diff options
-rw-r--r-- | .appveyor.yml | 17 | ||||
-rw-r--r-- | .travis.yml | 22 | ||||
-rw-r--r-- | SConstruct | 66 | ||||
-rw-r--r-- | core/array.cpp | 4 | ||||
-rw-r--r-- | core/bind/core_bind.cpp | 16 | ||||
-rw-r--r-- | core/bind/core_bind.h | 4 | ||||
-rw-r--r-- | core/callable.cpp | 357 | ||||
-rw-r--r-- | core/callable.h | 161 | ||||
-rw-r--r-- | core/callable_method_pointer.cpp | 94 | ||||
-rw-r--r-- | core/callable_method_pointer.h | 292 | ||||
-rw-r--r-- | core/class_db.cpp | 25 | ||||
-rw-r--r-- | core/class_db.h | 8 | ||||
-rw-r--r-- | core/compressed_translation.cpp | 4 | ||||
-rw-r--r-- | core/core_string_names.cpp | 6 | ||||
-rw-r--r-- | core/core_string_names.h | 5 | ||||
-rw-r--r-- | core/func_ref.cpp | 6 | ||||
-rw-r--r-- | core/func_ref.h | 2 | ||||
-rw-r--r-- | core/global_constants.cpp | 29 | ||||
-rw-r--r-- | core/io/dtls_server.cpp | 4 | ||||
-rw-r--r-- | core/io/dtls_server.h | 4 | ||||
-rw-r--r-- | core/io/json.cpp | 8 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 227 | ||||
-rw-r--r-- | core/io/multiplayer_api.cpp | 147 | ||||
-rw-r--r-- | core/io/packet_peer_dtls.cpp | 4 | ||||
-rw-r--r-- | core/io/packet_peer_dtls.h | 4 | ||||
-rw-r--r-- | core/io/resource_format_binary.cpp | 201 | ||||
-rw-r--r-- | core/io/resource_loader.cpp | 2 | ||||
-rw-r--r-- | core/io/udp_server.cpp | 4 | ||||
-rw-r--r-- | core/io/udp_server.h | 4 | ||||
-rw-r--r-- | core/make_binders.py | 24 | ||||
-rw-r--r-- | core/math/a_star.cpp | 4 | ||||
-rw-r--r-- | core/math/expression.cpp | 64 | ||||
-rw-r--r-- | core/math/expression.h | 2 | ||||
-rw-r--r-- | core/math/rect2.h | 5 | ||||
-rw-r--r-- | core/math/vector2.h | 7 | ||||
-rw-r--r-- | core/message_queue.cpp | 105 | ||||
-rw-r--r-- | core/message_queue.h | 6 | ||||
-rw-r--r-- | core/method_bind.h | 21 | ||||
-rw-r--r-- | core/method_ptrcall.h | 34 | ||||
-rw-r--r-- | core/node_path.h | 9 | ||||
-rw-r--r-- | core/object.cpp | 273 | ||||
-rw-r--r-- | core/object.h | 51 | ||||
-rw-r--r-- | core/object_id.h | 30 | ||||
-rw-r--r-- | core/os/input_event.cpp | 14 | ||||
-rw-r--r-- | core/os/main_loop.cpp | 4 | ||||
-rw-r--r-- | core/packed_data_container.cpp | 13 | ||||
-rw-r--r-- | core/reference.h | 9 | ||||
-rw-r--r-- | core/register_core_types.cpp | 3 | ||||
-rw-r--r-- | core/resource.cpp | 2 | ||||
-rw-r--r-- | core/script_debugger_remote.cpp | 1145 | ||||
-rw-r--r-- | core/script_debugger_remote.h (renamed from scene/debugger/script_debugger_remote.h) | 207 | ||||
-rw-r--r-- | core/script_language.cpp | 6 | ||||
-rw-r--r-- | core/script_language.h | 8 | ||||
-rw-r--r-- | core/type_info.h | 28 | ||||
-rw-r--r-- | core/typedefs.h | 30 | ||||
-rw-r--r-- | core/undo_redo.cpp | 48 | ||||
-rw-r--r-- | core/undo_redo.h | 14 | ||||
-rw-r--r-- | core/ustring.cpp | 1 | ||||
-rw-r--r-- | core/variant.cpp | 1021 | ||||
-rw-r--r-- | core/variant.h | 164 | ||||
-rw-r--r-- | core/variant_call.cpp | 715 | ||||
-rw-r--r-- | core/variant_op.cpp | 1361 | ||||
-rw-r--r-- | core/variant_parser.cpp | 207 | ||||
-rw-r--r-- | core/variant_parser.h | 1 | ||||
-rw-r--r-- | doc/classes/@GlobalScope.xml | 74 | ||||
-rw-r--r-- | doc/classes/ARVRInterface.xml | 2 | ||||
-rw-r--r-- | doc/classes/ARVRPositionalTracker.xml | 2 | ||||
-rw-r--r-- | doc/classes/ARVRServer.xml | 8 | ||||
-rw-r--r-- | doc/classes/AStar.xml | 4 | ||||
-rw-r--r-- | doc/classes/AStar2D.xml | 4 | ||||
-rw-r--r-- | doc/classes/AcceptDialog.xml | 2 | ||||
-rw-r--r-- | doc/classes/AnimatedSprite.xml | 4 | ||||
-rw-r--r-- | doc/classes/AnimatedSprite3D.xml | 4 | ||||
-rw-r--r-- | doc/classes/Animation.xml | 12 | ||||
-rw-r--r-- | doc/classes/AnimationNode.xml | 12 | ||||
-rw-r--r-- | doc/classes/AnimationNodeAnimation.xml | 2 | ||||
-rw-r--r-- | doc/classes/AnimationNodeBlendTree.xml | 22 | ||||
-rw-r--r-- | doc/classes/AnimationNodeStateMachine.xml | 38 | ||||
-rw-r--r-- | doc/classes/AnimationNodeStateMachinePlayback.xml | 6 | ||||
-rw-r--r-- | doc/classes/AnimationNodeStateMachineTransition.xml | 2 | ||||
-rw-r--r-- | doc/classes/AnimationPlayer.xml | 44 | ||||
-rw-r--r-- | doc/classes/Area.xml | 4 | ||||
-rw-r--r-- | doc/classes/Area2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/Array.xml | 62 | ||||
-rw-r--r-- | doc/classes/ArrayMesh.xml | 12 | ||||
-rw-r--r-- | doc/classes/AudioEffectCompressor.xml | 2 | ||||
-rw-r--r-- | doc/classes/AudioServer.xml | 6 | ||||
-rw-r--r-- | doc/classes/AudioStreamPlayer.xml | 2 | ||||
-rw-r--r-- | doc/classes/AudioStreamPlayer2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/AudioStreamPlayer3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/BaseMaterial3D.xml | 4 | ||||
-rw-r--r-- | doc/classes/BoxContainer.xml | 6 | ||||
-rw-r--r-- | doc/classes/Callable.xml | 77 | ||||
-rw-r--r-- | doc/classes/CanvasItem.xml | 6 | ||||
-rw-r--r-- | doc/classes/ClassDB.xml | 54 | ||||
-rw-r--r-- | doc/classes/ColorPicker.xml | 2 | ||||
-rw-r--r-- | doc/classes/Control.xml | 64 | ||||
-rw-r--r-- | doc/classes/Curve3D.xml | 4 | ||||
-rw-r--r-- | doc/classes/DTLSServer.xml | 6 | ||||
-rw-r--r-- | doc/classes/Dictionary.xml | 4 | ||||
-rw-r--r-- | doc/classes/EditorFeatureProfile.xml | 16 | ||||
-rw-r--r-- | doc/classes/EditorFileSystemDirectory.xml | 2 | ||||
-rw-r--r-- | doc/classes/EditorProperty.xml | 16 | ||||
-rw-r--r-- | doc/classes/EditorResourcePreview.xml | 4 | ||||
-rw-r--r-- | doc/classes/EditorSettings.xml | 2 | ||||
-rw-r--r-- | doc/classes/FuncRef.xml | 2 | ||||
-rw-r--r-- | doc/classes/GIProbeData.xml | 4 | ||||
-rw-r--r-- | doc/classes/Geometry.xml | 8 | ||||
-rw-r--r-- | doc/classes/Gradient.xml | 4 | ||||
-rw-r--r-- | doc/classes/GraphEdit.xml | 28 | ||||
-rw-r--r-- | doc/classes/HeightMapShape.xml | 2 | ||||
-rw-r--r-- | doc/classes/Input.xml | 12 | ||||
-rw-r--r-- | doc/classes/InputEvent.xml | 8 | ||||
-rw-r--r-- | doc/classes/InputEventAction.xml | 2 | ||||
-rw-r--r-- | doc/classes/InputMap.xml | 20 | ||||
-rw-r--r-- | doc/classes/ItemList.xml | 2 | ||||
-rw-r--r-- | doc/classes/Marshalls.xml | 2 | ||||
-rw-r--r-- | doc/classes/MeshDataTool.xml | 14 | ||||
-rw-r--r-- | doc/classes/MeshLibrary.xml | 2 | ||||
-rw-r--r-- | doc/classes/MultiMesh.xml | 2 | ||||
-rw-r--r-- | doc/classes/MultiplayerAPI.xml | 2 | ||||
-rw-r--r-- | doc/classes/Navigation.xml | 56 | ||||
-rw-r--r-- | doc/classes/Navigation2D.xml | 36 | ||||
-rw-r--r-- | doc/classes/Navigation2DServer.xml | 42 | ||||
-rw-r--r-- | doc/classes/NavigationMesh.xml | 6 | ||||
-rw-r--r-- | doc/classes/NavigationPolygon.xml | 8 | ||||
-rw-r--r-- | doc/classes/NavigationServer.xml | 66 | ||||
-rw-r--r-- | doc/classes/Node.xml | 38 | ||||
-rw-r--r-- | doc/classes/Object.xml | 47 | ||||
-rw-r--r-- | doc/classes/PackedByteArray.xml | 14 | ||||
-rw-r--r-- | doc/classes/PackedColorArray.xml | 14 | ||||
-rw-r--r-- | doc/classes/PackedFloat32Array.xml (renamed from doc/classes/PackedRealArray.xml) | 31 | ||||
-rw-r--r-- | doc/classes/PackedFloat64Array.xml | 114 | ||||
-rw-r--r-- | doc/classes/PackedInt32Array.xml | 114 | ||||
-rw-r--r-- | doc/classes/PackedInt64Array.xml (renamed from doc/classes/PackedIntArray.xml) | 32 | ||||
-rw-r--r-- | doc/classes/PackedScene.xml | 2 | ||||
-rw-r--r-- | doc/classes/PackedStringArray.xml | 14 | ||||
-rw-r--r-- | doc/classes/PackedVector2Array.xml | 14 | ||||
-rw-r--r-- | doc/classes/PackedVector3Array.xml | 14 | ||||
-rw-r--r-- | doc/classes/PacketPeerDTLS.xml | 2 | ||||
-rw-r--r-- | doc/classes/PanoramaSky.xml | 2 | ||||
-rw-r--r-- | doc/classes/Physics2DServer.xml | 6 | ||||
-rw-r--r-- | doc/classes/PhysicsServer.xml | 6 | ||||
-rw-r--r-- | doc/classes/Polygon2D.xml | 6 | ||||
-rw-r--r-- | doc/classes/PolygonPathFinder.xml | 2 | ||||
-rw-r--r-- | doc/classes/Quat.xml | 4 | ||||
-rw-r--r-- | doc/classes/Rect2.xml | 14 | ||||
-rw-r--r-- | doc/classes/Rect2i.xml | 52 | ||||
-rw-r--r-- | doc/classes/ResourceFormatLoader.xml | 2 | ||||
-rw-r--r-- | doc/classes/ResourcePreloader.xml | 12 | ||||
-rw-r--r-- | doc/classes/SceneState.xml | 10 | ||||
-rw-r--r-- | doc/classes/SceneTree.xml | 22 | ||||
-rw-r--r-- | doc/classes/Script.xml | 6 | ||||
-rw-r--r-- | doc/classes/ScrollContainer.xml | 4 | ||||
-rw-r--r-- | doc/classes/Shader.xml | 6 | ||||
-rw-r--r-- | doc/classes/ShaderMaterial.xml | 4 | ||||
-rw-r--r-- | doc/classes/Signal.xml | 87 | ||||
-rw-r--r-- | doc/classes/SkeletonIK.xml | 4 | ||||
-rw-r--r-- | doc/classes/Skin.xml | 18 | ||||
-rw-r--r-- | doc/classes/SpriteFrames.xml | 30 | ||||
-rw-r--r-- | doc/classes/String.xml | 84 | ||||
-rw-r--r-- | doc/classes/StringName.xml | 21 | ||||
-rw-r--r-- | doc/classes/SurfaceTool.xml | 4 | ||||
-rw-r--r-- | doc/classes/TabContainer.xml | 6 | ||||
-rw-r--r-- | doc/classes/Tabs.xml | 6 | ||||
-rw-r--r-- | doc/classes/TextEdit.xml | 4 | ||||
-rw-r--r-- | doc/classes/Theme.xml | 80 | ||||
-rw-r--r-- | doc/classes/Thread.xml | 2 | ||||
-rw-r--r-- | doc/classes/Transform.xml | 4 | ||||
-rw-r--r-- | doc/classes/Transform2D.xml | 4 | ||||
-rw-r--r-- | doc/classes/Translation.xml | 10 | ||||
-rw-r--r-- | doc/classes/TranslationServer.xml | 4 | ||||
-rw-r--r-- | doc/classes/TreeItem.xml | 4 | ||||
-rw-r--r-- | doc/classes/Tween.xml | 18 | ||||
-rw-r--r-- | doc/classes/UDPServer.xml | 2 | ||||
-rw-r--r-- | doc/classes/UndoRedo.xml | 8 | ||||
-rw-r--r-- | doc/classes/Vector2.xml | 14 | ||||
-rw-r--r-- | doc/classes/Vector2i.xml | 61 | ||||
-rw-r--r-- | doc/classes/Vector3.xml | 14 | ||||
-rw-r--r-- | doc/classes/Vector3i.xml | 72 | ||||
-rw-r--r-- | doc/classes/VideoPlayer.xml | 2 | ||||
-rw-r--r-- | doc/classes/Viewport.xml | 2 | ||||
-rw-r--r-- | doc/classes/VisualServer.xml | 20 | ||||
-rw-r--r-- | doc/classes/VisualShader.xml | 2 | ||||
-rw-r--r-- | doc/classes/VisualShaderNode.xml | 13 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeCompare.xml | 2 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeCustom.xml | 16 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeFloatConstant.xml (renamed from doc/classes/VisualShaderNodeScalarConstant.xml) | 5 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeFloatFunc.xml | 116 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeFloatOp.xml | 50 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeFloatUniform.xml (renamed from doc/classes/VisualShaderNodeScalarUniform.xml) | 6 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeIf.xml | 2 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeInput.xml | 4 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeIntConstant.xml | 20 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeIntFunc.xml | 32 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeIntOp.xml | 41 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeIntUniform.xml | 38 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeScalarFunc.xml | 81 | ||||
-rw-r--r-- | doc/classes/VisualShaderNodeScalarOp.xml | 37 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 4 | ||||
-rw-r--r-- | drivers/unix/net_socket_posix.cpp | 2 | ||||
-rw-r--r-- | drivers/vulkan/SCsub | 8 | ||||
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 2 | ||||
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.h | 4 | ||||
-rw-r--r-- | drivers/vulkan/vulkan_context.cpp | 11 | ||||
-rw-r--r-- | editor/SCsub | 1 | ||||
-rw-r--r-- | editor/animation_bezier_editor.cpp | 26 | ||||
-rw-r--r-- | editor/animation_track_editor.cpp | 187 | ||||
-rw-r--r-- | editor/animation_track_editor.h | 2 | ||||
-rw-r--r-- | editor/animation_track_editor_plugins.cpp | 4 | ||||
-rw-r--r-- | editor/array_property_edit.cpp | 6 | ||||
-rw-r--r-- | editor/code_editor.cpp | 54 | ||||
-rw-r--r-- | editor/connections_dialog.cpp | 74 | ||||
-rw-r--r-- | editor/connections_dialog.h | 36 | ||||
-rw-r--r-- | editor/create_dialog.cpp | 24 | ||||
-rw-r--r-- | editor/debugger/SCsub | 5 | ||||
-rw-r--r-- | editor/debugger/editor_debugger_inspector.cpp | 277 | ||||
-rw-r--r-- | editor/debugger/editor_debugger_inspector.h | 98 | ||||
-rw-r--r-- | editor/debugger/editor_debugger_node.cpp | 591 | ||||
-rw-r--r-- | editor/debugger/editor_debugger_node.h | 177 | ||||
-rw-r--r-- | editor/debugger/editor_debugger_tree.cpp | 274 | ||||
-rw-r--r-- | editor/debugger/editor_debugger_tree.h | 74 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp (renamed from editor/script_editor_debugger.cpp) | 1657 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.h (renamed from editor/script_editor_debugger.h) | 113 | ||||
-rw-r--r-- | editor/dependency_editor.cpp | 16 | ||||
-rw-r--r-- | editor/doc/doc_data.cpp | 13 | ||||
-rw-r--r-- | editor/doc/doc_dump.cpp | 13 | ||||
-rw-r--r-- | editor/editor_about.cpp | 2 | ||||
-rw-r--r-- | editor/editor_asset_installer.cpp | 2 | ||||
-rw-r--r-- | editor/editor_audio_buses.cpp | 56 | ||||
-rw-r--r-- | editor/editor_autoload_settings.cpp | 18 | ||||
-rw-r--r-- | editor/editor_data.cpp | 4 | ||||
-rw-r--r-- | editor/editor_dir_dialog.cpp | 20 | ||||
-rw-r--r-- | editor/editor_export.cpp | 2 | ||||
-rw-r--r-- | editor/editor_feature_profile.cpp | 40 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 62 | ||||
-rw-r--r-- | editor/editor_help.cpp | 18 | ||||
-rw-r--r-- | editor/editor_help_search.cpp | 16 | ||||
-rw-r--r-- | editor/editor_inspector.cpp | 98 | ||||
-rw-r--r-- | editor/editor_layouts_dialog.cpp | 4 | ||||
-rw-r--r-- | editor/editor_log.cpp | 4 | ||||
-rw-r--r-- | editor/editor_network_profiler.cpp | 6 | ||||
-rw-r--r-- | editor/editor_node.cpp | 237 | ||||
-rw-r--r-- | editor/editor_node.h | 8 | ||||
-rw-r--r-- | editor/editor_path.cpp | 6 | ||||
-rw-r--r-- | editor/editor_plugin_settings.cpp | 10 | ||||
-rw-r--r-- | editor/editor_profiler.cpp | 22 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 181 | ||||
-rw-r--r-- | editor/editor_properties.h | 5 | ||||
-rw-r--r-- | editor/editor_properties_array_dict.cpp | 86 | ||||
-rw-r--r-- | editor/editor_run.cpp | 32 | ||||
-rw-r--r-- | editor/editor_run.h | 8 | ||||
-rw-r--r-- | editor/editor_run_native.cpp | 4 | ||||
-rw-r--r-- | editor/editor_run_script.cpp | 6 | ||||
-rw-r--r-- | editor/editor_sectioned_inspector.cpp | 4 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 34 | ||||
-rw-r--r-- | editor/editor_spin_slider.cpp | 12 | ||||
-rw-r--r-- | editor/editor_sub_scene.cpp | 12 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 3 | ||||
-rw-r--r-- | editor/editor_visual_profiler.cpp | 28 | ||||
-rw-r--r-- | editor/export_template_manager.cpp | 20 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 68 | ||||
-rw-r--r-- | editor/filesystem_dock.h | 2 | ||||
-rw-r--r-- | editor/find_in_files.cpp | 38 | ||||
-rw-r--r-- | editor/find_in_files.h | 2 | ||||
-rw-r--r-- | editor/groups_editor.cpp | 31 | ||||
-rw-r--r-- | editor/icons/2D.svg (renamed from editor/icons/icon_2_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/3D.svg (renamed from editor/icons/icon_3_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AABB.svg (renamed from editor/icons/icon_a_a_b_b.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ARVRAnchor.svg (renamed from editor/icons/icon_a_r_v_r_anchor.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ARVRCamera.svg (renamed from editor/icons/icon_a_r_v_r_camera.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ARVRController.svg (renamed from editor/icons/icon_a_r_v_r_controller.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ARVROrigin.svg (renamed from editor/icons/icon_a_r_v_r_origin.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AcceptDialog.svg (renamed from editor/icons/icon_accept_dialog.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ActionCopy.svg (renamed from editor/icons/icon_action_copy.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ActionCut.svg (renamed from editor/icons/icon_action_cut.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ActionPaste.svg (renamed from editor/icons/icon_action_paste.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Add.svg (renamed from editor/icons/icon_add.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AddAtlasTile.svg (renamed from editor/icons/icon_add_atlas_tile.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AddAutotile.svg (renamed from editor/icons/icon_add_autotile.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AddSingleTile.svg (renamed from editor/icons/icon_add_single_tile.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AddSplit.svg (renamed from editor/icons/icon_add_split.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Anchor.svg (renamed from editor/icons/icon_anchor.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AnimatedSprite.svg (renamed from editor/icons/icon_animated_sprite.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AnimatedSprite3D.svg (renamed from editor/icons/icon_animated_sprite_3d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AnimatedTexture.svg (renamed from editor/icons/icon_animated_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Animation.svg (renamed from editor/icons/icon_animation.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AnimationFilter.svg (renamed from editor/icons/icon_animation_filter.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AnimationPlayer.svg (renamed from editor/icons/icon_animation_player.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AnimationTrackGroup.svg (renamed from editor/icons/icon_animation_track_group.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AnimationTrackList.svg (renamed from editor/icons/icon_animation_track_list.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AnimationTree.svg (renamed from editor/icons/icon_animation_tree.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Area.svg (renamed from editor/icons/icon_area.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Area2D.svg (renamed from editor/icons/icon_area_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Array.svg (renamed from editor/icons/icon_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ArrayMesh.svg (renamed from editor/icons/icon_array_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ArrowDown.svg (renamed from editor/icons/icon_arrow_down.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ArrowLeft.svg (renamed from editor/icons/icon_arrow_left.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ArrowRight.svg (renamed from editor/icons/icon_arrow_right.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ArrowUp.svg (renamed from editor/icons/icon_arrow_up.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AssetLib.svg (renamed from editor/icons/icon_asset_lib.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AtlasTexture.svg (renamed from editor/icons/icon_atlas_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioBusBypass.svg (renamed from editor/icons/icon_audio_bus_bypass.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioBusLayout.svg (renamed from editor/icons/icon_audio_bus_layout.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioBusMute.svg (renamed from editor/icons/icon_audio_bus_mute.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioBusSolo.svg (renamed from editor/icons/icon_audio_bus_solo.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioStreamOGGVorbis.svg (renamed from editor/icons/icon_audio_stream_o_g_g_vorbis.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioStreamPlayer.svg (renamed from editor/icons/icon_audio_stream_player.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioStreamPlayer2D.svg (renamed from editor/icons/icon_audio_stream_player_2_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioStreamPlayer3D.svg (renamed from editor/icons/icon_audio_stream_player_3_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AudioStreamSample.svg (renamed from editor/icons/icon_audio_stream_sample.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AutoEnd.svg (renamed from editor/icons/icon_auto_end.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AutoKey.svg (renamed from editor/icons/icon_auto_key.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AutoPlay.svg (renamed from editor/icons/icon_auto_play.svg) | 0 | ||||
-rw-r--r-- | editor/icons/AutoTriangle.svg (renamed from editor/icons/icon_auto_triangle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Back.svg (renamed from editor/icons/icon_back.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BackBufferCopy.svg (renamed from editor/icons/icon_back_buffer_copy.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Bake.svg (renamed from editor/icons/icon_bake.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BakedLightmap.svg (renamed from editor/icons/icon_baked_lightmap.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BakedLightmapData.svg (renamed from editor/icons/icon_baked_lightmap_data.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Basis.svg (renamed from editor/icons/icon_basis.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BezierHandlesBalanced.svg (renamed from editor/icons/icon_bezier_handles_balanced.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BezierHandlesFree.svg (renamed from editor/icons/icon_bezier_handles_free.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BezierHandlesMirror.svg (renamed from editor/icons/icon_bezier_handles_mirror.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BitMap.svg (renamed from editor/icons/icon_bit_map.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BitmapFont.svg (renamed from editor/icons/icon_bitmap_font.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Blend.svg (renamed from editor/icons/icon_blend.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Bone.svg (renamed from editor/icons/icon_bone.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Bone2D.svg (renamed from editor/icons/icon_bone_2_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BoneAttachment.svg (renamed from editor/icons/icon_bone_attachment.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BoneTrack.svg (renamed from editor/icons/icon_bone_track.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BoxShape.svg (renamed from editor/icons/icon_box_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Bucket.svg (renamed from editor/icons/icon_bucket.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BusVuEmpty.svg (renamed from editor/icons/icon_bus_vu_empty.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BusVuFrozen.svg (renamed from editor/icons/icon_bus_vu_frozen.svg) | 0 | ||||
-rw-r--r-- | editor/icons/BusVuFull.svg (renamed from editor/icons/icon_bus_vu_full.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Button.svg (renamed from editor/icons/icon_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ButtonGroup.svg (renamed from editor/icons/icon_button_group.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CPUParticles.svg (renamed from editor/icons/icon_c_p_u_particles.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CPUParticles2D.svg (renamed from editor/icons/icon_c_p_u_particles_2_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Callable.svg | 5 | ||||
-rw-r--r-- | editor/icons/Camera.svg (renamed from editor/icons/icon_camera.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Camera2D.svg (renamed from editor/icons/icon_camera_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CameraTexture.svg (renamed from editor/icons/icon_camera_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CanvasItem.svg (renamed from editor/icons/icon_canvas_item.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CanvasItemMaterial.svg (renamed from editor/icons/icon_canvas_item_material.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CanvasItemShader.svg (renamed from editor/icons/icon_canvas_item_shader.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CanvasItemShaderGraph.svg (renamed from editor/icons/icon_canvas_item_shader_graph.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CanvasLayer.svg (renamed from editor/icons/icon_canvas_layer.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CanvasModulate.svg (renamed from editor/icons/icon_canvas_modulate.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CapsuleMesh.svg (renamed from editor/icons/icon_capsule_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CapsuleShape.svg (renamed from editor/icons/icon_capsule_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CapsuleShape2D.svg (renamed from editor/icons/icon_capsule_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CenterContainer.svg (renamed from editor/icons/icon_center_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CheckBox.svg (renamed from editor/icons/icon_check_box.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CheckButton.svg (renamed from editor/icons/icon_check_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Checkerboard.svg (renamed from editor/icons/icon_checkerboard.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CircleShape2D.svg (renamed from editor/icons/icon_circle_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ClassList.svg (renamed from editor/icons/icon_class_list.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Clear.svg (renamed from editor/icons/icon_clear.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ClippedCamera.svg (renamed from editor/icons/icon_clipped_camera.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Close.svg (renamed from editor/icons/icon_close.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Collapse.svg (renamed from editor/icons/icon_collapse.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CollisionPolygon.svg (renamed from editor/icons/icon_collision_polygon.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CollisionPolygon2D.svg (renamed from editor/icons/icon_collision_polygon_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CollisionShape.svg (renamed from editor/icons/icon_collision_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CollisionShape2D.svg (renamed from editor/icons/icon_collision_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Color.svg (renamed from editor/icons/icon_color.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ColorPick.svg (renamed from editor/icons/icon_color_pick.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ColorPicker.svg (renamed from editor/icons/icon_color_picker.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ColorPickerButton.svg (renamed from editor/icons/icon_color_picker_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ColorRamp.svg (renamed from editor/icons/icon_color_ramp.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ColorRect.svg (renamed from editor/icons/icon_color_rect.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ColorTrackVu.svg (renamed from editor/icons/icon_color_track_vu.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ConcavePolygonShape.svg (renamed from editor/icons/icon_concave_polygon_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ConcavePolygonShape2D.svg (renamed from editor/icons/icon_concave_polygon_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ConeTwistJoint.svg (renamed from editor/icons/icon_cone_twist_joint.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ConfirmationDialog.svg (renamed from editor/icons/icon_confirmation_dialog.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Container.svg (renamed from editor/icons/icon_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Control.svg (renamed from editor/icons/icon_control.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignBottomCenter.svg (renamed from editor/icons/icon_control_align_bottom_center.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignBottomLeft.svg (renamed from editor/icons/icon_control_align_bottom_left.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignBottomRight.svg (renamed from editor/icons/icon_control_align_bottom_right.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignBottomWide.svg (renamed from editor/icons/icon_control_align_bottom_wide.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignCenter.svg (renamed from editor/icons/icon_control_align_center.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignCenterLeft.svg (renamed from editor/icons/icon_control_align_center_left.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignCenterRight.svg (renamed from editor/icons/icon_control_align_center_right.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignLeftCenter.svg (renamed from editor/icons/icon_control_align_left_center.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignLeftWide.svg (renamed from editor/icons/icon_control_align_left_wide.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignRightCenter.svg (renamed from editor/icons/icon_control_align_right_center.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignRightWide.svg (renamed from editor/icons/icon_control_align_right_wide.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignTopCenter.svg (renamed from editor/icons/icon_control_align_top_center.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignTopLeft.svg (renamed from editor/icons/icon_control_align_top_left.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignTopRight.svg (renamed from editor/icons/icon_control_align_top_right.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignTopWide.svg (renamed from editor/icons/icon_control_align_top_wide.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlAlignWide.svg (renamed from editor/icons/icon_control_align_wide.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlHcenterWide.svg (renamed from editor/icons/icon_control_hcenter_wide.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlLayout.svg (renamed from editor/icons/icon_control_layout.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ControlVcenterWide.svg (renamed from editor/icons/icon_control_vcenter_wide.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ConvexPolygonShape.svg (renamed from editor/icons/icon_convex_polygon_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ConvexPolygonShape2D.svg (renamed from editor/icons/icon_convex_polygon_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CopyNodePath.svg (renamed from editor/icons/icon_copy_node_path.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CreateNewSceneFrom.svg (renamed from editor/icons/icon_create_new_scene_from.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Crosshair.svg (renamed from editor/icons/icon_crosshair.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CryptoKey.svg (renamed from editor/icons/icon_crypto_key.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CubeMap.svg (renamed from editor/icons/icon_cube_map.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CubeMesh.svg (renamed from editor/icons/icon_cube_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Curve.svg (renamed from editor/icons/icon_curve.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Curve2D.svg (renamed from editor/icons/icon_curve_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Curve3D.svg (renamed from editor/icons/icon_curve_3d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveClose.svg (renamed from editor/icons/icon_curve_close.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveConstant.svg (renamed from editor/icons/icon_curve_constant.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveCreate.svg (renamed from editor/icons/icon_curve_create.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveCurve.svg (renamed from editor/icons/icon_curve_curve.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveDelete.svg (renamed from editor/icons/icon_curve_delete.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveEdit.svg (renamed from editor/icons/icon_curve_edit.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveIn.svg (renamed from editor/icons/icon_curve_in.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveInOut.svg (renamed from editor/icons/icon_curve_in_out.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveLinear.svg (renamed from editor/icons/icon_curve_linear.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveOut.svg (renamed from editor/icons/icon_curve_out.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveOutIn.svg (renamed from editor/icons/icon_curve_out_in.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CurveTexture.svg (renamed from editor/icons/icon_curve_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CylinderMesh.svg (renamed from editor/icons/icon_cylinder_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/CylinderShape.svg (renamed from editor/icons/icon_cylinder_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DampedSpringJoint2D.svg (renamed from editor/icons/icon_damped_spring_joint_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Debug.svg (renamed from editor/icons/icon_debug.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DebugContinue.svg (renamed from editor/icons/icon_debug_continue.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DebugNext.svg (renamed from editor/icons/icon_debug_next.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DebugSkipBreakpointsOff.svg (renamed from editor/icons/icon_debug_skip_breakpoints_off.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DebugSkipBreakpointsOn.svg (renamed from editor/icons/icon_debug_skip_breakpoints_on.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DebugStep.svg (renamed from editor/icons/icon_debug_step.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DefaultProjectIcon.svg (renamed from editor/icons/icon_default_project_icon.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DeleteSplit.svg (renamed from editor/icons/icon_delete_split.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Dictionary.svg (renamed from editor/icons/icon_dictionary.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DirectionalLight.svg (renamed from editor/icons/icon_directional_light.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DistractionFree.svg (renamed from editor/icons/icon_distraction_free.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Duplicate.svg (renamed from editor/icons/icon_duplicate.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DynamicFont.svg (renamed from editor/icons/icon_dynamic_font.svg) | 0 | ||||
-rw-r--r-- | editor/icons/DynamicFontData.svg (renamed from editor/icons/icon_dynamic_font_data.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Edit.svg (renamed from editor/icons/icon_edit.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditBezier.svg (renamed from editor/icons/icon_edit_bezier.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditInternal.svg (renamed from editor/icons/icon_edit_internal.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditKey.svg (renamed from editor/icons/icon_edit_key.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditPivot.svg (renamed from editor/icons/icon_edit_pivot.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditResource.svg (renamed from editor/icons/icon_edit_resource.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Editor3DHandle.svg (renamed from editor/icons/icon_editor_3d_handle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorControlAnchor.svg (renamed from editor/icons/icon_editor_control_anchor.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorCurveHandle.svg (renamed from editor/icons/icon_editor_curve_handle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorHandle.svg (renamed from editor/icons/icon_editor_handle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorHandleAdd.svg (renamed from editor/icons/icon_editor_handle_add.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorInternalHandle.svg (renamed from editor/icons/icon_editor_internal_handle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorPathSharpHandle.svg (renamed from editor/icons/icon_editor_path_sharp_handle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorPathSmoothHandle.svg (renamed from editor/icons/icon_editor_path_smooth_handle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorPivot.svg (renamed from editor/icons/icon_editor_pivot.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorPlugin.svg (renamed from editor/icons/icon_editor_plugin.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorPosition.svg (renamed from editor/icons/icon_editor_position.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorPositionPrevious.svg (renamed from editor/icons/icon_editor_position_previous.svg) | 0 | ||||
-rw-r--r-- | editor/icons/EditorPositionUnselected.svg (renamed from editor/icons/icon_editor_position_unselected.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Enum.svg (renamed from editor/icons/icon_enum.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Environment.svg (renamed from editor/icons/icon_environment.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Error.svg (renamed from editor/icons/icon_error.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ErrorSign.svg (renamed from editor/icons/icon_error_sign.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ExpandBottomDock.svg (renamed from editor/icons/icon_expand_bottom_dock.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Favorites.svg (renamed from editor/icons/icon_favorites.svg) | 0 | ||||
-rw-r--r-- | editor/icons/File.svg (renamed from editor/icons/icon_file.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileBigThumb.svg (renamed from editor/icons/icon_file_big_thumb.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileBroken.svg (renamed from editor/icons/icon_file_broken.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileBrokenBigThumb.svg (renamed from editor/icons/icon_file_broken_big_thumb.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileDead.svg (renamed from editor/icons/icon_file_dead.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileDeadBigThumb.svg (renamed from editor/icons/icon_file_dead_big_thumb.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileDeadMediumThumb.svg (renamed from editor/icons/icon_file_dead_medium_thumb.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileDialog.svg (renamed from editor/icons/icon_file_dialog.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileList.svg (renamed from editor/icons/icon_file_list.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileMediumThumb.svg (renamed from editor/icons/icon_file_medium_thumb.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FileThumbnail.svg (renamed from editor/icons/icon_file_thumbnail.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Filesystem.svg (renamed from editor/icons/icon_filesystem.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FixedMaterial.svg (renamed from editor/icons/icon_fixed_material.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FixedSpatialMaterial.svg (renamed from editor/icons/icon_fixed_spatial_material.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Folder.svg (renamed from editor/icons/icon_folder.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FolderBigThumb.svg (renamed from editor/icons/icon_folder_big_thumb.svg) | 0 | ||||
-rw-r--r-- | editor/icons/FolderMediumThumb.svg (renamed from editor/icons/icon_folder_medium_thumb.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Font.svg (renamed from editor/icons/icon_font.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Forward.svg (renamed from editor/icons/icon_forward.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GIProbe.svg (renamed from editor/icons/icon_g_i_probe.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GIProbeData.svg (renamed from editor/icons/icon_g_i_probe_data.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Generic6DOFJoint.svg (renamed from editor/icons/icon_generic_6_d_o_f_joint.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoBakedLightmap.svg (renamed from editor/icons/icon_gizmo_baked_lightmap.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoCPUParticles.svg (renamed from editor/icons/icon_gizmo_c_p_u_particles.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoCamera.svg (renamed from editor/icons/icon_gizmo_camera.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoDirectionalLight.svg (renamed from editor/icons/icon_gizmo_directional_light.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoGIProbe.svg (renamed from editor/icons/icon_gizmo_g_i_probe.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoLight.svg (renamed from editor/icons/icon_gizmo_light.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoListener.svg (renamed from editor/icons/icon_gizmo_listener.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoParticles.svg (renamed from editor/icons/icon_gizmo_particles.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoReflectionProbe.svg (renamed from editor/icons/icon_gizmo_reflection_probe.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoSpatialSamplePlayer.svg (renamed from editor/icons/icon_gizmo_spatial_sample_player.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GizmoSpotLight.svg (renamed from editor/icons/icon_gizmo_spot_light.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Godot.svg (renamed from editor/icons/icon_godot.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Gradient.svg (renamed from editor/icons/icon_gradient.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GradientTexture.svg (renamed from editor/icons/icon_gradient_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GraphEdit.svg (renamed from editor/icons/icon_graph_edit.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GraphNode.svg (renamed from editor/icons/icon_graph_node.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Grid.svg (renamed from editor/icons/icon_grid.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GridContainer.svg (renamed from editor/icons/icon_grid_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GrooveJoint2D.svg (renamed from editor/icons/icon_groove_joint_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Group.svg (renamed from editor/icons/icon_group.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GroupViewport.svg (renamed from editor/icons/icon_group_viewport.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Groups.svg (renamed from editor/icons/icon_groups.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiChecked.svg (renamed from editor/icons/icon_GUI_checked.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiClose.svg (renamed from editor/icons/icon_gui_close.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiCloseCustomizable.svg (renamed from editor/icons/icon_gui_close_customizable.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiDropdown.svg (renamed from editor/icons/icon_GUI_dropdown.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiEllipsis.svg (renamed from editor/icons/icon_GUI_ellipsis.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiGraphNodePort.svg (renamed from editor/icons/icon_gui_graph_node_port.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiHTick.svg (renamed from editor/icons/icon_GUI_h_tick.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiHsplitter.svg (renamed from editor/icons/icon_GUI_hsplitter.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiMiniCheckerboard.svg (renamed from editor/icons/icon_GUI_mini_checkerboard.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiOptionArrow.svg (renamed from editor/icons/icon_GUI_option_arrow.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiProgressBar.svg (renamed from editor/icons/icon_GUI_progress_bar.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiProgressFill.svg (renamed from editor/icons/icon_GUI_progress_fill.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiRadioChecked.svg (renamed from editor/icons/icon_GUI_radio_checked.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiRadioUnchecked.svg (renamed from editor/icons/icon_GUI_radio_unchecked.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiResizer.svg (renamed from editor/icons/icon_gui_resizer.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiScrollArrowLeft.svg (renamed from editor/icons/icon_GUI_scroll_arrow_left.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiScrollArrowLeftHl.svg (renamed from editor/icons/icon_GUI_scroll_arrow_left_hl.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiScrollArrowRight.svg (renamed from editor/icons/icon_GUI_scroll_arrow_right.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiScrollArrowRightHl.svg (renamed from editor/icons/icon_GUI_scroll_arrow_right_hl.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiScrollBg.svg (renamed from editor/icons/icon_GUI_scroll_bg.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiScrollGrabber.svg (renamed from editor/icons/icon_GUI_scroll_grabber.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiScrollGrabberHl.svg (renamed from editor/icons/icon_GUI_scroll_grabber_hl.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiScrollGrabberPressed.svg (renamed from editor/icons/icon_GUI_scroll_grabber_pressed.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiSliderGrabber.svg (renamed from editor/icons/icon_GUI_slider_grabber.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiSliderGrabberHl.svg (renamed from editor/icons/icon_GUI_slider_grabber_hl.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiSpace.svg (renamed from editor/icons/icon_GUI_space.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiSpinboxUpdown.svg (renamed from editor/icons/icon_GUI_spinbox_updown.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiTab.svg (renamed from editor/icons/icon_GUI_tab.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiTabMenu.svg (renamed from editor/icons/icon_GUI_tab_menu.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiTabMenuHl.svg (renamed from editor/icons/icon_GUI_tab_menu_hl.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiToggleOff.svg (renamed from editor/icons/icon_GUI_toggle_off.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiToggleOn.svg (renamed from editor/icons/icon_GUI_toggle_on.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiTreeArrowDown.svg (renamed from editor/icons/icon_GUI_tree_arrow_down.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiTreeArrowRight.svg (renamed from editor/icons/icon_GUI_tree_arrow_right.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiTreeArrowUp.svg (renamed from editor/icons/icon_GUI_tree_arrow_up.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiTreeUpdown.svg (renamed from editor/icons/icon_GUI_tree_updown.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiUnchecked.svg (renamed from editor/icons/icon_GUI_unchecked.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiVTick.svg (renamed from editor/icons/icon_GUI_v_tick.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiViewportHdiagsplitter.svg (renamed from editor/icons/icon_GUI_viewport_hdiagsplitter.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiViewportVdiagsplitter.svg (renamed from editor/icons/icon_GUI_viewport_vdiagsplitter.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiViewportVhsplitter.svg (renamed from editor/icons/icon_GUI_viewport_vhsplitter.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiVisibilityHidden.svg (renamed from editor/icons/icon_GUI_visibility_hidden.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiVisibilityVisible.svg (renamed from editor/icons/icon_GUI_visibility_visible.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiVisibilityXray.svg (renamed from editor/icons/icon_GUI_visibility_xray.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiVsplitBg.svg (renamed from editor/icons/icon_GUI_vsplit_bg.svg) | 0 | ||||
-rw-r--r-- | editor/icons/GuiVsplitter.svg (renamed from editor/icons/icon_GUI_vsplitter.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HBoxContainer.svg (renamed from editor/icons/icon_h_box_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HScrollBar.svg (renamed from editor/icons/icon_h_scroll_bar.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HSeparator.svg (renamed from editor/icons/icon_h_separator.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HSlider.svg (renamed from editor/icons/icon_h_slider.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HSplitContainer.svg (renamed from editor/icons/icon_h_split_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HTTPRequest.svg (renamed from editor/icons/icon_h_t_t_p_request.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Headphones.svg (renamed from editor/icons/icon_headphones.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HeightMapShape.svg (renamed from editor/icons/icon_height_map_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Help.svg (renamed from editor/icons/icon_help.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HelpSearch.svg (renamed from editor/icons/icon_help_search.svg) | 0 | ||||
-rw-r--r-- | editor/icons/HingeJoint.svg (renamed from editor/icons/icon_hinge_joint.svg) | 0 | ||||
-rw-r--r-- | editor/icons/History.svg (renamed from editor/icons/icon_history.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Hsize.svg (renamed from editor/icons/icon_hsize.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Image.svg (renamed from editor/icons/icon_image.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ImageTexture.svg (renamed from editor/icons/icon_image_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ImmediateGeometry.svg (renamed from editor/icons/icon_immediate_geometry.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ImportCheck.svg (renamed from editor/icons/icon_import_check.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ImportFail.svg (renamed from editor/icons/icon_import_fail.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InformationSign.svg (renamed from editor/icons/icon_information_sign.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InsertAfter.svg (renamed from editor/icons/icon_insert_after.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InsertBefore.svg (renamed from editor/icons/icon_insert_before.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Instance.svg (renamed from editor/icons/icon_instance.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InstanceOptions.svg (renamed from editor/icons/icon_instance_options.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InterpCubic.svg (renamed from editor/icons/icon_interp_cubic.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InterpLinear.svg (renamed from editor/icons/icon_interp_linear.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InterpRaw.svg (renamed from editor/icons/icon_interp_raw.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InterpWrapClamp.svg (renamed from editor/icons/icon_interp_wrap_clamp.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InterpWrapLoop.svg (renamed from editor/icons/icon_interp_wrap_loop.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InterpolatedCamera.svg (renamed from editor/icons/icon_interpolated_camera.svg) | 0 | ||||
-rw-r--r-- | editor/icons/InverseKinematics.svg (renamed from editor/icons/icon_inverse_kinematics.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Issue.svg (renamed from editor/icons/icon_issue.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ItemList.svg (renamed from editor/icons/icon_item_list.svg) | 0 | ||||
-rw-r--r-- | editor/icons/JoyAxis.svg (renamed from editor/icons/icon_joy_axis.svg) | 0 | ||||
-rw-r--r-- | editor/icons/JoyButton.svg (renamed from editor/icons/icon_joy_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Joypad.svg (renamed from editor/icons/icon_joypad.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Key.svg (renamed from editor/icons/icon_key.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyAnimation.svg (renamed from editor/icons/icon_key_animation.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyAudio.svg (renamed from editor/icons/icon_key_audio.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyBezier.svg (renamed from editor/icons/icon_key_bezier.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyBezierHandle.svg (renamed from editor/icons/icon_key_bezier_handle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyBezierPoint.svg (renamed from editor/icons/icon_key_bezier_point.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyBezierSelected.svg (renamed from editor/icons/icon_key_bezier_selected.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyCall.svg (renamed from editor/icons/icon_key_call.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyHover.svg (renamed from editor/icons/icon_key_hover.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyInvalid.svg (renamed from editor/icons/icon_key_invalid.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyNext.svg (renamed from editor/icons/icon_key_next.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyPosition.svg (renamed from editor/icons/icon_key_position.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyRotation.svg (renamed from editor/icons/icon_key_rotation.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyScale.svg (renamed from editor/icons/icon_key_scale.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeySelected.svg (renamed from editor/icons/icon_key_selected.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyValue.svg (renamed from editor/icons/icon_key_value.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KeyXform.svg (renamed from editor/icons/icon_key_xform.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Keyboard.svg (renamed from editor/icons/icon_keyboard.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KinematicBody.svg (renamed from editor/icons/icon_kinematic_body.svg) | 0 | ||||
-rw-r--r-- | editor/icons/KinematicBody2D.svg (renamed from editor/icons/icon_kinematic_body_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Label.svg (renamed from editor/icons/icon_label.svg) | 0 | ||||
-rw-r--r-- | editor/icons/LargeTexture.svg (renamed from editor/icons/icon_large_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Light2D.svg (renamed from editor/icons/icon_light_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/LightOccluder2D.svg (renamed from editor/icons/icon_light_occluder_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Line2D.svg (renamed from editor/icons/icon_line_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/LineEdit.svg (renamed from editor/icons/icon_line_edit.svg) | 0 | ||||
-rw-r--r-- | editor/icons/LineShape2D.svg (renamed from editor/icons/icon_line_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/LinkButton.svg (renamed from editor/icons/icon_link_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ListSelect.svg (renamed from editor/icons/icon_list_select.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Listener.svg (renamed from editor/icons/icon_listener.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Load.svg (renamed from editor/icons/icon_load.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Lock.svg (renamed from editor/icons/icon_lock.svg) | 0 | ||||
-rw-r--r-- | editor/icons/LockViewport.svg (renamed from editor/icons/icon_lock_viewport.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Logo.svg (renamed from editor/icons/icon_logo.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Loop.svg (renamed from editor/icons/icon_loop.svg) | 0 | ||||
-rw-r--r-- | editor/icons/LoopInterpolation.svg (renamed from editor/icons/icon_loop_interpolation.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MainPlay.svg (renamed from editor/icons/icon_main_play.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MarginContainer.svg (renamed from editor/icons/icon_margin_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MatchCase.svg (renamed from editor/icons/icon_match_case.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MaterialPreviewCube.svg (renamed from editor/icons/icon_material_preview_cube.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MaterialPreviewCubeOff.svg (renamed from editor/icons/icon_material_preview_cube_off.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MaterialPreviewLight1.svg (renamed from editor/icons/icon_material_preview_light_1.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MaterialPreviewLight1Off.svg (renamed from editor/icons/icon_material_preview_light_1_off.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MaterialPreviewLight2.svg (renamed from editor/icons/icon_material_preview_light_2.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MaterialPreviewLight2Off.svg (renamed from editor/icons/icon_material_preview_light_2_off.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MaterialPreviewSphere.svg (renamed from editor/icons/icon_material_preview_sphere.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MaterialPreviewSphereOff.svg (renamed from editor/icons/icon_material_preview_sphere_off.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MemberConstant.svg (renamed from editor/icons/icon_member_constant.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MemberMethod.svg (renamed from editor/icons/icon_member_method.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MemberProperty.svg (renamed from editor/icons/icon_member_property.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MemberSignal.svg (renamed from editor/icons/icon_member_signal.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MemberTheme.svg (renamed from editor/icons/icon_member_theme.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MenuButton.svg (renamed from editor/icons/icon_menu_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Mesh.svg (renamed from editor/icons/icon_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MeshInstance.svg (renamed from editor/icons/icon_mesh_instance.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MeshInstance2D.svg (renamed from editor/icons/icon_mesh_instance_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MeshLibrary.svg (renamed from editor/icons/icon_mesh_library.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MeshTexture.svg (renamed from editor/icons/icon_mesh_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MiniObject.svg (renamed from editor/icons/icon_mini_object.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MirrorX.svg (renamed from editor/icons/icon_mirror_x.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MirrorY.svg (renamed from editor/icons/icon_mirror_y.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Mouse.svg (renamed from editor/icons/icon_mouse.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MoveDown.svg (renamed from editor/icons/icon_move_down.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MoveLeft.svg (renamed from editor/icons/icon_move_left.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MovePoint.svg (renamed from editor/icons/icon_move_point.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MoveRight.svg (renamed from editor/icons/icon_move_right.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MoveUp.svg (renamed from editor/icons/icon_move_up.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MultiEdit.svg (renamed from editor/icons/icon_multi_edit.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MultiLine.svg (renamed from editor/icons/icon_multi_line.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MultiMesh.svg (renamed from editor/icons/icon_multi_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MultiMeshInstance.svg (renamed from editor/icons/icon_multi_mesh_instance.svg) | 0 | ||||
-rw-r--r-- | editor/icons/MultiMeshInstance2D.svg (renamed from editor/icons/icon_multi_mesh_instance_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Navigation.svg (renamed from editor/icons/icon_navigation.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Navigation2D.svg (renamed from editor/icons/icon_navigation_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NavigationMesh.svg (renamed from editor/icons/icon_navigation_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NavigationMeshInstance.svg (renamed from editor/icons/icon_navigation_mesh_instance.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NavigationPolygon.svg (renamed from editor/icons/icon_navigation_polygon.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NavigationPolygonInstance.svg (renamed from editor/icons/icon_navigation_polygon_instance.svg) | 0 | ||||
-rw-r--r-- | editor/icons/New.svg (renamed from editor/icons/icon_new.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NewRoot.svg (renamed from editor/icons/icon_new_root.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Nil.svg (renamed from editor/icons/icon_nil.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NinePatchRect.svg (renamed from editor/icons/icon_nine_patch_rect.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Node.svg (renamed from editor/icons/icon_node.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Node2D.svg (renamed from editor/icons/icon_node_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NodePath.svg (renamed from editor/icons/icon_node_path.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NodeWarning.svg (renamed from editor/icons/icon_node_warning.svg) | 0 | ||||
-rw-r--r-- | editor/icons/NonFavorite.svg (renamed from editor/icons/icon_non_favorite.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ORMMaterial3D.svg (renamed from editor/icons/icon_o_r_m_material_3d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Object.svg (renamed from editor/icons/icon_object.svg) | 0 | ||||
-rw-r--r-- | editor/icons/OccluderPolygon2D.svg (renamed from editor/icons/icon_occluder_polygon_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/OmniLight.svg (renamed from editor/icons/icon_omni_light.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Onion.svg (renamed from editor/icons/icon_onion.svg) | 0 | ||||
-rw-r--r-- | editor/icons/OptionButton.svg (renamed from editor/icons/icon_option_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/OverbrightIndicator.svg (renamed from editor/icons/icon_overbright_indicator.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Override.svg (renamed from editor/icons/icon_override.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedByteArray.svg (renamed from editor/icons/icon_packed_byte_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedColorArray.svg (renamed from editor/icons/icon_packed_color_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedDataContainer.svg (renamed from editor/icons/icon_packed_data_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedFloat32Array.svg (renamed from editor/icons/icon_packed_real_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedFloat64Array.svg | 1 | ||||
-rw-r--r-- | editor/icons/PackedInt32Array.svg (renamed from editor/icons/icon_packed_int_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedInt64Array.svg | 1 | ||||
-rw-r--r-- | editor/icons/PackedScene.svg (renamed from editor/icons/icon_packed_scene.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedStringArray.svg (renamed from editor/icons/icon_packed_string_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedVector2Array.svg (renamed from editor/icons/icon_packed_vector2_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PackedVector3Array.svg (renamed from editor/icons/icon_packed_vector3_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PaintVertex.svg (renamed from editor/icons/icon_paint_vertex.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Panel.svg (renamed from editor/icons/icon_panel.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PanelContainer.svg (renamed from editor/icons/icon_panel_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Panels1.svg (renamed from editor/icons/icon_panels_1.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Panels2.svg (renamed from editor/icons/icon_panels_2.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Panels2Alt.svg (renamed from editor/icons/icon_panels_2_alt.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Panels3.svg (renamed from editor/icons/icon_panels_3.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Panels3Alt.svg (renamed from editor/icons/icon_panels_3_alt.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Panels4.svg (renamed from editor/icons/icon_panels_4.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PanoramaSky.svg (renamed from editor/icons/icon_panorama_sky.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ParallaxBackground.svg (renamed from editor/icons/icon_parallax_background.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ParallaxLayer.svg (renamed from editor/icons/icon_parallax_layer.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Particles.svg (renamed from editor/icons/icon_particles.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Particles2D.svg (renamed from editor/icons/icon_particles_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ParticlesMaterial.svg (renamed from editor/icons/icon_particles_material.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Path.svg (renamed from editor/icons/icon_path.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Path2D.svg (renamed from editor/icons/icon_path_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PathFollow.svg (renamed from editor/icons/icon_path_follow.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PathFollow2D.svg (renamed from editor/icons/icon_path_follow_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Pause.svg (renamed from editor/icons/icon_pause.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PhysicalBone.svg (renamed from editor/icons/icon_physical_bone.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Pin.svg (renamed from editor/icons/icon_pin.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PinJoint.svg (renamed from editor/icons/icon_pin_joint.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PinJoint2D.svg (renamed from editor/icons/icon_pin_joint_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PinPressed.svg (renamed from editor/icons/icon_pin_pressed.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Plane.svg (renamed from editor/icons/icon_plane.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlaneMesh.svg (renamed from editor/icons/icon_plane_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlaneShape.svg (renamed from editor/icons/icon_plane_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Play.svg (renamed from editor/icons/icon_play.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlayBackwards.svg (renamed from editor/icons/icon_play_backwards.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlayCustom.svg (renamed from editor/icons/icon_play_custom.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlayOverlay.svg (renamed from editor/icons/icon_play_overlay.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlayScene.svg (renamed from editor/icons/icon_play_scene.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlayStart.svg (renamed from editor/icons/icon_play_start.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlayStartBackwards.svg (renamed from editor/icons/icon_play_start_backwards.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PlayTravel.svg (renamed from editor/icons/icon_play_travel.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PluginScript.svg (renamed from editor/icons/icon_plugin_script.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PointMesh.svg (renamed from editor/icons/icon_point_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Polygon2D.svg (renamed from editor/icons/icon_polygon_2_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PolygonPathFinder.svg (renamed from editor/icons/icon_polygon_path_finder.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Popup.svg (renamed from editor/icons/icon_popup.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PopupDialog.svg (renamed from editor/icons/icon_popup_dialog.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PopupMenu.svg (renamed from editor/icons/icon_popup_menu.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PopupPanel.svg (renamed from editor/icons/icon_popup_panel.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Portal.svg (renamed from editor/icons/icon_portal.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Position2D.svg (renamed from editor/icons/icon_position_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Position3D.svg (renamed from editor/icons/icon_position_3d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/PrismMesh.svg (renamed from editor/icons/icon_prism_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ProceduralSky.svg (renamed from editor/icons/icon_procedural_sky.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Progress1.svg (renamed from editor/icons/icon_progress_1.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Progress2.svg (renamed from editor/icons/icon_progress_2.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Progress3.svg (renamed from editor/icons/icon_progress_3.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Progress4.svg (renamed from editor/icons/icon_progress_4.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Progress5.svg (renamed from editor/icons/icon_progress_5.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Progress6.svg (renamed from editor/icons/icon_progress_6.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Progress7.svg (renamed from editor/icons/icon_progress_7.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Progress8.svg (renamed from editor/icons/icon_progress_8.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ProgressBar.svg (renamed from editor/icons/icon_progress_bar.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ProjectIconLoading.svg (renamed from editor/icons/icon_project_icon_loading.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ProximityGroup.svg (renamed from editor/icons/icon_proximity_group.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ProxyTexture.svg (renamed from editor/icons/icon_proxy_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Quad.svg (renamed from editor/icons/icon_quad.svg) | 0 | ||||
-rw-r--r-- | editor/icons/QuadMesh.svg (renamed from editor/icons/icon_quad_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Quat.svg (renamed from editor/icons/icon_quat.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RID.svg (renamed from editor/icons/icon_r_i_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RayCast.svg (renamed from editor/icons/icon_ray_cast.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RayCast2D.svg (renamed from editor/icons/icon_ray_cast_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RayShape.svg (renamed from editor/icons/icon_ray_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RayShape2D.svg (renamed from editor/icons/icon_ray_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Rayito.svg (renamed from editor/icons/icon_rayito.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Rect2.svg (renamed from editor/icons/icon_rect2.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Rect2i.svg | 4 | ||||
-rw-r--r-- | editor/icons/RectangleShape2D.svg (renamed from editor/icons/icon_rectangle_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ReferenceRect.svg (renamed from editor/icons/icon_reference_rect.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ReflectionProbe.svg (renamed from editor/icons/icon_reflection_probe.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RegionEdit.svg (renamed from editor/icons/icon_region_edit.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Reload.svg (renamed from editor/icons/icon_reload.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ReloadSmall.svg (renamed from editor/icons/icon_reload_small.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RemoteTransform.svg (renamed from editor/icons/icon_remote_transform.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RemoteTransform2D.svg (renamed from editor/icons/icon_remote_transform_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Remove.svg (renamed from editor/icons/icon_remove.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RemoveInternal.svg (renamed from editor/icons/icon_remove_internal.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Rename.svg (renamed from editor/icons/icon_rename.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Reparent.svg (renamed from editor/icons/icon_reparent.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ReparentToNewNode.svg (renamed from editor/icons/icon_reparent_to_new_node.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ResourcePreloader.svg (renamed from editor/icons/icon_resource_preloader.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RichTextEffect.svg (renamed from editor/icons/icon_rich_text_effect.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RichTextLabel.svg (renamed from editor/icons/icon_rich_text_label.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RigidBody.svg (renamed from editor/icons/icon_rigid_body.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RigidBody2D.svg (renamed from editor/icons/icon_rigid_body_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Room.svg (renamed from editor/icons/icon_room.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RoomBounds.svg (renamed from editor/icons/icon_room_bounds.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Rotate0.svg (renamed from editor/icons/icon_rotate_0.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Rotate180.svg (renamed from editor/icons/icon_rotate_180.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Rotate270.svg (renamed from editor/icons/icon_rotate_270.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Rotate90.svg (renamed from editor/icons/icon_rotate_90.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RotateLeft.svg (renamed from editor/icons/icon_rotate_left.svg) | 0 | ||||
-rw-r--r-- | editor/icons/RotateRight.svg (renamed from editor/icons/icon_rotate_right.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Ruler.svg (renamed from editor/icons/icon_ruler.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SampleLibrary.svg (renamed from editor/icons/icon_sample_library.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Save.svg (renamed from editor/icons/icon_save.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Script.svg (renamed from editor/icons/icon_script.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ScriptCreate.svg (renamed from editor/icons/icon_script_create.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ScriptCreateDialog.svg (renamed from editor/icons/icon_script_create_dialog.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ScriptExtend.svg (renamed from editor/icons/icon_script_extend.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ScriptRemove.svg (renamed from editor/icons/icon_script_remove.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ScrollContainer.svg (renamed from editor/icons/icon_scroll_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Search.svg (renamed from editor/icons/icon_search.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SegmentShape2D.svg (renamed from editor/icons/icon_segment_shape_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Shader.svg (renamed from editor/icons/icon_shader.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ShaderMaterial.svg (renamed from editor/icons/icon_shader_material.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ShortCut.svg (renamed from editor/icons/icon_short_cut.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Signal.svg (renamed from editor/icons/icon_signal.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Signals.svg (renamed from editor/icons/icon_signals.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SignalsAndGroups.svg (renamed from editor/icons/icon_signals_and_groups.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Skeleton.svg (renamed from editor/icons/icon_skeleton.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Skeleton2D.svg (renamed from editor/icons/icon_skeleton_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SkeletonIK.svg (renamed from editor/icons/icon_skeleton_i_k.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SliderJoint.svg (renamed from editor/icons/icon_slider_joint.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Slot.svg (renamed from editor/icons/icon_slot.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Snap.svg (renamed from editor/icons/icon_snap.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SnapGrid.svg (renamed from editor/icons/icon_snap_grid.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SoftBody.svg (renamed from editor/icons/icon_soft_body.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Sort.svg (renamed from editor/icons/icon_sort.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Spatial.svg (renamed from editor/icons/icon_spatial.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SpatialMaterial.svg (renamed from editor/icons/icon_spatial_material.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SphereMesh.svg (renamed from editor/icons/icon_sphere_mesh.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SphereShape.svg (renamed from editor/icons/icon_sphere_shape.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SpinBox.svg (renamed from editor/icons/icon_spin_box.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SpotLight.svg (renamed from editor/icons/icon_spot_light.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SpringArm.svg (renamed from editor/icons/icon_spring_arm.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Sprite.svg (renamed from editor/icons/icon_sprite.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Sprite3D.svg (renamed from editor/icons/icon_sprite_3d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SpriteFrames.svg (renamed from editor/icons/icon_sprite_frames.svg) | 0 | ||||
-rw-r--r-- | editor/icons/SpriteSheet.svg (renamed from editor/icons/icon_sprite_sheet.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StandardMaterial3D.svg (renamed from editor/icons/icon_standard_material_3d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StaticBody.svg (renamed from editor/icons/icon_static_body.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StaticBody2D.svg (renamed from editor/icons/icon_static_body_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StatusError.svg (renamed from editor/icons/icon_status_error.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StatusSuccess.svg (renamed from editor/icons/icon_status_success.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StatusWarning.svg (renamed from editor/icons/icon_status_warning.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Stop.svg (renamed from editor/icons/icon_stop.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StreamTexture.svg (renamed from editor/icons/icon_stream_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/String.svg (renamed from editor/icons/icon_string.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StringName.svg | 4 | ||||
-rw-r--r-- | editor/icons/StyleBoxEmpty.svg (renamed from editor/icons/icon_style_box_empty.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StyleBoxFlat.svg (renamed from editor/icons/icon_style_box_flat.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StyleBoxLine.svg (renamed from editor/icons/icon_style_box_line.svg) | 0 | ||||
-rw-r--r-- | editor/icons/StyleBoxTexture.svg (renamed from editor/icons/icon_style_box_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TabContainer.svg (renamed from editor/icons/icon_tab_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Tabs.svg (renamed from editor/icons/icon_tabs.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TestCube.svg (renamed from editor/icons/icon_test_cube.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TextEdit.svg (renamed from editor/icons/icon_text_edit.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TextFile.svg (renamed from editor/icons/icon_text_file.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Texture3D.svg (renamed from editor/icons/icon_texture_3_d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TextureArray.svg (renamed from editor/icons/icon_texture_array.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TextureButton.svg (renamed from editor/icons/icon_texture_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TextureProgress.svg (renamed from editor/icons/icon_texture_progress.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TextureRect.svg (renamed from editor/icons/icon_texture_rect.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Theme.svg (renamed from editor/icons/icon_theme.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ThumbnailWait.svg (renamed from editor/icons/icon_thumbnail_wait.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TileMap.svg (renamed from editor/icons/icon_tile_map.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TileSet.svg (renamed from editor/icons/icon_tile_set.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Time.svg (renamed from editor/icons/icon_time.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TimelineIndicator.svg (renamed from editor/icons/icon_timeline_indicator.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Timer.svg (renamed from editor/icons/icon_timer.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolAddNode.svg (renamed from editor/icons/icon_tool_add_node.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolButton.svg (renamed from editor/icons/icon_tool_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolConnect.svg (renamed from editor/icons/icon_tool_connect.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolMove.svg (renamed from editor/icons/icon_tool_move.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolPan.svg (renamed from editor/icons/icon_tool_pan.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolRotate.svg (renamed from editor/icons/icon_tool_rotate.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolScale.svg (renamed from editor/icons/icon_tool_scale.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolSelect.svg (renamed from editor/icons/icon_tool_select.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ToolTriangle.svg (renamed from editor/icons/icon_tool_triangle.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Tools.svg (renamed from editor/icons/icon_tools.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TouchScreenButton.svg (renamed from editor/icons/icon_touch_screen_button.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TrackAddKey.svg (renamed from editor/icons/icon_track_add_key.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TrackAddKeyHl.svg (renamed from editor/icons/icon_track_add_key_hl.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TrackCapture.svg (renamed from editor/icons/icon_track_capture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TrackColor.svg (renamed from editor/icons/icon_track_color.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TrackContinuous.svg (renamed from editor/icons/icon_track_continuous.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TrackDiscrete.svg (renamed from editor/icons/icon_track_discrete.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TrackTrigger.svg (renamed from editor/icons/icon_track_trigger.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Transform.svg (renamed from editor/icons/icon_transform.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Transform2D.svg (renamed from editor/icons/icon_transform_2_D.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionEnd.svg (renamed from editor/icons/icon_transition_end.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionEndAuto.svg (renamed from editor/icons/icon_transition_end_auto.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionEndAutoBig.svg (renamed from editor/icons/icon_transition_end_auto_big.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionEndBig.svg (renamed from editor/icons/icon_transition_end_big.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionImmediate.svg (renamed from editor/icons/icon_transition_immediate.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionImmediateAuto.svg (renamed from editor/icons/icon_transition_immediate_auto.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionImmediateAutoBig.svg (renamed from editor/icons/icon_transition_immediate_auto_big.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionImmediateBig.svg (renamed from editor/icons/icon_transition_immediate_big.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionSync.svg (renamed from editor/icons/icon_transition_sync.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionSyncAuto.svg (renamed from editor/icons/icon_transition_sync_auto.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionSyncAutoBig.svg (renamed from editor/icons/icon_transition_sync_auto_big.svg) | 0 | ||||
-rw-r--r-- | editor/icons/TransitionSyncBig.svg (renamed from editor/icons/icon_transition_sync_big.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Translation.svg (renamed from editor/icons/icon_translation.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Transpose.svg (renamed from editor/icons/icon_transpose.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Tree.svg (renamed from editor/icons/icon_tree.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Tween.svg (renamed from editor/icons/icon_tween.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Unbone.svg (renamed from editor/icons/icon_unbone.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Ungroup.svg (renamed from editor/icons/icon_ungroup.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Unlock.svg (renamed from editor/icons/icon_unlock.svg) | 0 | ||||
-rw-r--r-- | editor/icons/UnpaintVertex.svg (renamed from editor/icons/icon_unpaint_vertex.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Uv.svg (renamed from editor/icons/icon_uv.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VBoxContainer.svg (renamed from editor/icons/icon_v_box_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VScrollBar.svg (renamed from editor/icons/icon_v_scroll_bar.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VSeparator.svg (renamed from editor/icons/icon_v_separator.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VSlider.svg (renamed from editor/icons/icon_v_slider.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VSplitContainer.svg (renamed from editor/icons/icon_v_split_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Variant.svg (renamed from editor/icons/icon_variant.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Vector2.svg (renamed from editor/icons/icon_vector2.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Vector2i.svg | 5 | ||||
-rw-r--r-- | editor/icons/Vector3.svg (renamed from editor/icons/icon_vector3.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Vector3i.svg | 5 | ||||
-rw-r--r-- | editor/icons/VehicleBody.svg (renamed from editor/icons/icon_vehicle_body.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VehicleWheel.svg (renamed from editor/icons/icon_vehicle_wheel.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VideoPlayer.svg (renamed from editor/icons/icon_video_player.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Viewport.svg (renamed from editor/icons/icon_viewport.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ViewportContainer.svg (renamed from editor/icons/icon_viewport_container.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ViewportSpeed.svg (renamed from editor/icons/icon_viewport_speed.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ViewportTexture.svg (renamed from editor/icons/icon_viewport_texture.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ViewportZoom.svg (renamed from editor/icons/icon_viewport_zoom.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VisibilityEnabler.svg (renamed from editor/icons/icon_visibility_enabler.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VisibilityEnabler2D.svg (renamed from editor/icons/icon_visibility_enabler_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VisibilityNotifier.svg (renamed from editor/icons/icon_visibility_notifier.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VisibilityNotifier2D.svg (renamed from editor/icons/icon_visibility_notifier_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VisualShader.svg (renamed from editor/icons/icon_visual_shader.svg) | 0 | ||||
-rw-r--r-- | editor/icons/VisualShaderPort.svg (renamed from editor/icons/icon_visual_shader_port.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Warning.svg (renamed from editor/icons/icon_warning.svg) | 0 | ||||
-rw-r--r-- | editor/icons/WindowDialog.svg (renamed from editor/icons/icon_window_dialog.svg) | 0 | ||||
-rw-r--r-- | editor/icons/World.svg (renamed from editor/icons/icon_world.svg) | 0 | ||||
-rw-r--r-- | editor/icons/World2D.svg (renamed from editor/icons/icon_world_2d.svg) | 0 | ||||
-rw-r--r-- | editor/icons/WorldEnvironment.svg (renamed from editor/icons/icon_world_environment.svg) | 0 | ||||
-rw-r--r-- | editor/icons/X509Certificate.svg (renamed from editor/icons/icon_x509_certificate.svg) | 0 | ||||
-rw-r--r-- | editor/icons/YSort.svg (renamed from editor/icons/icon_y_sort.svg) | 0 | ||||
-rw-r--r-- | editor/icons/Zoom.svg (renamed from editor/icons/icon_zoom.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ZoomLess.svg (renamed from editor/icons/icon_zoom_less.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ZoomMore.svg (renamed from editor/icons/icon_zoom_more.svg) | 0 | ||||
-rw-r--r-- | editor/icons/ZoomReset.svg (renamed from editor/icons/icon_zoom_reset.svg) | 0 | ||||
-rw-r--r-- | editor/icons/bool.svg (renamed from editor/icons/icon_bool.svg) | 0 | ||||
-rw-r--r-- | editor/icons/editor_icons_builders.py | 10 | ||||
-rw-r--r-- | editor/icons/float.svg (renamed from editor/icons/icon_float.svg) | 0 | ||||
-rw-r--r-- | editor/icons/icon_gizmo_spatial_stream_player.svg | 1 | ||||
-rw-r--r-- | editor/icons/int.svg (renamed from editor/icons/icon_int.svg) | 0 | ||||
-rw-r--r-- | editor/import/editor_import_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 15 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.h | 3 | ||||
-rw-r--r-- | editor/import/resource_importer_bitmask.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 16 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.h | 3 | ||||
-rw-r--r-- | editor/import/resource_importer_texture.cpp | 4 | ||||
-rw-r--r-- | editor/import/resource_importer_texture_atlas.cpp | 8 | ||||
-rw-r--r-- | editor/import/resource_importer_wav.cpp | 2 | ||||
-rw-r--r-- | editor/import_dock.cpp | 12 | ||||
-rw-r--r-- | editor/inspector_dock.cpp | 35 | ||||
-rw-r--r-- | editor/inspector_dock.h | 6 | ||||
-rw-r--r-- | editor/node_dock.cpp | 4 | ||||
-rw-r--r-- | editor/plugin_config_dialog.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/abstract_polygon_2d_editor.cpp | 10 | ||||
-rw-r--r-- | editor/plugins/animation_blend_space_1d_editor.cpp | 32 | ||||
-rw-r--r-- | editor/plugins/animation_blend_space_2d_editor.cpp | 52 | ||||
-rw-r--r-- | editor/plugins/animation_blend_tree_editor_plugin.cpp | 42 | ||||
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 65 | ||||
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/plugins/animation_state_machine_editor.cpp | 32 | ||||
-rw-r--r-- | editor/plugins/animation_tree_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 64 | ||||
-rw-r--r-- | editor/plugins/audio_stream_editor_plugin.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/camera_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 132 | ||||
-rw-r--r-- | editor/plugins/collision_polygon_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/cpu_particles_2d_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/cpu_particles_editor_plugin.cpp | 9 | ||||
-rw-r--r-- | editor/plugins/cpu_particles_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/debugger_editor_plugin.cpp | 51 | ||||
-rw-r--r-- | editor/plugins/debugger_editor_plugin.h (renamed from drivers/dummy/audio_driver_dummy.h) | 36 | ||||
-rw-r--r-- | editor/plugins/gi_probe_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/gradient_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/item_list_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/material_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/mesh_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/mesh_instance_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/mesh_library_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/multimesh_editor_plugin.cpp | 10 | ||||
-rw-r--r-- | editor/plugins/particles_2d_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/particles_editor_plugin.cpp | 36 | ||||
-rw-r--r-- | editor/plugins/particles_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/path_2d_editor_plugin.cpp | 20 | ||||
-rw-r--r-- | editor/plugins/path_editor_plugin.cpp | 10 | ||||
-rw-r--r-- | editor/plugins/physical_bone_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/polygon_2d_editor_plugin.cpp | 42 | ||||
-rw-r--r-- | editor/plugins/resource_preloader_editor_plugin.cpp | 10 | ||||
-rw-r--r-- | editor/plugins/root_motion_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 245 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.h | 14 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 101 | ||||
-rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 24 | ||||
-rw-r--r-- | editor/plugins/skeleton_2d_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/skeleton_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/skeleton_ik_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 112 | ||||
-rw-r--r-- | editor/plugins/sprite_editor_plugin.cpp | 10 | ||||
-rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.cpp | 50 | ||||
-rw-r--r-- | editor/plugins/style_box_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/text_editor.cpp | 22 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 30 | ||||
-rw-r--r-- | editor/plugins/theme_editor_plugin.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 58 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 56 | ||||
-rw-r--r-- | editor/plugins/version_control_editor_plugin.cpp | 22 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 589 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.h | 33 | ||||
-rw-r--r-- | editor/progress_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/project_export.cpp | 66 | ||||
-rw-r--r-- | editor/project_manager.cpp | 88 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 78 | ||||
-rw-r--r-- | editor/property_editor.cpp | 72 | ||||
-rw-r--r-- | editor/property_selector.cpp | 22 | ||||
-rw-r--r-- | editor/quick_open.cpp | 12 | ||||
-rw-r--r-- | editor/rename_dialog.cpp | 58 | ||||
-rw-r--r-- | editor/reparent_dialog.cpp | 6 | ||||
-rw-r--r-- | editor/run_settings_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 130 | ||||
-rw-r--r-- | editor/scene_tree_editor.cpp | 66 | ||||
-rw-r--r-- | editor/script_create_dialog.cpp | 26 | ||||
-rw-r--r-- | editor/settings_config_dialog.cpp | 29 | ||||
-rw-r--r-- | editor/spatial_editor_gizmos.cpp | 47 | ||||
-rw-r--r-- | editor/translations/af.po | 9 | ||||
-rw-r--r-- | editor/translations/ar.po | 9 | ||||
-rw-r--r-- | editor/translations/bg.po | 8 | ||||
-rw-r--r-- | editor/translations/bn.po | 10 | ||||
-rw-r--r-- | editor/translations/ca.po | 8 | ||||
-rw-r--r-- | editor/translations/cs.po | 58 | ||||
-rw-r--r-- | editor/translations/da.po | 8 | ||||
-rw-r--r-- | editor/translations/de.po | 83 | ||||
-rw-r--r-- | editor/translations/de_CH.po | 9 | ||||
-rw-r--r-- | editor/translations/editor.pot | 6 | ||||
-rw-r--r-- | editor/translations/el.po | 8 | ||||
-rw-r--r-- | editor/translations/eo.po | 9 | ||||
-rw-r--r-- | editor/translations/es.po | 8 | ||||
-rw-r--r-- | editor/translations/es_AR.po | 91 | ||||
-rw-r--r-- | editor/translations/et.po | 6 | ||||
-rw-r--r-- | editor/translations/eu.po | 6 | ||||
-rw-r--r-- | editor/translations/fa.po | 9 | ||||
-rw-r--r-- | editor/translations/fi.po | 86 | ||||
-rw-r--r-- | editor/translations/fil.po | 6 | ||||
-rw-r--r-- | editor/translations/fr.po | 95 | ||||
-rw-r--r-- | editor/translations/ga.po | 9 | ||||
-rw-r--r-- | editor/translations/he.po | 9 | ||||
-rw-r--r-- | editor/translations/hi.po | 6 | ||||
-rw-r--r-- | editor/translations/hr.po | 9 | ||||
-rw-r--r-- | editor/translations/hu.po | 9 | ||||
-rw-r--r-- | editor/translations/id.po | 33 | ||||
-rw-r--r-- | editor/translations/is.po | 6 | ||||
-rw-r--r-- | editor/translations/it.po | 23 | ||||
-rw-r--r-- | editor/translations/ja.po | 294 | ||||
-rw-r--r-- | editor/translations/ka.po | 6 | ||||
-rw-r--r-- | editor/translations/ko.po | 9 | ||||
-rw-r--r-- | editor/translations/lt.po | 9 | ||||
-rw-r--r-- | editor/translations/lv.po | 9 | ||||
-rw-r--r-- | editor/translations/mi.po | 6 | ||||
-rw-r--r-- | editor/translations/ml.po | 6 | ||||
-rw-r--r-- | editor/translations/mr.po | 6 | ||||
-rw-r--r-- | editor/translations/ms.po | 6 | ||||
-rw-r--r-- | editor/translations/nb.po | 8 | ||||
-rw-r--r-- | editor/translations/nl.po | 8 | ||||
-rw-r--r-- | editor/translations/or.po | 6 | ||||
-rw-r--r-- | editor/translations/pl.po | 51 | ||||
-rw-r--r-- | editor/translations/pr.po | 9 | ||||
-rw-r--r-- | editor/translations/pt_BR.po | 94 | ||||
-rw-r--r-- | editor/translations/pt_PT.po | 556 | ||||
-rw-r--r-- | editor/translations/ro.po | 9 | ||||
-rw-r--r-- | editor/translations/ru.po | 9 | ||||
-rw-r--r-- | editor/translations/si.po | 6 | ||||
-rw-r--r-- | editor/translations/sk.po | 10 | ||||
-rw-r--r-- | editor/translations/sl.po | 9 | ||||
-rw-r--r-- | editor/translations/sq.po | 9 | ||||
-rw-r--r-- | editor/translations/sr_Cyrl.po | 9 | ||||
-rw-r--r-- | editor/translations/sr_Latn.po | 6 | ||||
-rw-r--r-- | editor/translations/sv.po | 8 | ||||
-rw-r--r-- | editor/translations/ta.po | 6 | ||||
-rw-r--r-- | editor/translations/te.po | 6 | ||||
-rw-r--r-- | editor/translations/th.po | 9 | ||||
-rw-r--r-- | editor/translations/tr.po | 9 | ||||
-rw-r--r-- | editor/translations/uk.po | 78 | ||||
-rw-r--r-- | editor/translations/ur_PK.po | 9 | ||||
-rw-r--r-- | editor/translations/vi.po | 9 | ||||
-rw-r--r-- | editor/translations/zh_CN.po | 79 | ||||
-rw-r--r-- | editor/translations/zh_HK.po | 10 | ||||
-rw-r--r-- | editor/translations/zh_TW.po | 9 | ||||
-rw-r--r-- | main/main.cpp | 16 | ||||
-rw-r--r-- | main/tests/test_gdscript.cpp | 2 | ||||
-rw-r--r-- | methods.py | 24 | ||||
-rwxr-xr-x | misc/dist/osx_template.app/Contents/Info.plist | 6 | ||||
-rwxr-xr-x | misc/dist/osx_tools.app/Contents/Info.plist | 4 | ||||
-rwxr-xr-x | misc/travis/clang-format.sh | 14 | ||||
-rw-r--r-- | modules/assimp/editor_scene_importer_assimp.cpp | 2 | ||||
-rw-r--r-- | modules/bullet/area_bullet.cpp | 2 | ||||
-rw-r--r-- | modules/bullet/rigid_body_bullet.cpp | 2 | ||||
-rw-r--r-- | modules/bullet/shape_bullet.cpp | 8 | ||||
-rw-r--r-- | modules/bullet/shape_bullet.h | 2 | ||||
-rw-r--r-- | modules/bullet/space_bullet.cpp | 3 | ||||
-rw-r--r-- | modules/csg/csg_shape.cpp | 40 | ||||
-rw-r--r-- | modules/gdnative/doc_classes/GDNative.xml | 4 | ||||
-rw-r--r-- | modules/gdnative/doc_classes/NativeScript.xml | 6 | ||||
-rw-r--r-- | modules/gdnative/gdnative/gdnative.cpp | 2 | ||||
-rw-r--r-- | modules/gdnative/gdnative/variant.cpp | 14 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.cpp | 14 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_singleton_editor.cpp | 4 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/pool_arrays.h | 4 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/variant.h | 14 | ||||
-rw-r--r-- | modules/gdnative/nativescript/nativescript.cpp | 30 | ||||
-rw-r--r-- | modules/gdnative/nativescript/nativescript.h | 4 | ||||
-rw-r--r-- | modules/gdnative/pluginscript/pluginscript_instance.cpp | 2 | ||||
-rw-r--r-- | modules/gdnative/pluginscript/pluginscript_instance.h | 2 | ||||
-rw-r--r-- | modules/gdnative/pluginscript/pluginscript_script.cpp | 16 | ||||
-rw-r--r-- | modules/gdnative/pluginscript/pluginscript_script.h | 4 | ||||
-rw-r--r-- | modules/gdnavigation/gd_navigation_server.cpp | 23 | ||||
-rw-r--r-- | modules/gdnavigation/gd_navigation_server.h | 4 | ||||
-rw-r--r-- | modules/gdnavigation/nav_map.cpp | 7 | ||||
-rw-r--r-- | modules/gdnavigation/navigation_mesh_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | modules/gdnavigation/rvo_agent.cpp | 2 | ||||
-rw-r--r-- | modules/gdscript/gdscript.cpp | 57 | ||||
-rw-r--r-- | modules/gdscript/gdscript.h | 9 | ||||
-rw-r--r-- | modules/gdscript/gdscript_compiler.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 42 | ||||
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 87 | ||||
-rw-r--r-- | modules/gdscript/gdscript_function.h | 8 | ||||
-rw-r--r-- | modules/gdscript/gdscript_functions.cpp | 338 | ||||
-rw-r--r-- | modules/gdscript/gdscript_functions.h | 2 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 98 | ||||
-rw-r--r-- | modules/gdscript/gdscript_tokenizer.cpp | 28 | ||||
-rw-r--r-- | modules/gdscript/language_server/gdscript_language_protocol.cpp | 201 | ||||
-rw-r--r-- | modules/gdscript/language_server/gdscript_language_protocol.h | 40 | ||||
-rw-r--r-- | modules/gdscript/language_server/gdscript_workspace.cpp | 49 | ||||
-rw-r--r-- | modules/gdscript/language_server/gdscript_workspace.h | 5 | ||||
-rw-r--r-- | modules/gridmap/grid_map.cpp | 2 | ||||
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 30 | ||||
-rw-r--r-- | modules/mbedtls/dtls_server_mbedtls.cpp | 4 | ||||
-rw-r--r-- | modules/mbedtls/dtls_server_mbedtls.h | 4 | ||||
-rwxr-xr-x | modules/mbedtls/packet_peer_mbed_dtls.cpp | 4 | ||||
-rwxr-xr-x | modules/mbedtls/packet_peer_mbed_dtls.h | 4 | ||||
-rw-r--r-- | modules/mobile_vr/mobile_vr_interface.cpp | 14 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 30 | ||||
-rw-r--r-- | modules/mono/csharp_script.h | 8 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs | 2 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs | 7 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/BuildManager.cs | 23 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs | 78 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs | 28 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs | 4 | ||||
-rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 24 | ||||
-rw-r--r-- | modules/mono/editor/editor_internal_calls.cpp | 14 | ||||
-rw-r--r-- | modules/mono/glue/base_object_glue.cpp | 4 | ||||
-rw-r--r-- | modules/mono/glue/gd_glue.cpp | 4 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_field.cpp | 14 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_marshal.cpp | 38 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_marshal.h | 12 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_utils.cpp | 2 | ||||
-rw-r--r-- | modules/mono/signal_awaiter_utils.cpp | 8 | ||||
-rw-r--r-- | modules/mono/signal_awaiter_utils.h | 2 | ||||
-rw-r--r-- | modules/opensimplex/noise_texture.cpp | 6 | ||||
-rw-r--r-- | modules/opensimplex/open_simplex_noise.cpp | 6 | ||||
-rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 2 | ||||
-rw-r--r-- | modules/stb_vorbis/resource_importer_ogg_vorbis.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScript.xml | 90 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptClassConstant.xml | 4 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptEmitSignal.xml | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptFunctionCall.xml | 6 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptInputAction.xml | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptLocalVar.xml | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptPropertyGet.xml | 6 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptPropertySet.xml | 6 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptTypeCast.xml | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptVariableGet.xml | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptVariableSet.xml | 2 | ||||
-rw-r--r-- | modules/visual_script/doc_classes/VisualScriptYieldSignal.xml | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script.cpp | 84 | ||||
-rw-r--r-- | modules/visual_script/visual_script.h | 10 | ||||
-rw-r--r-- | modules/visual_script/visual_script_builtin_funcs.cpp | 146 | ||||
-rw-r--r-- | modules/visual_script/visual_script_builtin_funcs.h | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 152 | ||||
-rw-r--r-- | modules/visual_script/visual_script_expression.cpp | 18 | ||||
-rw-r--r-- | modules/visual_script/visual_script_flow_control.cpp | 26 | ||||
-rw-r--r-- | modules/visual_script/visual_script_func_nodes.cpp | 50 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.cpp | 100 | ||||
-rw-r--r-- | modules/visual_script/visual_script_property_selector.cpp | 24 | ||||
-rw-r--r-- | modules/visual_script/visual_script_yield_nodes.cpp | 14 | ||||
-rw-r--r-- | platform/android/api/api.cpp | 4 | ||||
-rw-r--r-- | platform/android/api/java_class_wrapper.h | 20 | ||||
-rw-r--r-- | platform/android/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/android/java_class_wrapper.cpp | 22 | ||||
-rw-r--r-- | platform/android/java_godot_lib_jni.cpp | 45 | ||||
-rw-r--r-- | platform/iphone/SCsub | 1 | ||||
-rw-r--r-- | platform/iphone/app_delegate.h | 7 | ||||
-rw-r--r-- | platform/iphone/app_delegate.mm | 16 | ||||
-rw-r--r-- | platform/iphone/detect.py | 14 | ||||
-rw-r--r-- | platform/iphone/game_center.mm | 14 | ||||
-rw-r--r-- | platform/iphone/icloud.mm | 16 | ||||
-rw-r--r-- | platform/iphone/in_app_store.mm | 16 | ||||
-rw-r--r-- | platform/iphone/os_iphone.cpp | 24 | ||||
-rw-r--r-- | platform/iphone/os_iphone.h | 9 | ||||
-rw-r--r-- | platform/iphone/vulkan_context_iphone.h | 48 | ||||
-rw-r--r-- | platform/iphone/vulkan_context_iphone.mm | 56 | ||||
-rw-r--r-- | platform/javascript/javascript_eval.cpp | 4 | ||||
-rw-r--r-- | platform/osx/detect.py | 4 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 4 | ||||
-rw-r--r-- | platform/server/detect.py | 4 | ||||
-rw-r--r-- | platform/server/os_server.cpp | 1 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 5 | ||||
-rw-r--r-- | platform/x11/detect.py | 21 | ||||
-rw-r--r-- | scene/2d/animated_sprite.cpp | 10 | ||||
-rw-r--r-- | scene/2d/area_2d.cpp | 34 | ||||
-rw-r--r-- | scene/2d/audio_stream_player_2d.cpp | 12 | ||||
-rw-r--r-- | scene/2d/camera_2d.cpp | 14 | ||||
-rw-r--r-- | scene/2d/canvas_item.cpp | 6 | ||||
-rw-r--r-- | scene/2d/canvas_item.h | 4 | ||||
-rw-r--r-- | scene/2d/collision_polygon_2d.cpp | 2 | ||||
-rw-r--r-- | scene/2d/collision_shape_2d.cpp | 6 | ||||
-rw-r--r-- | scene/2d/cpu_particles_2d.cpp | 74 | ||||
-rw-r--r-- | scene/2d/joints_2d.cpp | 16 | ||||
-rw-r--r-- | scene/2d/light_2d.cpp | 8 | ||||
-rw-r--r-- | scene/2d/light_occluder_2d.cpp | 4 | ||||
-rw-r--r-- | scene/2d/line_2d.cpp | 12 | ||||
-rw-r--r-- | scene/2d/navigation_2d.cpp | 8 | ||||
-rw-r--r-- | scene/2d/navigation_2d.h | 1 | ||||
-rw-r--r-- | scene/2d/navigation_agent_2d.cpp | 12 | ||||
-rw-r--r-- | scene/2d/navigation_polygon.cpp | 4 | ||||
-rw-r--r-- | scene/2d/node_2d.cpp | 8 | ||||
-rw-r--r-- | scene/2d/particles_2d.cpp | 10 | ||||
-rw-r--r-- | scene/2d/path_2d.cpp | 14 | ||||
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 44 | ||||
-rw-r--r-- | scene/2d/polygon_2d.cpp | 12 | ||||
-rw-r--r-- | scene/2d/position_2d.cpp | 2 | ||||
-rw-r--r-- | scene/2d/skeleton_2d.cpp | 2 | ||||
-rw-r--r-- | scene/2d/sprite.cpp | 6 | ||||
-rw-r--r-- | scene/2d/tile_map.cpp | 10 | ||||
-rw-r--r-- | scene/2d/touch_screen_button.cpp | 6 | ||||
-rw-r--r-- | scene/2d/visibility_notifier_2d.cpp | 4 | ||||
-rw-r--r-- | scene/3d/area.cpp | 40 | ||||
-rw-r--r-- | scene/3d/arvr_nodes.cpp | 4 | ||||
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 46 | ||||
-rw-r--r-- | scene/3d/baked_lightmap.cpp | 12 | ||||
-rw-r--r-- | scene/3d/bone_attachment.cpp | 2 | ||||
-rw-r--r-- | scene/3d/camera.cpp | 14 | ||||
-rw-r--r-- | scene/3d/collision_polygon.cpp | 2 | ||||
-rw-r--r-- | scene/3d/collision_shape.cpp | 4 | ||||
-rw-r--r-- | scene/3d/cpu_particles.cpp | 72 | ||||
-rw-r--r-- | scene/3d/gi_probe.cpp | 14 | ||||
-rw-r--r-- | scene/3d/interpolated_camera.cpp | 2 | ||||
-rw-r--r-- | scene/3d/light.cpp | 36 | ||||
-rw-r--r-- | scene/3d/mesh_instance.cpp | 6 | ||||
-rw-r--r-- | scene/3d/navigation.cpp | 4 | ||||
-rw-r--r-- | scene/3d/navigation_agent.cpp | 14 | ||||
-rw-r--r-- | scene/3d/particles.cpp | 10 | ||||
-rw-r--r-- | scene/3d/path.cpp | 12 | ||||
-rw-r--r-- | scene/3d/physics_body.cpp | 130 | ||||
-rw-r--r-- | scene/3d/physics_joint.cpp | 210 | ||||
-rw-r--r-- | scene/3d/reflection_probe.cpp | 8 | ||||
-rw-r--r-- | scene/3d/skeleton.cpp | 51 | ||||
-rw-r--r-- | scene/3d/skeleton.h | 5 | ||||
-rw-r--r-- | scene/3d/soft_body.cpp | 24 | ||||
-rw-r--r-- | scene/3d/spring_arm.cpp | 4 | ||||
-rw-r--r-- | scene/3d/sprite_3d.cpp | 14 | ||||
-rw-r--r-- | scene/3d/vehicle_body.cpp | 30 | ||||
-rw-r--r-- | scene/3d/visibility_notifier.cpp | 4 | ||||
-rw-r--r-- | scene/3d/visual_instance.cpp | 2 | ||||
-rw-r--r-- | scene/animation/animation_blend_space_1d.cpp | 18 | ||||
-rw-r--r-- | scene/animation/animation_blend_space_2d.cpp | 12 | ||||
-rw-r--r-- | scene/animation/animation_blend_tree.cpp | 48 | ||||
-rw-r--r-- | scene/animation/animation_cache.cpp | 12 | ||||
-rw-r--r-- | scene/animation/animation_cache.h | 2 | ||||
-rw-r--r-- | scene/animation/animation_node_state_machine.cpp | 20 | ||||
-rw-r--r-- | scene/animation/animation_player.cpp | 28 | ||||
-rw-r--r-- | scene/animation/animation_tree.cpp | 22 | ||||
-rw-r--r-- | scene/animation/root_motion_view.cpp | 4 | ||||
-rw-r--r-- | scene/animation/skeleton_ik.cpp | 8 | ||||
-rw-r--r-- | scene/animation/tween.cpp | 191 | ||||
-rw-r--r-- | scene/audio/audio_stream_player.cpp | 8 | ||||
-rw-r--r-- | scene/debugger/scene_debugger.cpp | 871 | ||||
-rw-r--r-- | scene/debugger/scene_debugger.h | 151 | ||||
-rw-r--r-- | scene/debugger/script_debugger_remote.cpp | 1313 | ||||
-rw-r--r-- | scene/gui/button.cpp | 2 | ||||
-rw-r--r-- | scene/gui/color_picker.cpp | 48 | ||||
-rw-r--r-- | scene/gui/container.cpp | 12 | ||||
-rw-r--r-- | scene/gui/control.cpp | 72 | ||||
-rw-r--r-- | scene/gui/dialogs.cpp | 12 | ||||
-rw-r--r-- | scene/gui/file_dialog.cpp | 38 | ||||
-rw-r--r-- | scene/gui/gradient_edit.cpp | 4 | ||||
-rw-r--r-- | scene/gui/graph_edit.cpp | 40 | ||||
-rw-r--r-- | scene/gui/item_list.cpp | 4 | ||||
-rw-r--r-- | scene/gui/label.cpp | 2 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 47 | ||||
-rw-r--r-- | scene/gui/menu_button.cpp | 4 | ||||
-rw-r--r-- | scene/gui/option_button.cpp | 6 | ||||
-rw-r--r-- | scene/gui/popup_menu.cpp | 8 | ||||
-rw-r--r-- | scene/gui/range.cpp | 14 | ||||
-rw-r--r-- | scene/gui/rich_text_effect.cpp | 2 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 4 | ||||
-rw-r--r-- | scene/gui/scroll_bar.cpp | 20 | ||||
-rw-r--r-- | scene/gui/scroll_container.cpp | 6 | ||||
-rw-r--r-- | scene/gui/spin_box.cpp | 8 | ||||
-rw-r--r-- | scene/gui/tab_container.cpp | 6 | ||||
-rw-r--r-- | scene/gui/tabs.cpp | 2 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 74 | ||||
-rw-r--r-- | scene/gui/texture_progress.cpp | 4 | ||||
-rw-r--r-- | scene/gui/texture_rect.cpp | 4 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 32 | ||||
-rw-r--r-- | scene/gui/tree.h | 4 | ||||
-rw-r--r-- | scene/gui/video_player.cpp | 8 | ||||
-rw-r--r-- | scene/main/canvas_layer.cpp | 6 | ||||
-rw-r--r-- | scene/main/http_request.cpp | 2 | ||||
-rw-r--r-- | scene/main/node.cpp | 88 | ||||
-rw-r--r-- | scene/main/node.h | 8 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 436 | ||||
-rw-r--r-- | scene/main/scene_tree.h | 40 | ||||
-rwxr-xr-x | scene/main/timer.cpp | 4 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 16 | ||||
-rw-r--r-- | scene/main/viewport.h | 2 | ||||
-rw-r--r-- | scene/register_scene_types.cpp | 19 | ||||
-rw-r--r-- | scene/resources/animation.cpp | 12 | ||||
-rw-r--r-- | scene/resources/capsule_shape.cpp | 26 | ||||
-rw-r--r-- | scene/resources/capsule_shape_2d.cpp | 4 | ||||
-rw-r--r-- | scene/resources/circle_shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/curve.cpp | 16 | ||||
-rw-r--r-- | scene/resources/curve.h | 4 | ||||
-rw-r--r-- | scene/resources/cylinder_shape.cpp | 4 | ||||
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 6 | ||||
-rw-r--r-- | scene/resources/environment.cpp | 86 | ||||
-rw-r--r-- | scene/resources/font.cpp | 8 | ||||
-rw-r--r-- | scene/resources/gradient.cpp | 2 | ||||
-rw-r--r-- | scene/resources/height_map_shape.cpp | 6 | ||||
-rw-r--r-- | scene/resources/height_map_shape.h | 6 | ||||
-rw-r--r-- | scene/resources/line_shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/material.cpp | 56 | ||||
-rw-r--r-- | scene/resources/material.h | 4 | ||||
-rw-r--r-- | scene/resources/multimesh.cpp | 2 | ||||
-rw-r--r-- | scene/resources/navigation_mesh.cpp | 26 | ||||
-rw-r--r-- | scene/resources/packed_scene.cpp | 16 | ||||
-rw-r--r-- | scene/resources/particles_material.cpp | 58 | ||||
-rw-r--r-- | scene/resources/physics_material.cpp | 4 | ||||
-rw-r--r-- | scene/resources/primitive_meshes.cpp | 54 | ||||
-rw-r--r-- | scene/resources/ray_shape.cpp | 2 | ||||
-rw-r--r-- | scene/resources/segment_shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/shape.cpp | 2 | ||||
-rw-r--r-- | scene/resources/shape_2d.cpp | 2 | ||||
-rw-r--r-- | scene/resources/skin.cpp | 30 | ||||
-rw-r--r-- | scene/resources/skin.h | 12 | ||||
-rw-r--r-- | scene/resources/sky.cpp | 20 | ||||
-rw-r--r-- | scene/resources/sphere_shape.cpp | 2 | ||||
-rw-r--r-- | scene/resources/style_box.cpp | 36 | ||||
-rw-r--r-- | scene/resources/texture.cpp | 15 | ||||
-rw-r--r-- | scene/resources/theme.cpp | 28 | ||||
-rw-r--r-- | scene/resources/tile_set.cpp | 2 | ||||
-rw-r--r-- | scene/resources/visual_shader.cpp | 116 | ||||
-rw-r--r-- | scene/resources/visual_shader.h | 10 | ||||
-rw-r--r-- | scene/resources/visual_shader_nodes.cpp | 551 | ||||
-rw-r--r-- | scene/resources/visual_shader_nodes.h | 202 | ||||
-rw-r--r-- | scene/resources/world.cpp | 4 | ||||
-rw-r--r-- | scene/resources/world_2d.cpp | 4 | ||||
-rw-r--r-- | servers/arvr/arvr_positional_tracker.cpp | 2 | ||||
-rw-r--r-- | servers/arvr_server.cpp | 10 | ||||
-rw-r--r-- | servers/audio/audio_stream.cpp | 2 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_amplify.cpp | 2 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_chorus.cpp | 60 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_compressor.cpp | 14 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_delay.cpp | 20 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_distortion.cpp | 8 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_eq.cpp | 2 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_filter.cpp | 6 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_limiter.cpp | 8 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_panner.cpp | 2 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_phaser.cpp | 10 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_pitch_shift.cpp | 4 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_reverb.cpp | 16 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_spectrum_analyzer.cpp | 4 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_stereo_enhance.cpp | 6 | ||||
-rw-r--r-- | servers/audio/effects/audio_stream_generator.cpp | 4 | ||||
-rw-r--r-- | servers/audio_server.cpp | 8 | ||||
-rw-r--r-- | servers/navigation_server.cpp | 2 | ||||
-rw-r--r-- | servers/navigation_server.h | 8 | ||||
-rw-r--r-- | servers/physics/area_sw.cpp | 4 | ||||
-rw-r--r-- | servers/physics/body_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics/space_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/area_2d_sw.cpp | 4 | ||||
-rw-r--r-- | servers/physics_2d/body_2d_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/shape_2d_sw.cpp | 4 | ||||
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d_server.cpp | 14 | ||||
-rw-r--r-- | servers/physics_server.cpp | 10 | ||||
-rw-r--r-- | servers/register_server_types.cpp | 8 | ||||
-rw-r--r-- | servers/visual/rasterizer.h | 2 | ||||
-rw-r--r-- | servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp | 8 | ||||
-rw-r--r-- | servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp | 18 | ||||
-rw-r--r-- | servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp | 4 | ||||
-rw-r--r-- | servers/visual/rasterizer_rd/shaders/scene_high_end_inc.glsl | 8 | ||||
-rw-r--r-- | servers/visual/shader_language.cpp | 4 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 4 | ||||
-rw-r--r-- | servers/visual_server.cpp | 16 | ||||
-rw-r--r-- | servers/visual_server.h | 4 | ||||
-rw-r--r-- | thirdparty/glslang/glslang/Include/revision.template | 13 |
1402 files changed, 18199 insertions, 11208 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 05e7094981..3f6e932050 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,10 +7,19 @@ environment: PYTHON: C:\Python38 SCONS_CACHE_ROOT: "%HOME%\\scons_cache" SCONS_CACHE_LIMIT: 1024 + OPTIONS: "debug_symbols=no verbose=yes progress=no" + EXTRA_ARGS: "warnings=all werror=yes" matrix: - - GD_PLATFORM: windows - TOOLS: yes - TARGET: release_debug + - GD_PLATFORM: windows + TARGET: release_debug + TOOLS: yes +# Disabled for performance reasons until master is more stable. +# - GD_PLATFORM: windows +# TARGET: release +# TOOLS: no + +matrix: + fast_finish: true init: - ps: if ($env:APPVEYOR_REPO_BRANCH -ne "master") { $env:APPVEYOR_CACHE_SKIP_SAVE = "true" } @@ -29,4 +38,4 @@ before_build: - set "SCONS_CACHE=%SCONS_CACHE_ROOT%\%APPVEYOR_REPO_BRANCH%" build_script: - - scons platform=%GD_PLATFORM% target=%TARGET% tools=%TOOLS% debug_symbols=no verbose=yes progress=no gdnative_wrapper=yes + - scons platform=%GD_PLATFORM% target=%TARGET% tools=%TOOLS% %OPTIONS% %EXTRA_ARGS% diff --git a/.travis.yml b/.travis.yml index 714133b117..80191423c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp # OS config, depends on actual 'os' in build matrix -dist: xenial +dist: bionic stages: - build @@ -26,8 +26,6 @@ matrix: compiler: gcc addons: apt: - sources: - - llvm-toolchain-xenial-8 packages: - clang-format-8 @@ -39,14 +37,15 @@ matrix: addons: apt: sources: - - mono - - ubuntu-toolchain-r-test + - sourceline: "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" + key_url: "https://raw.githubusercontent.com/travis-ci/apt-source-safelist/master/keys/mono.asc" + - sourceline: "ppa:ubuntu-toolchain-r/test" packages: - &gcc9_deps [gcc-9, g++-9] - &linux_deps [libasound2-dev, libgl1-mesa-dev, libglu1-mesa-dev, libx11-dev, libxcursor-dev, libxi-dev, libxinerama-dev, libxrandr-dev] - &linux_mono_deps [mono-devel, msbuild, nuget] - - name: Linux export template (release, Clang) + - name: Linux export template (release, Clang 7) stage: build env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes" os: linux @@ -72,11 +71,13 @@ matrix: stage: build env: PLATFORM=osx TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-clang EXTRA_ARGS="warnings=extra werror=yes" os: osx + osx_image: xcode11.3 compiler: clang addons: homebrew: packages: - scons + update: true # TODO: iOS MoltenVK support @@ -84,6 +85,7 @@ matrix: # stage: build # env: PLATFORM=iphone TOOLS=no TARGET=debug CACHE_NAME=${PLATFORM}-clang # os: osx +# osx_image: xcode11.3 # compiler: clang # addons: # homebrew: @@ -100,14 +102,14 @@ matrix: # addons: # apt: # sources: -# - ubuntu-toolchain-r-test +# - sourceline: "ppa:ubuntu-toolchain-r/test" # packages: # - *gcc9_deps # - *linux_deps - - name: Linux export template (release_debug, GCC 5, without 3D support) + - name: Linux export template (release_debug, GCC 7, without 3D support) stage: build - env: PLATFORM=x11 TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-gcc-5 EXTRA_ARGS="CXXFLAGS=-fno-strict-aliasing disable_3d=yes" + env: PLATFORM=x11 TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-gcc-7 EXTRA_ARGS="disable_3d=yes" os: linux compiler: gcc addons: @@ -123,7 +125,7 @@ before_install: install: - if [ "$TRAVIS_OS_NAME" = "linux" ]; then - pyenv global 3.7.1 system; + pyenv global 3.8 system; pip3 install --user scons; fi - scons --version diff --git a/SConstruct b/SConstruct index fe6178d670..f2c20ea91e 100644 --- a/SConstruct +++ b/SConstruct @@ -292,6 +292,7 @@ if selected_platform in platform_list: if env["extra_suffix"] != '': env.extra_suffix += '.' + env["extra_suffix"] + # Environment flags CCFLAGS = env.get('CCFLAGS', '') env['CCFLAGS'] = '' env.Append(CCFLAGS=str(CCFLAGS).split()) @@ -308,17 +309,66 @@ if selected_platform in platform_list: env['LINKFLAGS'] = '' env.Append(LINKFLAGS=str(LINKFLAGS).split()) + # Platform specific flags flag_list = platform_flags[selected_platform] for f in flag_list: if not (f[0] in ARGUMENTS): # allow command line to override platform flags env[f[0]] = f[1] - # must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11) + # Must happen after the flags definition, so that they can be used by platform detect detect.configure(env) - # Enable C++11 support + # Set our C and C++ standard requirements. + # C++17 is required as we need guaranteed copy elision as per GH-36436. + # Prepending to make it possible to override. + # This needs to come after `configure`, otherwise we don't have env.msvc. if not env.msvc: - env.Append(CXXFLAGS=['-std=c++11']) + # Specifying GNU extensions support explicitly, which are supported by + # both GCC and Clang. Both currently default to gnu11 and gnu++14. + env.Prepend(CFLAGS=['-std=gnu11']) + env.Prepend(CXXFLAGS=['-std=gnu++17']) + else: + # MSVC doesn't have clear C standard support, /std only covers C++. + # We apply it to CCFLAGS (both C and C++ code) in case it impacts C features. + env.Prepend(CCFLAGS=['/std:c++17', '/permissive-']) + + # Enforce our minimal compiler version requirements + cc_version = methods.get_compiler_version(env) or [-1, -1] + cc_version_major = cc_version[0] + cc_version_minor = cc_version[1] + + if methods.using_gcc(env): + # GCC 8 before 8.4 has a regression in the support of guaranteed copy elision + # which causes a build failure: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521 + if cc_version_major == 8 and cc_version_minor < 4: + print("Detected GCC 8 version < 8.4, which is not supported due to a " + "regression in its C++17 guaranteed copy elision support. Use a " + "newer GCC version, or Clang 6 or later by passing \"use_llvm=yes\" " + "to the SCons command line.") + sys.exit(255) + elif cc_version_major < 7: + print("Detected GCC version older than 7, which does not fully support " + "C++17. Supported versions are GCC 7, 9 and later. Use a newer GCC " + "version, or Clang 6 or later by passing \"use_llvm=yes\" to the " + "SCons command line.") + sys.exit(255) + elif methods.using_clang(env): + # Apple LLVM versions differ from upstream LLVM version \o/, compare + # in https://en.wikipedia.org/wiki/Xcode#Toolchain_versions + if env["platform"] == "osx" or env["platform"] == "iphone": + vanilla = methods.is_vanilla_clang(env) + if vanilla and cc_version_major < 6: + print("Detected Clang version older than 6, which does not fully support " + "C++17. Supported versions are Clang 6 and later.") + sys.exit(255) + elif not vanilla and cc_version_major < 10: + print("Detected Apple Clang version older than 10, which does not fully " + "support C++17. Supported versions are Apple Clang 10 and later.") + sys.exit(255) + elif cc_version_major < 6: + print("Detected Clang version older than 6, which does not fully support " + "C++17. Supported versions are Clang 6 and later.") + sys.exit(255) # Configure compiler warnings if env.msvc: @@ -343,13 +393,10 @@ if selected_platform in platform_list: all_plus_warnings = ['-Wwrite-strings'] if methods.using_gcc(env): - version = methods.get_compiler_version(env) - if version != None and version[0] >= '7': + if cc_version_major >= 7: shadow_local_warning = ['-Wshadow-local'] if (env["warnings"] == 'extra'): - # Note: enable -Wimplicit-fallthrough for Clang (already part of -Wextra for GCC) - # once we switch to C++11 or later (necessary for our FALLTHROUGH macro). env.Append(CCFLAGS=['-Wall', '-Wextra', '-Wno-unused-parameter'] + all_plus_warnings + shadow_local_warning) env.Append(CXXFLAGS=['-Wctor-dtor-privacy', '-Wnon-virtual-dtor']) @@ -359,9 +406,10 @@ if selected_platform in platform_list: '-Wstringop-overflow=4', '-Wlogical-op']) # -Wnoexcept was removed temporarily due to GH-36325. env.Append(CXXFLAGS=['-Wplacement-new=1']) - version = methods.get_compiler_version(env) - if version != None and version[0] >= '9': + if cc_version_major >= 9: env.Append(CCFLAGS=['-Wattribute-alias=2']) + if methods.using_clang(env): + env.Append(CCFLAGS=['-Wimplicit-fallthrough']) elif (env["warnings"] == 'all'): env.Append(CCFLAGS=['-Wall'] + shadow_local_warning) elif (env["warnings"] == 'moderate'): diff --git a/core/array.cpp b/core/array.cpp index 2253d05605..7eb15ea934 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -308,9 +308,9 @@ struct _ArrayVariantSortCustom { _FORCE_INLINE_ bool operator()(const Variant &p_l, const Variant &p_r) const { const Variant *args[2] = { &p_l, &p_r }; - Variant::CallError err; + Callable::CallError err; bool res = obj->call(func, args, 2, err); - if (err.error != Variant::CallError::CALL_OK) + if (err.error != Callable::CallError::CALL_OK) res = false; return res; } diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 583a44846f..c1cf061854 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -2620,29 +2620,29 @@ void _Thread::_start_func(void *ud) { Ref<_Thread> *tud = (Ref<_Thread> *)ud; Ref<_Thread> t = *tud; memdelete(tud); - Variant::CallError ce; + Callable::CallError ce; const Variant *arg[1] = { &t->userdata }; Thread::set_name(t->target_method); t->ret = t->target_instance->call(t->target_method, arg, 1, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { String reason; switch (ce.error) { - case Variant::CallError::CALL_ERROR_INVALID_ARGUMENT: { + case Callable::CallError::CALL_ERROR_INVALID_ARGUMENT: { reason = "Invalid Argument #" + itos(ce.argument); } break; - case Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { + case Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { reason = "Too Many Arguments"; } break; - case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { + case Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { reason = "Too Few Arguments"; } break; - case Variant::CallError::CALL_ERROR_INVALID_METHOD: { + case Callable::CallError::CALL_ERROR_INVALID_METHOD: { reason = "Method Not Found"; } break; @@ -3101,8 +3101,8 @@ void _Engine::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_hint"), "set_editor_hint", "is_editor_hint"); ADD_PROPERTY(PropertyInfo(Variant::INT, "iterations_per_second"), "set_iterations_per_second", "get_iterations_per_second"); ADD_PROPERTY(PropertyInfo(Variant::INT, "target_fps"), "set_target_fps", "get_target_fps"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_scale"), "set_time_scale", "get_time_scale"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "physics_jitter_fix"), "set_physics_jitter_fix", "get_physics_jitter_fix"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_scale"), "set_time_scale", "get_time_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "physics_jitter_fix"), "set_physics_jitter_fix", "get_physics_jitter_fix"); } _Engine *_Engine::singleton = NULL; diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 342c43802e..ae569ea189 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -581,9 +581,9 @@ private: bool _list_skip_hidden; }; -class _Marshalls : public Reference { +class _Marshalls : public Object { - GDCLASS(_Marshalls, Reference); + GDCLASS(_Marshalls, Object); static _Marshalls *singleton; diff --git a/core/callable.cpp b/core/callable.cpp new file mode 100644 index 0000000000..34b79cea10 --- /dev/null +++ b/core/callable.cpp @@ -0,0 +1,357 @@ +/*************************************************************************/ +/* callable.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "callable.h" +#include "core/script_language.h" +#include "message_queue.h" +#include "object.h" +#include "reference.h" + +void Callable::call_deferred(const Variant **p_arguments, int p_argcount) const { + MessageQueue::get_singleton()->push_callable(*this, p_arguments, p_argcount); +} + +void Callable::call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, CallError &r_call_error) const { + + if (is_null()) { + r_call_error.error = CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_call_error.argument = 0; + r_call_error.expected = 0; + r_return_value = Variant(); + } else if (is_custom()) { + custom->call(p_arguments, p_argcount, r_return_value, r_call_error); + } else { + Object *obj = ObjectDB::get_instance(ObjectID(object)); + r_return_value = obj->call(method, p_arguments, p_argcount, r_call_error); + } +} + +Object *Callable::get_object() const { + if (is_null()) { + return nullptr; + } else if (is_custom()) { + return ObjectDB::get_instance(custom->get_object()); + } else { + return ObjectDB::get_instance(ObjectID(object)); + } +} + +ObjectID Callable::get_object_id() const { + if (is_null()) { + return ObjectID(); + } else if (is_custom()) { + return custom->get_object(); + } else { + return ObjectID(object); + } +} +StringName Callable::get_method() const { + ERR_FAIL_COND_V(is_custom(), StringName()); + return method; +} +uint32_t Callable::hash() const { + if (is_custom()) { + return custom->hash(); + } else { + uint32_t hash = method.hash(); + return hash_djb2_one_64(object, hash); + } +} + +bool Callable::operator==(const Callable &p_callable) const { + bool custom_a = is_custom(); + bool custom_b = p_callable.is_custom(); + + if (custom_a == custom_b) { + if (custom_a) { + if (custom == p_callable.custom) { + return true; //same pointer, dont even compare + } + + CallableCustom::CompareEqualFunc eq_a = custom->get_compare_equal_func(); + CallableCustom::CompareEqualFunc eq_b = p_callable.custom->get_compare_equal_func(); + if (eq_a == eq_b) { + return eq_a(custom, p_callable.custom); + } else { + return false; + } + } else { + return object == p_callable.object && method == p_callable.method; + } + } else { + return false; + } +} +bool Callable::operator!=(const Callable &p_callable) const { + return !(*this == p_callable); +} +bool Callable::operator<(const Callable &p_callable) const { + bool custom_a = is_custom(); + bool custom_b = p_callable.is_custom(); + + if (custom_a == custom_b) { + if (custom_a) { + if (custom == p_callable.custom) { + return false; //same pointer, dont even compare + } + + CallableCustom::CompareLessFunc less_a = custom->get_compare_less_func(); + CallableCustom::CompareLessFunc less_b = p_callable.custom->get_compare_less_func(); + if (less_a == less_b) { + return less_a(custom, p_callable.custom); + } else { + return less_a < less_b; //it's something.. + } + + } else { + if (object == p_callable.object) { + return method < p_callable.method; + } else { + return object < p_callable.object; + } + } + } else { + return int(custom_a ? 1 : 0) < int(custom_b ? 1 : 0); + } +} + +void Callable::operator=(const Callable &p_callable) { + if (is_custom()) { + if (p_callable.is_custom()) { + if (custom == p_callable.custom) { + return; + } + } + + if (custom->ref_count.unref()) { + memdelete(custom); + } + } + + if (p_callable.is_custom()) { + method = StringName(); + if (!p_callable.custom->ref_count.ref()) { + object = 0; + } else { + object = 0; + custom = p_callable.custom; + } + } else { + method = p_callable.method; + object = p_callable.object; + } +} + +Callable::operator String() const { + + if (is_custom()) { + return custom->get_as_text(); + } else { + if (is_null()) { + return "null::null"; + } + + Object *base = get_object(); + if (base) { + String class_name = base->get_class(); + Ref<Script> script = base->get_script(); + if (script.is_valid() && script->get_path().is_resource_file()) { + + class_name += "(" + script->get_path().get_file() + ")"; + } + return class_name + "::" + String(method); + } else { + return "null::" + String(method); + } + } +} + +Callable::Callable(const Object *p_object, const StringName &p_method) { + if (p_method == StringName()) { + object = 0; + ERR_FAIL_MSG("Method argument to Callable constructor must be a non-empty string"); + } + if (p_object == nullptr) { + object = 0; + ERR_FAIL_MSG("Object argument to Callable constructor must be non-null"); + } + + object = p_object->get_instance_id(); + method = p_method; +} + +Callable::Callable(ObjectID p_object, const StringName &p_method) { + if (p_method == StringName()) { + object = 0; + ERR_FAIL_MSG("Method argument to Callable constructor must be a non-empty string"); + } + + object = p_object; + method = p_method; +} +Callable::Callable(CallableCustom *p_custom) { + if (p_custom->referenced) { + object = 0; + ERR_FAIL_MSG("Callable custom is already referenced"); + } + p_custom->referenced = true; + object = 0; //ensure object is all zero, since pointer may be 32 bits + custom = p_custom; +} +Callable::Callable(const Callable &p_callable) { + if (p_callable.is_custom()) { + if (!p_callable.custom->ref_count.ref()) { + object = 0; + } else { + object = 0; + custom = p_callable.custom; + } + } else { + method = p_callable.method; + object = p_callable.object; + } +} + +Callable::~Callable() { + if (is_custom()) { + if (custom->ref_count.unref()) { + memdelete(custom); + } + } +} + +Callable::Callable() { + object = 0; +} + +CallableCustom::CallableCustom() { + referenced = false; + ref_count.init(); +} + +////////////////////////////////// + +Object *Signal::get_object() const { + return ObjectDB::get_instance(object); +} +ObjectID Signal::get_object_id() const { + return object; +} +StringName Signal::get_name() const { + return name; +} + +bool Signal::operator==(const Signal &p_signal) const { + return object == p_signal.object && name == p_signal.name; +} + +bool Signal::operator!=(const Signal &p_signal) const { + return object != p_signal.object || name != p_signal.name; +} + +bool Signal::operator<(const Signal &p_signal) const { + if (object == p_signal.object) { + return name < p_signal.name; + } else { + return object < p_signal.object; + } +} + +Signal::operator String() const { + Object *base = get_object(); + if (base) { + String class_name = base->get_class(); + Ref<Script> script = base->get_script(); + if (script.is_valid() && script->get_path().is_resource_file()) { + + class_name += "(" + script->get_path().get_file() + ")"; + } + return class_name + "::[signal]" + String(name); + } else { + return "null::[signal]" + String(name); + } +} + +Error Signal::emit(const Variant **p_arguments, int p_argcount) const { + Object *obj = ObjectDB::get_instance(object); + if (!obj) { + return ERR_INVALID_DATA; + } + + return obj->emit_signal(name, p_arguments, p_argcount); +} +Error Signal::connect(const Callable &p_callable, const Vector<Variant> &p_binds, uint32_t p_flags) { + + Object *object = get_object(); + ERR_FAIL_COND_V(!object, ERR_UNCONFIGURED); + + return object->connect(name, p_callable, p_binds, p_flags); +} +void Signal::disconnect(const Callable &p_callable) { + Object *object = get_object(); + ERR_FAIL_COND(!object); + object->disconnect(name, p_callable); +} +bool Signal::is_connected(const Callable &p_callable) const { + Object *object = get_object(); + ERR_FAIL_COND_V(!object, false); + + return object->is_connected(name, p_callable); +} + +Array Signal::get_connections() const { + Object *object = get_object(); + if (!object) { + return Array(); + } + + List<Object::Connection> connections; + object->get_signal_connection_list(name, &connections); + + Array arr; + for (List<Object::Connection>::Element *E = connections.front(); E; E = E->next()) { + arr.push_back(E->get()); + } + return arr; +} +Signal::Signal(const Object *p_object, const StringName &p_name) { + + ERR_FAIL_COND_MSG(p_object == nullptr, "Object argument to Signal constructor must be non-null"); + + object = p_object->get_instance_id(); + name = p_name; +} +Signal::Signal(ObjectID p_object, const StringName &p_name) { + + object = p_object; + name = p_name; +} +Signal::Signal() { +} diff --git a/core/callable.h b/core/callable.h new file mode 100644 index 0000000000..cecf2264a3 --- /dev/null +++ b/core/callable.h @@ -0,0 +1,161 @@ +/*************************************************************************/ +/* callable.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef CALLABLE_H +#define CALLABLE_H + +#include "core/list.h" +#include "core/object_id.h" +#include "core/string_name.h" + +class Object; +class Variant; +class CallableCustom; + +// This is an abstraction of things that can be called. +// It is used for signals and other cases where efficient calling of functions +// is required. It is designed for the standard case (object and method) +// but can be optimized or customized. + +class Callable { + + //needs to be max 16 bytes in 64 bits + StringName method; + union { + uint64_t object; + CallableCustom *custom; + }; + +public: + struct CallError { + enum Error { + CALL_OK, + CALL_ERROR_INVALID_METHOD, + CALL_ERROR_INVALID_ARGUMENT, // expected is variant type + CALL_ERROR_TOO_MANY_ARGUMENTS, // expected is number of arguments + CALL_ERROR_TOO_FEW_ARGUMENTS, // expected is number of arguments + CALL_ERROR_INSTANCE_IS_NULL, + }; + Error error; + int argument; + int expected; + }; + + void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, CallError &r_call_error) const; + void call_deferred(const Variant **p_arguments, int p_argcount) const; + + _FORCE_INLINE_ bool is_null() const { + return method == StringName() && object == 0; + } + _FORCE_INLINE_ bool is_custom() const { + return method == StringName() && custom != 0; + } + _FORCE_INLINE_ bool is_standard() const { + return method != StringName(); + } + + Object *get_object() const; + ObjectID get_object_id() const; + StringName get_method() const; + + uint32_t hash() const; + + bool operator==(const Callable &p_callable) const; + bool operator!=(const Callable &p_callable) const; + bool operator<(const Callable &p_callable) const; + + void operator=(const Callable &p_callable); + + operator String() const; + + Callable(const Object *p_object, const StringName &p_method); + Callable(ObjectID p_object, const StringName &p_method); + Callable(CallableCustom *p_custom); + Callable(const Callable &p_callable); + Callable(); + ~Callable(); +}; + +class CallableCustom { + friend class Callable; + SafeRefCount ref_count; + bool referenced; + +public: + typedef bool (*CompareEqualFunc)(const CallableCustom *p_a, const CallableCustom *p_b); + typedef bool (*CompareLessFunc)(const CallableCustom *p_a, const CallableCustom *p_b); + + //for every type that inherits, these must always be the same for this type + virtual uint32_t hash() const = 0; + virtual String get_as_text() const = 0; + virtual CompareEqualFunc get_compare_equal_func() const = 0; + virtual CompareLessFunc get_compare_less_func() const = 0; + virtual ObjectID get_object() const = 0; //must always be able to provide an object + virtual void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const = 0; + + CallableCustom(); + virtual ~CallableCustom() {} +}; + +// This is just a proxy object to object signals, its only +// allocated on demand by/for scripting languages so it can +// be put inside a Variant, but it is not +// used by the engine itself. + +class Signal { + StringName name; + ObjectID object; + +public: + _FORCE_INLINE_ bool is_null() const { + return object.is_null() && name == StringName(); + } + Object *get_object() const; + ObjectID get_object_id() const; + StringName get_name() const; + + bool operator==(const Signal &p_signal) const; + bool operator!=(const Signal &p_signal) const; + bool operator<(const Signal &p_signal) const; + + operator String() const; + + Error emit(const Variant **p_arguments, int p_argcount) const; + Error connect(const Callable &p_callable, const Vector<Variant> &p_binds = Vector<Variant>(), uint32_t p_flags = 0); + void disconnect(const Callable &p_callable); + bool is_connected(const Callable &p_callable) const; + + Array get_connections() const; + Signal(const Object *p_object, const StringName &p_name); + Signal(ObjectID p_object, const StringName &p_name); + Signal(); +}; + +#endif // CALLABLE_H diff --git a/core/callable_method_pointer.cpp b/core/callable_method_pointer.cpp new file mode 100644 index 0000000000..8774af6add --- /dev/null +++ b/core/callable_method_pointer.cpp @@ -0,0 +1,94 @@ +/*************************************************************************/ +/* callable_method_pointer.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "callable_method_pointer.h" + +bool CallableCustomMethodPointerBase::compare_equal(const CallableCustom *p_a, const CallableCustom *p_b) { + const CallableCustomMethodPointerBase *a = static_cast<const CallableCustomMethodPointerBase *>(p_a); + const CallableCustomMethodPointerBase *b = static_cast<const CallableCustomMethodPointerBase *>(p_b); + + if (a->comp_size != b->comp_size) { + return false; + } + + for (uint32_t i = 0; i < a->comp_size; i++) { + if (a->comp_ptr[i] != b->comp_ptr[i]) { + return false; + } + } + + return true; +} + +bool CallableCustomMethodPointerBase::compare_less(const CallableCustom *p_a, const CallableCustom *p_b) { + + const CallableCustomMethodPointerBase *a = static_cast<const CallableCustomMethodPointerBase *>(p_a); + const CallableCustomMethodPointerBase *b = static_cast<const CallableCustomMethodPointerBase *>(p_b); + + if (a->comp_size != b->comp_size) { + return a->comp_size < b->comp_size; + } + + for (uint32_t i = 0; i < a->comp_size; i++) { + if (a->comp_ptr[i] == b->comp_ptr[i]) { + continue; + } + + return a->comp_ptr[i] < b->comp_ptr[i]; + } + + return false; +} + +CallableCustom::CompareEqualFunc CallableCustomMethodPointerBase::get_compare_equal_func() const { + return compare_equal; +} + +CallableCustom::CompareLessFunc CallableCustomMethodPointerBase::get_compare_less_func() const { + return compare_less; +} + +uint32_t CallableCustomMethodPointerBase::hash() const { + return h; +} + +void CallableCustomMethodPointerBase::_setup(uint32_t *p_base_ptr, uint32_t p_ptr_size) { + comp_ptr = p_base_ptr; + comp_size = p_ptr_size / 4; + + // Precompute hash. + for (uint32_t i = 0; i < comp_size; i++) { + if (i == 0) { + h = hash_djb2_one_32(comp_ptr[i]); + } else { + h = hash_djb2_one_32(comp_ptr[i], h); + } + } +} diff --git a/core/callable_method_pointer.h b/core/callable_method_pointer.h new file mode 100644 index 0000000000..a931a344e6 --- /dev/null +++ b/core/callable_method_pointer.h @@ -0,0 +1,292 @@ +/*************************************************************************/ +/* callable_method_pointer.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef CALLABLE_METHOD_POINTER_H +#define CALLABLE_METHOD_POINTER_H + +#include "core/callable.h" +#include "core/hashfuncs.h" +#include "core/object.h" +#include "core/simple_type.h" + +class CallableCustomMethodPointerBase : public CallableCustom { + + uint32_t *comp_ptr; + uint32_t comp_size; + uint32_t h; +#ifdef DEBUG_METHODS_ENABLED + const char *text = ""; +#endif + static bool compare_equal(const CallableCustom *p_a, const CallableCustom *p_b); + static bool compare_less(const CallableCustom *p_a, const CallableCustom *p_b); + +protected: + void _setup(uint32_t *p_base_ptr, uint32_t p_ptr_size); + +public: +#ifdef DEBUG_METHODS_ENABLED + void set_text(const char *p_text) { + text = p_text; + } + virtual String get_as_text() const { + return text; + } +#else + virtual String get_as_text() const { + return String(); + } +#endif + virtual CompareEqualFunc get_compare_equal_func() const; + virtual CompareLessFunc get_compare_less_func() const; + + virtual uint32_t hash() const; +}; + +#ifdef DEBUG_METHODS_ENABLED + +template <class T> +struct VariantCasterAndValidate { + + static _FORCE_INLINE_ T cast(const Variant **p_args, uint32_t p_arg_idx, Callable::CallError &r_error) { + Variant::Type argtype = GetTypeInfo<T>::VARIANT_TYPE; + if (!Variant::can_convert_strict(p_args[p_arg_idx]->get_type(), argtype)) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument = p_arg_idx; + r_error.expected = argtype; + } + + return VariantCaster<T>::cast(*p_args[p_arg_idx]); + } +}; + +template <class T> +struct VariantCasterAndValidate<T &> { + + static _FORCE_INLINE_ T cast(const Variant **p_args, uint32_t p_arg_idx, Callable::CallError &r_error) { + Variant::Type argtype = GetTypeInfo<T>::VARIANT_TYPE; + if (!Variant::can_convert_strict(p_args[p_arg_idx]->get_type(), argtype)) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument = p_arg_idx; + r_error.expected = argtype; + } + + return VariantCaster<T>::cast(*p_args[p_arg_idx]); + } +}; + +template <class T> +struct VariantCasterAndValidate<const T &> { + + static _FORCE_INLINE_ T cast(const Variant **p_args, uint32_t p_arg_idx, Callable::CallError &r_error) { + Variant::Type argtype = GetTypeInfo<T>::VARIANT_TYPE; + if (!Variant::can_convert_strict(p_args[p_arg_idx]->get_type(), argtype)) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument = p_arg_idx; + r_error.expected = argtype; + } + + return VariantCaster<T>::cast(*p_args[p_arg_idx]); + } +}; + +#endif // DEBUG_METHODS_ENABLED + +// GCC 8 raises "parameter 'p_args' set but not used" here, probably using a +// template version that does not have arguments and thus sees it unused, but +// obviously the template can be used for functions with and without them, and +// the optimizer will get rid of it anyway. +#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-parameter" +#endif + +template <class T, class... P, size_t... Is> +void call_with_variant_args_helper(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, Callable::CallError &r_error, IndexSequence<Is...>) { + r_error.error = Callable::CallError::CALL_OK; + +#ifdef DEBUG_METHODS_ENABLED + (p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...); +#else + (p_instance->*p_method)(VariantCaster<P>::cast(p_args[Is])...); +#endif +} + +#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + +template <class T, class... P> +void call_with_variant_args(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, int p_argcount, Callable::CallError &r_error) { +#ifdef DEBUG_METHODS_ENABLED + if ((size_t)p_argcount > sizeof...(P)) { + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.argument = sizeof...(P); + return; + } + + if ((size_t)p_argcount < sizeof...(P)) { + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.argument = sizeof...(P); + return; + } +#endif + call_with_variant_args_helper<T, P...>(p_instance, p_method, p_args, r_error, BuildIndexSequence<sizeof...(P)>{}); +} + +template <class T, class... P> +class CallableCustomMethodPointer : public CallableCustomMethodPointerBase { + + struct Data { + T *instance; + void (T::*method)(P...); + } data; + +public: + virtual ObjectID get_object() const { return data.instance->get_instance_id(); } + + virtual void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const { + + call_with_variant_args(data.instance, data.method, p_arguments, p_argcount, r_call_error); + } + + CallableCustomMethodPointer(T *p_instance, void (T::*p_method)(P...)) { + zeromem(&data, sizeof(Data)); // Clear beforehand, may have padding bytes. + data.instance = p_instance; + data.method = p_method; + _setup((uint32_t *)&data, sizeof(Data)); + } +}; + +template <class T, class... P> +Callable create_custom_callable_function_pointer(T *p_instance, +#ifdef DEBUG_METHODS_ENABLED + const char *p_func_text, +#endif + void (T::*p_method)(P...)) { + + typedef CallableCustomMethodPointer<T, P...> CCMP; // Messes with memnew otherwise. + CCMP *ccmp = memnew(CCMP(p_instance, p_method)); +#ifdef DEBUG_METHODS_ENABLED + ccmp->set_text(p_func_text + 1); // Try to get rid of the ampersand. +#endif + return Callable(ccmp); +} + +// VERSION WITH RETURN + +// GCC 8 raises "parameter 'p_args' set but not used" here, probably using a +// template version that does not have arguments and thus sees it unused, but +// obviously the template can be used for functions with and without them, and +// the optimizer will get rid of it anyway. +#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-parameter" +#endif + +template <class T, class R, class... P, size_t... Is> +void call_with_variant_args_ret_helper(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence<Is...>) { + r_error.error = Callable::CallError::CALL_OK; + +#ifdef DEBUG_METHODS_ENABLED + r_ret = (p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...); +#else + (p_instance->*p_method)(VariantCaster<P>::cast(p_args[Is])...); +#endif +} + +#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + +template <class T, class R, class... P> +void call_with_variant_args_ret(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) { +#ifdef DEBUG_METHODS_ENABLED + if ((size_t)p_argcount > sizeof...(P)) { + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.argument = sizeof...(P); + return; + } + + if ((size_t)p_argcount < sizeof...(P)) { + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.argument = sizeof...(P); + return; + } +#endif + call_with_variant_args_ret_helper<T, R, P...>(p_instance, p_method, p_args, r_ret, r_error, BuildIndexSequence<sizeof...(P)>{}); +} + +template <class T, class R, class... P> +class CallableCustomMethodPointerRet : public CallableCustomMethodPointerBase { + + struct Data { + T *instance; + R(T::*method) + (P...); + } data; + +public: + virtual ObjectID get_object() const { return data.instance->get_instance_id(); } + + virtual void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const { + + call_with_variant_args_ret(data.instance, data.method, p_arguments, p_argcount, r_return_value, r_call_error); + } + + CallableCustomMethodPointerRet(T *p_instance, R (T::*p_method)(P...)) { + zeromem(&data, sizeof(Data)); // Clear beforehand, may have padding bytes. + data.instance = p_instance; + data.method = p_method; + _setup((uint32_t *)&data, sizeof(Data)); + } +}; + +template <class T, class R, class... P> +Callable create_custom_callable_function_pointer(T *p_instance, +#ifdef DEBUG_METHODS_ENABLED + const char *p_func_text, +#endif + R (T::*p_method)(P...)) { + + typedef CallableCustomMethodPointerRet<T, R, P...> CCMP; // Messes with memnew otherwise. + CCMP *ccmp = memnew(CCMP(p_instance, p_method)); +#ifdef DEBUG_METHODS_ENABLED + ccmp->set_text(p_func_text + 1); // Try to get rid of the ampersand. +#endif + return Callable(ccmp); +} + +#ifdef DEBUG_METHODS_ENABLED +#define callable_mp(I, M) create_custom_callable_function_pointer(I, #M, M) +#else +#define callable_mp(I, M) create_custom_callable_function_pointer(I, M) +#endif + +#endif // CALLABLE_METHOD_POINTER_H diff --git a/core/class_db.cpp b/core/class_db.cpp index 2fd0ee2d89..35e216a58f 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -1033,7 +1033,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const return true; //return true but do nothing } - Variant::CallError ce; + Callable::CallError ce; if (psg->index >= 0) { Variant index = psg->index; @@ -1055,7 +1055,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const } if (r_valid) - *r_valid = ce.error == Variant::CallError::CALL_OK; + *r_valid = ce.error == Callable::CallError::CALL_OK; return true; } @@ -1078,12 +1078,12 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia if (psg->index >= 0) { Variant index = psg->index; const Variant *arg[1] = { &index }; - Variant::CallError ce; + Callable::CallError ce; r_value = p_object->call(psg->getter, arg, 1, ce); } else { - Variant::CallError ce; + Callable::CallError ce; if (psg->_getptr) { r_value = psg->_getptr->call(p_object, NULL, 0, ce); @@ -1094,13 +1094,23 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia return true; } - const int *c = check->constant_map.getptr(p_property); + const int *c = check->constant_map.getptr(p_property); //constants count if (c) { r_value = *c; return true; } + if (check->method_map.has(p_property)) { //methods count + r_value = Callable(p_object, p_property); + return true; + } + + if (check->signal_map.has(p_property)) { //signals count + r_value = Signal(p_object, p_property); + return true; + } + check = check->inherits_ptr; } @@ -1410,10 +1420,7 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con cleanup_c = false; } else if (ClassDB::can_instance(p_class)) { c = ClassDB::instance(p_class); -#ifndef _MSC_VER -#warning FIXME: ObjectID refactoring broke GDScript handling of reference pointers, this needs a proper fix. -#endif - cleanup_c = (p_class != StringName("GDScript")); + cleanup_c = true; } if (c) { diff --git a/core/class_db.h b/core/class_db.h index 404b04f2d0..398eca9132 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -35,13 +35,15 @@ #include "core/object.h" #include "core/print_string.h" -/** To bind more then 6 parameters include this: +/** To bind more then 6 parameters include this: * #include "core/method_bind_ext.gen.inc" */ -#define DEFVAL(m_defval) (m_defval) +// Makes callable_mp readily available in all classes connecting signals. +// Needs to come after method_bind and object have been included. +#include "core/callable_method_pointer.h" -//#define SIMPLE_METHODDEF +#define DEFVAL(m_defval) (m_defval) #ifdef DEBUG_METHODS_ENABLED diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index ea84ded3b4..ed307fd3ac 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -279,8 +279,8 @@ StringName PHashTranslation::get_message(const StringName &p_src_text) const { void PHashTranslation::_get_property_list(List<PropertyInfo> *p_list) const { - p_list->push_back(PropertyInfo(Variant::PACKED_INT_ARRAY, "hash_table")); - p_list->push_back(PropertyInfo(Variant::PACKED_INT_ARRAY, "bucket_table")); + p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "hash_table")); + p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "bucket_table")); p_list->push_back(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "strings")); p_list->push_back(PropertyInfo(Variant::OBJECT, "load_from", PROPERTY_HINT_RESOURCE_TYPE, "Translation", PROPERTY_USAGE_EDITOR)); } diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp index bafb800e41..253d5f1acb 100644 --- a/core/core_string_names.cpp +++ b/core/core_string_names.cpp @@ -70,5 +70,9 @@ CoreStringNames::CoreStringNames() : r8(StaticCString::create("r8")), g8(StaticCString::create("g8")), b8(StaticCString::create("b8")), - a8(StaticCString::create("a8")) { + a8(StaticCString::create("a8")), + call(StaticCString::create("call")), + call_deferred(StaticCString::create("call_deferred")), + emit(StaticCString::create("emit")), + notification(StaticCString::create("notification")) { } diff --git a/core/core_string_names.h b/core/core_string_names.h index a507a20935..42416d3f75 100644 --- a/core/core_string_names.h +++ b/core/core_string_names.h @@ -90,6 +90,11 @@ public: StringName g8; StringName b8; StringName a8; + + StringName call; + StringName call_deferred; + StringName emit; + StringName notification; }; #endif // SCENE_STRING_NAMES_H diff --git a/core/func_ref.cpp b/core/func_ref.cpp index e20188c813..338c17946b 100644 --- a/core/func_ref.cpp +++ b/core/func_ref.cpp @@ -30,16 +30,16 @@ #include "func_ref.h" -Variant FuncRef::call_func(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant FuncRef::call_func(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (id.is_null()) { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); } Object *obj = ObjectDB::get_instance(id); if (!obj) { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); } diff --git a/core/func_ref.h b/core/func_ref.h index 1d1ca47ad7..8cb3be6e61 100644 --- a/core/func_ref.h +++ b/core/func_ref.h @@ -43,7 +43,7 @@ protected: static void _bind_methods(); public: - Variant call_func(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant call_func(const Variant **p_args, int p_argcount, Callable::CallError &r_error); Variant call_funcv(const Array &p_args); void set_instance(Object *p_obj); void set_function(const StringName &p_func); diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 94713b4ee6..0945240c1f 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -92,9 +92,6 @@ VARIANT_ENUM_CAST(JoystickList); VARIANT_ENUM_CAST(MidiMessageList); void register_global_constants() { - - //{ KEY_BACKSPACE, VK_BACK },// (0x08) // backspace - BIND_GLOBAL_ENUM_CONSTANT(MARGIN_LEFT); BIND_GLOBAL_ENUM_CONSTANT(MARGIN_TOP); BIND_GLOBAL_ENUM_CONSTANT(MARGIN_RIGHT); @@ -116,7 +113,7 @@ void register_global_constants() { BIND_GLOBAL_ENUM_CONSTANT(VALIGN_CENTER); BIND_GLOBAL_ENUM_CONSTANT(VALIGN_BOTTOM); - // hueg list of keys + // huge list of keys BIND_GLOBAL_CONSTANT(SPKEY); BIND_GLOBAL_ENUM_CONSTANT(KEY_ESCAPE); @@ -594,28 +591,36 @@ void register_global_constants() { BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NIL", Variant::NIL); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BOOL", Variant::BOOL); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT); - BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::REAL); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::FLOAT); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING", Variant::STRING); - BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2); // 5 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2I", Variant::VECTOR2I); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT2", Variant::RECT2); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT2I", Variant::RECT2I); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3", Variant::VECTOR3); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3I", Variant::VECTOR3I); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM2D", Variant::TRANSFORM2D); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_PLANE", Variant::PLANE); - BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_QUAT", Variant::QUAT); // 10 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_QUAT", Variant::QUAT); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_AABB", Variant::AABB); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BASIS", Variant::BASIS); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM", Variant::TRANSFORM); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR", Variant::COLOR); - BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NODE_PATH", Variant::NODE_PATH); // 15 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_NAME", Variant::STRING_NAME); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NODE_PATH", Variant::NODE_PATH); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RID", Variant::_RID); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_OBJECT", Variant::OBJECT); - BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY); // 20 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_CALLABLE", Variant::CALLABLE); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_SIGNAL", Variant::SIGNAL); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_ARRAY", Variant::ARRAY); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RAW_ARRAY", Variant::PACKED_BYTE_ARRAY); - BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT_ARRAY", Variant::PACKED_INT_ARRAY); - BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL_ARRAY", Variant::PACKED_REAL_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT32_ARRAY", Variant::PACKED_INT32_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT64_ARRAY", Variant::PACKED_INT64_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_FLOAT32_ARRAY", Variant::PACKED_FLOAT32_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_FLOAT64_ARRAY", Variant::PACKED_FLOAT64_ARRAY); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_ARRAY", Variant::PACKED_STRING_ARRAY); - BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2_ARRAY", Variant::PACKED_VECTOR2_ARRAY); // 25 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2_ARRAY", Variant::PACKED_VECTOR2_ARRAY); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3_ARRAY", Variant::PACKED_VECTOR3_ARRAY); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR_ARRAY", Variant::PACKED_COLOR_ARRAY); BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_MAX", Variant::VARIANT_MAX); diff --git a/core/io/dtls_server.cpp b/core/io/dtls_server.cpp index aa302ced8f..07e6abb1c9 100644 --- a/core/io/dtls_server.cpp +++ b/core/io/dtls_server.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/dtls_server.h b/core/io/dtls_server.h index ebef13da64..7b08138f7f 100644 --- a/core/io/dtls_server.h +++ b/core/io/dtls_server.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/json.cpp b/core/io/json.cpp index 08a147032f..3a0edceb81 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -70,9 +70,11 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_ case Variant::NIL: return "null"; case Variant::BOOL: return p_var.operator bool() ? "true" : "false"; case Variant::INT: return itos(p_var); - case Variant::REAL: return rtos(p_var); - case Variant::PACKED_INT_ARRAY: - case Variant::PACKED_REAL_ARRAY: + case Variant::FLOAT: return rtos(p_var); + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: case Variant::PACKED_STRING_ARRAY: case Variant::ARRAY: { diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 6548faac9f..fbcaa582b7 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -147,7 +147,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int } } break; - case Variant::REAL: { + case Variant::FLOAT: { if (type & ENCODE_FLAG_64) { ERR_FAIL_COND_V(len < 8, ERR_INVALID_DATA); @@ -186,7 +186,19 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int if (r_len) (*r_len) += 4 * 2; - } break; // 5 + } break; + case Variant::VECTOR2I: { + + ERR_FAIL_COND_V(len < 4 * 2, ERR_INVALID_DATA); + Vector2i val; + val.x = decode_uint32(&buf[0]); + val.y = decode_uint32(&buf[4]); + r_variant = val; + + if (r_len) + (*r_len) += 4 * 2; + + } break; case Variant::RECT2: { ERR_FAIL_COND_V(len < 4 * 4, ERR_INVALID_DATA); @@ -201,6 +213,20 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int (*r_len) += 4 * 4; } break; + case Variant::RECT2I: { + + ERR_FAIL_COND_V(len < 4 * 4, ERR_INVALID_DATA); + Rect2i val; + val.position.x = decode_uint32(&buf[0]); + val.position.y = decode_uint32(&buf[4]); + val.size.x = decode_uint32(&buf[8]); + val.size.y = decode_uint32(&buf[12]); + r_variant = val; + + if (r_len) + (*r_len) += 4 * 4; + + } break; case Variant::VECTOR3: { ERR_FAIL_COND_V(len < 4 * 3, ERR_INVALID_DATA); @@ -214,6 +240,19 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int (*r_len) += 4 * 3; } break; + case Variant::VECTOR3I: { + + ERR_FAIL_COND_V(len < 4 * 3, ERR_INVALID_DATA); + Vector3i val; + val.x = decode_uint32(&buf[0]); + val.y = decode_uint32(&buf[4]); + val.z = decode_uint32(&buf[8]); + r_variant = val; + + if (r_len) + (*r_len) += 4 * 3; + + } break; case Variant::TRANSFORM2D: { ERR_FAIL_COND_V(len < 4 * 6, ERR_INVALID_DATA); @@ -328,6 +367,16 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int (*r_len) += 4 * 4; } break; + case Variant::STRING_NAME: { + + String str; + Error err = _decode_string(buf, len, r_len, str); + if (err) + return err; + r_variant = StringName(str); + + } break; + case Variant::NODE_PATH: { ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); @@ -455,6 +504,15 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int } } break; + case Variant::CALLABLE: { + + r_variant = Callable(); + } break; + case Variant::SIGNAL: { + + r_variant = Signal(); + } break; + case Variant::DICTIONARY: { ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); @@ -563,7 +621,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int } } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); int32_t count = decode_uint32(buf); @@ -572,12 +630,12 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int ERR_FAIL_MUL_OF(count, 4, ERR_INVALID_DATA); ERR_FAIL_COND_V(count < 0 || count * 4 > len, ERR_INVALID_DATA); - Vector<int> data; + Vector<int32_t> data; if (count) { //const int*rbuf=(const int*)buf; data.resize(count); - int *w = data.ptrw(); + int32_t *w = data.ptrw(); for (int32_t i = 0; i < count; i++) { w[i] = decode_uint32(&buf[i * 4]); @@ -585,11 +643,37 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int } r_variant = Variant(data); if (r_len) { - (*r_len) += 4 + count * sizeof(int); + (*r_len) += 4 + count * sizeof(int32_t); } } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_INT64_ARRAY: { + + ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); + int64_t count = decode_uint64(buf); + buf += 4; + len -= 4; + ERR_FAIL_MUL_OF(count, 8, ERR_INVALID_DATA); + ERR_FAIL_COND_V(count < 0 || count * 8 > len, ERR_INVALID_DATA); + + Vector<int64_t> data; + + if (count) { + //const int*rbuf=(const int*)buf; + data.resize(count); + int64_t *w = data.ptrw(); + for (int64_t i = 0; i < count; i++) { + + w[i] = decode_uint64(&buf[i * 8]); + } + } + r_variant = Variant(data); + if (r_len) { + (*r_len) += 4 + count * sizeof(int64_t); + } + + } break; + case Variant::PACKED_FLOAT32_ARRAY: { ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); int32_t count = decode_uint32(buf); @@ -616,6 +700,33 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int } } break; + case Variant::PACKED_FLOAT64_ARRAY: { + + ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); + int64_t count = decode_uint64(buf); + buf += 4; + len -= 4; + ERR_FAIL_MUL_OF(count, 8, ERR_INVALID_DATA); + ERR_FAIL_COND_V(count < 0 || count * 8 > len, ERR_INVALID_DATA); + + Vector<double> data; + + if (count) { + //const double*rbuf=(const double*)buf; + data.resize(count); + double *w = data.ptrw(); + for (int64_t i = 0; i < count; i++) { + + w[i] = decode_double(&buf[i * 8]); + } + } + r_variant = data; + + if (r_len) { + (*r_len) += 4 + count * sizeof(double); + } + + } break; case Variant::PACKED_STRING_ARRAY: { ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); @@ -793,7 +904,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo flags |= ENCODE_FLAG_64; } } break; - case Variant::REAL: { + case Variant::FLOAT: { double d = p_variant; float f = d; @@ -860,7 +971,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo r_len += 4; } } break; - case Variant::REAL: { + case Variant::FLOAT: { if (flags & ENCODE_FLAG_64) { if (buf) { @@ -930,6 +1041,11 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo _encode_string(p_variant, buf, r_len); } break; + case Variant::STRING_NAME: { + + _encode_string(p_variant, buf, r_len); + + } break; // math types case Variant::VECTOR2: { @@ -942,7 +1058,18 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo r_len += 2 * 4; - } break; // 5 + } break; + case Variant::VECTOR2I: { + + if (buf) { + Vector2i v2 = p_variant; + encode_uint32(v2.x, &buf[0]); + encode_uint32(v2.y, &buf[4]); + } + + r_len += 2 * 4; + + } break; case Variant::RECT2: { if (buf) { @@ -955,6 +1082,18 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo r_len += 4 * 4; } break; + case Variant::RECT2I: { + + if (buf) { + Rect2i r2 = p_variant; + encode_uint32(r2.position.x, &buf[0]); + encode_uint32(r2.position.y, &buf[4]); + encode_uint32(r2.size.x, &buf[8]); + encode_uint32(r2.size.y, &buf[12]); + } + r_len += 4 * 4; + + } break; case Variant::VECTOR3: { if (buf) { @@ -967,6 +1106,18 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo r_len += 3 * 4; } break; + case Variant::VECTOR3I: { + + if (buf) { + Vector3i v3 = p_variant; + encode_uint32(v3.x, &buf[0]); + encode_uint32(v3.y, &buf[4]); + encode_uint32(v3.z, &buf[8]); + } + + r_len += 3 * 4; + + } break; case Variant::TRANSFORM2D: { if (buf) { @@ -1075,6 +1226,12 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo case Variant::_RID: { } break; + case Variant::CALLABLE: { + + } break; + case Variant::SIGNAL: { + + } break; case Variant::OBJECT: { if (p_full_objects) { @@ -1229,33 +1386,50 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo } } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { - Vector<int> data = p_variant; + Vector<int32_t> data = p_variant; int datalen = data.size(); int datasize = sizeof(int32_t); if (buf) { encode_uint32(datalen, buf); buf += 4; - const int *r = data.ptr(); - for (int i = 0; i < datalen; i++) + const int32_t *r = data.ptr(); + for (int32_t i = 0; i < datalen; i++) encode_uint32(r[i], &buf[i * datasize]); } r_len += 4 + datalen * datasize; } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_INT64_ARRAY: { - Vector<real_t> data = p_variant; + Vector<int64_t> data = p_variant; int datalen = data.size(); - int datasize = sizeof(real_t); + int datasize = sizeof(int64_t); + + if (buf) { + encode_uint64(datalen, buf); + buf += 4; + const int64_t *r = data.ptr(); + for (int64_t i = 0; i < datalen; i++) + encode_uint64(r[i], &buf[i * datasize]); + } + + r_len += 4 + datalen * datasize; + + } break; + case Variant::PACKED_FLOAT32_ARRAY: { + + Vector<float> data = p_variant; + int datalen = data.size(); + int datasize = sizeof(float); if (buf) { encode_uint32(datalen, buf); buf += 4; - const real_t *r = data.ptr(); + const float *r = data.ptr(); for (int i = 0; i < datalen; i++) encode_float(r[i], &buf[i * datasize]); } @@ -1263,6 +1437,23 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo r_len += 4 + datalen * datasize; } break; + case Variant::PACKED_FLOAT64_ARRAY: { + + Vector<double> data = p_variant; + int datalen = data.size(); + int datasize = sizeof(double); + + if (buf) { + encode_uint32(datalen, buf); + buf += 4; + const double *r = data.ptr(); + for (int i = 0; i < datalen; i++) + encode_double(r[i], &buf[i * datasize]); + } + + r_len += 4 + datalen * datasize; + + } break; case Variant::PACKED_STRING_ARRAY: { Vector<String> data = p_variant; diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index abe629ecba..2aef0a3274 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -34,6 +34,10 @@ #include "scene/main/node.h" #include <stdint.h> +#define NODE_ID_COMPRESSION_SHIFT 3 +#define NAME_ID_COMPRESSION_SHIFT 5 +#define BYTE_ONLY_OR_NO_ARGS_SHIFT 6 + #ifdef DEBUG_ENABLED #include "core/os/os.h" #endif @@ -51,7 +55,7 @@ _FORCE_INLINE_ bool _should_call_local(MultiplayerAPI::RPCMode mode, bool is_mas case MultiplayerAPI::RPC_MODE_MASTERSYNC: { if (is_master) r_skip_rpc = true; // I am the master, so skip remote call. - FALLTHROUGH; + [[fallthrough]]; } case MultiplayerAPI::RPC_MODE_REMOTESYNC: case MultiplayerAPI::RPC_MODE_PUPPETSYNC: { @@ -145,22 +149,22 @@ void MultiplayerAPI::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_pee "Supplied NetworkedMultiplayerPeer must be connecting or connected."); if (network_peer.is_valid()) { - network_peer->disconnect("peer_connected", this, "_add_peer"); - network_peer->disconnect("peer_disconnected", this, "_del_peer"); - network_peer->disconnect("connection_succeeded", this, "_connected_to_server"); - network_peer->disconnect("connection_failed", this, "_connection_failed"); - network_peer->disconnect("server_disconnected", this, "_server_disconnected"); + network_peer->disconnect_compat("peer_connected", this, "_add_peer"); + network_peer->disconnect_compat("peer_disconnected", this, "_del_peer"); + network_peer->disconnect_compat("connection_succeeded", this, "_connected_to_server"); + network_peer->disconnect_compat("connection_failed", this, "_connection_failed"); + network_peer->disconnect_compat("server_disconnected", this, "_server_disconnected"); clear(); } network_peer = p_peer; if (network_peer.is_valid()) { - network_peer->connect("peer_connected", this, "_add_peer"); - network_peer->connect("peer_disconnected", this, "_del_peer"); - network_peer->connect("connection_succeeded", this, "_connected_to_server"); - network_peer->connect("connection_failed", this, "_connection_failed"); - network_peer->connect("server_disconnected", this, "_server_disconnected"); + network_peer->connect_compat("peer_connected", this, "_add_peer"); + network_peer->connect_compat("peer_disconnected", this, "_del_peer"); + network_peer->connect_compat("connection_succeeded", this, "_connected_to_server"); + network_peer->connect_compat("connection_failed", this, "_connection_failed"); + network_peer->connect_compat("server_disconnected", this, "_server_disconnected"); } } @@ -168,6 +172,16 @@ Ref<NetworkedMultiplayerPeer> MultiplayerAPI::get_network_peer() const { return network_peer; } +// Returns the packet size stripping the node path added when the node is not yet cached. +int get_packet_len(uint32_t p_node_target, int p_packet_len) { + if (p_node_target & 0x80000000) { + int ofs = p_node_target & 0x7FFFFFFF; + return p_packet_len - (p_packet_len - ofs); + } else { + return p_packet_len; + } +} + void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_packet_len) { ERR_FAIL_COND_MSG(root_node == NULL, "Multiplayer root node was not initialized. If you are using custom multiplayer, remember to set the root node via MultiplayerAPI.set_root_node before using it."); @@ -204,8 +218,8 @@ void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_ int name_id_offset = 1; ERR_FAIL_COND_MSG(p_packet_len < packet_min_size, "Invalid packet received. Size too small."); // Compute the meta size, which depends on the compression level. - int node_id_compression = (p_packet[0] & 24) >> 3; - int name_id_compression = (p_packet[0] & 32) >> 5; + int node_id_compression = (p_packet[0] & 24) >> NODE_ID_COMPRESSION_SHIFT; + int name_id_compression = (p_packet[0] & 32) >> NAME_ID_COMPRESSION_SHIFT; switch (node_id_compression) { case NETWORK_NODE_ID_COMPRESSION_8: @@ -250,6 +264,7 @@ void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_ // Unreachable, checked before. CRASH_NOW(); } + Node *node = _process_get_node(p_from, p_packet, node_target, p_packet_len); ERR_FAIL_COND_MSG(node == NULL, "Invalid packet received. Requested node was not found."); @@ -266,13 +281,14 @@ void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_ CRASH_NOW(); } + const int packet_len = get_packet_len(node_target, p_packet_len); if (packet_type == NETWORK_COMMAND_REMOTE_CALL) { - _process_rpc(node, name_id, p_from, p_packet, p_packet_len, packet_min_size); + _process_rpc(node, name_id, p_from, p_packet, packet_len, packet_min_size); } else { - _process_rset(node, name_id, p_from, p_packet, p_packet_len, packet_min_size); + _process_rset(node, name_id, p_from, p_packet, packet_len, packet_min_size); } } break; @@ -326,7 +342,7 @@ Node *MultiplayerAPI::_process_get_node(int p_from, const uint8_t *p_packet, uin void MultiplayerAPI::_process_rpc(Node *p_node, const uint16_t p_rpc_method_id, int p_from, const uint8_t *p_packet, int p_packet_len, int p_offset) { - ERR_FAIL_COND_MSG(p_offset >= p_packet_len, "Invalid packet received. Size too small."); + ERR_FAIL_COND_MSG(p_offset > p_packet_len, "Invalid packet received. Size too small."); // Check that remote can call the RPC on this node. StringName name = p_node->get_node_rpc_method(p_rpc_method_id); @@ -340,14 +356,30 @@ void MultiplayerAPI::_process_rpc(Node *p_node, const uint16_t p_rpc_method_id, bool can_call = _can_call_mode(p_node, rpc_mode, p_from); ERR_FAIL_COND_MSG(!can_call, "RPC '" + String(name) + "' is not allowed on node " + p_node->get_path() + " from: " + itos(p_from) + ". Mode is " + itos((int)rpc_mode) + ", master is " + itos(p_node->get_network_master()) + "."); - int argc = p_packet[p_offset]; + int argc = 0; + bool byte_only = false; + + const bool byte_only_or_no_args = ((p_packet[0] & 64) >> BYTE_ONLY_OR_NO_ARGS_SHIFT) == 1; + if (byte_only_or_no_args) { + if (p_offset < p_packet_len) { + // This packet contains only bytes. + argc = 1; + byte_only = true; + } else { + // This rpc calls a method without parameters. + } + } else { + // Normal variant, takes the argument count from the packet. + ERR_FAIL_COND_MSG(p_offset >= p_packet_len, "Invalid packet received. Size too small."); + argc = p_packet[p_offset]; + p_offset += 1; + } + Vector<Variant> args; Vector<const Variant *> argp; args.resize(argc); argp.resize(argc); - p_offset++; - #ifdef DEBUG_ENABLED if (profiling) { ObjectID id = p_node->get_instance_id(); @@ -356,22 +388,32 @@ void MultiplayerAPI::_process_rpc(Node *p_node, const uint16_t p_rpc_method_id, } #endif - for (int i = 0; i < argc; i++) { + if (byte_only) { + Vector<uint8_t> pure_data; + const int len = p_packet_len - p_offset; + pure_data.resize(len); + memcpy(pure_data.ptrw(), &p_packet[p_offset], len); + args.write[0] = pure_data; + argp.write[0] = &args[0]; + p_offset += len; + } else { + for (int i = 0; i < argc; i++) { - ERR_FAIL_COND_MSG(p_offset >= p_packet_len, "Invalid packet received. Size too small."); + ERR_FAIL_COND_MSG(p_offset >= p_packet_len, "Invalid packet received. Size too small."); - int vlen; - Error err = _decode_and_decompress_variant(args.write[i], &p_packet[p_offset], p_packet_len - p_offset, &vlen); - ERR_FAIL_COND_MSG(err != OK, "Invalid packet received. Unable to decode RPC argument."); + int vlen; + Error err = _decode_and_decompress_variant(args.write[i], &p_packet[p_offset], p_packet_len - p_offset, &vlen); + ERR_FAIL_COND_MSG(err != OK, "Invalid packet received. Unable to decode RPC argument."); - argp.write[i] = &args[i]; - p_offset += vlen; + argp.write[i] = &args[i]; + p_offset += vlen; + } } - Variant::CallError ce; + Callable::CallError ce; p_node->call(name, (const Variant **)argp.ptr(), argc, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { String error = Variant::get_call_error_text(p_node, name, (const Variant **)argp.ptr(), argc, ce); error = "RPC - " + error; ERR_PRINT(error); @@ -742,10 +784,12 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p // - `NetworkCommands` in the first three bits. // - `NetworkNodeIdCompression` in the next 2 bits. // - `NetworkNameIdCompression` in the next 1 bit. - // - So we still have the last two bits free! + // - `byte_only_or_no_args` in the next 1 bit. + // - So we still have the last bit free! uint8_t command_type = p_set ? NETWORK_COMMAND_REMOTE_SET : NETWORK_COMMAND_REMOTE_CALL; uint8_t node_id_compression = UINT8_MAX; uint8_t name_id_compression = UINT8_MAX; + bool byte_only_or_no_args = false; MAKE_ROOM(1); // The meta is composed along the way, so just set 0 for now. @@ -835,17 +879,28 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p ofs += 2; } - // Call arguments. - MAKE_ROOM(ofs + 1); - packet_cache.write[ofs] = p_argcount; - ofs += 1; - for (int i = 0; i < p_argcount; i++) { - int len(0); - Error err = _encode_and_compress_variant(*p_arg[i], NULL, len); - ERR_FAIL_COND_MSG(err != OK, "Unable to encode RPC argument. THIS IS LIKELY A BUG IN THE ENGINE!"); - MAKE_ROOM(ofs + len); - _encode_and_compress_variant(*p_arg[i], &(packet_cache.write[ofs]), len); - ofs += len; + if (p_argcount == 0) { + byte_only_or_no_args = true; + } else if (p_argcount == 1 && p_arg[0]->get_type() == Variant::PACKED_BYTE_ARRAY) { + byte_only_or_no_args = true; + // Special optimization when only the byte vector is sent. + const Vector<uint8_t> data = *p_arg[0]; + MAKE_ROOM(ofs + data.size()); + copymem(&(packet_cache.write[ofs]), data.ptr(), sizeof(uint8_t) * data.size()); + ofs += data.size(); + } else { + // Arguments + MAKE_ROOM(ofs + 1); + packet_cache.write[ofs] = p_argcount; + ofs += 1; + for (int i = 0; i < p_argcount; i++) { + int len(0); + Error err = _encode_and_compress_variant(*p_arg[i], NULL, len); + ERR_FAIL_COND_MSG(err != OK, "Unable to encode RPC argument. THIS IS LIKELY A BUG IN THE ENGINE!"); + MAKE_ROOM(ofs + len); + _encode_and_compress_variant(*p_arg[i], &(packet_cache.write[ofs]), len); + ofs += len; + } } } @@ -854,7 +909,7 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p ERR_FAIL_COND(name_id_compression > 1); // We can now set the meta - packet_cache.write[0] = command_type + (node_id_compression << 3) + (name_id_compression << 5); + packet_cache.write[0] = command_type + (node_id_compression << NODE_ID_COMPRESSION_SHIFT) + (name_id_compression << NAME_ID_COMPRESSION_SHIFT) + ((byte_only_or_no_args ? 1 : 0) << BYTE_ONLY_OR_NO_ARGS_SHIFT); #ifdef DEBUG_ENABLED if (profiling) { @@ -989,10 +1044,10 @@ void MultiplayerAPI::rpcp(Node *p_node, int p_peer_id, bool p_unreliable, const if (call_local_native) { int temp_id = rpc_sender_id; rpc_sender_id = get_network_unique_id(); - Variant::CallError ce; + Callable::CallError ce; p_node->call(p_method, p_arg, p_argcount, ce); rpc_sender_id = temp_id; - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { String error = Variant::get_call_error_text(p_node, p_method, p_arg, p_argcount, ce); error = "rpc() aborted in local call: - " + error + "."; ERR_PRINT(error); @@ -1003,11 +1058,11 @@ void MultiplayerAPI::rpcp(Node *p_node, int p_peer_id, bool p_unreliable, const if (call_local_script) { int temp_id = rpc_sender_id; rpc_sender_id = get_network_unique_id(); - Variant::CallError ce; - ce.error = Variant::CallError::CALL_OK; + Callable::CallError ce; + ce.error = Callable::CallError::CALL_OK; p_node->get_script_instance()->call(p_method, p_arg, p_argcount, ce); rpc_sender_id = temp_id; - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { String error = Variant::get_call_error_text(p_node, p_method, p_arg, p_argcount, ce); error = "rpc() aborted in script local call: - " + error + "."; ERR_PRINT(error); diff --git a/core/io/packet_peer_dtls.cpp b/core/io/packet_peer_dtls.cpp index 64007c7e3b..01218a6881 100644 --- a/core/io/packet_peer_dtls.cpp +++ b/core/io/packet_peer_dtls.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/packet_peer_dtls.h b/core/io/packet_peer_dtls.h index b7cabb6ae0..4f9f4535bc 100644 --- a/core/io/packet_peer_dtls.h +++ b/core/io/packet_peer_dtls.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index d4c1fd2e9b..8c343a0f43 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -46,7 +46,7 @@ enum { VARIANT_NIL = 1, VARIANT_BOOL = 2, VARIANT_INT = 3, - VARIANT_REAL = 4, + VARIANT_FLOAT = 4, VARIANT_STRING = 5, VARIANT_VECTOR2 = 10, VARIANT_RECT2 = 11, @@ -65,14 +65,22 @@ enum { VARIANT_DICTIONARY = 26, VARIANT_ARRAY = 30, VARIANT_RAW_ARRAY = 31, - VARIANT_INT_ARRAY = 32, - VARIANT_REAL_ARRAY = 33, + VARIANT_INT32_ARRAY = 32, + VARIANT_FLOAT32_ARRAY = 33, VARIANT_STRING_ARRAY = 34, VARIANT_VECTOR3_ARRAY = 35, VARIANT_COLOR_ARRAY = 36, VARIANT_VECTOR2_ARRAY = 37, VARIANT_INT64 = 40, VARIANT_DOUBLE = 41, + VARIANT_CALLABLE = 42, + VARIANT_SIGNAL = 43, + VARIANT_STRING_NAME = 44, + VARIANT_VECTOR2I = 45, + VARIANT_RECT2I = 46, + VARIANT_VECTOR3I = 47, + VARIANT_INT64_ARRAY = 48, + VARIANT_FLOAT64_ARRAY = 49, OBJECT_EMPTY = 0, OBJECT_EXTERNAL_RESOURCE = 1, OBJECT_INTERNAL_RESOURCE = 2, @@ -136,7 +144,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { r_v = int64_t(f->get_64()); } break; - case VARIANT_REAL: { + case VARIANT_FLOAT: { r_v = f->get_real(); } break; @@ -156,6 +164,14 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { r_v = v; } break; + case VARIANT_VECTOR2I: { + + Vector2i v; + v.x = f->get_32(); + v.y = f->get_32(); + r_v = v; + + } break; case VARIANT_RECT2: { Rect2 v; @@ -166,6 +182,16 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { r_v = v; } break; + case VARIANT_RECT2I: { + + Rect2i v; + v.position.x = f->get_32(); + v.position.y = f->get_32(); + v.size.x = f->get_32(); + v.size.y = f->get_32(); + r_v = v; + + } break; case VARIANT_VECTOR3: { Vector3 v; @@ -174,6 +200,14 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { v.z = f->get_real(); r_v = v; } break; + case VARIANT_VECTOR3I: { + + Vector3i v; + v.x = f->get_32(); + v.y = f->get_32(); + v.z = f->get_32(); + r_v = v; + } break; case VARIANT_PLANE: { Plane v; @@ -258,6 +292,10 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { r_v = v; } break; + case VARIANT_STRING_NAME: { + + r_v = StringName(get_unicode_string()); + } break; case VARIANT_NODE_PATH: { @@ -363,6 +401,15 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { } } break; + case VARIANT_CALLABLE: { + + r_v = Callable(); + } break; + case VARIANT_SIGNAL: { + + r_v = Signal(); + } break; + case VARIANT_DICTIONARY: { uint32_t len = f->get_32(); @@ -407,14 +454,14 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { r_v = array; } break; - case VARIANT_INT_ARRAY: { + case VARIANT_INT32_ARRAY: { uint32_t len = f->get_32(); - Vector<int> array; + Vector<int32_t> array; array.resize(len); - int *w = array.ptrw(); - f->get_buffer((uint8_t *)w, len * 4); + int32_t *w = array.ptrw(); + f->get_buffer((uint8_t *)w, len * sizeof(int32_t)); #ifdef BIG_ENDIAN_ENABLED { uint32_t *ptr = (uint32_t *)w.ptr(); @@ -428,14 +475,35 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { r_v = array; } break; - case VARIANT_REAL_ARRAY: { + case VARIANT_INT64_ARRAY: { + + uint32_t len = f->get_32(); + + Vector<int64_t> array; + array.resize(len); + int64_t *w = array.ptrw(); + f->get_buffer((uint8_t *)w, len * sizeof(int64_t)); +#ifdef BIG_ENDIAN_ENABLED + { + uint64_t *ptr = (uint64_t *)w.ptr(); + for (int i = 0; i < len; i++) { + + ptr[i] = BSWAP64(ptr[i]); + } + } + +#endif + + r_v = array; + } break; + case VARIANT_FLOAT32_ARRAY: { uint32_t len = f->get_32(); - Vector<real_t> array; + Vector<float> array; array.resize(len); - real_t *w = array.ptrw(); - f->get_buffer((uint8_t *)w, len * sizeof(real_t)); + float *w = array.ptrw(); + f->get_buffer((uint8_t *)w, len * sizeof(float)); #ifdef BIG_ENDIAN_ENABLED { uint32_t *ptr = (uint32_t *)w.ptr(); @@ -449,6 +517,27 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { r_v = array; } break; + case VARIANT_FLOAT64_ARRAY: { + + uint32_t len = f->get_32(); + + Vector<double> array; + array.resize(len); + double *w = array.ptrw(); + f->get_buffer((uint8_t *)w, len * sizeof(double)); +#ifdef BIG_ENDIAN_ENABLED + { + uint64_t *ptr = (uint64_t *)w.ptr(); + for (int i = 0; i < len; i++) { + + ptr[i] = BSWAP64(ptr[i]); + } + } + +#endif + + r_v = array; + } break; case VARIANT_STRING_ARRAY: { uint32_t len = f->get_32(); @@ -1248,7 +1337,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia } } break; - case Variant::REAL: { + case Variant::FLOAT: { double d = p_property; float fl = d; @@ -1257,7 +1346,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia f->store_double(d); } else { - f->store_32(VARIANT_REAL); + f->store_32(VARIANT_FLOAT); f->store_real(fl); } @@ -1277,6 +1366,14 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia f->store_real(val.y); } break; + case Variant::VECTOR2I: { + + f->store_32(VARIANT_VECTOR2I); + Vector2i val = p_property; + f->store_32(val.x); + f->store_32(val.y); + + } break; case Variant::RECT2: { f->store_32(VARIANT_RECT2); @@ -1287,6 +1384,16 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia f->store_real(val.size.y); } break; + case Variant::RECT2I: { + + f->store_32(VARIANT_RECT2I); + Rect2i val = p_property; + f->store_32(val.position.x); + f->store_32(val.position.y); + f->store_32(val.size.x); + f->store_32(val.size.y); + + } break; case Variant::VECTOR3: { f->store_32(VARIANT_VECTOR3); @@ -1296,6 +1403,15 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia f->store_real(val.z); } break; + case Variant::VECTOR3I: { + + f->store_32(VARIANT_VECTOR3I); + Vector3i val = p_property; + f->store_32(val.x); + f->store_32(val.y); + f->store_32(val.z); + + } break; case Variant::PLANE: { f->store_32(VARIANT_PLANE); @@ -1383,6 +1499,13 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia f->store_real(val.a); } break; + case Variant::STRING_NAME: { + + f->store_32(VARIANT_STRING_NAME); + String val = p_property; + save_unicode_string(f, val); + + } break; case Variant::NODE_PATH: { f->store_32(VARIANT_NODE_PATH); @@ -1440,6 +1563,17 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia } } break; + case Variant::CALLABLE: { + + f->store_32(VARIANT_CALLABLE); + WARN_PRINT("Can't save Callables."); + } break; + case Variant::SIGNAL: { + + f->store_32(VARIANT_SIGNAL); + WARN_PRINT("Can't save Signals."); + } break; + case Variant::DICTIONARY: { f->store_32(VARIANT_DICTIONARY); @@ -1483,29 +1617,52 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia _pad_buffer(f, len); } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { - f->store_32(VARIANT_INT_ARRAY); - Vector<int> arr = p_property; + f->store_32(VARIANT_INT32_ARRAY); + Vector<int32_t> arr = p_property; int len = arr.size(); f->store_32(len); - const int *r = arr.ptr(); + const int32_t *r = arr.ptr(); for (int i = 0; i < len; i++) f->store_32(r[i]); } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_INT64_ARRAY: { + + f->store_32(VARIANT_INT64_ARRAY); + Vector<int64_t> arr = p_property; + int len = arr.size(); + f->store_32(len); + const int64_t *r = arr.ptr(); + for (int i = 0; i < len; i++) + f->store_64(r[i]); + + } break; + case Variant::PACKED_FLOAT32_ARRAY: { - f->store_32(VARIANT_REAL_ARRAY); - Vector<real_t> arr = p_property; + f->store_32(VARIANT_FLOAT32_ARRAY); + Vector<float> arr = p_property; int len = arr.size(); f->store_32(len); - const real_t *r = arr.ptr(); + const float *r = arr.ptr(); for (int i = 0; i < len; i++) { f->store_real(r[i]); } } break; + case Variant::PACKED_FLOAT64_ARRAY: { + + f->store_32(VARIANT_FLOAT64_ARRAY); + Vector<double> arr = p_property; + int len = arr.size(); + f->store_32(len); + const double *r = arr.ptr(); + for (int i = 0; i < len; i++) { + f->store_double(r[i]); + } + + } break; case Variant::PACKED_STRING_ARRAY: { f->store_32(VARIANT_STRING_ARRAY); diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 1d5d8f9280..39bbebefa6 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -248,7 +248,7 @@ void ResourceFormatLoader::_bind_methods() { } ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::PACKED_STRING_ARRAY, "get_recognized_extensions")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "handles_type", PropertyInfo(Variant::STRING, "typename"))); + ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "handles_type", PropertyInfo(Variant::STRING_NAME, "typename"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_resource_type", PropertyInfo(Variant::STRING, "path"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo("get_dependencies", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::STRING, "add_types"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "rename_dependencies", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::STRING, "renames"))); diff --git a/core/io/udp_server.cpp b/core/io/udp_server.cpp index f041bf097f..16b7863cdd 100644 --- a/core/io/udp_server.cpp +++ b/core/io/udp_server.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/udp_server.h b/core/io/udp_server.h index 5182a04246..90bb82b62b 100644 --- a/core/io/udp_server.h +++ b/core/io/udp_server.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/make_binders.py b/core/make_binders.py index 11cfbf6e79..c42b91fbe5 100644 --- a/core/make_binders.py +++ b/core/make_binders.py @@ -32,22 +32,22 @@ public: return T::get_class_static(); } - virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { + virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Callable::CallError& r_error) { T *instance=Object::cast_to<T>(p_object); - r_error.error=Variant::CallError::CALL_OK; + r_error.error=Callable::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { - r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error=Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { - r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error=Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } @@ -126,23 +126,23 @@ public: return type_name; } - virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { + virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Callable::CallError& r_error) { __UnexistingClass *instance = (__UnexistingClass*)p_object; - r_error.error=Variant::CallError::CALL_OK; + r_error.error=Callable::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { - r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error=Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { - r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error=Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } @@ -223,22 +223,22 @@ public: return T::get_class_static(); } - virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { + virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Callable::CallError& r_error) { T *instance=Object::cast_to<T>(p_object); - r_error.error=Variant::CallError::CALL_OK; + r_error.error=Callable::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED ERR_FAIL_COND_V(!instance,Variant()); if (p_arg_count>get_argument_count()) { - r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error=Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument=get_argument_count(); return Variant(); } if (p_arg_count<(get_argument_count()-get_default_argument_count())) { - r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error=Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument=get_argument_count()-get_default_argument_count(); return Variant(); } diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index b26903e45a..847d4d8681 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -576,8 +576,8 @@ void AStar::_bind_methods() { ClassDB::bind_method(D_METHOD("get_point_path", "from_id", "to_id"), &AStar::get_point_path); ClassDB::bind_method(D_METHOD("get_id_path", "from_id", "to_id"), &AStar::get_id_path); - BIND_VMETHOD(MethodInfo(Variant::REAL, "_estimate_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id"))); - BIND_VMETHOD(MethodInfo(Variant::REAL, "_compute_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id"))); + BIND_VMETHOD(MethodInfo(Variant::FLOAT, "_estimate_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id"))); + BIND_VMETHOD(MethodInfo(Variant::FLOAT, "_compute_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id"))); } AStar::AStar() { diff --git a/core/math/expression.cpp b/core/math/expression.cpp index c7229ef688..058673b681 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -208,16 +208,16 @@ int Expression::get_func_argument_count(BuiltinFunc p_func) { return 0; } -#define VALIDATE_ARG_NUM(m_arg) \ - if (!p_inputs[m_arg]->is_num()) { \ - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; \ - r_error.argument = m_arg; \ - r_error.expected = Variant::REAL; \ - return; \ +#define VALIDATE_ARG_NUM(m_arg) \ + if (!p_inputs[m_arg]->is_num()) { \ + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \ + r_error.argument = m_arg; \ + r_error.expected = Variant::FLOAT; \ + return; \ } -void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Variant::CallError &r_error, String &r_error_str) { - r_error.error = Variant::CallError::CALL_OK; +void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Callable::CallError &r_error, String &r_error_str) { + r_error.error = Callable::CallError::CALL_OK; switch (p_func) { case MATH_SIN: { @@ -314,15 +314,15 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant int64_t i = *p_inputs[0]; *r_return = ABS(i); - } else if (p_inputs[0]->get_type() == Variant::REAL) { + } else if (p_inputs[0]->get_type() == Variant::FLOAT) { real_t r = *p_inputs[0]; *r_return = Math::abs(r); } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::REAL; + r_error.expected = Variant::FLOAT; } } break; case MATH_SIGN: { @@ -331,15 +331,15 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant int64_t i = *p_inputs[0]; *r_return = i < 0 ? -1 : (i > 0 ? +1 : 0); - } else if (p_inputs[0]->get_type() == Variant::REAL) { + } else if (p_inputs[0]->get_type() == Variant::FLOAT) { real_t r = *p_inputs[0]; *r_return = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0); } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::REAL; + r_error.expected = Variant::FLOAT; } } break; case MATH_POW: { @@ -580,7 +580,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant if (p_inputs[0]->get_type() != Variant::OBJECT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; @@ -614,7 +614,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant if (p_inputs[0]->get_type() != Variant::OBJECT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; @@ -622,7 +622,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant } if (p_inputs[1]->get_type() != Variant::STRING && p_inputs[1]->get_type() != Variant::NODE_PATH) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::STRING; @@ -644,7 +644,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant if (type < 0 || type >= Variant::VARIANT_MAX) { r_error_str = RTR("Invalid type argument to convert(), use TYPE_* constants."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::INT; return; @@ -675,7 +675,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant if (p_inputs[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; @@ -687,7 +687,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant if (str.length() != 1) { r_error_str = RTR("Expected a string of length 1 (a character)."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; @@ -732,7 +732,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant case STR_TO_VAR: { if (p_inputs[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; @@ -747,7 +747,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant Error err = VariantParser::parse(&ss, *r_return, errs, line); if (err != OK) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; *r_return = "Parse error at line " + itos(line) + ": " + errs; @@ -762,7 +762,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant int len; Error err = encode_variant(*p_inputs[0], NULL, len, full_objects); if (err) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::NIL; r_error_str = "Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID)."; @@ -779,7 +779,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant case BYTES_TO_VAR: { if (p_inputs[0]->get_type() != Variant::PACKED_BYTE_ARRAY) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::PACKED_BYTE_ARRAY; @@ -794,7 +794,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant Error err = decode_variant(ret, r, varr.size(), NULL, allow_objects); if (err != OK) { r_error_str = RTR("Not enough bytes for decoding bytes, or invalid format."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::PACKED_BYTE_ARRAY; return; @@ -1161,7 +1161,7 @@ Error Expression::_get_token(Token &r_token) { if (is_float) r_token.value = num.to_double(); else - r_token.value = num.to_int(); + r_token.value = num.to_int64(); return OK; } else if ((cchar >= 'A' && cchar <= 'Z') || (cchar >= 'a' && cchar <= 'z') || cchar == '_') { @@ -2071,10 +2071,10 @@ bool Expression::_execute(const Array &p_inputs, Object *p_instance, Expression: argp.write[i] = &arr[i]; } - Variant::CallError ce; + Callable::CallError ce; r_ret = Variant::construct(constructor->data_type, (const Variant **)argp.ptr(), argp.size(), ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { r_error_str = vformat(RTR("Invalid arguments to construct '%s'"), Variant::get_type_name(constructor->data_type)); return true; } @@ -2099,10 +2099,10 @@ bool Expression::_execute(const Array &p_inputs, Object *p_instance, Expression: argp.write[i] = &arr[i]; } - Variant::CallError ce; + Callable::CallError ce; exec_func(bifunc->func, (const Variant **)argp.ptr(), &r_ret, ce, r_error_str); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { r_error_str = "Builtin Call Failed. " + r_error_str; return true; } @@ -2134,10 +2134,10 @@ bool Expression::_execute(const Array &p_inputs, Object *p_instance, Expression: argp.write[i] = &arr[i]; } - Variant::CallError ce; + Callable::CallError ce; r_ret = base.call(call->method, (const Variant **)argp.ptr(), argp.size(), ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { r_error_str = vformat(RTR("On call to '%s':"), String(call->method)); return true; } diff --git a/core/math/expression.h b/core/math/expression.h index 1cd1415dcf..bbf946bb0a 100644 --- a/core/math/expression.h +++ b/core/math/expression.h @@ -111,7 +111,7 @@ public: static int get_func_argument_count(BuiltinFunc p_func); static String get_func_name(BuiltinFunc p_func); - static void exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Variant::CallError &r_error, String &r_error_str); + static void exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Callable::CallError &r_error, String &r_error_str); static BuiltinFunc find_function(const String &p_string); private: diff --git a/core/math/rect2.h b/core/math/rect2.h index 0d2e7eb6e5..e4ea615c22 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -387,6 +387,11 @@ struct Rect2i { size = end - begin; } + _FORCE_INLINE_ Rect2i abs() const { + + return Rect2i(Point2i(position.x + MIN(size.x, 0), position.y + MIN(size.y, 0)), size.abs()); + } + operator String() const { return String(position) + ", " + String(size); } operator Rect2() const { return Rect2(position, size); } diff --git a/core/math/vector2.h b/core/math/vector2.h index 1dec830821..ba5558102f 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -311,10 +311,15 @@ struct Vector2i { bool operator<(const Vector2i &p_vec2) const { return (x == p_vec2.x) ? (y < p_vec2.y) : (x < p_vec2.x); } bool operator>(const Vector2i &p_vec2) const { return (x == p_vec2.x) ? (y > p_vec2.y) : (x > p_vec2.x); } + bool operator<=(const Vector2i &p_vec2) const { return x == p_vec2.x ? (y <= p_vec2.y) : (x < p_vec2.x); } + bool operator>=(const Vector2i &p_vec2) const { return x == p_vec2.x ? (y >= p_vec2.y) : (x > p_vec2.x); } + bool operator==(const Vector2i &p_vec2) const; bool operator!=(const Vector2i &p_vec2) const; - real_t get_aspect() const { return width / (real_t)height; } + real_t aspect() const { return width / (real_t)height; } + Vector2i sign() const { return Vector2i(SGN(x), SGN(y)); } + Vector2i abs() const { return Vector2i(ABS(x), ABS(y)); } operator String() const { return String::num(x) + ", " + String::num(y); } diff --git a/core/message_queue.cpp b/core/message_queue.cpp index 42390935d4..235003627e 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -30,6 +30,7 @@ #include "message_queue.h" +#include "core/core_string_names.h" #include "core/project_settings.h" #include "core/script_language.h" @@ -42,37 +43,7 @@ MessageQueue *MessageQueue::get_singleton() { Error MessageQueue::push_call(ObjectID p_id, const StringName &p_method, const Variant **p_args, int p_argcount, bool p_show_error) { - _THREAD_SAFE_METHOD_ - - int room_needed = sizeof(Message) + sizeof(Variant) * p_argcount; - - if ((buffer_end + room_needed) >= buffer_size) { - String type; - if (ObjectDB::get_instance(p_id)) - type = ObjectDB::get_instance(p_id)->get_class(); - print_line("Failed method: " + type + ":" + p_method + " target ID: " + itos(p_id)); - statistics(); - ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_kb' in project settings."); - } - - Message *msg = memnew_placement(&buffer[buffer_end], Message); - msg->args = p_argcount; - msg->instance_id = p_id; - msg->target = p_method; - msg->type = TYPE_CALL; - if (p_show_error) - msg->type |= FLAG_SHOW_ERROR; - - buffer_end += sizeof(Message); - - for (int i = 0; i < p_argcount; i++) { - - Variant *v = memnew_placement(&buffer[buffer_end], Variant); - buffer_end += sizeof(Variant); - *v = *p_args[i]; - } - - return OK; + return push_callable(Callable(p_id, p_method), p_args, p_argcount, p_show_error); } Error MessageQueue::push_call(ObjectID p_id, const StringName &p_method, VARIANT_ARG_DECLARE) { @@ -107,8 +78,7 @@ Error MessageQueue::push_set(ObjectID p_id, const StringName &p_prop, const Vari Message *msg = memnew_placement(&buffer[buffer_end], Message); msg->args = 1; - msg->instance_id = p_id; - msg->target = p_prop; + msg->callable = Callable(p_id, p_prop); msg->type = TYPE_SET; buffer_end += sizeof(Message); @@ -137,7 +107,7 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) { Message *msg = memnew_placement(&buffer[buffer_end], Message); msg->type = TYPE_NOTIFICATION; - msg->instance_id = p_id; + msg->callable = Callable(p_id, CoreStringNames::get_singleton()->notification); //name is meaningless but callable needs it //msg->target; msg->notification = p_notification; @@ -160,18 +130,49 @@ Error MessageQueue::push_set(Object *p_object, const StringName &p_prop, const V return push_set(p_object->get_instance_id(), p_prop, p_value); } +Error MessageQueue::push_callable(const Callable &p_callable, const Variant **p_args, int p_argcount, bool p_show_error) { + + _THREAD_SAFE_METHOD_ + + int room_needed = sizeof(Message) + sizeof(Variant) * p_argcount; + + if ((buffer_end + room_needed) >= buffer_size) { + print_line("Failed method: " + p_callable); + statistics(); + ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_kb' in project settings."); + } + + Message *msg = memnew_placement(&buffer[buffer_end], Message); + msg->args = p_argcount; + msg->callable = p_callable; + msg->type = TYPE_CALL; + if (p_show_error) + msg->type |= FLAG_SHOW_ERROR; + + buffer_end += sizeof(Message); + + for (int i = 0; i < p_argcount; i++) { + + Variant *v = memnew_placement(&buffer[buffer_end], Variant); + buffer_end += sizeof(Variant); + *v = *p_args[i]; + } + + return OK; +} + void MessageQueue::statistics() { Map<StringName, int> set_count; Map<int, int> notify_count; - Map<StringName, int> call_count; + Map<Callable, int> call_count; int null_count = 0; uint32_t read_pos = 0; while (read_pos < buffer_end) { Message *message = (Message *)&buffer[read_pos]; - Object *target = ObjectDB::get_instance(message->instance_id); + Object *target = message->callable.get_object(); if (target != NULL) { @@ -179,10 +180,10 @@ void MessageQueue::statistics() { case TYPE_CALL: { - if (!call_count.has(message->target)) - call_count[message->target] = 0; + if (!call_count.has(message->callable)) + call_count[message->callable] = 0; - call_count[message->target]++; + call_count[message->callable]++; } break; case TYPE_NOTIFICATION: { @@ -195,10 +196,11 @@ void MessageQueue::statistics() { } break; case TYPE_SET: { - if (!set_count.has(message->target)) - set_count[message->target] = 0; + StringName t = message->callable.get_method(); + if (!set_count.has(t)) + set_count[t] = 0; - set_count[message->target]++; + set_count[t]++; } break; } @@ -222,7 +224,7 @@ void MessageQueue::statistics() { print_line("SET " + E->key() + ": " + itos(E->get())); } - for (Map<StringName, int>::Element *E = call_count.front(); E; E = E->next()) { + for (Map<Callable, int>::Element *E = call_count.front(); E; E = E->next()) { print_line("CALL " + E->key() + ": " + itos(E->get())); } @@ -236,7 +238,7 @@ int MessageQueue::get_max_buffer_usage() const { return buffer_max_used; } -void MessageQueue::_call_function(Object *p_target, const StringName &p_func, const Variant *p_args, int p_argcount, bool p_show_error) { +void MessageQueue::_call_function(const Callable &p_callable, const Variant *p_args, int p_argcount, bool p_show_error) { const Variant **argptrs = NULL; if (p_argcount) { @@ -246,11 +248,12 @@ void MessageQueue::_call_function(Object *p_target, const StringName &p_func, co } } - Variant::CallError ce; - p_target->call(p_func, argptrs, p_argcount, ce); - if (p_show_error && ce.error != Variant::CallError::CALL_OK) { + Callable::CallError ce; + Variant ret; + p_callable.call(argptrs, p_argcount, ret, ce); + if (p_show_error && ce.error != Callable::CallError::CALL_OK) { - ERR_PRINT("Error calling deferred method: " + Variant::get_call_error_text(p_target, p_func, argptrs, p_argcount, ce) + "."); + ERR_PRINT("Error calling deferred method: " + Variant::get_callable_error_text(p_callable, argptrs, p_argcount, ce) + "."); } } @@ -283,7 +286,7 @@ void MessageQueue::flush() { _THREAD_SAFE_UNLOCK_ - Object *target = ObjectDB::get_instance(message->instance_id); + Object *target = message->callable.get_object(); if (target != NULL) { @@ -294,7 +297,7 @@ void MessageQueue::flush() { // messages don't expect a return value - _call_function(target, message->target, args, message->args, message->type & FLAG_SHOW_ERROR); + _call_function(message->callable, args, message->args, message->type & FLAG_SHOW_ERROR); } break; case TYPE_NOTIFICATION: { @@ -307,7 +310,7 @@ void MessageQueue::flush() { Variant *arg = (Variant *)(message + 1); // messages don't expect a return value - target->set(message->target, *arg); + target->set(message->callable.get_method(), *arg); } break; } diff --git a/core/message_queue.h b/core/message_queue.h index e9a92ff5b7..9ba748bb42 100644 --- a/core/message_queue.h +++ b/core/message_queue.h @@ -54,8 +54,7 @@ class MessageQueue { struct Message { - ObjectID instance_id; - StringName target; + Callable callable; int16_t type; union { int16_t notification; @@ -68,7 +67,7 @@ class MessageQueue { uint32_t buffer_max_used; uint32_t buffer_size; - void _call_function(Object *p_target, const StringName &p_func, const Variant *p_args, int p_argcount, bool p_show_error); + void _call_function(const Callable &p_callable, const Variant *p_args, int p_argcount, bool p_show_error); static MessageQueue *singleton; @@ -81,6 +80,7 @@ public: Error push_call(ObjectID p_id, const StringName &p_method, VARIANT_ARG_LIST); Error push_notification(ObjectID p_id, int p_notification); Error push_set(ObjectID p_id, const StringName &p_prop, const Variant &p_value); + Error push_callable(const Callable &p_callable, const Variant **p_args, int p_argcount, bool p_show_error = false); Error push_call(Object *p_object, const StringName &p_method, VARIANT_ARG_LIST); Error push_notification(Object *p_object, int p_notification); diff --git a/core/method_bind.h b/core/method_bind.h index 1860d227f7..726ce512f8 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -31,19 +31,18 @@ #ifndef METHOD_BIND_H #define METHOD_BIND_H +#ifdef DEBUG_ENABLED +#define DEBUG_METHODS_ENABLED +#endif + #include "core/list.h" #include "core/method_ptrcall.h" #include "core/object.h" +#include "core/type_info.h" #include "core/variant.h" #include <stdio.h> -#ifdef DEBUG_ENABLED -#define DEBUG_METHODS_ENABLED -#endif - -#include "core/type_info.h" - enum MethodFlags { METHOD_FLAG_NORMAL = 1, @@ -155,7 +154,7 @@ struct VariantObjectClassChecker<Control *> { Variant::Type argtype = get_argument_type(m_arg - 1); \ if (!Variant::can_convert_strict(p_args[m_arg - 1]->get_type(), argtype) || \ !VariantObjectClassChecker<P##m_arg>::check(*p_args[m_arg - 1])) { \ - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; \ + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \ r_error.argument = m_arg - 1; \ r_error.expected = argtype; \ return Variant(); \ @@ -278,7 +277,7 @@ public: _FORCE_INLINE_ int get_argument_count() const { return argument_count; }; - virtual Variant call(Object *p_object, const Variant **p_args, int p_arg_count, Variant::CallError &r_error) = 0; + virtual Variant call(Object *p_object, const Variant **p_args, int p_arg_count, Callable::CallError &r_error) = 0; #ifdef PTRCALL_ENABLED virtual void ptrcall(Object *p_object, const void **p_args, void *r_ret) = 0; @@ -300,7 +299,7 @@ public: template <class T> class MethodBindVarArg : public MethodBind { public: - typedef Variant (T::*NativeCall)(const Variant **, int, Variant::CallError &); + typedef Variant (T::*NativeCall)(const Variant **, int, Callable::CallError &); protected: NativeCall call_method; @@ -338,7 +337,7 @@ public: } #endif - virtual Variant call(Object *p_object, const Variant **p_args, int p_arg_count, Variant::CallError &r_error) { + virtual Variant call(Object *p_object, const Variant **p_args, int p_arg_count, Callable::CallError &r_error) { T *instance = static_cast<T *>(p_object); return (instance->*call_method)(p_args, p_arg_count, r_error); @@ -389,7 +388,7 @@ public: }; template <class T> -MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, int, Variant::CallError &), const MethodInfo &p_info, bool p_return_nil_is_variant) { +MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, int, Callable::CallError &), const MethodInfo &p_info, bool p_return_nil_is_variant) { MethodBindVarArg<T> *a = memnew((MethodBindVarArg<T>)); a->set_method(p_method); diff --git a/core/method_ptrcall.h b/core/method_ptrcall.h index 6ccf41229f..3db186ca69 100644 --- a/core/method_ptrcall.h +++ b/core/method_ptrcall.h @@ -125,13 +125,18 @@ MAKE_PTRARG_BY_REFERENCE(AABB); MAKE_PTRARG_BY_REFERENCE(Basis); MAKE_PTRARG_BY_REFERENCE(Transform); MAKE_PTRARG_BY_REFERENCE(Color); +MAKE_PTRARG(StringName); MAKE_PTRARG(NodePath); MAKE_PTRARG(RID); MAKE_PTRARG(Dictionary); +MAKE_PTRARG(Callable); +MAKE_PTRARG(Signal); MAKE_PTRARG(Array); MAKE_PTRARG(PackedByteArray); -MAKE_PTRARG(PackedIntArray); -MAKE_PTRARG(PackedRealArray); +MAKE_PTRARG(PackedInt32Array); +MAKE_PTRARG(PackedInt64Array); +MAKE_PTRARG(PackedFloat32Array); +MAKE_PTRARG(PackedFloat64Array); MAKE_PTRARG(PackedStringArray); MAKE_PTRARG(PackedVector2Array); MAKE_PTRARG(PackedVector3Array); @@ -371,29 +376,7 @@ MAKE_VECARR(Plane); } \ } -//MAKE_DVECARR(Plane); -//for special case StringName - -#define MAKE_STRINGCONV(m_type) \ - template <> \ - struct PtrToArg<m_type> { \ - _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \ - m_type s = *reinterpret_cast<const String *>(p_ptr); \ - return s; \ - } \ - _FORCE_INLINE_ static void encode(m_type p_vec, void *p_ptr) { \ - String *arr = reinterpret_cast<String *>(p_ptr); \ - *arr = p_vec; \ - } \ - }; \ - \ - template <> \ - struct PtrToArg<const m_type &> { \ - _FORCE_INLINE_ static m_type convert(const void *p_ptr) { \ - m_type s = *reinterpret_cast<const String *>(p_ptr); \ - return s; \ - } \ - } +// Special case for IP_Address. #define MAKE_STRINGCONV_BY_REFERENCE(m_type) \ template <> \ @@ -416,7 +399,6 @@ MAKE_VECARR(Plane); } \ } -MAKE_STRINGCONV(StringName); MAKE_STRINGCONV_BY_REFERENCE(IP_Address); template <> diff --git a/core/node_path.h b/core/node_path.h index 5439658910..05b6d844ff 100644 --- a/core/node_path.h +++ b/core/node_path.h @@ -54,15 +54,6 @@ class NodePath { void _update_hash_cache() const; public: - _FORCE_INLINE_ StringName get_sname() const { - - if (data && data->path.size() == 1 && data->subpath.empty()) { - return data->path[0]; - } else { - return operator String(); - } - } - bool is_absolute() const; int get_name_count() const; StringName get_name(int p_idx) const; diff --git a/core/object.cpp b/core/object.cpp index 0a7a46a7d2..140ee811fe 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -335,10 +335,8 @@ MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const Pr Object::Connection::operator Variant() const { Dictionary d; - d["source"] = source; d["signal"] = signal; - d["target"] = target; - d["method"] = method; + d["callable"] = callable; d["flags"] = flags; d["binds"] = binds; return d; @@ -346,34 +344,19 @@ Object::Connection::operator Variant() const { bool Object::Connection::operator<(const Connection &p_conn) const { - if (source == p_conn.source) { - - if (signal == p_conn.signal) { - - if (target == p_conn.target) { - - return method < p_conn.method; - } else { - - return target < p_conn.target; - } - } else - return signal < p_conn.signal; + if (signal == p_conn.signal) { + return callable < p_conn.callable; } else { - return source < p_conn.source; + return signal < p_conn.signal; } } Object::Connection::Connection(const Variant &p_variant) { Dictionary d = p_variant; - if (d.has("source")) - source = d["source"]; if (d.has("signal")) signal = d["signal"]; - if (d.has("target")) - target = d["target"]; - if (d.has("method")) - method = d["method"]; + if (d.has("callable")) + callable = d["callable"]; if (d.has("flags")) flags = d["flags"]; if (d.has("binds")) @@ -655,18 +638,18 @@ void Object::get_method_list(List<MethodInfo> *p_list) const { } } -Variant Object::_call_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant Object::_call_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 0; return Variant(); } - if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + if (p_args[0]->get_type() != Variant::STRING_NAME && p_args[0]->get_type() != Variant::STRING) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::STRING; + r_error.expected = Variant::STRING_NAME; return Variant(); } @@ -675,22 +658,22 @@ Variant Object::_call_bind(const Variant **p_args, int p_argcount, Variant::Call return call(method, &p_args[1], p_argcount - 1, r_error); } -Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 0; return Variant(); } - if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + if (p_args[0]->get_type() != Variant::STRING_NAME && p_args[0]->get_type() != Variant::STRING) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::STRING; + r_error.expected = Variant::STRING_NAME; return Variant(); } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; StringName method = *p_args[0]; @@ -700,29 +683,29 @@ Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Vari } #ifdef DEBUG_ENABLED -static void _test_call_error(const StringName &p_func, const Variant::CallError &error) { +static void _test_call_error(const StringName &p_func, const Callable::CallError &error) { switch (error.error) { - case Variant::CallError::CALL_OK: - case Variant::CallError::CALL_ERROR_INVALID_METHOD: + case Callable::CallError::CALL_OK: + case Callable::CallError::CALL_ERROR_INVALID_METHOD: break; - case Variant::CallError::CALL_ERROR_INVALID_ARGUMENT: { + case Callable::CallError::CALL_ERROR_INVALID_ARGUMENT: { - ERR_FAIL_MSG("Error calling function: " + String(p_func) + " - Invalid type for argument " + itos(error.argument) + ", expected " + Variant::get_type_name(error.expected) + "."); + ERR_FAIL_MSG("Error calling function: " + String(p_func) + " - Invalid type for argument " + itos(error.argument) + ", expected " + Variant::get_type_name(Variant::Type(error.expected)) + "."); break; } - case Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { + case Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { ERR_FAIL_MSG("Error calling function: " + String(p_func) + " - Too many arguments, expected " + itos(error.argument) + "."); break; } - case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { + case Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { ERR_FAIL_MSG("Error calling function: " + String(p_func) + " - Too few arguments, expected " + itos(error.argument) + "."); break; } - case Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL: + case Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL: break; } } @@ -749,7 +732,7 @@ void Object::call_multilevel(const StringName &p_method, const Variant **p_args, //Variant ret; OBJ_DEBUG_LOCK - Variant::CallError error; + Callable::CallError error; if (script_instance) { script_instance->call_multilevel(p_method, p_args, p_argcount); @@ -769,7 +752,7 @@ void Object::call_multilevel_reversed(const StringName &p_method, const Variant MethodBind *method = ClassDB::get_method(get_class_name(), p_method); - Variant::CallError error; + Callable::CallError error; OBJ_DEBUG_LOCK if (method) { @@ -823,9 +806,9 @@ Variant Object::callv(const StringName &p_method, const Array &p_args) { } } - Variant::CallError ce; + Callable::CallError ce; Variant ret = call(p_method, argptrs, p_args.size(), ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { ERR_FAIL_V_MSG(Variant(), "Error calling method from 'callv': " + Variant::get_call_error_text(this, p_method, argptrs, p_args.size(), ce) + "."); } return ret; @@ -842,7 +825,7 @@ Variant Object::call(const StringName &p_name, VARIANT_ARG_DECLARE) { argc++; } - Variant::CallError error; + Callable::CallError error; Variant ret = call(p_name, argptr, argc, error); return ret; @@ -859,38 +842,38 @@ void Object::call_multilevel(const StringName &p_name, VARIANT_ARG_DECLARE) { argc++; } - //Variant::CallError error; + //Callable::CallError error; call_multilevel(p_name, argptr, argc); } -Variant Object::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant Object::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; if (p_method == CoreStringNames::get_singleton()->_free) { //free must be here, before anything, always ready #ifdef DEBUG_ENABLED if (p_argcount != 0) { r_error.argument = 0; - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; return Variant(); } if (Object::cast_to<Reference>(this)) { r_error.argument = 0; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; ERR_FAIL_V_MSG(Variant(), "Can't 'free' a reference."); } if (_lock_index.get() > 1) { r_error.argument = 0; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; ERR_FAIL_V_MSG(Variant(), "Object is locked and can't be freed."); } #endif //must be here, must be before everything, memdelete(this); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; return Variant(); } @@ -901,15 +884,15 @@ Variant Object::call(const StringName &p_method, const Variant **p_args, int p_a //force jumptable switch (r_error.error) { - case Variant::CallError::CALL_OK: + case Callable::CallError::CALL_OK: return ret; - case Variant::CallError::CALL_ERROR_INVALID_METHOD: + case Callable::CallError::CALL_ERROR_INVALID_METHOD: break; - case Variant::CallError::CALL_ERROR_INVALID_ARGUMENT: - case Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: - case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: + case Callable::CallError::CALL_ERROR_INVALID_ARGUMENT: + case Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: + case Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: return ret; - case Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL: { + case Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL: { } } } @@ -917,10 +900,9 @@ Variant Object::call(const StringName &p_method, const Variant **p_args, int p_a MethodBind *method = ClassDB::get_method(get_class_name(), p_method); if (method) { - ret = method->call(this, p_args, p_argcount, r_error); } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; } return ret; @@ -1103,7 +1085,7 @@ void Object::add_user_signal(const MethodInfo &p_signal) { ERR_FAIL_COND_MSG(p_signal.name == "", "Signal name cannot be empty."); ERR_FAIL_COND_MSG(ClassDB::has_signal(get_class_name(), p_signal.name), "User signal's name conflicts with a built-in signal of '" + get_class_name() + "'."); ERR_FAIL_COND_MSG(signal_map.has(p_signal.name), "Trying to add already existing signal '" + p_signal.name + "'."); - Signal s; + SignalData s; s.user = p_signal; signal_map[p_signal.name] = s; } @@ -1118,23 +1100,22 @@ bool Object::_has_user_signal(const StringName &p_name) const { struct _ObjectSignalDisconnectData { StringName signal; - Object *target; - StringName method; + Callable callable; }; -Variant Object::_emit_signal(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant Object::_emit_signal(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; ERR_FAIL_COND_V(p_argcount < 1, Variant()); - if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + if (p_args[0]->get_type() != Variant::STRING_NAME && p_args[0]->get_type() != Variant::STRING) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::STRING; - ERR_FAIL_COND_V(p_args[0]->get_type() != Variant::STRING, Variant()); + r_error.expected = Variant::STRING_NAME; + ERR_FAIL_COND_V(p_args[0]->get_type() != Variant::STRING_NAME && p_args[0]->get_type() != Variant::STRING, Variant()); } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; StringName signal = *p_args[0]; @@ -1155,7 +1136,7 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int if (_block_signals) return ERR_CANT_ACQUIRE_RESOURCE; //no emit, signals blocked - Signal *s = signal_map.getptr(p_name); + SignalData *s = signal_map.getptr(p_name); if (!s) { #ifdef DEBUG_ENABLED bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_name); @@ -1171,7 +1152,7 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int //copy on write will ensure that disconnecting the signal or even deleting the object will not affect the signal calling. //this happens automatically and will not change the performance of calling. //awesome, isn't it? - VMap<Signal::Target, Signal::Slot> slot_map = s->slot_map; + VMap<Callable, SignalData::Slot> slot_map = s->slot_map; int ssize = slot_map.size(); @@ -1185,7 +1166,7 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int const Connection &c = slot_map.getv(i).conn; - Object *target = ObjectDB::get_instance(slot_map.getk(i)._id); + Object *target = c.callable.get_object(); if (!target) { // Target might have been deleted during signal callback, this is expected and OK. continue; @@ -1210,22 +1191,23 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int } if (c.flags & CONNECT_DEFERRED) { - MessageQueue::get_singleton()->push_call(target->get_instance_id(), c.method, args, argc, true); + MessageQueue::get_singleton()->push_callable(c.callable, args, argc, true); } else { - Variant::CallError ce; + Callable::CallError ce; _emitting = true; - target->call(c.method, args, argc, ce); + Variant ret; + c.callable.call(args, argc, ret, ce); _emitting = false; - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { #ifdef DEBUG_ENABLED if (c.flags & CONNECT_PERSIST && Engine::get_singleton()->is_editor_hint() && (script.is_null() || !Ref<Script>(script)->is_tool())) continue; #endif - if (ce.error == Variant::CallError::CALL_ERROR_INVALID_METHOD && !ClassDB::class_exists(target->get_class_name())) { + if (ce.error == Callable::CallError::CALL_ERROR_INVALID_METHOD && !ClassDB::class_exists(target->get_class_name())) { //most likely object is not initialized yet, do not throw error. } else { - ERR_PRINT("Error calling method from signal '" + String(p_name) + "': " + Variant::get_call_error_text(target, c.method, args, argc, ce) + "."); + ERR_PRINT("Error calling from signal '" + String(p_name) + "' to callable: " + Variant::get_callable_error_text(c.callable, args, argc, ce) + "."); err = ERR_METHOD_NOT_FOUND; } } @@ -1242,8 +1224,7 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int _ObjectSignalDisconnectData dd; dd.signal = p_name; - dd.target = target; - dd.method = c.method; + dd.callable = c.callable; disconnect_data.push_back(dd); } } @@ -1251,7 +1232,8 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int while (!disconnect_data.empty()) { const _ObjectSignalDisconnectData &dd = disconnect_data.front()->get(); - disconnect(dd.signal, dd.target, dd.method); + + _disconnect(dd.signal, dd.callable); disconnect_data.pop_front(); } @@ -1323,15 +1305,8 @@ Array Object::_get_signal_connection_list(const String &p_signal) const { for (List<Connection>::Element *E = conns.front(); E; E = E->next()) { Connection &c = E->get(); - if (c.signal == p_signal) { - Dictionary rc; - rc["signal"] = c.signal; - rc["method"] = c.method; - rc["source"] = c.source; - rc["target"] = c.target; - rc["binds"] = c.binds; - rc["flags"] = c.flags; - ret.push_back(rc); + if (c.signal.get_name() == p_signal) { + ret.push_back(c); } } @@ -1343,11 +1318,7 @@ Array Object::_get_incoming_connections() const { Array ret; int connections_amount = connections.size(); for (int idx_conn = 0; idx_conn < connections_amount; idx_conn++) { - Dictionary conn_data; - conn_data["source"] = connections[idx_conn].source; - conn_data["signal_name"] = connections[idx_conn].signal; - conn_data["method_name"] = connections[idx_conn].method; - ret.push_back(conn_data); + ret.push_back(connections[idx_conn]); } return ret; @@ -1381,7 +1352,7 @@ void Object::get_all_signal_connections(List<Connection> *p_connections) const { while ((S = signal_map.next(S))) { - const Signal *s = &signal_map[*S]; + const SignalData *s = &signal_map[*S]; for (int i = 0; i < s->slot_map.size(); i++) { @@ -1392,7 +1363,7 @@ void Object::get_all_signal_connections(List<Connection> *p_connections) const { void Object::get_signal_connection_list(const StringName &p_signal, List<Connection> *p_connections) const { - const Signal *s = signal_map.getptr(p_signal); + const SignalData *s = signal_map.getptr(p_signal); if (!s) return; //nothing @@ -1407,7 +1378,7 @@ int Object::get_persistent_signal_connection_count() const { while ((S = signal_map.next(S))) { - const Signal *s = &signal_map[*S]; + const SignalData *s = &signal_map[*S]; for (int i = 0; i < s->slot_map.size(); i++) { if (s->slot_map.getv(i).conn.flags & CONNECT_PERSIST) { @@ -1426,11 +1397,18 @@ void Object::get_signals_connected_to_this(List<Connection> *p_connections) cons } } -Error Object::connect(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector<Variant> &p_binds, uint32_t p_flags) { +Error Object::connect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector<Variant> &p_binds, uint32_t p_flags) { + + return connect(p_signal, Callable(p_to_object, p_to_method), p_binds, p_flags); +} +Error Object::connect(const StringName &p_signal, const Callable &p_callable, const Vector<Variant> &p_binds, uint32_t p_flags) { + + ERR_FAIL_COND_V(p_callable.is_null(), ERR_INVALID_PARAMETER); - ERR_FAIL_NULL_V(p_to_object, ERR_INVALID_PARAMETER); + Object *target_object = p_callable.get_object(); + ERR_FAIL_COND_V(!target_object, ERR_INVALID_PARAMETER); - Signal *s = signal_map.getptr(p_signal); + SignalData *s = signal_map.getptr(p_signal); if (!s) { bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal); //check in script @@ -1449,33 +1427,32 @@ Error Object::connect(const StringName &p_signal, Object *p_to_object, const Str #endif } - ERR_FAIL_COND_V_MSG(!signal_is_valid, ERR_INVALID_PARAMETER, "In Object of type '" + String(get_class()) + "': Attempt to connect nonexistent signal '" + p_signal + "' to method '" + p_to_object->get_class() + "." + p_to_method + "'."); + ERR_FAIL_COND_V_MSG(!signal_is_valid, ERR_INVALID_PARAMETER, "In Object of type '" + String(get_class()) + "': Attempt to connect nonexistent signal '" + p_signal + "' to callable '" + p_callable + "'."); - signal_map[p_signal] = Signal(); + signal_map[p_signal] = SignalData(); s = &signal_map[p_signal]; } - Signal::Target target(p_to_object->get_instance_id(), p_to_method); + Callable target = p_callable; + if (s->slot_map.has(target)) { if (p_flags & CONNECT_REFERENCE_COUNTED) { s->slot_map[target].reference_count++; return OK; } else { - ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Signal '" + p_signal + "' is already connected to given method '" + p_to_method + "' in that object."); + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Signal '" + p_signal + "' is already connected to given callable '" + p_callable + "' in that object."); } } - Signal::Slot slot; + SignalData::Slot slot; Connection conn; - conn.source = this; - conn.target = p_to_object; - conn.method = p_to_method; - conn.signal = p_signal; + conn.callable = target; + conn.signal = ::Signal(this, p_signal); conn.flags = p_flags; conn.binds = p_binds; slot.conn = conn; - slot.cE = p_to_object->connections.push_back(conn); + slot.cE = target_object->connections.push_back(conn); if (p_flags & CONNECT_REFERENCE_COUNTED) { slot.reference_count = 1; } @@ -1485,10 +1462,15 @@ Error Object::connect(const StringName &p_signal, Object *p_to_object, const Str return OK; } -bool Object::is_connected(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) const { +bool Object::is_connected_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) const { + + return is_connected(p_signal, Callable(p_to_object, p_to_method)); +} - ERR_FAIL_NULL_V(p_to_object, false); - const Signal *s = signal_map.getptr(p_signal); +bool Object::is_connected(const StringName &p_signal, const Callable &p_callable) const { + + ERR_FAIL_COND_V(p_callable.is_null(), false); + const SignalData *s = signal_map.getptr(p_signal); if (!s) { bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal); if (signal_is_valid) @@ -1500,28 +1482,35 @@ bool Object::is_connected(const StringName &p_signal, Object *p_to_object, const ERR_FAIL_V_MSG(false, "Nonexistent signal: " + p_signal + "."); } - Signal::Target target(p_to_object->get_instance_id(), p_to_method); + Callable target = p_callable; return s->slot_map.has(target); //const Map<Signal::Target,Signal::Slot>::Element *E = s->slot_map.find(target); //return (E!=NULL); } -void Object::disconnect(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) { +void Object::disconnect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) { - _disconnect(p_signal, p_to_object, p_to_method); + _disconnect(p_signal, Callable(p_to_object, p_to_method)); } -void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, bool p_force) { - ERR_FAIL_NULL(p_to_object); - Signal *s = signal_map.getptr(p_signal); - ERR_FAIL_COND_MSG(!s, vformat("Nonexistent signal '%s' in %s.", p_signal, to_string())); +void Object::disconnect(const StringName &p_signal, const Callable &p_callable) { + _disconnect(p_signal, p_callable); +} + +void Object::_disconnect(const StringName &p_signal, const Callable &p_callable, bool p_force) { + + ERR_FAIL_COND(p_callable.is_null()); - Signal::Target target(p_to_object->get_instance_id(), p_to_method); + Object *target_object = p_callable.get_object(); + ERR_FAIL_COND(!target_object); + + SignalData *s = signal_map.getptr(p_signal); + ERR_FAIL_COND_MSG(!s, vformat("Nonexistent signal '%s' in %s.", p_signal, to_string())); - ERR_FAIL_COND_MSG(!s->slot_map.has(target), "Disconnecting nonexistent signal '" + p_signal + "', slot: " + itos(target._id) + ":" + target.method + "."); + ERR_FAIL_COND_MSG(!s->slot_map.has(p_callable), "Disconnecting nonexistent signal '" + p_signal + "', callable: " + p_callable + "."); - Signal::Slot *slot = &s->slot_map[target]; + SignalData::Slot *slot = &s->slot_map[p_callable]; if (!p_force) { slot->reference_count--; // by default is zero, if it was not referenced it will go below it @@ -1530,8 +1519,8 @@ void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const } } - p_to_object->connections.erase(slot->cE); - s->slot_map.erase(target); + target_object->connections.erase(slot->cE); + s->slot_map.erase(p_callable); if (s->slot_map.empty() && ClassDB::has_signal(get_class_name(), p_signal)) { //not user signal, delete @@ -1680,7 +1669,7 @@ void Object::_bind_methods() { { MethodInfo mi; mi.name = "emit_signal"; - mi.arguments.push_back(PropertyInfo(Variant::STRING, "signal")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "signal")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "emit_signal", &Object::_emit_signal, mi, varray(), false); } @@ -1688,7 +1677,7 @@ void Object::_bind_methods() { { MethodInfo mi; mi.name = "call"; - mi.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call", &Object::_call_bind, mi); } @@ -1696,7 +1685,7 @@ void Object::_bind_methods() { { MethodInfo mi; mi.name = "call_deferred"; - mi.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_deferred", &Object::_call_deferred_bind, mi, varray(), false); } @@ -1711,9 +1700,9 @@ void Object::_bind_methods() { ClassDB::bind_method(D_METHOD("get_signal_connection_list", "signal"), &Object::_get_signal_connection_list); ClassDB::bind_method(D_METHOD("get_incoming_connections"), &Object::_get_incoming_connections); - ClassDB::bind_method(D_METHOD("connect", "signal", "target", "method", "binds", "flags"), &Object::connect, DEFVAL(Array()), DEFVAL(0)); - ClassDB::bind_method(D_METHOD("disconnect", "signal", "target", "method"), &Object::disconnect); - ClassDB::bind_method(D_METHOD("is_connected", "signal", "target", "method"), &Object::is_connected); + ClassDB::bind_method(D_METHOD("connect", "signal", "callable", "binds", "flags"), &Object::connect, DEFVAL(Array()), DEFVAL(0)); + ClassDB::bind_method(D_METHOD("disconnect", "signal", "callable"), &Object::disconnect); + ClassDB::bind_method(D_METHOD("is_connected", "signal", "callable"), &Object::is_connected); ClassDB::bind_method(D_METHOD("set_block_signals", "enable"), &Object::set_block_signals); ClassDB::bind_method(D_METHOD("is_blocking_signals"), &Object::is_blocking_signals); @@ -1730,9 +1719,9 @@ void Object::_bind_methods() { ADD_SIGNAL(MethodInfo("script_changed")); BIND_VMETHOD(MethodInfo("_notification", PropertyInfo(Variant::INT, "what"))); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "_set", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_set", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::NIL, "value"))); #ifdef TOOLS_ENABLED - MethodInfo miget("_get", PropertyInfo(Variant::STRING, "property")); + MethodInfo miget("_get", PropertyInfo(Variant::STRING_NAME, "property")); miget.return_val.name = "Variant"; miget.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; BIND_VMETHOD(miget); @@ -1830,7 +1819,7 @@ Variant::Type Object::get_static_property_type_indexed(const Vector<StringName> return Variant::NIL; } - Variant::CallError ce; + Callable::CallError ce; Variant check = Variant::construct(t, NULL, 0, ce); for (int i = 1; i < p_path.size(); i++) { @@ -1957,15 +1946,15 @@ Object::~Object() { while ((S = signal_map.next(NULL))) { - Signal *s = &signal_map[*S]; + SignalData *s = &signal_map[*S]; //brute force disconnect for performance int slot_count = s->slot_map.size(); - const VMap<Signal::Target, Signal::Slot>::Pair *slot_list = s->slot_map.get_array(); + const VMap<Callable, SignalData::Slot>::Pair *slot_list = s->slot_map.get_array(); for (int i = 0; i < slot_count; i++) { - slot_list[i].value.conn.target->connections.erase(slot_list[i].value.cE); + slot_list[i].value.conn.callable.get_object()->connections.erase(slot_list[i].value.cE); } signal_map.erase(*S); @@ -1975,7 +1964,7 @@ Object::~Object() { while (connections.size()) { Connection c = connections.front()->get(); - c.source->_disconnect(c.signal, c.target, c.method, true); + c.signal.get_object()->_disconnect(c.signal.get_name(), c.callable, true); } ObjectDB::remove_instance(this); diff --git a/core/object.h b/core/object.h index afbdbda814..dc7d49f534 100644 --- a/core/object.h +++ b/core/object.h @@ -413,18 +413,15 @@ public: struct Connection { - Object *source; - StringName signal; - Object *target; - StringName method; + ::Signal signal; + Callable callable; + uint32_t flags; Vector<Variant> binds; bool operator<(const Connection &p_conn) const; operator Variant() const; Connection() { - source = NULL; - target = NULL; flags = 0; } Connection(const Variant &p_variant); @@ -441,21 +438,7 @@ private: friend bool predelete_handler(Object *); friend void postinitialize_handler(Object *); - struct Signal { - - struct Target { - - ObjectID _id; - StringName method; - - _FORCE_INLINE_ bool operator<(const Target &p_target) const { return (_id == p_target._id) ? (method < p_target.method) : (_id < p_target._id); } - - Target(const ObjectID &p_id, const StringName &p_method) : - _id(p_id), - method(p_method) { - } - Target() { _id = ObjectID(); } - }; + struct SignalData { struct Slot { @@ -466,11 +449,11 @@ private: }; MethodInfo user; - VMap<Target, Slot> slot_map; - Signal() {} + VMap<Callable, Slot> slot_map; + SignalData() {} }; - HashMap<StringName, Signal> signal_map; + HashMap<StringName, SignalData> signal_map; List<Connection> connections; #ifdef DEBUG_ENABLED SafeRefCount _lock_index; @@ -496,7 +479,7 @@ private: void _add_user_signal(const String &p_name, const Array &p_args = Array()); bool _has_user_signal(const StringName &p_name) const; - Variant _emit_signal(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _emit_signal(const Variant **p_args, int p_argcount, Callable::CallError &r_error); Array _get_signal_list() const; Array _get_signal_connection_list(const String &p_signal) const; Array _get_incoming_connections() const; @@ -554,8 +537,8 @@ protected: //Variant _call_bind(const StringName& p_name, const Variant& p_arg1 = Variant(), const Variant& p_arg2 = Variant(), const Variant& p_arg3 = Variant(), const Variant& p_arg4 = Variant()); //void _call_deferred_bind(const StringName& p_name, const Variant& p_arg1 = Variant(), const Variant& p_arg2 = Variant(), const Variant& p_arg3 = Variant(), const Variant& p_arg4 = Variant()); - Variant _call_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error); - Variant _call_deferred_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _call_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); + Variant _call_deferred_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual const StringName *_get_class_namev() const { if (!_class_name) @@ -572,7 +555,7 @@ protected: friend class ClassDB; virtual void _validate_property(PropertyInfo &property) const; - void _disconnect(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, bool p_force = false); + void _disconnect(const StringName &p_signal, const Callable &p_callable, bool p_force = false); public: //should be protected, but bug in clang++ static void initialize_class(); @@ -670,7 +653,7 @@ public: bool has_method(const StringName &p_method) const; void get_method_list(List<MethodInfo> *p_list) const; Variant callv(const StringName &p_method, const Array &p_args); - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual void call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount); virtual void call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount); Variant call(const StringName &p_name, VARIANT_ARG_LIST); // C++ helper @@ -716,9 +699,13 @@ public: int get_persistent_signal_connection_count() const; void get_signals_connected_to_this(List<Connection> *p_connections) const; - Error connect(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector<Variant> &p_binds = Vector<Variant>(), uint32_t p_flags = 0); - void disconnect(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method); - bool is_connected(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) const; + Error connect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector<Variant> &p_binds = Vector<Variant>(), uint32_t p_flags = 0); + void disconnect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method); + bool is_connected_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method) const; + + Error connect(const StringName &p_signal, const Callable &p_callable, const Vector<Variant> &p_binds = Vector<Variant>(), uint32_t p_flags = 0); + void disconnect(const StringName &p_signal, const Callable &p_callable); + bool is_connected(const StringName &p_signal, const Callable &p_callable) const; void call_deferred(const StringName &p_method, VARIANT_ARG_LIST); void set_deferred(const StringName &p_property, const Variant &p_value); diff --git a/core/object_id.h b/core/object_id.h index 6ab1a3031a..63b0c27af8 100644 --- a/core/object_id.h +++ b/core/object_id.h @@ -1,3 +1,33 @@ +/*************************************************************************/ +/* object_id.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + #ifndef OBJECT_ID_H #define OBJECT_ID_H diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 2e863c9c76..3cb9c2c1c2 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -541,7 +541,7 @@ void InputEventMouseButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_doubleclick", "doubleclick"), &InputEventMouseButton::set_doubleclick); ClassDB::bind_method(D_METHOD("is_doubleclick"), &InputEventMouseButton::is_doubleclick); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "factor"), "set_factor", "get_factor"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "factor"), "set_factor", "get_factor"); ADD_PROPERTY(PropertyInfo(Variant::INT, "button_index"), "set_button_index", "get_button_index"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "doubleclick"), "set_doubleclick", "is_doubleclick"); @@ -702,7 +702,7 @@ void InputEventMouseMotion::_bind_methods() { ClassDB::bind_method(D_METHOD("get_speed"), &InputEventMouseMotion::get_speed); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "tilt"), "set_tilt", "get_tilt"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pressure"), "set_pressure", "get_pressure"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pressure"), "set_pressure", "get_pressure"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "relative"), "set_relative", "get_relative"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "speed"), "set_speed", "get_speed"); } @@ -780,7 +780,7 @@ void InputEventJoypadMotion::_bind_methods() { ClassDB::bind_method(D_METHOD("get_axis_value"), &InputEventJoypadMotion::get_axis_value); ADD_PROPERTY(PropertyInfo(Variant::INT, "axis"), "set_axis", "get_axis"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "axis_value"), "set_axis_value", "get_axis_value"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "axis_value"), "set_axis_value", "get_axis_value"); } InputEventJoypadMotion::InputEventJoypadMotion() { @@ -861,7 +861,7 @@ void InputEventJoypadButton::_bind_methods() { // ClassDB::bind_method(D_METHOD("is_pressed"), &InputEventJoypadButton::is_pressed); ADD_PROPERTY(PropertyInfo(Variant::INT, "button_index"), "set_button_index", "get_button_index"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pressure"), "set_pressure", "get_pressure"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pressure"), "set_pressure", "get_pressure"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed"); } @@ -1098,9 +1098,9 @@ void InputEventAction::_bind_methods() { // ClassDB::bind_method(D_METHOD("is_action", "name"), &InputEventAction::is_action); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "action"), "set_action", "get_action"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "action"), "set_action", "get_action"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_strength", "get_strength"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_strength", "get_strength"); } InputEventAction::InputEventAction() { @@ -1162,7 +1162,7 @@ void InputEventMagnifyGesture::_bind_methods() { ClassDB::bind_method(D_METHOD("set_factor", "factor"), &InputEventMagnifyGesture::set_factor); ClassDB::bind_method(D_METHOD("get_factor"), &InputEventMagnifyGesture::get_factor); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "factor"), "set_factor", "get_factor"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "factor"), "set_factor", "get_factor"); } InputEventMagnifyGesture::InputEventMagnifyGesture() { diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 61bcb7dd32..ab43ce4af7 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -44,8 +44,8 @@ void MainLoop::_bind_methods() { BIND_VMETHOD(MethodInfo("_input_event", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); BIND_VMETHOD(MethodInfo("_input_text", PropertyInfo(Variant::STRING, "text"))); BIND_VMETHOD(MethodInfo("_initialize")); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::REAL, "delta"))); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::REAL, "delta"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::FLOAT, "delta"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::FLOAT, "delta"))); BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::PACKED_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen"))); BIND_VMETHOD(MethodInfo("_finalize")); diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index ae5f89e870..b82a366ef2 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -225,12 +225,12 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd string_cache[s] = tmpdata.size(); - FALLTHROUGH; - }; + [[fallthrough]]; + } case Variant::NIL: case Variant::BOOL: case Variant::INT: - case Variant::REAL: + case Variant::FLOAT: case Variant::VECTOR2: case Variant::RECT2: case Variant::VECTOR3: @@ -241,12 +241,15 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd case Variant::BASIS: case Variant::TRANSFORM: case Variant::PACKED_BYTE_ARRAY: - case Variant::PACKED_INT_ARRAY: - case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: case Variant::PACKED_STRING_ARRAY: case Variant::PACKED_VECTOR2_ARRAY: case Variant::PACKED_VECTOR3_ARRAY: case Variant::PACKED_COLOR_ARRAY: + case Variant::STRING_NAME: case Variant::NODE_PATH: { uint32_t pos = tmpdata.size(); diff --git a/core/reference.h b/core/reference.h index b01e0035a7..fd42c4e537 100644 --- a/core/reference.h +++ b/core/reference.h @@ -38,7 +38,6 @@ class Reference : public Object { GDCLASS(Reference, Object); - friend class RefBase; SafeRefCount refcount; SafeRefCount refcount_init; @@ -170,9 +169,9 @@ public: return; } - Reference *r = Object::cast_to<Reference>(object); + T *r = Object::cast_to<T>(object); if (r && r->reference()) { - reference = static_cast<T *>(r); + reference = r; } } @@ -226,9 +225,9 @@ public: return; } - Reference *r = Object::cast_to<Reference>(object); + T *r = Object::cast_to<T>(object); if (r && r->reference()) { - reference = static_cast<T *>(r); + reference = r; } else { reference = nullptr; } diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 45b600a23d..bb017f43e5 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -99,6 +99,9 @@ extern void unregister_variant_methods(); void register_core_types() { + //consistency check + ERR_FAIL_COND(sizeof(Callable) > 16); + ObjectDB::setup(); ResourceCache::setup(); diff --git a/core/resource.cpp b/core/resource.cpp index 30e09716aa..2afc9e4042 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -423,7 +423,7 @@ void Resource::_bind_methods() { ADD_GROUP("Resource", "resource_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "resource_local_to_scene"), "set_local_to_scene", "is_local_to_scene"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "resource_path", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_path", "get_path"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "resource_name"), "set_name", "get_name"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "resource_name"), "set_name", "get_name"); BIND_VMETHOD(MethodInfo("_setup_local_to_scene")); } diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp new file mode 100644 index 0000000000..fdb6135edd --- /dev/null +++ b/core/script_debugger_remote.cpp @@ -0,0 +1,1145 @@ +/*************************************************************************/ +/* script_debugger_remote.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "script_debugger_remote.h" + +#include "core/engine.h" +#include "core/io/ip.h" +#include "core/io/marshalls.h" +#include "core/os/input.h" +#include "core/os/os.h" +#include "core/project_settings.h" +#include "servers/visual_server.h" + +#define CHECK_SIZE(arr, expected, what) ERR_FAIL_COND_V_MSG((uint32_t)arr.size() < (uint32_t)(expected), false, String("Malformed ") + what + " message from script debugger, message too short. Exptected size: " + itos(expected) + ", actual size: " + itos(arr.size())) +#define CHECK_END(arr, expected, what) ERR_FAIL_COND_V_MSG((uint32_t)arr.size() > (uint32_t)expected, false, String("Malformed ") + what + " message from script debugger, message too short. Exptected size: " + itos(expected) + ", actual size: " + itos(arr.size())) + +Array ScriptDebuggerRemote::ScriptStackDump::serialize() { + Array arr; + arr.push_back(frames.size() * 3); + for (int i = 0; i < frames.size(); i++) { + arr.push_back(frames[i].file); + arr.push_back(frames[i].line); + arr.push_back(frames[i].func); + } + return arr; +} + +bool ScriptDebuggerRemote::ScriptStackDump::deserialize(const Array &p_arr) { + CHECK_SIZE(p_arr, 1, "ScriptStackDump"); + uint32_t size = p_arr[0]; + CHECK_SIZE(p_arr, size, "ScriptStackDump"); + int idx = 1; + for (uint32_t i = 0; i < size / 3; i++) { + ScriptLanguage::StackInfo sf; + sf.file = p_arr[idx]; + sf.line = p_arr[idx + 1]; + sf.func = p_arr[idx + 2]; + frames.push_back(sf); + idx += 3; + } + CHECK_END(p_arr, idx, "ScriptStackDump"); + return true; +} + +Array ScriptDebuggerRemote::ScriptStackVariable::serialize(int max_size) { + Array arr; + arr.push_back(name); + arr.push_back(type); + + Variant var = value; + if (value.get_type() == Variant::OBJECT && value.get_validated_object() == nullptr) { + var = Variant(); + } + + int len = 0; + Error err = encode_variant(var, NULL, len, true); + if (err != OK) + ERR_PRINT("Failed to encode variant."); + + if (len > max_size) { + arr.push_back(Variant()); + } else { + arr.push_back(var); + } + return arr; +} + +bool ScriptDebuggerRemote::ScriptStackVariable::deserialize(const Array &p_arr) { + CHECK_SIZE(p_arr, 3, "ScriptStackVariable"); + name = p_arr[0]; + type = p_arr[1]; + value = p_arr[2]; + CHECK_END(p_arr, 3, "ScriptStackVariable"); + return true; +} + +Array ScriptDebuggerRemote::OutputError::serialize() { + Array arr; + arr.push_back(hr); + arr.push_back(min); + arr.push_back(sec); + arr.push_back(msec); + arr.push_back(source_file); + arr.push_back(source_func); + arr.push_back(source_line); + arr.push_back(error); + arr.push_back(error_descr); + arr.push_back(warning); + unsigned int size = callstack.size(); + const ScriptLanguage::StackInfo *r = callstack.ptr(); + arr.push_back(size * 3); + for (int i = 0; i < callstack.size(); i++) { + arr.push_back(r[i].file); + arr.push_back(r[i].func); + arr.push_back(r[i].line); + } + return arr; +} + +bool ScriptDebuggerRemote::OutputError::deserialize(const Array &p_arr) { + CHECK_SIZE(p_arr, 11, "OutputError"); + hr = p_arr[0]; + min = p_arr[1]; + sec = p_arr[2]; + msec = p_arr[3]; + source_file = p_arr[4]; + source_func = p_arr[5]; + source_line = p_arr[6]; + error = p_arr[7]; + error_descr = p_arr[8]; + warning = p_arr[9]; + unsigned int stack_size = p_arr[10]; + CHECK_SIZE(p_arr, stack_size, "OutputError"); + int idx = 11; + callstack.resize(stack_size / 3); + ScriptLanguage::StackInfo *w = callstack.ptrw(); + for (unsigned int i = 0; i < stack_size / 3; i++) { + w[i].file = p_arr[idx]; + w[i].func = p_arr[idx + 1]; + w[i].line = p_arr[idx + 2]; + idx += 3; + } + CHECK_END(p_arr, idx, "OutputError"); + return true; +} + +Array ScriptDebuggerRemote::ResourceUsage::serialize() { + infos.sort(); + + Array arr; + arr.push_back(infos.size() * 4); + for (List<ResourceInfo>::Element *E = infos.front(); E; E = E->next()) { + arr.push_back(E->get().path); + arr.push_back(E->get().format); + arr.push_back(E->get().type); + arr.push_back(E->get().vram); + } + return arr; +} + +bool ScriptDebuggerRemote::ResourceUsage::deserialize(const Array &p_arr) { + CHECK_SIZE(p_arr, 1, "ResourceUsage"); + uint32_t size = p_arr[0]; + CHECK_SIZE(p_arr, size, "ResourceUsage"); + int idx = 1; + for (uint32_t i = 0; i < size / 4; i++) { + ResourceInfo info; + info.path = p_arr[idx]; + info.format = p_arr[idx + 1]; + info.type = p_arr[idx + 2]; + info.vram = p_arr[idx + 3]; + infos.push_back(info); + } + CHECK_END(p_arr, idx, "ResourceUsage"); + return true; +} + +Array ScriptDebuggerRemote::ProfilerSignature::serialize() { + Array arr; + arr.push_back(name); + arr.push_back(id); + return arr; +} + +bool ScriptDebuggerRemote::ProfilerSignature::deserialize(const Array &p_arr) { + CHECK_SIZE(p_arr, 2, "ProfilerSignature"); + name = p_arr[0]; + id = p_arr[1]; + CHECK_END(p_arr, 2, "ProfilerSignature"); + return true; +} + +Array ScriptDebuggerRemote::ProfilerFrame::serialize() { + Array arr; + arr.push_back(frame_number); + arr.push_back(frame_time); + arr.push_back(idle_time); + arr.push_back(physics_time); + arr.push_back(physics_frame_time); + arr.push_back(USEC_TO_SEC(script_time)); + + arr.push_back(frames_data.size()); + arr.push_back(frame_functions.size() * 4); + + // Servers profiling info. + for (int i = 0; i < frames_data.size(); i++) { + arr.push_back(frames_data[i].name); // Type (physics/process/audio/...) + arr.push_back(frames_data[i].data.size()); + for (int j = 0; j < frames_data[i].data.size() / 2; j++) { + arr.push_back(frames_data[i].data[2 * j]); // NAME + arr.push_back(frames_data[i].data[2 * j + 1]); // TIME + } + } + for (int i = 0; i < frame_functions.size(); i++) { + arr.push_back(frame_functions[i].sig_id); + arr.push_back(frame_functions[i].call_count); + arr.push_back(frame_functions[i].self_time); + arr.push_back(frame_functions[i].total_time); + } + return arr; +} + +bool ScriptDebuggerRemote::ProfilerFrame::deserialize(const Array &p_arr) { + CHECK_SIZE(p_arr, 8, "ProfilerFrame"); + frame_number = p_arr[0]; + frame_time = p_arr[1]; + idle_time = p_arr[2]; + physics_time = p_arr[3]; + physics_frame_time = p_arr[4]; + script_time = p_arr[5]; + uint32_t frame_data_size = p_arr[6]; + int frame_func_size = p_arr[7]; + int idx = 8; + while (frame_data_size) { + CHECK_SIZE(p_arr, idx + 2, "ProfilerFrame"); + frame_data_size--; + FrameData fd; + fd.name = p_arr[idx]; + int sub_data_size = p_arr[idx + 1]; + idx += 2; + CHECK_SIZE(p_arr, idx + sub_data_size, "ProfilerFrame"); + for (int j = 0; j < sub_data_size / 2; j++) { + fd.data.push_back(p_arr[idx]); // NAME + fd.data.push_back(p_arr[idx + 1]); // TIME + idx += 2; + } + frames_data.push_back(fd); + } + CHECK_SIZE(p_arr, idx + frame_func_size, "ProfilerFrame"); + for (int i = 0; i < frame_func_size / 4; i++) { + FrameFunction ff; + ff.sig_id = p_arr[idx]; + ff.call_count = p_arr[idx + 1]; + ff.self_time = p_arr[idx + 2]; + ff.total_time = p_arr[idx + 3]; + frame_functions.push_back(ff); + idx += 4; + } + CHECK_END(p_arr, idx, "ProfilerFrame"); + return true; +} + +Array ScriptDebuggerRemote::NetworkProfilerFrame::serialize() { + Array arr; + arr.push_back(infos.size() * 6); + for (int i = 0; i < infos.size(); ++i) { + arr.push_back(uint64_t(infos[i].node)); + arr.push_back(infos[i].node_path); + arr.push_back(infos[i].incoming_rpc); + arr.push_back(infos[i].incoming_rset); + arr.push_back(infos[i].outgoing_rpc); + arr.push_back(infos[i].outgoing_rset); + } + return arr; +} + +bool ScriptDebuggerRemote::NetworkProfilerFrame::deserialize(const Array &p_arr) { + CHECK_SIZE(p_arr, 1, "NetworkProfilerFrame"); + uint32_t size = p_arr[0]; + CHECK_SIZE(p_arr, size, "NetworkProfilerFrame"); + infos.resize(size); + int idx = 1; + for (uint32_t i = 0; i < size / 6; ++i) { + infos.write[i].node = uint64_t(p_arr[idx]); + infos.write[i].node_path = p_arr[idx + 1]; + infos.write[i].incoming_rpc = p_arr[idx + 2]; + infos.write[i].incoming_rset = p_arr[idx + 3]; + infos.write[i].outgoing_rpc = p_arr[idx + 4]; + infos.write[i].outgoing_rset = p_arr[idx + 5]; + } + CHECK_END(p_arr, idx, "NetworkProfilerFrame"); + return true; +} + +void ScriptDebuggerRemote::_put_msg(String p_message, Array p_data) { + Array msg; + msg.push_back(p_message); + msg.push_back(p_data); + packet_peer_stream->put_var(msg); +} + +bool ScriptDebuggerRemote::is_peer_connected() { + return tcp_client->is_connected_to_host() && tcp_client->get_status() == StreamPeerTCP::STATUS_CONNECTED; +} + +void ScriptDebuggerRemote::_send_video_memory() { + + ResourceUsage usage; + if (resource_usage_func) + resource_usage_func(&usage); + + _put_msg("message:video_mem", usage.serialize()); +} + +Error ScriptDebuggerRemote::connect_to_host(const String &p_host, uint16_t p_port) { + + IP_Address ip; + if (p_host.is_valid_ip_address()) + ip = p_host; + else + ip = IP::get_singleton()->resolve_hostname(p_host); + + int port = p_port; + + const int tries = 6; + int waits[tries] = { 1, 10, 100, 1000, 1000, 1000 }; + + tcp_client->connect_to_host(ip, port); + + for (int i = 0; i < tries; i++) { + + if (tcp_client->get_status() == StreamPeerTCP::STATUS_CONNECTED) { + print_verbose("Remote Debugger: Connected!"); + break; + } else { + + const int ms = waits[i]; + OS::get_singleton()->delay_usec(ms * 1000); + print_verbose("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in " + String::num(ms) + " msec."); + }; + }; + + if (tcp_client->get_status() != StreamPeerTCP::STATUS_CONNECTED) { + + ERR_PRINT("Remote Debugger: Unable to connect. Status: " + String::num(tcp_client->get_status()) + "."); + return FAILED; + }; + + packet_peer_stream->set_stream_peer(tcp_client); + Array msg; + msg.push_back(OS::get_singleton()->get_process_id()); + send_message("set_pid", msg); + + return OK; +} + +void ScriptDebuggerRemote::_parse_message(const String p_command, const Array &p_data, ScriptLanguage *p_script) { + + if (p_command == "request_video_mem") { + _send_video_memory(); + + } else if (p_command == "start_profiling") { + ERR_FAIL_COND(p_data.size() < 1); + + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + ScriptServer::get_language(i)->profiling_start(); + } + + max_frame_functions = p_data[0]; + profiler_function_signature_map.clear(); + profiling = true; + frame_time = 0; + idle_time = 0; + physics_time = 0; + physics_frame_time = 0; + print_line("PROFILING ALRIGHT!"); + + } else if (p_command == "stop_profiling") { + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + ScriptServer::get_language(i)->profiling_stop(); + } + profiling = false; + _send_profiling_data(false); + print_line("PROFILING END!"); + + } else if (p_command == "start_visual_profiling") { + + visual_profiling = true; + VS::get_singleton()->set_frame_profiling_enabled(true); + } else if (p_command == "stop_visual_profiling") { + + visual_profiling = false; + VS::get_singleton()->set_frame_profiling_enabled(false); + + } else if (p_command == "start_network_profiling") { + + network_profiling = true; + multiplayer->profiling_start(); + + } else if (p_command == "stop_network_profiling") { + + network_profiling = false; + multiplayer->profiling_end(); + + } else if (p_command == "reload_scripts") { + reload_all_scripts = true; + + } else if (p_command == "breakpoint") { + ERR_FAIL_COND(p_data.size() < 3); + bool set = p_data[2]; + if (set) + insert_breakpoint(p_data[1], p_data[0]); + else + remove_breakpoint(p_data[1], p_data[0]); + + } else if (p_command == "set_skip_breakpoints") { + ERR_FAIL_COND(p_data.size() < 1); + skip_breakpoints = p_data[0]; + + } else if (p_command == "get_stack_dump") { + ERR_FAIL_COND(!p_script); + ScriptStackDump dump; + int slc = p_script->debug_get_stack_level_count(); + for (int i = 0; i < slc; i++) { + ScriptLanguage::StackInfo frame; + frame.file = p_script->debug_get_stack_level_source(i); + frame.line = p_script->debug_get_stack_level_line(i); + frame.func = p_script->debug_get_stack_level_function(i); + dump.frames.push_back(frame); + } + _put_msg("stack_dump", dump.serialize()); + + } else if (p_command == "get_stack_frame_vars") { + ERR_FAIL_COND(p_data.size() != 1); + ERR_FAIL_COND(!p_script); + int lv = p_data[0]; + + List<String> members; + List<Variant> member_vals; + if (ScriptInstance *inst = p_script->debug_get_stack_level_instance(lv)) { + members.push_back("self"); + member_vals.push_back(inst->get_owner()); + } + p_script->debug_get_stack_level_members(lv, &members, &member_vals); + ERR_FAIL_COND(members.size() != member_vals.size()); + + List<String> locals; + List<Variant> local_vals; + p_script->debug_get_stack_level_locals(lv, &locals, &local_vals); + ERR_FAIL_COND(locals.size() != local_vals.size()); + + List<String> globals; + List<Variant> globals_vals; + p_script->debug_get_globals(&globals, &globals_vals); + ERR_FAIL_COND(globals.size() != globals_vals.size()); + + _put_msg("stack_frame_vars", Array()); + + ScriptStackVariable stvar; + { //locals + List<String>::Element *E = locals.front(); + List<Variant>::Element *F = local_vals.front(); + while (E) { + stvar.name = E->get(); + stvar.value = F->get(); + stvar.type = 0; + _put_msg("stack_frame_var", stvar.serialize()); + + E = E->next(); + F = F->next(); + } + } + + { //members + List<String>::Element *E = members.front(); + List<Variant>::Element *F = member_vals.front(); + while (E) { + stvar.name = E->get(); + stvar.value = F->get(); + stvar.type = 1; + _put_msg("stack_frame_var", stvar.serialize()); + + E = E->next(); + F = F->next(); + } + } + + { //globals + List<String>::Element *E = globals.front(); + List<Variant>::Element *F = globals_vals.front(); + while (E) { + stvar.name = E->get(); + stvar.value = F->get(); + stvar.type = 2; + _put_msg("stack_frame_var", stvar.serialize()); + + E = E->next(); + F = F->next(); + } + } + + } else { + if (scene_tree_parse_func) { + scene_tree_parse_func(p_command, p_data); + } + // Unknown message... + } +} + +void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue, bool p_is_error_breakpoint) { + + //this function is called when there is a debugger break (bug on script) + //or when execution is paused from editor + + if (skip_breakpoints && !p_is_error_breakpoint) + return; + + ERR_FAIL_COND_MSG(!is_peer_connected(), "Script Debugger failed to connect, but being used anyway."); + + Array msg; + msg.push_back(p_can_continue); + msg.push_back(p_script->debug_get_error()); + _put_msg("debug_enter", msg); + + skip_profile_frame = true; // to avoid super long frame time for the frame + + Input::MouseMode mouse_mode = Input::get_singleton()->get_mouse_mode(); + if (mouse_mode != Input::MOUSE_MODE_VISIBLE) + Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); + + uint64_t loop_begin_usec = 0; + uint64_t loop_time_sec = 0; + while (true) { + loop_begin_usec = OS::get_singleton()->get_ticks_usec(); + + _get_output(); + + if (packet_peer_stream->get_available_packet_count() > 0) { + + Variant var; + Error err = packet_peer_stream->get_var(var); + + ERR_CONTINUE(err != OK); + ERR_CONTINUE(var.get_type() != Variant::ARRAY); + + Array cmd = var; + + ERR_CONTINUE(cmd.size() != 2); + ERR_CONTINUE(cmd[0].get_type() != Variant::STRING); + ERR_CONTINUE(cmd[1].get_type() != Variant::ARRAY); + + String command = cmd[0]; + Array data = cmd[1]; + if (command == "step") { + + set_depth(-1); + set_lines_left(1); + break; + } else if (command == "next") { + + set_depth(0); + set_lines_left(1); + break; + + } else if (command == "continue") { + set_depth(-1); + set_lines_left(-1); + OS::get_singleton()->move_window_to_foreground(); + break; + } else if (command == "break") { + ERR_PRINT("Got break when already broke!"); + break; + } + + _parse_message(command, data, p_script); + } else { + OS::get_singleton()->delay_usec(10000); + OS::get_singleton()->process_and_drop_events(); + } + + // This is for the camera override to stay live even when the game is paused from the editor + loop_time_sec = (OS::get_singleton()->get_ticks_usec() - loop_begin_usec) / 1000000.0f; + VisualServer::get_singleton()->sync(); + if (VisualServer::get_singleton()->has_changed()) { + VisualServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale()); + } + } + + _put_msg("debug_exit", Array()); + + if (mouse_mode != Input::MOUSE_MODE_VISIBLE) + Input::get_singleton()->set_mouse_mode(mouse_mode); +} + +void ScriptDebuggerRemote::_get_output() { + + mutex->lock(); + if (output_strings.size()) { + + locking = true; + + while (output_strings.size()) { + + Array arr; + arr.push_back(output_strings.front()->get()); + _put_msg("output", arr); + output_strings.pop_front(); + } + locking = false; + } + + if (n_messages_dropped > 0) { + Message msg; + msg.message = "Too many messages! " + String::num_int64(n_messages_dropped) + " messages were dropped."; + messages.push_back(msg); + n_messages_dropped = 0; + } + + while (messages.size()) { + locking = true; + Message msg = messages.front()->get(); + _put_msg("message:" + msg.message, msg.data); + messages.pop_front(); + locking = false; + } + + if (n_errors_dropped == 1) { + // Only print one message about dropping per second + OutputError oe; + oe.error = "TOO_MANY_ERRORS"; + oe.error_descr = "Too many errors! Ignoring errors for up to 1 second."; + oe.warning = false; + uint64_t time = OS::get_singleton()->get_ticks_msec(); + oe.hr = time / 3600000; + oe.min = (time / 60000) % 60; + oe.sec = (time / 1000) % 60; + oe.msec = time % 1000; + errors.push_back(oe); + } + + if (n_warnings_dropped == 1) { + // Only print one message about dropping per second + OutputError oe; + oe.error = "TOO_MANY_WARNINGS"; + oe.error_descr = "Too many warnings! Ignoring warnings for up to 1 second."; + oe.warning = true; + uint64_t time = OS::get_singleton()->get_ticks_msec(); + oe.hr = time / 3600000; + oe.min = (time / 60000) % 60; + oe.sec = (time / 1000) % 60; + oe.msec = time % 1000; + errors.push_back(oe); + } + + while (errors.size()) { + locking = true; + OutputError oe = errors.front()->get(); + _put_msg("error", oe.serialize()); + errors.pop_front(); + locking = false; + } + mutex->unlock(); +} + +void ScriptDebuggerRemote::line_poll() { + + //the purpose of this is just processing events every now and then when the script might get too busy + //otherwise bugs like infinite loops can't be caught + if (poll_every % 2048 == 0) + _poll_events(); + poll_every++; +} + +void ScriptDebuggerRemote::_err_handler(void *ud, const char *p_func, const char *p_file, int p_line, const char *p_err, const char *p_descr, ErrorHandlerType p_type) { + + if (p_type == ERR_HANDLER_SCRIPT) + return; //ignore script errors, those go through debugger + + Vector<ScriptLanguage::StackInfo> si; + + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + si = ScriptServer::get_language(i)->debug_get_current_stack_info(); + if (si.size()) + break; + } + + ScriptDebuggerRemote *sdr = (ScriptDebuggerRemote *)ud; + sdr->send_error(p_func, p_file, p_line, p_err, p_descr, p_type, si); +} + +void ScriptDebuggerRemote::_poll_events() { + + //this si called from ::idle_poll, happens only when running the game, + //does not get called while on debug break + + while (packet_peer_stream->get_available_packet_count() > 0) { + + _get_output(); + + //send over output_strings + + Variant var; + Error err = packet_peer_stream->get_var(var); + + ERR_CONTINUE(err != OK); + ERR_CONTINUE(var.get_type() != Variant::ARRAY); + + Array cmd = var; + + ERR_CONTINUE(cmd.size() < 2); + ERR_CONTINUE(cmd[0].get_type() != Variant::STRING); + ERR_CONTINUE(cmd[1].get_type() != Variant::ARRAY); + + String command = cmd[0]; + Array data = cmd[1]; + + if (command == "break") { + + if (get_break_language()) + debug(get_break_language()); + } else { + _parse_message(command, data); + } + } +} + +void ScriptDebuggerRemote::_send_profiling_data(bool p_for_frame) { + + int ofs = 0; + + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + if (p_for_frame) + ofs += ScriptServer::get_language(i)->profiling_get_frame_data(&profile_info.write[ofs], profile_info.size() - ofs); + else + ofs += ScriptServer::get_language(i)->profiling_get_accumulated_data(&profile_info.write[ofs], profile_info.size() - ofs); + } + + for (int i = 0; i < ofs; i++) { + profile_info_ptrs.write[i] = &profile_info.write[i]; + } + + SortArray<ScriptLanguage::ProfilingInfo *, ProfileInfoSort> sa; + sa.sort(profile_info_ptrs.ptrw(), ofs); + + int to_send = MIN(ofs, max_frame_functions); + + //check signatures first + uint64_t total_script_time = 0; + + for (int i = 0; i < to_send; i++) { + + if (!profiler_function_signature_map.has(profile_info_ptrs[i]->signature)) { + + int idx = profiler_function_signature_map.size(); + ProfilerSignature sig; + sig.name = profile_info_ptrs[i]->signature; + sig.id = idx; + _put_msg("profile_sig", sig.serialize()); + profiler_function_signature_map[profile_info_ptrs[i]->signature] = idx; + } + + total_script_time += profile_info_ptrs[i]->self_time; + } + + //send frames then + ProfilerFrame metric; + metric.frame_number = Engine::get_singleton()->get_frames_drawn(); + metric.frame_time = frame_time; + metric.idle_time = idle_time; + metric.physics_time = physics_time; + metric.physics_frame_time = physics_frame_time; + metric.script_time = total_script_time; + + // Add script functions information. + metric.frame_functions.resize(to_send); + FrameFunction *w = metric.frame_functions.ptrw(); + for (int i = 0; i < to_send; i++) { + + if (profiler_function_signature_map.has(profile_info_ptrs[i]->signature)) { + w[i].sig_id = profiler_function_signature_map[profile_info_ptrs[i]->signature]; + } + + w[i].call_count = profile_info_ptrs[i]->call_count; + w[i].total_time = profile_info_ptrs[i]->total_time / 1000000.0; + w[i].self_time = profile_info_ptrs[i]->self_time / 1000000.0; + } + if (p_for_frame) { + // Add profile frame data information. + metric.frames_data.append_array(profile_frame_data); + _put_msg("profile_frame", metric.serialize()); + profile_frame_data.clear(); + } else { + _put_msg("profile_total", metric.serialize()); + } +} + +void ScriptDebuggerRemote::idle_poll() { + + // this function is called every frame, except when there is a debugger break (::debug() in this class) + // execution stops and remains in the ::debug function + + _get_output(); + + if (requested_quit) { + + _put_msg("kill_me", Array()); + requested_quit = false; + } + + if (performance) { + + uint64_t pt = OS::get_singleton()->get_ticks_msec(); + if (pt - last_perf_time > 1000) { + + last_perf_time = pt; + int max = performance->get("MONITOR_MAX"); + Array arr; + arr.resize(max); + for (int i = 0; i < max; i++) { + arr[i] = performance->call("get_monitor", i); + } + _put_msg("performance", arr); + } + } + + if (visual_profiling) { + Vector<VS::FrameProfileArea> profile_areas = VS::get_singleton()->get_frame_profile(); + if (profile_areas.size()) { + Vector<String> area_names; + Vector<real_t> area_times; + area_names.resize(profile_areas.size()); + area_times.resize(profile_areas.size() * 2); + { + String *area_namesw = area_names.ptrw(); + real_t *area_timesw = area_times.ptrw(); + + for (int i = 0; i < profile_areas.size(); i++) { + area_namesw[i] = profile_areas[i].name; + area_timesw[i * 2 + 0] = profile_areas[i].cpu_msec; + area_timesw[i * 2 + 1] = profile_areas[i].gpu_msec; + } + } + Array msg; + msg.push_back(VS::get_singleton()->get_frame_profile_frame()); + msg.push_back(area_names); + msg.push_back(area_times); + _put_msg("visual_profile", msg); + } + } + + if (profiling) { + + if (skip_profile_frame) { + skip_profile_frame = false; + } else { + //send profiling info normally + _send_profiling_data(true); + } + } + + if (network_profiling) { + uint64_t pt = OS::get_singleton()->get_ticks_msec(); + if (pt - last_net_bandwidth_time > 200) { + last_net_bandwidth_time = pt; + _send_network_bandwidth_usage(); + } + if (pt - last_net_prof_time > 100) { + last_net_prof_time = pt; + _send_network_profiling_data(); + } + } + + if (reload_all_scripts) { + + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + ScriptServer::get_language(i)->reload_all_scripts(); + } + reload_all_scripts = false; + } + + _poll_events(); +} + +void ScriptDebuggerRemote::_send_network_profiling_data() { + ERR_FAIL_COND(multiplayer.is_null()); + + int n_nodes = multiplayer->get_profiling_frame(&network_profile_info.write[0]); + + NetworkProfilerFrame frame; + for (int i = 0; i < n_nodes; i++) { + frame.infos.push_back(network_profile_info[i]); + } + _put_msg("network_profile", frame.serialize()); +} + +void ScriptDebuggerRemote::_send_network_bandwidth_usage() { + ERR_FAIL_COND(multiplayer.is_null()); + + int incoming_bandwidth = multiplayer->get_incoming_bandwidth_usage(); + int outgoing_bandwidth = multiplayer->get_outgoing_bandwidth_usage(); + + Array arr; + arr.push_back(incoming_bandwidth); + arr.push_back(outgoing_bandwidth); + _put_msg("network_bandwidth", arr); +} + +void ScriptDebuggerRemote::send_message(const String &p_message, const Array &p_args) { + + mutex->lock(); + if (!locking && is_peer_connected()) { + + if (messages.size() >= max_messages_per_frame) { + n_messages_dropped++; + } else { + Message msg; + msg.message = p_message; + msg.data = p_args; + messages.push_back(msg); + } + } + mutex->unlock(); +} + +void ScriptDebuggerRemote::send_error(const String &p_func, const String &p_file, int p_line, const String &p_err, const String &p_descr, ErrorHandlerType p_type, const Vector<ScriptLanguage::StackInfo> &p_stack_info) { + + OutputError oe; + oe.error = p_err; + oe.error_descr = p_descr; + oe.source_file = p_file; + oe.source_line = p_line; + oe.source_func = p_func; + oe.warning = p_type == ERR_HANDLER_WARNING; + uint64_t time = OS::get_singleton()->get_ticks_msec(); + oe.hr = time / 3600000; + oe.min = (time / 60000) % 60; + oe.sec = (time / 1000) % 60; + oe.msec = time % 1000; + Array cstack; + + uint64_t ticks = OS::get_singleton()->get_ticks_usec() / 1000; + msec_count += ticks - last_msec; + last_msec = ticks; + + if (msec_count > 1000) { + msec_count = 0; + + err_count = 0; + n_errors_dropped = 0; + warn_count = 0; + n_warnings_dropped = 0; + } + + cstack.resize(p_stack_info.size() * 3); + for (int i = 0; i < p_stack_info.size(); i++) { + cstack[i * 3 + 0] = p_stack_info[i].file; + cstack[i * 3 + 1] = p_stack_info[i].func; + cstack[i * 3 + 2] = p_stack_info[i].line; + } + + //oe.callstack = cstack; + if (oe.warning) { + warn_count++; + } else { + err_count++; + } + + mutex->lock(); + + if (!locking && is_peer_connected()) { + + if (oe.warning) { + if (warn_count > max_warnings_per_second) { + n_warnings_dropped++; + } else { + errors.push_back(oe); + } + } else { + if (err_count > max_errors_per_second) { + n_errors_dropped++; + } else { + errors.push_back(oe); + } + } + } + + mutex->unlock(); +} + +void ScriptDebuggerRemote::_print_handler(void *p_this, const String &p_string, bool p_error) { + + ScriptDebuggerRemote *sdr = (ScriptDebuggerRemote *)p_this; + + uint64_t ticks = OS::get_singleton()->get_ticks_usec() / 1000; + sdr->msec_count += ticks - sdr->last_msec; + sdr->last_msec = ticks; + + if (sdr->msec_count > 1000) { + sdr->char_count = 0; + sdr->msec_count = 0; + } + + String s = p_string; + int allowed_chars = MIN(MAX(sdr->max_cps - sdr->char_count, 0), s.length()); + + if (allowed_chars == 0) + return; + + if (allowed_chars < s.length()) { + s = s.substr(0, allowed_chars); + } + + sdr->char_count += allowed_chars; + bool overflowed = sdr->char_count >= sdr->max_cps; + + sdr->mutex->lock(); + if (!sdr->locking && sdr->is_peer_connected()) { + + if (overflowed) + s += "[...]"; + + sdr->output_strings.push_back(s); + + if (overflowed) { + sdr->output_strings.push_back("[output overflow, print less text!]"); + } + } + sdr->mutex->unlock(); +} + +void ScriptDebuggerRemote::request_quit() { + + requested_quit = true; +} + +void ScriptDebuggerRemote::set_multiplayer(Ref<MultiplayerAPI> p_multiplayer) { + multiplayer = p_multiplayer; +} + +bool ScriptDebuggerRemote::is_profiling() const { + + return profiling; +} +void ScriptDebuggerRemote::add_profiling_frame_data(const StringName &p_name, const Array &p_data) { + + int idx = -1; + for (int i = 0; i < profile_frame_data.size(); i++) { + if (profile_frame_data[i].name == p_name) { + idx = i; + break; + } + } + + FrameData fd; + fd.name = p_name; + fd.data = p_data; + + if (idx == -1) { + profile_frame_data.push_back(fd); + } else { + profile_frame_data.write[idx] = fd; + } +} + +void ScriptDebuggerRemote::profiling_start() { + //ignores this, uses it via connection +} + +void ScriptDebuggerRemote::profiling_end() { + //ignores this, uses it via connection +} + +void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time) { + + frame_time = p_frame_time; + idle_time = p_idle_time; + physics_time = p_physics_time; + physics_frame_time = p_physics_frame_time; +} + +void ScriptDebuggerRemote::set_skip_breakpoints(bool p_skip_breakpoints) { + skip_breakpoints = p_skip_breakpoints; +} + +ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL; +ScriptDebuggerRemote::ParseMessageFunc ScriptDebuggerRemote::scene_tree_parse_func = NULL; + +ScriptDebuggerRemote::ScriptDebuggerRemote() : + profiling(false), + visual_profiling(false), + network_profiling(false), + max_frame_functions(16), + skip_profile_frame(false), + reload_all_scripts(false), + tcp_client(Ref<StreamPeerTCP>(memnew(StreamPeerTCP))), + packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))), + last_perf_time(0), + last_net_prof_time(0), + last_net_bandwidth_time(0), + performance(Engine::get_singleton()->get_singleton_object("Performance")), + requested_quit(false), + mutex(Mutex::create()), + max_messages_per_frame(GLOBAL_GET("network/limits/debugger_stdout/max_messages_per_frame")), + n_messages_dropped(0), + max_errors_per_second(GLOBAL_GET("network/limits/debugger_stdout/max_errors_per_second")), + max_warnings_per_second(GLOBAL_GET("network/limits/debugger_stdout/max_warnings_per_second")), + n_errors_dropped(0), + max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), + char_count(0), + err_count(0), + warn_count(0), + last_msec(0), + msec_count(0), + locking(false), + poll_every(0) { + + packet_peer_stream->set_stream_peer(tcp_client); + packet_peer_stream->set_output_buffer_max_size((1024 * 1024 * 8) - 4); // 8 MiB should be way more than enough, minus 4 bytes for separator. + + phl.printfunc = _print_handler; + phl.userdata = this; + add_print_handler(&phl); + + eh.errfunc = _err_handler; + eh.userdata = this; + add_error_handler(&eh); + + profile_info.resize(GLOBAL_GET("debug/settings/profiler/max_functions")); + network_profile_info.resize(GLOBAL_GET("debug/settings/profiler/max_functions")); + profile_info_ptrs.resize(profile_info.size()); +} + +ScriptDebuggerRemote::~ScriptDebuggerRemote() { + + remove_print_handler(&phl); + remove_error_handler(&eh); + memdelete(mutex); +} diff --git a/scene/debugger/script_debugger_remote.h b/core/script_debugger_remote.h index ae44bf9ca2..682da1d276 100644 --- a/scene/debugger/script_debugger_remote.h +++ b/core/script_debugger_remote.h @@ -37,16 +37,170 @@ #include "core/os/os.h" #include "core/script_language.h" -class SceneTree; - class ScriptDebuggerRemote : public ScriptDebugger { - struct Message { +public: + class ResourceInfo { + public: + String path; + String format; + String type; + RID id; + int vram; + bool operator<(const ResourceInfo &p_img) const { return vram == p_img.vram ? id < p_img.id : vram > p_img.vram; } + ResourceInfo() { + vram = 0; + } + }; + + class ResourceUsage { + public: + List<ResourceInfo> infos; + + Array serialize(); + bool deserialize(const Array &p_arr); + }; + + class FrameInfo { + public: + StringName name; + float self_time; + float total_time; + + FrameInfo() { + self_time = 0; + total_time = 0; + } + }; + + class FrameFunction { + public: + int sig_id; + int call_count; + StringName name; + float self_time; + float total_time; + + FrameFunction() { + sig_id = -1; + call_count = 0; + self_time = 0; + total_time = 0; + } + }; + class ScriptStackVariable { + public: + String name; + Variant value; + int type; + ScriptStackVariable() { + type = -1; + } + + Array serialize(int max_size = 1 << 20); // 1 MiB default. + bool deserialize(const Array &p_arr); + }; + + class ScriptStackDump { + public: + List<ScriptLanguage::StackInfo> frames; + ScriptStackDump() {} + + Array serialize(); + bool deserialize(const Array &p_arr); + }; + + class Message { + + public: String message; Array data; + + Message() {} + }; + + class OutputError { + public: + int hr; + int min; + int sec; + int msec; + String source_file; + String source_func; + int source_line; + String error; + String error_descr; + bool warning; + Vector<ScriptLanguage::StackInfo> callstack; + + OutputError() { + hr = -1; + min = -1; + sec = -1; + msec = -1; + source_line = -1; + warning = false; + } + + Array serialize(); + bool deserialize(const Array &p_arr); + }; + + struct FrameData { + + StringName name; + Array data; + }; + + class ProfilerSignature { + public: + StringName name; + int id; + + Array serialize(); + bool deserialize(const Array &p_arr); + + ProfilerSignature() { + id = -1; + }; + }; + + class ProfilerFrame { + public: + int frame_number; + float frame_time; + float idle_time; + float physics_time; + float physics_frame_time; + float script_time; + + Vector<FrameData> frames_data; + Vector<FrameFunction> frame_functions; + + ProfilerFrame() { + frame_number = 0; + frame_time = 0; + idle_time = 0; + physics_time = 0; + physics_frame_time = 0; + } + + Array serialize(); + bool deserialize(const Array &p_arr); }; + class NetworkProfilerFrame { + public: + Vector<MultiplayerAPI::ProfilingInfo> infos; + + Array serialize(); + bool deserialize(const Array &p_arr); + + NetworkProfilerFrame(){}; + }; + +protected: struct ProfileInfoSort { bool operator()(ScriptLanguage::ProfilingInfo *A, ScriptLanguage::ProfilingInfo *B) const { @@ -78,21 +232,6 @@ class ScriptDebuggerRemote : public ScriptDebugger { bool requested_quit; Mutex *mutex; - struct OutputError { - - int hr; - int min; - int sec; - int msec; - String source_file; - String source_func; - int source_line; - String error; - String error_descr; - bool warning; - Array callstack; - }; - List<String> output_strings; List<Message> messages; int max_messages_per_frame; @@ -119,9 +258,7 @@ class ScriptDebuggerRemote : public ScriptDebugger { void _poll_events(); uint32_t poll_every; - SceneTree *scene_tree; - - bool _parse_live_edit(const Array &p_command); + void _parse_message(const String p_command, const Array &p_data, ScriptLanguage *p_script = NULL); void _set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value); @@ -133,40 +270,24 @@ class ScriptDebuggerRemote : public ScriptDebugger { ErrorHandlerList eh; static void _err_handler(void *, const char *, const char *, int p_line, const char *, const char *, ErrorHandlerType p_type); + void _put_msg(String p_message, Array p_data); void _send_profiling_data(bool p_for_frame); void _send_network_profiling_data(); void _send_network_bandwidth_usage(); - struct FrameData { - - StringName name; - Array data; - }; - Vector<FrameData> profile_frame_data; - void _put_variable(const String &p_name, const Variant &p_variable); - - void _save_node(ObjectID id, const String &p_path); - bool skip_breakpoints; public: - struct ResourceUsage { - - String path; - String format; - String type; - RID id; - int vram; - bool operator<(const ResourceUsage &p_img) const { return vram == p_img.vram ? id < p_img.id : vram > p_img.vram; } - }; - - typedef void (*ResourceUsageFunc)(List<ResourceUsage> *); + typedef void (*ResourceUsageFunc)(ResourceUsage *); + typedef Error (*ParseMessageFunc)(const String &p_name, const Array &p_msg); // Returns true if something was found (stopping propagation). static ResourceUsageFunc resource_usage_func; + static ParseMessageFunc scene_tree_parse_func; // Could be made into list, extensible... Error connect_to_host(const String &p_host, uint16_t p_port); + bool is_peer_connected(); virtual void debug(ScriptLanguage *p_script, bool p_can_continue = true, bool p_is_error_breakpoint = false); virtual void idle_poll(); virtual void line_poll(); @@ -188,8 +309,6 @@ public: virtual void set_skip_breakpoints(bool p_skip_breakpoints); - void set_scene_tree(SceneTree *p_scene_tree) { scene_tree = p_scene_tree; }; - ScriptDebuggerRemote(); ~ScriptDebuggerRemote(); }; diff --git a/core/script_language.cpp b/core/script_language.cpp index 1149feac38..0b00247502 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -307,17 +307,17 @@ Variant ScriptInstance::call(const StringName &p_method, VARIANT_ARG_DECLARE) { argc++; } - Variant::CallError error; + Callable::CallError error; return call(p_method, argptr, argc, error); } void ScriptInstance::call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount) { - Variant::CallError ce; + Callable::CallError ce; call(p_method, p_args, p_argcount, ce); // script may not support multilevel calls } void ScriptInstance::call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount) { - Variant::CallError ce; + Callable::CallError ce; call(p_method, p_args, p_argcount, ce); // script may not support multilevel calls } diff --git a/core/script_language.h b/core/script_language.h index 2209f78fe4..48570ae546 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -197,7 +197,7 @@ public: virtual void get_method_list(List<MethodInfo> *p_list) const = 0; virtual bool has_method(const StringName &p_method) const = 0; virtual Variant call(const StringName &p_method, VARIANT_ARG_LIST); - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) = 0; + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) = 0; virtual void call_multilevel(const StringName &p_method, VARIANT_ARG_LIST); virtual void call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount); virtual void call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount); @@ -424,12 +424,12 @@ public: virtual void get_method_list(List<MethodInfo> *p_list) const; virtual bool has_method(const StringName &p_method) const; virtual Variant call(const StringName &p_method, VARIANT_ARG_LIST) { return Variant(); } - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } //virtual void call_multilevel(const StringName& p_method,VARIANT_ARG_LIST) { return Variant(); } - //virtual void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount,Variant::CallError &r_error) { return Variant(); } + //virtual void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount,Callable::CallError &r_error) { return Variant(); } virtual void notification(int p_notification) {} virtual Ref<Script> get_script() const { return script; } diff --git a/core/type_info.h b/core/type_info.h index 379735fd67..5dacf67de4 100644 --- a/core/type_info.h +++ b/core/type_info.h @@ -137,8 +137,8 @@ MAKE_TYPE_INFO_WITH_META(int32_t, Variant::INT, GodotTypeInfo::METADATA_INT_IS_I MAKE_TYPE_INFO_WITH_META(uint64_t, Variant::INT, GodotTypeInfo::METADATA_INT_IS_UINT64) MAKE_TYPE_INFO_WITH_META(int64_t, Variant::INT, GodotTypeInfo::METADATA_INT_IS_INT64) MAKE_TYPE_INFO(wchar_t, Variant::INT) -MAKE_TYPE_INFO_WITH_META(float, Variant::REAL, GodotTypeInfo::METADATA_REAL_IS_FLOAT) -MAKE_TYPE_INFO_WITH_META(double, Variant::REAL, GodotTypeInfo::METADATA_REAL_IS_DOUBLE) +MAKE_TYPE_INFO_WITH_META(float, Variant::FLOAT, GodotTypeInfo::METADATA_REAL_IS_FLOAT) +MAKE_TYPE_INFO_WITH_META(double, Variant::FLOAT, GodotTypeInfo::METADATA_REAL_IS_DOUBLE) MAKE_TYPE_INFO(String, Variant::STRING) MAKE_TYPE_INFO(Vector2, Variant::VECTOR2) @@ -151,19 +151,23 @@ MAKE_TYPE_INFO(AABB, Variant::AABB) MAKE_TYPE_INFO(Basis, Variant::BASIS) MAKE_TYPE_INFO(Transform, Variant::TRANSFORM) MAKE_TYPE_INFO(Color, Variant::COLOR) +MAKE_TYPE_INFO(StringName, Variant::STRING_NAME) MAKE_TYPE_INFO(NodePath, Variant::NODE_PATH) MAKE_TYPE_INFO(RID, Variant::_RID) +MAKE_TYPE_INFO(Callable, Variant::CALLABLE) +MAKE_TYPE_INFO(Signal, Variant::SIGNAL) MAKE_TYPE_INFO(Dictionary, Variant::DICTIONARY) MAKE_TYPE_INFO(Array, Variant::ARRAY) MAKE_TYPE_INFO(PackedByteArray, Variant::PACKED_BYTE_ARRAY) -MAKE_TYPE_INFO(PackedIntArray, Variant::PACKED_INT_ARRAY) -MAKE_TYPE_INFO(PackedRealArray, Variant::PACKED_REAL_ARRAY) +MAKE_TYPE_INFO(PackedInt32Array, Variant::PACKED_INT32_ARRAY) +MAKE_TYPE_INFO(PackedInt64Array, Variant::PACKED_INT64_ARRAY) +MAKE_TYPE_INFO(PackedFloat32Array, Variant::PACKED_FLOAT32_ARRAY) +MAKE_TYPE_INFO(PackedFloat64Array, Variant::PACKED_FLOAT64_ARRAY) MAKE_TYPE_INFO(PackedStringArray, Variant::PACKED_STRING_ARRAY) MAKE_TYPE_INFO(PackedVector2Array, Variant::PACKED_VECTOR2_ARRAY) MAKE_TYPE_INFO(PackedVector3Array, Variant::PACKED_VECTOR3_ARRAY) MAKE_TYPE_INFO(PackedColorArray, Variant::PACKED_COLOR_ARRAY) -MAKE_TYPE_INFO(StringName, Variant::STRING) MAKE_TYPE_INFO(IP_Address, Variant::STRING) //objectID @@ -219,20 +223,6 @@ MAKE_TEMPLATE_TYPE_INFO(Vector, Plane, Variant::ARRAY) MAKE_TEMPLATE_TYPE_INFO(Vector, Face3, Variant::PACKED_VECTOR3_ARRAY) MAKE_TEMPLATE_TYPE_INFO(Vector, StringName, Variant::PACKED_STRING_ARRAY) -/* -MAKE_TEMPLATE_TYPE_INFO(Vector, uint8_t, Variant::PACKED_BYTE_ARRAY) -MAKE_TEMPLATE_TYPE_INFO(Vector, int, Variant::PACKED_INT_ARRAY) -MAKE_TEMPLATE_TYPE_INFO(Vector, float, Variant::PACKED_REAL_ARRAY) -MAKE_TEMPLATE_TYPE_INFO(Vector, String, Variant::PACKED_STRING_ARRAY) -MAKE_TEMPLATE_TYPE_INFO(Vector, Vector2, Variant::PACKED_VECTOR2_ARRAY) -MAKE_TEMPLATE_TYPE_INFO(Vector, Vector3, Variant::PACKED_VECTOR3_ARRAY) -MAKE_TEMPLATE_TYPE_INFO(Vector, Color, Variant::PACKED_COLOR_ARRAY) - - -MAKE_TEMPLATE_TYPE_INFO(Vector, Plane, Variant::ARRAY) -MAKE_TEMPLATE_TYPE_INFO(Vector, Face3, Variant::PACKED_VECTOR3_ARRAY) -*/ - template <typename T> struct GetTypeInfo<T *, typename EnableIf<TypeInherits<Object, T>::value>::type> { static const Variant::Type VARIANT_TYPE = Variant::OBJECT; diff --git a/core/typedefs.h b/core/typedefs.h index 0bb80cb2dd..5376b0718a 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -335,26 +335,16 @@ struct _GlobalLock { */ #define CAST_INT_TO_UCHAR_PTR(ptr) ((uint8_t *)(uintptr_t)(ptr)) -/** Hint for compilers that this fallthrough in a switch is intentional. - * Can be replaced by [[fallthrough]] annotation if we move to C++17. - * Including conditional support for it for people who set -std=c++17 - * themselves. - * Requires a trailing semicolon when used. - */ -#if __cplusplus >= 201703L -#define FALLTHROUGH [[fallthrough]] -#elif defined(__GNUC__) && __GNUC__ >= 7 -#define FALLTHROUGH __attribute__((fallthrough)) -#elif defined(__llvm__) && __cplusplus >= 201103L && defined(__has_feature) -#if __has_feature(cxx_attributes) && defined(__has_warning) -#if __has_warning("-Wimplicit-fallthrough") -#define FALLTHROUGH [[clang::fallthrough]] -#endif -#endif -#endif +// Home-made index sequence trick, so it can be used everywhere without the costly include of std::tuple. +// https://stackoverflow.com/questions/15014096/c-index-of-type-during-variadic-template-expansion -#ifndef FALLTHROUGH -#define FALLTHROUGH -#endif +template <size_t... Is> +struct IndexSequence {}; + +template <size_t N, size_t... Is> +struct BuildIndexSequence : BuildIndexSequence<N - 1, N - 1, Is...> {}; + +template <size_t... Is> +struct BuildIndexSequence<0, Is...> : IndexSequence<Is...> {}; #endif // TYPEDEFS_H diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index 577879d448..02f460c93d 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -105,7 +105,7 @@ void UndoRedo::create_action(const String &p_name, MergeMode p_mode) { action_level++; } -void UndoRedo::add_do_method(Object *p_object, const String &p_method, VARIANT_ARG_DECLARE) { +void UndoRedo::add_do_method(Object *p_object, const StringName &p_method, VARIANT_ARG_DECLARE) { VARIANT_ARGPTRS ERR_FAIL_COND(p_object == NULL); @@ -125,7 +125,7 @@ void UndoRedo::add_do_method(Object *p_object, const String &p_method, VARIANT_A actions.write[current_action + 1].do_ops.push_back(do_op); } -void UndoRedo::add_undo_method(Object *p_object, const String &p_method, VARIANT_ARG_DECLARE) { +void UndoRedo::add_undo_method(Object *p_object, const StringName &p_method, VARIANT_ARG_DECLARE) { VARIANT_ARGPTRS ERR_FAIL_COND(p_object == NULL); @@ -149,7 +149,7 @@ void UndoRedo::add_undo_method(Object *p_object, const String &p_method, VARIANT } actions.write[current_action + 1].undo_ops.push_back(undo_op); } -void UndoRedo::add_do_property(Object *p_object, const String &p_property, const Variant &p_value) { +void UndoRedo::add_do_property(Object *p_object, const StringName &p_property, const Variant &p_value) { ERR_FAIL_COND(p_object == NULL); ERR_FAIL_COND(action_level <= 0); @@ -164,7 +164,7 @@ void UndoRedo::add_do_property(Object *p_object, const String &p_property, const do_op.args[0] = p_value; actions.write[current_action + 1].do_ops.push_back(do_op); } -void UndoRedo::add_undo_property(Object *p_object, const String &p_property, const Variant &p_value) { +void UndoRedo::add_undo_property(Object *p_object, const StringName &p_property, const Variant &p_value) { ERR_FAIL_COND(p_object == NULL); ERR_FAIL_COND(action_level <= 0); @@ -290,9 +290,9 @@ void UndoRedo::_process_operation_list(List<Operation>::Element *E) { } argptrs.resize(argc); - Variant::CallError ce; + Callable::CallError ce; obj->call(op.name, (const Variant **)argptrs.ptr(), argc, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { ERR_PRINT("Error calling method from signal '" + String(op.name) + "': " + Variant::get_call_error_text(obj, op.name, (const Variant **)argptrs.ptr(), argc, ce)); } #ifdef TOOLS_ENABLED @@ -431,32 +431,32 @@ UndoRedo::~UndoRedo() { clear_history(); } -Variant UndoRedo::_add_do_method(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant UndoRedo::_add_do_method(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 2) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 0; return Variant(); } if (p_args[0]->get_type() != Variant::OBJECT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; return Variant(); } - if (p_args[1]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + if (p_args[1]->get_type() != Variant::STRING_NAME && p_args[1]->get_type() != Variant::STRING) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; - r_error.expected = Variant::STRING; + r_error.expected = Variant::STRING_NAME; return Variant(); } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; Object *object = *p_args[0]; - String method = *p_args[1]; + StringName method = *p_args[1]; Variant v[VARIANT_ARG_MAX]; @@ -469,32 +469,32 @@ Variant UndoRedo::_add_do_method(const Variant **p_args, int p_argcount, Variant return Variant(); } -Variant UndoRedo::_add_undo_method(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant UndoRedo::_add_undo_method(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 2) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 0; return Variant(); } if (p_args[0]->get_type() != Variant::OBJECT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; return Variant(); } - if (p_args[1]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + if (p_args[1]->get_type() != Variant::STRING_NAME && p_args[1]->get_type() != Variant::STRING) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; - r_error.expected = Variant::STRING; + r_error.expected = Variant::STRING_NAME; return Variant(); } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; Object *object = *p_args[0]; - String method = *p_args[1]; + StringName method = *p_args[1]; Variant v[VARIANT_ARG_MAX]; @@ -518,7 +518,7 @@ void UndoRedo::_bind_methods() { MethodInfo mi; mi.name = "add_do_method"; mi.arguments.push_back(PropertyInfo(Variant::OBJECT, "object")); - mi.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "add_do_method", &UndoRedo::_add_do_method, mi, varray(), false); } @@ -527,7 +527,7 @@ void UndoRedo::_bind_methods() { MethodInfo mi; mi.name = "add_undo_method"; mi.arguments.push_back(PropertyInfo(Variant::OBJECT, "object")); - mi.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "add_undo_method", &UndoRedo::_add_undo_method, mi, varray(), false); } diff --git a/core/undo_redo.h b/core/undo_redo.h index bb9a4d1642..3b91e9ce36 100644 --- a/core/undo_redo.h +++ b/core/undo_redo.h @@ -47,8 +47,8 @@ public: }; typedef void (*CommitNotifyCallback)(void *p_ud, const String &p_name); - Variant _add_do_method(const Variant **p_args, int p_argcount, Variant::CallError &r_error); - Variant _add_undo_method(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _add_do_method(const Variant **p_args, int p_argcount, Callable::CallError &r_error); + Variant _add_undo_method(const Variant **p_args, int p_argcount, Callable::CallError &r_error); typedef void (*MethodNotifyCallback)(void *p_ud, Object *p_base, const StringName &p_name, VARIANT_ARG_DECLARE); typedef void (*PropertyNotifyCallback)(void *p_ud, Object *p_base, const StringName &p_property, const Variant &p_value); @@ -65,7 +65,7 @@ private: Type type; Ref<Resource> resref; ObjectID object; - String name; + StringName name; Variant args[VARIANT_ARG_MAX]; }; @@ -103,10 +103,10 @@ protected: public: void create_action(const String &p_name = "", MergeMode p_mode = MERGE_DISABLE); - void add_do_method(Object *p_object, const String &p_method, VARIANT_ARG_LIST); - void add_undo_method(Object *p_object, const String &p_method, VARIANT_ARG_LIST); - void add_do_property(Object *p_object, const String &p_property, const Variant &p_value); - void add_undo_property(Object *p_object, const String &p_property, const Variant &p_value); + void add_do_method(Object *p_object, const StringName &p_method, VARIANT_ARG_LIST); + void add_undo_method(Object *p_object, const StringName &p_method, VARIANT_ARG_LIST); + void add_do_property(Object *p_object, const StringName &p_property, const Variant &p_value); + void add_undo_property(Object *p_object, const StringName &p_property, const Variant &p_value); void add_do_reference(Object *p_object); void add_undo_reference(Object *p_object); diff --git a/core/ustring.cpp b/core/ustring.cpp index c4543b89da..1d4d9c2dfd 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -2169,6 +2169,7 @@ int64_t String::to_int(const CharType *p_str, int p_len) { } else { break; } + [[fallthrough]]; } case READING_INT: { diff --git a/core/variant.cpp b/core/variant.cpp index b849a83cb4..7bdaab8fa8 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -57,7 +57,7 @@ String Variant::get_type_name(Variant::Type p_type) { return "int"; } break; - case REAL: { + case FLOAT: { return "float"; @@ -72,10 +72,18 @@ String Variant::get_type_name(Variant::Type p_type) { return "Vector2"; } break; + case VECTOR2I: { + + return "Vector2i"; + } break; case RECT2: { return "Rect2"; } break; + case RECT2I: { + + return "Rect2i"; + } break; case TRANSFORM2D: { return "Transform2D"; @@ -84,6 +92,10 @@ String Variant::get_type_name(Variant::Type p_type) { return "Vector3"; } break; + case VECTOR3I: { + + return "Vector3i"; + } break; case PLANE: { return "Plane"; @@ -128,6 +140,19 @@ String Variant::get_type_name(Variant::Type p_type) { return "Object"; } break; + case CALLABLE: { + + return "Callable"; + } break; + case SIGNAL: { + + return "Signal"; + } break; + case STRING_NAME: { + + return "StringName"; + + } break; case NODE_PATH: { return "NodePath"; @@ -150,14 +175,24 @@ String Variant::get_type_name(Variant::Type p_type) { return "PackedByteArray"; } break; - case PACKED_INT_ARRAY: { + case PACKED_INT32_ARRAY: { - return "PackedIntArray"; + return "PackedInt32Array"; } break; - case PACKED_REAL_ARRAY: { + case PACKED_INT64_ARRAY: { - return "PackedRealArray"; + return "PackedInt64Array"; + + } break; + case PACKED_FLOAT32_ARRAY: { + + return "PackedFloat32Array"; + + } break; + case PACKED_FLOAT64_ARRAY: { + + return "PackedFloat64Array"; } break; case PACKED_STRING_ARRAY: { @@ -205,7 +240,7 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { static const Type valid[] = { INT, - REAL, + FLOAT, STRING, NIL, }; @@ -216,7 +251,7 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { static const Type valid[] = { BOOL, - REAL, + FLOAT, STRING, NIL, }; @@ -224,7 +259,7 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { valid_types = valid; } break; - case REAL: { + case FLOAT: { static const Type valid[] = { BOOL, @@ -245,6 +280,46 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { invalid_types = invalid; } break; + case VECTOR2: { + + static const Type valid[] = { + VECTOR2I, + NIL, + }; + + valid_types = valid; + + } break; + case VECTOR2I: { + + static const Type valid[] = { + VECTOR2, + NIL, + }; + + valid_types = valid; + + } break; + case RECT2: { + + static const Type valid[] = { + RECT2I, + NIL, + }; + + valid_types = valid; + + } break; + case RECT2I: { + + static const Type valid[] = { + RECT2, + NIL, + }; + + valid_types = valid; + + } break; case TRANSFORM2D: { static const Type valid[] = { @@ -254,6 +329,27 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { valid_types = valid; } break; + case VECTOR3: { + + static const Type valid[] = { + VECTOR3I, + NIL, + }; + + valid_types = valid; + + } break; + case VECTOR3I: { + + static const Type valid[] = { + VECTOR3, + NIL, + }; + + valid_types = valid; + + } break; + case QUAT: { static const Type valid[] = { @@ -317,6 +413,15 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { valid_types = valid; } break; + case STRING_NAME: { + + static const Type valid[] = { + STRING, + NIL + }; + + valid_types = valid; + } break; case NODE_PATH: { static const Type valid[] = { @@ -330,9 +435,11 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { static const Type valid[] = { PACKED_BYTE_ARRAY, - PACKED_INT_ARRAY, + PACKED_INT32_ARRAY, + PACKED_INT64_ARRAY, + PACKED_FLOAT32_ARRAY, + PACKED_FLOAT64_ARRAY, PACKED_STRING_ARRAY, - PACKED_REAL_ARRAY, PACKED_COLOR_ARRAY, PACKED_VECTOR2_ARRAY, PACKED_VECTOR3_ARRAY, @@ -351,7 +458,7 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { valid_types = valid; } break; - case PACKED_INT_ARRAY: { + case PACKED_INT32_ARRAY: { static const Type valid[] = { ARRAY, @@ -359,7 +466,24 @@ bool Variant::can_convert(Variant::Type p_type_from, Variant::Type p_type_to) { }; valid_types = valid; } break; - case PACKED_REAL_ARRAY: { + case PACKED_INT64_ARRAY: { + + static const Type valid[] = { + ARRAY, + NIL + }; + valid_types = valid; + } break; + case PACKED_FLOAT32_ARRAY: { + + static const Type valid[] = { + ARRAY, + NIL + }; + + valid_types = valid; + } break; + case PACKED_FLOAT64_ARRAY: { static const Type valid[] = { ARRAY, @@ -452,7 +576,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type static const Type valid[] = { INT, - REAL, + FLOAT, //STRING, NIL, }; @@ -463,7 +587,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type static const Type valid[] = { BOOL, - REAL, + FLOAT, //STRING, NIL, }; @@ -471,7 +595,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type valid_types = valid; } break; - case REAL: { + case FLOAT: { static const Type valid[] = { BOOL, @@ -487,11 +611,52 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type static const Type valid[] = { NODE_PATH, + STRING_NAME, NIL }; valid_types = valid; } break; + case VECTOR2: { + + static const Type valid[] = { + VECTOR2I, + NIL, + }; + + valid_types = valid; + + } break; + case VECTOR2I: { + + static const Type valid[] = { + VECTOR2, + NIL, + }; + + valid_types = valid; + + } break; + case RECT2: { + + static const Type valid[] = { + RECT2I, + NIL, + }; + + valid_types = valid; + + } break; + case RECT2I: { + + static const Type valid[] = { + RECT2, + NIL, + }; + + valid_types = valid; + + } break; case TRANSFORM2D: { static const Type valid[] = { @@ -501,6 +666,27 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type valid_types = valid; } break; + case VECTOR3: { + + static const Type valid[] = { + VECTOR3I, + NIL, + }; + + valid_types = valid; + + } break; + case VECTOR3I: { + + static const Type valid[] = { + VECTOR3, + NIL, + }; + + valid_types = valid; + + } break; + case QUAT: { static const Type valid[] = { @@ -564,6 +750,15 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type valid_types = valid; } break; + case STRING_NAME: { + + static const Type valid[] = { + STRING, + NIL + }; + + valid_types = valid; + } break; case NODE_PATH: { static const Type valid[] = { @@ -577,9 +772,11 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type static const Type valid[] = { PACKED_BYTE_ARRAY, - PACKED_INT_ARRAY, + PACKED_INT32_ARRAY, + PACKED_INT64_ARRAY, + PACKED_FLOAT32_ARRAY, + PACKED_FLOAT64_ARRAY, PACKED_STRING_ARRAY, - PACKED_REAL_ARRAY, PACKED_COLOR_ARRAY, PACKED_VECTOR2_ARRAY, PACKED_VECTOR3_ARRAY, @@ -598,7 +795,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type valid_types = valid; } break; - case PACKED_INT_ARRAY: { + case PACKED_INT32_ARRAY: { static const Type valid[] = { ARRAY, @@ -606,7 +803,24 @@ bool Variant::can_convert_strict(Variant::Type p_type_from, Variant::Type p_type }; valid_types = valid; } break; - case PACKED_REAL_ARRAY: { + case PACKED_INT64_ARRAY: { + + static const Type valid[] = { + ARRAY, + NIL + }; + valid_types = valid; + } break; + case PACKED_FLOAT32_ARRAY: { + + static const Type valid[] = { + ARRAY, + NIL + }; + + valid_types = valid; + } break; + case PACKED_FLOAT64_ARRAY: { static const Type valid[] = { ARRAY, @@ -716,9 +930,9 @@ bool Variant::is_zero() const { return _data._int == 0; } break; - case REAL: { + case FLOAT: { - return _data._real == 0; + return _data._float == 0; } break; case STRING: { @@ -733,11 +947,21 @@ bool Variant::is_zero() const { return *reinterpret_cast<const Vector2 *>(_data._mem) == Vector2(); } break; + case VECTOR2I: { + + return *reinterpret_cast<const Vector2i *>(_data._mem) == Vector2i(); + + } break; case RECT2: { return *reinterpret_cast<const Rect2 *>(_data._mem) == Rect2(); } break; + case RECT2I: { + + return *reinterpret_cast<const Rect2i *>(_data._mem) == Rect2i(); + + } break; case TRANSFORM2D: { return *_data._transform2d == Transform2D(); @@ -748,6 +972,11 @@ bool Variant::is_zero() const { return *reinterpret_cast<const Vector3 *>(_data._mem) == Vector3(); } break; + case VECTOR3I: { + + return *reinterpret_cast<const Vector3i *>(_data._mem) == Vector3i(); + + } break; case PLANE: { return *reinterpret_cast<const Plane *>(_data._mem) == Plane(); @@ -792,6 +1021,19 @@ bool Variant::is_zero() const { return _get_obj().obj == NULL; } break; + case CALLABLE: { + + return reinterpret_cast<const Callable *>(_data._mem)->is_null(); + } break; + case SIGNAL: { + + return reinterpret_cast<const Signal *>(_data._mem)->is_null(); + } break; + case STRING_NAME: { + + return *reinterpret_cast<const StringName *>(_data._mem) != StringName(); + + } break; case NODE_PATH: { return reinterpret_cast<const NodePath *>(_data._mem)->is_empty(); @@ -811,37 +1053,47 @@ bool Variant::is_zero() const { // arrays case PACKED_BYTE_ARRAY: { - return reinterpret_cast<const Vector<uint8_t> *>(_data._mem)->size() == 0; + return PackedArrayRef<uint8_t>::get_array(_data.packed_array).size() == 0; + + } break; + case PACKED_INT32_ARRAY: { + + return PackedArrayRef<int32_t>::get_array(_data.packed_array).size() == 0; } break; - case PACKED_INT_ARRAY: { + case PACKED_INT64_ARRAY: { - return reinterpret_cast<const Vector<int> *>(_data._mem)->size() == 0; + return PackedArrayRef<int64_t>::get_array(_data.packed_array).size() == 0; } break; - case PACKED_REAL_ARRAY: { + case PACKED_FLOAT32_ARRAY: { - return reinterpret_cast<const Vector<real_t> *>(_data._mem)->size() == 0; + return PackedArrayRef<float>::get_array(_data.packed_array).size() == 0; + + } break; + case PACKED_FLOAT64_ARRAY: { + + return PackedArrayRef<double>::get_array(_data.packed_array).size() == 0; } break; case PACKED_STRING_ARRAY: { - return reinterpret_cast<const Vector<String> *>(_data._mem)->size() == 0; + return PackedArrayRef<String>::get_array(_data.packed_array).size() == 0; } break; case PACKED_VECTOR2_ARRAY: { - return reinterpret_cast<const Vector<Vector2> *>(_data._mem)->size() == 0; + return PackedArrayRef<Vector2>::get_array(_data.packed_array).size() == 0; } break; case PACKED_VECTOR3_ARRAY: { - return reinterpret_cast<const Vector<Vector3> *>(_data._mem)->size() == 0; + return PackedArrayRef<Vector3>::get_array(_data.packed_array).size() == 0; } break; case PACKED_COLOR_ARRAY: { - return reinterpret_cast<const Vector<Color> *>(_data._mem)->size() == 0; + return PackedArrayRef<Color>::get_array(_data.packed_array).size() == 0; } break; default: { @@ -869,9 +1121,9 @@ bool Variant::is_one() const { return _data._int == 1; } break; - case REAL: { + case FLOAT: { - return _data._real == 1; + return _data._float == 1; } break; case VECTOR2: { @@ -879,16 +1131,31 @@ bool Variant::is_one() const { return *reinterpret_cast<const Vector2 *>(_data._mem) == Vector2(1, 1); } break; + case VECTOR2I: { + + return *reinterpret_cast<const Vector2i *>(_data._mem) == Vector2i(1, 1); + + } break; case RECT2: { return *reinterpret_cast<const Rect2 *>(_data._mem) == Rect2(1, 1, 1, 1); } break; + case RECT2I: { + + return *reinterpret_cast<const Rect2i *>(_data._mem) == Rect2i(1, 1, 1, 1); + + } break; case VECTOR3: { return *reinterpret_cast<const Vector3 *>(_data._mem) == Vector3(1, 1, 1); } break; + case VECTOR3I: { + + return *reinterpret_cast<const Vector3i *>(_data._mem) == Vector3i(1, 1, 1); + + } break; case PLANE: { return *reinterpret_cast<const Plane *>(_data._mem) == Plane(1, 1, 1, 1); @@ -922,7 +1189,7 @@ void Variant::reference(const Variant &p_variant) { case NIL: case BOOL: case INT: - case REAL: + case FLOAT: break; default: clear(); @@ -945,9 +1212,9 @@ void Variant::reference(const Variant &p_variant) { _data._int = p_variant._data._int; } break; - case REAL: { + case FLOAT: { - _data._real = p_variant._data._real; + _data._float = p_variant._data._float; } break; case STRING: { @@ -959,10 +1226,18 @@ void Variant::reference(const Variant &p_variant) { memnew_placement(_data._mem, Vector2(*reinterpret_cast<const Vector2 *>(p_variant._data._mem))); } break; + case VECTOR2I: { + + memnew_placement(_data._mem, Vector2i(*reinterpret_cast<const Vector2i *>(p_variant._data._mem))); + } break; case RECT2: { memnew_placement(_data._mem, Rect2(*reinterpret_cast<const Rect2 *>(p_variant._data._mem))); } break; + case RECT2I: { + + memnew_placement(_data._mem, Rect2i(*reinterpret_cast<const Rect2i *>(p_variant._data._mem))); + } break; case TRANSFORM2D: { _data._transform2d = memnew(Transform2D(*p_variant._data._transform2d)); @@ -971,6 +1246,10 @@ void Variant::reference(const Variant &p_variant) { memnew_placement(_data._mem, Vector3(*reinterpret_cast<const Vector3 *>(p_variant._data._mem))); } break; + case VECTOR3I: { + + memnew_placement(_data._mem, Vector3i(*reinterpret_cast<const Vector3i *>(p_variant._data._mem))); + } break; case PLANE: { memnew_placement(_data._mem, Plane(*reinterpret_cast<const Plane *>(p_variant._data._mem))); @@ -1022,6 +1301,19 @@ void Variant::reference(const Variant &p_variant) { _get_obj().id = p_variant._get_obj().id; } break; + case CALLABLE: { + + memnew_placement(_data._mem, Callable(*reinterpret_cast<const Callable *>(p_variant._data._mem))); + } break; + case SIGNAL: { + + memnew_placement(_data._mem, Signal(*reinterpret_cast<const Signal *>(p_variant._data._mem))); + } break; + case STRING_NAME: { + + memnew_placement(_data._mem, StringName(*reinterpret_cast<const StringName *>(p_variant._data._mem))); + + } break; case NODE_PATH: { memnew_placement(_data._mem, NodePath(*reinterpret_cast<const NodePath *>(p_variant._data._mem))); @@ -1041,37 +1333,74 @@ void Variant::reference(const Variant &p_variant) { // arrays case PACKED_BYTE_ARRAY: { - memnew_placement(_data._mem, Vector<uint8_t>(*reinterpret_cast<const Vector<uint8_t> *>(p_variant._data._mem))); + _data.packed_array = static_cast<PackedArrayRef<uint8_t> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<uint8_t>::create(); + } } break; - case PACKED_INT_ARRAY: { + case PACKED_INT32_ARRAY: { - memnew_placement(_data._mem, Vector<int>(*reinterpret_cast<const Vector<int> *>(p_variant._data._mem))); + _data.packed_array = static_cast<PackedArrayRef<int32_t> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<int32_t>::create(); + } } break; - case PACKED_REAL_ARRAY: { + case PACKED_INT64_ARRAY: { + + _data.packed_array = static_cast<PackedArrayRef<int64_t> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<int64_t>::create(); + } - memnew_placement(_data._mem, Vector<real_t>(*reinterpret_cast<const Vector<real_t> *>(p_variant._data._mem))); + } break; + case PACKED_FLOAT32_ARRAY: { + + _data.packed_array = static_cast<PackedArrayRef<float> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<float>::create(); + } + + } break; + case PACKED_FLOAT64_ARRAY: { + + _data.packed_array = static_cast<PackedArrayRef<double> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<double>::create(); + } } break; case PACKED_STRING_ARRAY: { - memnew_placement(_data._mem, Vector<String>(*reinterpret_cast<const Vector<String> *>(p_variant._data._mem))); + _data.packed_array = static_cast<PackedArrayRef<String> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<String>::create(); + } } break; case PACKED_VECTOR2_ARRAY: { - memnew_placement(_data._mem, Vector<Vector2>(*reinterpret_cast<const Vector<Vector2> *>(p_variant._data._mem))); + _data.packed_array = static_cast<PackedArrayRef<Vector2> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<Vector2>::create(); + } } break; case PACKED_VECTOR3_ARRAY: { - memnew_placement(_data._mem, Vector<Vector3>(*reinterpret_cast<const Vector<Vector3> *>(p_variant._data._mem))); + _data.packed_array = static_cast<PackedArrayRef<Vector3> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<Vector3>::create(); + } } break; case PACKED_COLOR_ARRAY: { - memnew_placement(_data._mem, Vector<Color>(*reinterpret_cast<const Vector<Color> *>(p_variant._data._mem))); + _data.packed_array = static_cast<PackedArrayRef<Color> *>(p_variant._data.packed_array)->reference(); + if (!_data.packed_array) { + _data.packed_array = PackedArrayRef<Color>::create(); + } } break; default: { @@ -1084,10 +1413,13 @@ void Variant::zero() { case NIL: break; case BOOL: this->_data._bool = false; break; case INT: this->_data._int = 0; break; - case REAL: this->_data._real = 0; break; + case FLOAT: this->_data._float = 0; break; case VECTOR2: *reinterpret_cast<Vector2 *>(this->_data._mem) = Vector2(); break; + case VECTOR2I: *reinterpret_cast<Vector2i *>(this->_data._mem) = Vector2i(); break; case RECT2: *reinterpret_cast<Rect2 *>(this->_data._mem) = Rect2(); break; + case RECT2I: *reinterpret_cast<Rect2i *>(this->_data._mem) = Rect2i(); break; case VECTOR3: *reinterpret_cast<Vector3 *>(this->_data._mem) = Vector3(); break; + case VECTOR3I: *reinterpret_cast<Vector3i *>(this->_data._mem) = Vector3i(); break; case PLANE: *reinterpret_cast<Plane *>(this->_data._mem) = Plane(); break; case QUAT: *reinterpret_cast<Quat *>(this->_data._mem) = Quat(); break; case COLOR: *reinterpret_cast<Color *>(this->_data._mem) = Color(); break; @@ -1128,7 +1460,11 @@ void Variant::clear() { memdelete(_data._transform); } break; - // misc types + // misc types + case STRING_NAME: { + + reinterpret_cast<StringName *>(_data._mem)->~StringName(); + } break; case NODE_PATH: { reinterpret_cast<NodePath *>(_data._mem)->~NodePath(); @@ -1149,6 +1485,14 @@ void Variant::clear() { // not much need probably reinterpret_cast<RID *>(_data._mem)->~RID(); } break; + case CALLABLE: { + + reinterpret_cast<Callable *>(_data._mem)->~Callable(); + } break; + case SIGNAL: { + + reinterpret_cast<Signal *>(_data._mem)->~Signal(); + } break; case DICTIONARY: { reinterpret_cast<Dictionary *>(_data._mem)->~Dictionary(); @@ -1160,31 +1504,39 @@ void Variant::clear() { // arrays case PACKED_BYTE_ARRAY: { - reinterpret_cast<Vector<uint8_t> *>(_data._mem)->~Vector<uint8_t>(); + PackedArrayRefBase::destroy(_data.packed_array); + } break; + case PACKED_INT32_ARRAY: { + + PackedArrayRefBase::destroy(_data.packed_array); + } break; + case PACKED_INT64_ARRAY: { + + PackedArrayRefBase::destroy(_data.packed_array); } break; - case PACKED_INT_ARRAY: { + case PACKED_FLOAT32_ARRAY: { - reinterpret_cast<Vector<int> *>(_data._mem)->~Vector<int>(); + PackedArrayRefBase::destroy(_data.packed_array); } break; - case PACKED_REAL_ARRAY: { + case PACKED_FLOAT64_ARRAY: { - reinterpret_cast<Vector<real_t> *>(_data._mem)->~Vector<real_t>(); + PackedArrayRefBase::destroy(_data.packed_array); } break; case PACKED_STRING_ARRAY: { - reinterpret_cast<Vector<String> *>(_data._mem)->~Vector<String>(); + PackedArrayRefBase::destroy(_data.packed_array); } break; case PACKED_VECTOR2_ARRAY: { - reinterpret_cast<Vector<Vector2> *>(_data._mem)->~Vector<Vector2>(); + PackedArrayRefBase::destroy(_data.packed_array); } break; case PACKED_VECTOR3_ARRAY: { - reinterpret_cast<Vector<Vector3> *>(_data._mem)->~Vector<Vector3>(); + PackedArrayRefBase::destroy(_data.packed_array); } break; case PACKED_COLOR_ARRAY: { - reinterpret_cast<Vector<Color> *>(_data._mem)->~Vector<Color>(); + PackedArrayRefBase::destroy(_data.packed_array); } break; default: { } /* not needed */ @@ -1200,7 +1552,7 @@ Variant::operator signed int() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_int(); default: { @@ -1215,7 +1567,7 @@ Variant::operator unsigned int() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_int(); default: { @@ -1231,7 +1583,7 @@ Variant::operator int64_t() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_int64(); default: { @@ -1248,7 +1600,7 @@ Variant::operator long unsigned int() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._real; case STRING: return operator String().to_int(); default: { @@ -1267,7 +1619,7 @@ Variant::operator uint64_t() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_int(); default: { @@ -1279,6 +1631,8 @@ Variant::operator uint64_t() const { Variant::operator ObjectID() const { if (type == INT) { return ObjectID(_data._int); + } else if (type == OBJECT) { + return _get_obj().id; } else { return ObjectID(); } @@ -1292,7 +1646,7 @@ Variant::operator signed long() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._real; case STRING: return operator String().to_int(); default: { @@ -1310,7 +1664,7 @@ Variant::operator unsigned long() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._real; case STRING: return operator String().to_int(); default: { @@ -1329,7 +1683,7 @@ Variant::operator signed short() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_int(); default: { @@ -1344,7 +1698,7 @@ Variant::operator unsigned short() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_int(); default: { @@ -1359,7 +1713,7 @@ Variant::operator signed char() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_int(); default: { @@ -1374,7 +1728,7 @@ Variant::operator unsigned char() const { case NIL: return 0; case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_int(); default: { @@ -1395,7 +1749,7 @@ Variant::operator float() const { case NIL: return 0; case BOOL: return _data._bool ? 1.0 : 0.0; case INT: return (float)_data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_double(); default: { @@ -1410,7 +1764,7 @@ Variant::operator double() const { case NIL: return 0; case BOOL: return _data._bool ? 1.0 : 0.0; case INT: return (double)_data._int; - case REAL: return _data._real; + case FLOAT: return _data._float; case STRING: return operator String().to_double(); default: { @@ -1421,10 +1775,13 @@ Variant::operator double() const { Variant::operator StringName() const { - if (type == NODE_PATH) { - return reinterpret_cast<const NodePath *>(_data._mem)->get_sname(); + if (type == STRING_NAME) { + return *reinterpret_cast<const StringName *>(_data._mem); + } else if (type == STRING) { + return *reinterpret_cast<const String *>(_data._mem); } - return StringName(operator String()); + + return StringName(); } struct _VariantStrPair { @@ -1450,16 +1807,19 @@ String Variant::stringify(List<const void *> &stack) const { case NIL: return "Null"; case BOOL: return _data._bool ? "True" : "False"; case INT: return itos(_data._int); - case REAL: return rtos(_data._real); + case FLOAT: return rtos(_data._float); case STRING: return *reinterpret_cast<const String *>(_data._mem); case VECTOR2: return "(" + operator Vector2() + ")"; + case VECTOR2I: return "(" + operator Vector2i() + ")"; case RECT2: return "(" + operator Rect2() + ")"; + case RECT2I: return "(" + operator Rect2i() + ")"; case TRANSFORM2D: { Transform2D mat32 = operator Transform2D(); return "(" + Variant(mat32.elements[0]).operator String() + ", " + Variant(mat32.elements[1]).operator String() + ", " + Variant(mat32.elements[2]).operator String() + ")"; } break; case VECTOR3: return "(" + operator Vector3() + ")"; + case VECTOR3I: return "(" + operator Vector3i() + ")"; case PLANE: return operator Plane(); //case QUAT: @@ -1491,6 +1851,7 @@ String Variant::stringify(List<const void *> &stack) const { return mtx + ")"; } break; case TRANSFORM: return operator Transform(); + case STRING_NAME: return operator StringName(); case NODE_PATH: return operator NodePath(); case COLOR: return String::num(operator Color().r) + "," + String::num(operator Color().g) + "," + String::num(operator Color().b) + "," + String::num(operator Color().a); case DICTIONARY: { @@ -1568,9 +1929,22 @@ String Variant::stringify(List<const void *> &stack) const { str += "]"; return str; } break; - case PACKED_INT_ARRAY: { + case PACKED_INT32_ARRAY: { + + Vector<int32_t> vec = operator Vector<int32_t>(); + String str("["); + for (int i = 0; i < vec.size(); i++) { + + if (i > 0) + str += ", "; + str = str + itos(vec[i]); + } + str += "]"; + return str; + } break; + case PACKED_INT64_ARRAY: { - Vector<int> vec = operator Vector<int>(); + Vector<int64_t> vec = operator Vector<int64_t>(); String str("["); for (int i = 0; i < vec.size(); i++) { @@ -1581,9 +1955,22 @@ String Variant::stringify(List<const void *> &stack) const { str += "]"; return str; } break; - case PACKED_REAL_ARRAY: { + case PACKED_FLOAT32_ARRAY: { - Vector<real_t> vec = operator Vector<real_t>(); + Vector<float> vec = operator Vector<float>(); + String str("["); + for (int i = 0; i < vec.size(); i++) { + + if (i > 0) + str += ", "; + str = str + rtos(vec[i]); + } + str += "]"; + return str; + } break; + case PACKED_FLOAT64_ARRAY: { + + Vector<double> vec = operator Vector<double>(); String str("["); for (int i = 0; i < vec.size(); i++) { @@ -1627,6 +2014,18 @@ String Variant::stringify(List<const void *> &stack) const { return "[Object:null]"; } break; + case CALLABLE: { + const Callable &c = *reinterpret_cast<const Callable *>(_data._mem); + return c; + } break; + case SIGNAL: { + const Signal &s = *reinterpret_cast<const Signal *>(_data._mem); + return s; + } break; + case _RID: { + const RID &s = *reinterpret_cast<const RID *>(_data._mem); + return "RID(" + itos(s.get_id()) + ")"; + } break; default: { return "[" + get_type_name(type) + "]"; } @@ -1639,28 +2038,78 @@ Variant::operator Vector2() const { if (type == VECTOR2) return *reinterpret_cast<const Vector2 *>(_data._mem); + else if (type == VECTOR2I) + return *reinterpret_cast<const Vector2i *>(_data._mem); else if (type == VECTOR3) return Vector2(reinterpret_cast<const Vector3 *>(_data._mem)->x, reinterpret_cast<const Vector3 *>(_data._mem)->y); + else if (type == VECTOR3I) + return Vector2(reinterpret_cast<const Vector3i *>(_data._mem)->x, reinterpret_cast<const Vector3i *>(_data._mem)->y); else return Vector2(); } + +Variant::operator Vector2i() const { + + if (type == VECTOR2I) + return *reinterpret_cast<const Vector2i *>(_data._mem); + else if (type == VECTOR2) + return *reinterpret_cast<const Vector2 *>(_data._mem); + else if (type == VECTOR3) + return Vector2(reinterpret_cast<const Vector3 *>(_data._mem)->x, reinterpret_cast<const Vector3 *>(_data._mem)->y); + else if (type == VECTOR3I) + return Vector2(reinterpret_cast<const Vector3i *>(_data._mem)->x, reinterpret_cast<const Vector3i *>(_data._mem)->y); + else + return Vector2i(); +} + Variant::operator Rect2() const { if (type == RECT2) return *reinterpret_cast<const Rect2 *>(_data._mem); + else if (type == RECT2I) + return *reinterpret_cast<const Rect2i *>(_data._mem); else return Rect2(); } +Variant::operator Rect2i() const { + + if (type == RECT2I) + return *reinterpret_cast<const Rect2i *>(_data._mem); + else if (type == RECT2) + return *reinterpret_cast<const Rect2 *>(_data._mem); + else + return Rect2i(); +} + Variant::operator Vector3() const { if (type == VECTOR3) return *reinterpret_cast<const Vector3 *>(_data._mem); + else if (type == VECTOR3I) + return *reinterpret_cast<const Vector3i *>(_data._mem); else if (type == VECTOR2) return Vector3(reinterpret_cast<const Vector2 *>(_data._mem)->x, reinterpret_cast<const Vector2 *>(_data._mem)->y, 0.0); + else if (type == VECTOR2I) + return Vector3(reinterpret_cast<const Vector2i *>(_data._mem)->x, reinterpret_cast<const Vector2i *>(_data._mem)->y, 0.0); else return Vector3(); } + +Variant::operator Vector3i() const { + + if (type == VECTOR3I) + return *reinterpret_cast<const Vector3i *>(_data._mem); + else if (type == VECTOR3) + return *reinterpret_cast<const Vector3 *>(_data._mem); + else if (type == VECTOR2) + return Vector3i(reinterpret_cast<const Vector2 *>(_data._mem)->x, reinterpret_cast<const Vector2 *>(_data._mem)->y, 0.0); + else if (type == VECTOR2I) + return Vector3i(reinterpret_cast<const Vector2i *>(_data._mem)->x, reinterpret_cast<const Vector2i *>(_data._mem)->y, 0.0); + else + return Vector3i(); +} + Variant::operator Plane() const { if (type == PLANE) @@ -1776,9 +2225,9 @@ Variant::operator RID() const { ERR_FAIL_COND_V_MSG(ObjectDB::get_instance(_get_obj().id) == nullptr, RID(), "Invalid pointer (object was freed)."); }; #endif - Variant::CallError ce; + Callable::CallError ce; Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->get_rid, NULL, 0, ce); - if (ce.error == Variant::CallError::CALL_OK && ret.get_type() == Variant::_RID) { + if (ce.error == Callable::CallError::CALL_OK && ret.get_type() == Variant::_RID) { return ret; } return RID(); @@ -1836,6 +2285,22 @@ Variant::operator Dictionary() const { return Dictionary(); } +Variant::operator Callable() const { + + if (type == CALLABLE) + return *reinterpret_cast<const Callable *>(_data._mem); + else + return Callable(); +} + +Variant::operator Signal() const { + + if (type == SIGNAL) + return *reinterpret_cast<const Signal *>(_data._mem); + else + return Signal(); +} + template <class DA, class SA> inline DA _convert_array(const SA &p_array) { @@ -1861,11 +2326,17 @@ inline DA _convert_array_from_variant(const Variant &p_variant) { case Variant::PACKED_BYTE_ARRAY: { return _convert_array<DA, Vector<uint8_t> >(p_variant.operator Vector<uint8_t>()); } - case Variant::PACKED_INT_ARRAY: { - return _convert_array<DA, Vector<int> >(p_variant.operator Vector<int>()); + case Variant::PACKED_INT32_ARRAY: { + return _convert_array<DA, Vector<int32_t> >(p_variant.operator Vector<int32_t>()); + } + case Variant::PACKED_INT64_ARRAY: { + return _convert_array<DA, Vector<int64_t> >(p_variant.operator Vector<int64_t>()); + } + case Variant::PACKED_FLOAT32_ARRAY: { + return _convert_array<DA, Vector<float> >(p_variant.operator Vector<float>()); } - case Variant::PACKED_REAL_ARRAY: { - return _convert_array<DA, Vector<real_t> >(p_variant.operator Vector<real_t>()); + case Variant::PACKED_FLOAT64_ARRAY: { + return _convert_array<DA, Vector<double> >(p_variant.operator Vector<double>()); } case Variant::PACKED_STRING_ARRAY: { return _convert_array<DA, Vector<String> >(p_variant.operator Vector<String>()); @@ -1896,43 +2367,59 @@ Variant::operator Array() const { Variant::operator Vector<uint8_t>() const { if (type == PACKED_BYTE_ARRAY) - return *reinterpret_cast<const Vector<uint8_t> *>(_data._mem); + return static_cast<PackedArrayRef<uint8_t> *>(_data.packed_array)->array; else return _convert_array_from_variant<Vector<uint8_t> >(*this); } -Variant::operator Vector<int>() const { +Variant::operator Vector<int32_t>() const { - if (type == PACKED_INT_ARRAY) - return *reinterpret_cast<const Vector<int> *>(_data._mem); + if (type == PACKED_INT32_ARRAY) + return static_cast<PackedArrayRef<int32_t> *>(_data.packed_array)->array; else return _convert_array_from_variant<Vector<int> >(*this); } -Variant::operator Vector<real_t>() const { +Variant::operator Vector<int64_t>() const { - if (type == PACKED_REAL_ARRAY) - return *reinterpret_cast<const Vector<real_t> *>(_data._mem); + if (type == PACKED_INT64_ARRAY) + return static_cast<PackedArrayRef<int64_t> *>(_data.packed_array)->array; else - return _convert_array_from_variant<Vector<real_t> >(*this); + return _convert_array_from_variant<Vector<int64_t> >(*this); +} + +Variant::operator Vector<float>() const { + + if (type == PACKED_FLOAT32_ARRAY) + return static_cast<PackedArrayRef<float> *>(_data.packed_array)->array; + else + return _convert_array_from_variant<Vector<float> >(*this); +} + +Variant::operator Vector<double>() const { + + if (type == PACKED_FLOAT64_ARRAY) + return static_cast<PackedArrayRef<double> *>(_data.packed_array)->array; + else + return _convert_array_from_variant<Vector<double> >(*this); } Variant::operator Vector<String>() const { if (type == PACKED_STRING_ARRAY) - return *reinterpret_cast<const Vector<String> *>(_data._mem); + return static_cast<PackedArrayRef<String> *>(_data.packed_array)->array; else return _convert_array_from_variant<Vector<String> >(*this); } Variant::operator Vector<Vector3>() const { if (type == PACKED_VECTOR3_ARRAY) - return *reinterpret_cast<const Vector<Vector3> *>(_data._mem); + return static_cast<PackedArrayRef<Vector3> *>(_data.packed_array)->array; else return _convert_array_from_variant<Vector<Vector3> >(*this); } Variant::operator Vector<Vector2>() const { if (type == PACKED_VECTOR2_ARRAY) - return *reinterpret_cast<const Vector<Vector2> *>(_data._mem); + return static_cast<PackedArrayRef<Vector2> *>(_data.packed_array)->array; else return _convert_array_from_variant<Vector<Vector2> >(*this); } @@ -1940,7 +2427,7 @@ Variant::operator Vector<Vector2>() const { Variant::operator Vector<Color>() const { if (type == PACKED_COLOR_ARRAY) - return *reinterpret_cast<const Vector<Color> *>(_data._mem); + return static_cast<PackedArrayRef<Color> *>(_data.packed_array)->array; else return _convert_array_from_variant<Vector<Color> >(*this); } @@ -2031,7 +2518,7 @@ Variant::operator Orientation() const { Variant::operator IP_Address() const { - if (type == PACKED_REAL_ARRAY || type == PACKED_INT_ARRAY || type == PACKED_BYTE_ARRAY) { + if (type == PACKED_FLOAT32_ARRAY || type == PACKED_INT32_ARRAY || type == PACKED_FLOAT64_ARRAY || type == PACKED_INT64_ARRAY || type == PACKED_BYTE_ARRAY) { Vector<int> addr = operator Vector<int>(); if (addr.size() == 4) { @@ -2115,13 +2602,13 @@ Variant::Variant(unsigned char p_char) { } Variant::Variant(float p_float) { - type = REAL; - _data._real = p_float; + type = FLOAT; + _data._float = p_float; } Variant::Variant(double p_double) { - type = REAL; - _data._real = p_double; + type = FLOAT; + _data._float = p_double; } Variant::Variant(const ObjectID &p_id) { @@ -2131,8 +2618,8 @@ Variant::Variant(const ObjectID &p_id) { Variant::Variant(const StringName &p_string) { - type = STRING; - memnew_placement(_data._mem, String(p_string.operator String())); + type = STRING_NAME; + memnew_placement(_data._mem, StringName(p_string)); } Variant::Variant(const String &p_string) { @@ -2156,17 +2643,36 @@ Variant::Variant(const Vector3 &p_vector3) { type = VECTOR3; memnew_placement(_data._mem, Vector3(p_vector3)); } +Variant::Variant(const Vector3i &p_vector3i) { + + type = VECTOR3I; + memnew_placement(_data._mem, Vector3i(p_vector3i)); +} + Variant::Variant(const Vector2 &p_vector2) { type = VECTOR2; memnew_placement(_data._mem, Vector2(p_vector2)); } + +Variant::Variant(const Vector2i &p_vector2i) { + + type = VECTOR2I; + memnew_placement(_data._mem, Vector2i(p_vector2i)); +} + Variant::Variant(const Rect2 &p_rect2) { type = RECT2; memnew_placement(_data._mem, Rect2(p_rect2)); } +Variant::Variant(const Rect2i &p_rect2i) { + + type = RECT2I; + memnew_placement(_data._mem, Rect2i(p_rect2i)); +} + Variant::Variant(const Plane &p_plane) { type = PLANE; @@ -2243,6 +2749,17 @@ Variant::Variant(const Object *p_object) { } } +Variant::Variant(const Callable &p_callable) { + + type = CALLABLE; + memnew_placement(_data._mem, Callable(p_callable)); +} +Variant::Variant(const Signal &p_callable) { + + type = SIGNAL; + memnew_placement(_data._mem, Signal(p_callable)); +} + Variant::Variant(const Dictionary &p_dictionary) { type = DICTIONARY; @@ -2283,41 +2800,56 @@ Variant::Variant(const Vector<RID> &p_array) { } } -Variant::Variant(const Vector<uint8_t> &p_raw_array) { +Variant::Variant(const Vector<uint8_t> &p_byte_array) { type = PACKED_BYTE_ARRAY; - memnew_placement(_data._mem, Vector<uint8_t>(p_raw_array)); + + _data.packed_array = PackedArrayRef<uint8_t>::create(p_byte_array); +} +Variant::Variant(const Vector<int32_t> &p_int32_array) { + + type = PACKED_INT32_ARRAY; + _data.packed_array = PackedArrayRef<int32_t>::create(p_int32_array); +} + +Variant::Variant(const Vector<int64_t> &p_int64_array) { + + type = PACKED_INT64_ARRAY; + _data.packed_array = PackedArrayRef<int64_t>::create(p_int64_array); } -Variant::Variant(const Vector<int> &p_int_array) { - type = PACKED_INT_ARRAY; - memnew_placement(_data._mem, Vector<int>(p_int_array)); +Variant::Variant(const Vector<float> &p_float32_array) { + + type = PACKED_FLOAT32_ARRAY; + _data.packed_array = PackedArrayRef<float>::create(p_float32_array); } -Variant::Variant(const Vector<real_t> &p_real_array) { - type = PACKED_REAL_ARRAY; - memnew_placement(_data._mem, Vector<real_t>(p_real_array)); +Variant::Variant(const Vector<double> &p_float64_array) { + + type = PACKED_FLOAT64_ARRAY; + _data.packed_array = PackedArrayRef<double>::create(p_float64_array); } + Variant::Variant(const Vector<String> &p_string_array) { type = PACKED_STRING_ARRAY; - memnew_placement(_data._mem, Vector<String>(p_string_array)); + _data.packed_array = PackedArrayRef<String>::create(p_string_array); } Variant::Variant(const Vector<Vector3> &p_vector3_array) { type = PACKED_VECTOR3_ARRAY; - memnew_placement(_data._mem, Vector<Vector3>(p_vector3_array)); + _data.packed_array = PackedArrayRef<Vector3>::create(p_vector3_array); } Variant::Variant(const Vector<Vector2> &p_vector2_array) { type = PACKED_VECTOR2_ARRAY; - memnew_placement(_data._mem, Vector<Vector2>(p_vector2_array)); + _data.packed_array = PackedArrayRef<Vector2>::create(p_vector2_array); } Variant::Variant(const Vector<Color> &p_color_array) { type = PACKED_COLOR_ARRAY; - memnew_placement(_data._mem, Vector<Color>(p_color_array)); + _data.packed_array = PackedArrayRef<Color>::create(p_color_array); } Variant::Variant(const Vector<Face3> &p_face_array) { @@ -2389,9 +2921,9 @@ void Variant::operator=(const Variant &p_variant) { _data._int = p_variant._data._int; } break; - case REAL: { + case FLOAT: { - _data._real = p_variant._data._real; + _data._float = p_variant._data._float; } break; case STRING: { @@ -2403,10 +2935,18 @@ void Variant::operator=(const Variant &p_variant) { *reinterpret_cast<Vector2 *>(_data._mem) = *reinterpret_cast<const Vector2 *>(p_variant._data._mem); } break; + case VECTOR2I: { + + *reinterpret_cast<Vector2i *>(_data._mem) = *reinterpret_cast<const Vector2i *>(p_variant._data._mem); + } break; case RECT2: { *reinterpret_cast<Rect2 *>(_data._mem) = *reinterpret_cast<const Rect2 *>(p_variant._data._mem); } break; + case RECT2I: { + + *reinterpret_cast<Rect2i *>(_data._mem) = *reinterpret_cast<const Rect2i *>(p_variant._data._mem); + } break; case TRANSFORM2D: { *_data._transform2d = *(p_variant._data._transform2d); @@ -2415,6 +2955,10 @@ void Variant::operator=(const Variant &p_variant) { *reinterpret_cast<Vector3 *>(_data._mem) = *reinterpret_cast<const Vector3 *>(p_variant._data._mem); } break; + case VECTOR3I: { + + *reinterpret_cast<Vector3i *>(_data._mem) = *reinterpret_cast<const Vector3i *>(p_variant._data._mem); + } break; case PLANE: { *reinterpret_cast<Plane *>(_data._mem) = *reinterpret_cast<const Plane *>(p_variant._data._mem); @@ -2469,6 +3013,19 @@ void Variant::operator=(const Variant &p_variant) { _get_obj().id = p_variant._get_obj().id; } break; + case CALLABLE: { + + *reinterpret_cast<Callable *>(_data._mem) = *reinterpret_cast<const Callable *>(p_variant._data._mem); + } break; + case SIGNAL: { + + *reinterpret_cast<Signal *>(_data._mem) = *reinterpret_cast<const Signal *>(p_variant._data._mem); + } break; + + case STRING_NAME: { + + *reinterpret_cast<StringName *>(_data._mem) = *reinterpret_cast<const StringName *>(p_variant._data._mem); + } break; case NODE_PATH: { *reinterpret_cast<NodePath *>(_data._mem) = *reinterpret_cast<const NodePath *>(p_variant._data._mem); @@ -2485,31 +3042,39 @@ void Variant::operator=(const Variant &p_variant) { // arrays case PACKED_BYTE_ARRAY: { - *reinterpret_cast<Vector<uint8_t> *>(_data._mem) = *reinterpret_cast<const Vector<uint8_t> *>(p_variant._data._mem); + _data.packed_array = PackedArrayRef<uint8_t>::reference_from(_data.packed_array, p_variant._data.packed_array); + } break; + case PACKED_INT32_ARRAY: { + + _data.packed_array = PackedArrayRef<int32_t>::reference_from(_data.packed_array, p_variant._data.packed_array); + } break; + case PACKED_INT64_ARRAY: { + + _data.packed_array = PackedArrayRef<int64_t>::reference_from(_data.packed_array, p_variant._data.packed_array); } break; - case PACKED_INT_ARRAY: { + case PACKED_FLOAT32_ARRAY: { - *reinterpret_cast<Vector<int> *>(_data._mem) = *reinterpret_cast<const Vector<int> *>(p_variant._data._mem); + _data.packed_array = PackedArrayRef<float>::reference_from(_data.packed_array, p_variant._data.packed_array); } break; - case PACKED_REAL_ARRAY: { + case PACKED_FLOAT64_ARRAY: { - *reinterpret_cast<Vector<real_t> *>(_data._mem) = *reinterpret_cast<const Vector<real_t> *>(p_variant._data._mem); + _data.packed_array = PackedArrayRef<double>::reference_from(_data.packed_array, p_variant._data.packed_array); } break; case PACKED_STRING_ARRAY: { - *reinterpret_cast<Vector<String> *>(_data._mem) = *reinterpret_cast<const Vector<String> *>(p_variant._data._mem); + _data.packed_array = PackedArrayRef<String>::reference_from(_data.packed_array, p_variant._data.packed_array); } break; case PACKED_VECTOR2_ARRAY: { - *reinterpret_cast<Vector<Vector2> *>(_data._mem) = *reinterpret_cast<const Vector<Vector2> *>(p_variant._data._mem); + _data.packed_array = PackedArrayRef<Vector2>::reference_from(_data.packed_array, p_variant._data.packed_array); } break; case PACKED_VECTOR3_ARRAY: { - *reinterpret_cast<Vector<Vector3> *>(_data._mem) = *reinterpret_cast<const Vector<Vector3> *>(p_variant._data._mem); + _data.packed_array = PackedArrayRef<Vector3>::reference_from(_data.packed_array, p_variant._data.packed_array); } break; case PACKED_COLOR_ARRAY: { - *reinterpret_cast<Vector<Color> *>(_data._mem) = *reinterpret_cast<const Vector<Color> *>(p_variant._data._mem); + _data.packed_array = PackedArrayRef<Color>::reference_from(_data.packed_array, p_variant._data.packed_array); } break; default: { } @@ -2549,9 +3114,9 @@ uint32_t Variant::hash() const { return _data._int; } break; - case REAL: { + case FLOAT: { - return hash_djb2_one_float(_data._real); + return hash_djb2_one_float(_data._float); } break; case STRING: { @@ -2564,6 +3129,11 @@ uint32_t Variant::hash() const { uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Vector2 *>(_data._mem)->x); return hash_djb2_one_float(reinterpret_cast<const Vector2 *>(_data._mem)->y, hash); } break; + case VECTOR2I: { + + uint32_t hash = hash_djb2_one_32(reinterpret_cast<const Vector2i *>(_data._mem)->x); + return hash_djb2_one_32(reinterpret_cast<const Vector2i *>(_data._mem)->y, hash); + } break; case RECT2: { uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->position.x); @@ -2571,6 +3141,13 @@ uint32_t Variant::hash() const { hash = hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->size.x, hash); return hash_djb2_one_float(reinterpret_cast<const Rect2 *>(_data._mem)->size.y, hash); } break; + case RECT2I: { + + uint32_t hash = hash_djb2_one_32(reinterpret_cast<const Rect2i *>(_data._mem)->position.x); + hash = hash_djb2_one_32(reinterpret_cast<const Rect2i *>(_data._mem)->position.y, hash); + hash = hash_djb2_one_32(reinterpret_cast<const Rect2i *>(_data._mem)->size.x, hash); + return hash_djb2_one_32(reinterpret_cast<const Rect2i *>(_data._mem)->size.y, hash); + } break; case TRANSFORM2D: { uint32_t hash = 5831; @@ -2589,6 +3166,12 @@ uint32_t Variant::hash() const { hash = hash_djb2_one_float(reinterpret_cast<const Vector3 *>(_data._mem)->y, hash); return hash_djb2_one_float(reinterpret_cast<const Vector3 *>(_data._mem)->z, hash); } break; + case VECTOR3I: { + + uint32_t hash = hash_djb2_one_32(reinterpret_cast<const Vector3i *>(_data._mem)->x); + hash = hash_djb2_one_32(reinterpret_cast<const Vector3i *>(_data._mem)->y, hash); + return hash_djb2_one_32(reinterpret_cast<const Vector3i *>(_data._mem)->z, hash); + } break; case PLANE: { uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Plane *>(_data._mem)->normal.x); @@ -2667,6 +3250,10 @@ uint32_t Variant::hash() const { return hash_djb2_one_64(make_uint64_t(_get_obj().obj)); } break; + case STRING_NAME: { + + return reinterpret_cast<const StringName *>(_data._mem)->hash(); + } break; case NODE_PATH: { return reinterpret_cast<const NodePath *>(_data._mem)->hash(); @@ -2676,6 +3263,17 @@ uint32_t Variant::hash() const { return reinterpret_cast<const Dictionary *>(_data._mem)->hash(); } break; + case CALLABLE: { + + return reinterpret_cast<const Callable *>(_data._mem)->hash(); + + } break; + case SIGNAL: { + + const Signal &s = *reinterpret_cast<const Signal *>(_data._mem); + uint32_t hash = s.get_name().hash(); + return hash_djb2_one_64(s.get_object_id(), hash); + } break; case ARRAY: { const Array &arr = *reinterpret_cast<const Array *>(_data._mem); @@ -2684,7 +3282,7 @@ uint32_t Variant::hash() const { } break; case PACKED_BYTE_ARRAY: { - const Vector<uint8_t> &arr = *reinterpret_cast<const Vector<uint8_t> *>(_data._mem); + const Vector<uint8_t> &arr = PackedArrayRef<uint8_t>::get_array(_data.packed_array); int len = arr.size(); if (likely(len)) { const uint8_t *r = arr.ptr(); @@ -2694,26 +3292,51 @@ uint32_t Variant::hash() const { } } break; - case PACKED_INT_ARRAY: { + case PACKED_INT32_ARRAY: { - const Vector<int> &arr = *reinterpret_cast<const Vector<int> *>(_data._mem); + const Vector<int32_t> &arr = PackedArrayRef<int32_t>::get_array(_data.packed_array); int len = arr.size(); if (likely(len)) { - const int *r = arr.ptr(); - return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(int)); + const int32_t *r = arr.ptr(); + return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(int32_t)); } else { return hash_djb2_one_64(0); } } break; - case PACKED_REAL_ARRAY: { + case PACKED_INT64_ARRAY: { + + const Vector<int64_t> &arr = PackedArrayRef<int64_t>::get_array(_data.packed_array); + int len = arr.size(); + if (likely(len)) { + const int64_t *r = arr.ptr(); + return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(int64_t)); + } else { + return hash_djb2_one_64(0); + } + + } break; + case PACKED_FLOAT32_ARRAY: { + + const Vector<float> &arr = PackedArrayRef<float>::get_array(_data.packed_array); + int len = arr.size(); + + if (likely(len)) { + const float *r = arr.ptr(); + return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(float)); + } else { + return hash_djb2_one_float(0.0); + } + + } break; + case PACKED_FLOAT64_ARRAY: { - const Vector<real_t> &arr = *reinterpret_cast<const Vector<real_t> *>(_data._mem); + const Vector<double> &arr = PackedArrayRef<double>::get_array(_data.packed_array); int len = arr.size(); if (likely(len)) { - const real_t *r = arr.ptr(); - return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(real_t)); + const double *r = arr.ptr(); + return hash_djb2_buffer((uint8_t *)&r[0], len * sizeof(double)); } else { return hash_djb2_one_float(0.0); } @@ -2722,7 +3345,7 @@ uint32_t Variant::hash() const { case PACKED_STRING_ARRAY: { uint32_t hash = 5831; - const Vector<String> &arr = *reinterpret_cast<const Vector<String> *>(_data._mem); + const Vector<String> &arr = PackedArrayRef<String>::get_array(_data.packed_array); int len = arr.size(); if (likely(len)) { @@ -2738,7 +3361,7 @@ uint32_t Variant::hash() const { case PACKED_VECTOR2_ARRAY: { uint32_t hash = 5831; - const Vector<Vector2> &arr = *reinterpret_cast<const Vector<Vector2> *>(_data._mem); + const Vector<Vector2> &arr = PackedArrayRef<Vector2>::get_array(_data.packed_array); int len = arr.size(); if (likely(len)) { @@ -2755,7 +3378,7 @@ uint32_t Variant::hash() const { case PACKED_VECTOR3_ARRAY: { uint32_t hash = 5831; - const Vector<Vector3> &arr = *reinterpret_cast<const Vector<Vector3> *>(_data._mem); + const Vector<Vector3> &arr = PackedArrayRef<Vector3>::get_array(_data.packed_array); int len = arr.size(); if (likely(len)) { @@ -2773,7 +3396,7 @@ uint32_t Variant::hash() const { case PACKED_COLOR_ARRAY: { uint32_t hash = 5831; - const Vector<Color> &arr = *reinterpret_cast<const Vector<Color> *>(_data._mem); + const Vector<Color> &arr = PackedArrayRef<Color>::get_array(_data.packed_array); int len = arr.size(); if (likely(len)) { @@ -2820,21 +3443,21 @@ uint32_t Variant::hash() const { (hash_compare_scalar((p_lhs).b, (p_rhs).b)) && \ (hash_compare_scalar((p_lhs).a, (p_rhs).a)) -#define hash_compare_pool_array(p_lhs, p_rhs, p_type, p_compare_func) \ - const Vector<p_type> &l = *reinterpret_cast<const Vector<p_type> *>(p_lhs); \ - const Vector<p_type> &r = *reinterpret_cast<const Vector<p_type> *>(p_rhs); \ - \ - if (l.size() != r.size()) \ - return false; \ - \ - const p_type *lr = l.ptr(); \ - const p_type *rr = r.ptr(); \ - \ - for (int i = 0; i < l.size(); ++i) { \ - if (!p_compare_func((lr[i]), (rr[i]))) \ - return false; \ - } \ - \ +#define hash_compare_packed_array(p_lhs, p_rhs, p_type, p_compare_func) \ + const Vector<p_type> &l = PackedArrayRef<p_type>::get_array(p_lhs); \ + const Vector<p_type> &r = PackedArrayRef<p_type>::get_array(p_rhs); \ + \ + if (l.size() != r.size()) \ + return false; \ + \ + const p_type *lr = l.ptr(); \ + const p_type *rr = r.ptr(); \ + \ + for (int i = 0; i < l.size(); ++i) { \ + if (!p_compare_func((lr[i]), (rr[i]))) \ + return false; \ + } \ + \ return true bool Variant::hash_compare(const Variant &p_variant) const { @@ -2842,8 +3465,8 @@ bool Variant::hash_compare(const Variant &p_variant) const { return false; switch (type) { - case REAL: { - return hash_compare_scalar(_data._real, p_variant._data._real); + case FLOAT: { + return hash_compare_scalar(_data._float, p_variant._data._float); } break; case VECTOR2: { @@ -2852,6 +3475,11 @@ bool Variant::hash_compare(const Variant &p_variant) const { return hash_compare_vector2(*l, *r); } break; + case VECTOR2I: { + const Vector2i *l = reinterpret_cast<const Vector2i *>(_data._mem); + const Vector2i *r = reinterpret_cast<const Vector2i *>(p_variant._data._mem); + return *l == *r; + } break; case RECT2: { const Rect2 *l = reinterpret_cast<const Rect2 *>(_data._mem); @@ -2860,6 +3488,12 @@ bool Variant::hash_compare(const Variant &p_variant) const { return (hash_compare_vector2(l->position, r->position)) && (hash_compare_vector2(l->size, r->size)); } break; + case RECT2I: { + const Rect2i *l = reinterpret_cast<const Rect2i *>(_data._mem); + const Rect2i *r = reinterpret_cast<const Rect2i *>(p_variant._data._mem); + + return *l == *r; + } break; case TRANSFORM2D: { Transform2D *l = _data._transform2d; @@ -2879,6 +3513,12 @@ bool Variant::hash_compare(const Variant &p_variant) const { return hash_compare_vector3(*l, *r); } break; + case VECTOR3I: { + const Vector3i *l = reinterpret_cast<const Vector3i *>(_data._mem); + const Vector3i *r = reinterpret_cast<const Vector3i *>(p_variant._data._mem); + + return *l == *r; + } break; case PLANE: { const Plane *l = reinterpret_cast<const Plane *>(_data._mem); @@ -2950,20 +3590,25 @@ bool Variant::hash_compare(const Variant &p_variant) const { return true; } break; - case PACKED_REAL_ARRAY: { - hash_compare_pool_array(_data._mem, p_variant._data._mem, real_t, hash_compare_scalar); + // This is for floating point comparisons only. + case PACKED_FLOAT32_ARRAY: { + hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, float, hash_compare_scalar); + } break; + + case PACKED_FLOAT64_ARRAY: { + hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, double, hash_compare_scalar); } break; case PACKED_VECTOR2_ARRAY: { - hash_compare_pool_array(_data._mem, p_variant._data._mem, Vector2, hash_compare_vector2); + hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, Vector2, hash_compare_vector2); } break; case PACKED_VECTOR3_ARRAY: { - hash_compare_pool_array(_data._mem, p_variant._data._mem, Vector3, hash_compare_vector3); + hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, Vector3, hash_compare_vector3); } break; case PACKED_COLOR_ARRAY: { - hash_compare_pool_array(_data._mem, p_variant._data._mem, Color, hash_compare_color); + hash_compare_packed_array(_data.packed_array, p_variant._data.packed_array, Color, hash_compare_color); } break; default: @@ -3054,24 +3699,24 @@ Variant Variant::call(const StringName &p_method, VARIANT_ARG_DECLARE) { argc++; } - CallError error; + Callable::CallError error; Variant ret = call(p_method, argptr, argc, error); switch (error.error) { - case CallError::CALL_ERROR_INVALID_ARGUMENT: { + case Callable::CallError::CALL_ERROR_INVALID_ARGUMENT: { - String err = "Invalid type for argument #" + itos(error.argument) + ", expected '" + Variant::get_type_name(error.expected) + "'."; + String err = "Invalid type for argument #" + itos(error.argument) + ", expected '" + Variant::get_type_name(Variant::Type(error.expected)) + "'."; ERR_PRINT(err.utf8().get_data()); } break; - case CallError::CALL_ERROR_INVALID_METHOD: { + case Callable::CallError::CALL_ERROR_INVALID_METHOD: { String err = "Invalid method '" + p_method + "' for type '" + Variant::get_type_name(type) + "'."; ERR_PRINT(err.utf8().get_data()); } break; - case CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { + case Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { String err = "Too many arguments for method '" + p_method + "'"; ERR_PRINT(err.utf8().get_data()); @@ -3096,26 +3741,26 @@ String Variant::get_construct_string() const { return vars; } -String Variant::get_call_error_text(Object *p_base, const StringName &p_method, const Variant **p_argptrs, int p_argcount, const Variant::CallError &ce) { +String Variant::get_call_error_text(Object *p_base, const StringName &p_method, const Variant **p_argptrs, int p_argcount, const Callable::CallError &ce) { String err_text; - if (ce.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) { + if (ce.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) { int errorarg = ce.argument; if (p_argptrs) { - err_text = "Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(p_argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(ce.expected) + "."; + err_text = "Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(p_argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(Variant::Type(ce.expected)) + "."; } else { - err_text = "Cannot convert argument " + itos(errorarg + 1) + " from [missing argptr, type unknown] to " + Variant::get_type_name(ce.expected) + "."; + err_text = "Cannot convert argument " + itos(errorarg + 1) + " from [missing argptr, type unknown] to " + Variant::get_type_name(Variant::Type(ce.expected)) + "."; } - } else if (ce.error == Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { + } else if (ce.error == Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { err_text = "Method expected " + itos(ce.argument) + " arguments, but called with " + itos(p_argcount) + "."; - } else if (ce.error == Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { + } else if (ce.error == Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { err_text = "Method expected " + itos(ce.argument) + " arguments, but called with " + itos(p_argcount) + "."; - } else if (ce.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) { + } else if (ce.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) { err_text = "Method not found."; - } else if (ce.error == Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) { + } else if (ce.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) { err_text = "Instance is null"; - } else if (ce.error == Variant::CallError::CALL_OK) { + } else if (ce.error == Callable::CallError::CALL_OK) { return "Call OK"; } @@ -3128,6 +3773,32 @@ String Variant::get_call_error_text(Object *p_base, const StringName &p_method, return "'" + class_name + "::" + String(p_method) + "': " + err_text; } +String Variant::get_callable_error_text(const Callable &p_callable, const Variant **p_argptrs, int p_argcount, const Callable::CallError &ce) { + + String err_text; + + if (ce.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) { + int errorarg = ce.argument; + if (p_argptrs) { + err_text = "Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(p_argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(Variant::Type(ce.expected)) + "."; + } else { + err_text = "Cannot convert argument " + itos(errorarg + 1) + " from [missing argptr, type unknown] to " + Variant::get_type_name(Variant::Type(ce.expected)) + "."; + } + } else if (ce.error == Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { + err_text = "Method expected " + itos(ce.argument) + " arguments, but called with " + itos(p_argcount) + "."; + } else if (ce.error == Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { + err_text = "Method expected " + itos(ce.argument) + " arguments, but called with " + itos(p_argcount) + "."; + } else if (ce.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) { + err_text = "Method not found."; + } else if (ce.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) { + err_text = "Instance is null"; + } else if (ce.error == Callable::CallError::CALL_OK) { + return "Call OK"; + } + + return String(p_callable) + " : " + err_text; +} + String vformat(const String &p_text, const Variant &p1, const Variant &p2, const Variant &p3, const Variant &p4, const Variant &p5) { Array args; diff --git a/core/variant.h b/core/variant.h index 51f23b4b49..614d39e84a 100644 --- a/core/variant.h +++ b/core/variant.h @@ -32,6 +32,7 @@ #define VARIANT_H #include "core/array.h" +#include "core/callable.h" #include "core/color.h" #include "core/dictionary.h" #include "core/io/ip_address.h" @@ -43,9 +44,9 @@ #include "core/math/transform.h" #include "core/math/transform_2d.h" #include "core/math/vector3.h" +#include "core/math/vector3i.h" #include "core/node_path.h" #include "core/object_id.h" - #include "core/rid.h" #include "core/ustring.h" @@ -57,8 +58,10 @@ struct PropertyInfo; struct MethodInfo; typedef Vector<uint8_t> PackedByteArray; -typedef Vector<int> PackedIntArray; -typedef Vector<real_t> PackedRealArray; +typedef Vector<int32_t> PackedInt32Array; +typedef Vector<int64_t> PackedInt64Array; +typedef Vector<float> PackedFloat32Array; +typedef Vector<double> PackedFloat64Array; typedef Vector<String> PackedStringArray; typedef Vector<Vector2> PackedVector2Array; typedef Vector<Vector3> PackedVector3Array; @@ -75,46 +78,51 @@ class Variant { public: // If this changes the table in variant_op must be updated enum Type { - NIL, // atomic types BOOL, INT, - REAL, + FLOAT, STRING, // math types - - VECTOR2, // 5 + VECTOR2, + VECTOR2I, RECT2, + RECT2I, VECTOR3, + VECTOR3I, TRANSFORM2D, PLANE, - QUAT, // 10 + QUAT, AABB, BASIS, TRANSFORM, // misc types COLOR, - NODE_PATH, // 15 + STRING_NAME, + NODE_PATH, _RID, OBJECT, + CALLABLE, + SIGNAL, DICTIONARY, ARRAY, - // arrays - PACKED_BYTE_ARRAY, // 20 - PACKED_INT_ARRAY, - PACKED_REAL_ARRAY, + // typed arrays + PACKED_BYTE_ARRAY, + PACKED_INT32_ARRAY, + PACKED_INT64_ARRAY, + PACKED_FLOAT32_ARRAY, + PACKED_FLOAT64_ARRAY, PACKED_STRING_ARRAY, PACKED_VECTOR2_ARRAY, - PACKED_VECTOR3_ARRAY, // 25 + PACKED_VECTOR3_ARRAY, PACKED_COLOR_ARRAY, VARIANT_MAX - }; private: @@ -130,17 +138,77 @@ private: Object *obj; }; + /* array helpers */ + struct PackedArrayRefBase { + SafeRefCount refcount; + _FORCE_INLINE_ PackedArrayRefBase *reference() { + if (this->refcount.ref()) { + return this; + } else { + return nullptr; + } + } + static _FORCE_INLINE_ PackedArrayRefBase *reference_from(PackedArrayRefBase *p_base, PackedArrayRefBase *p_from) { + if (p_base == p_from) { + return p_base; //same thing, do nothing + } + + if (p_from->reference()) { + if (p_base->refcount.unref()) { + memdelete(p_base); + } + return p_from; + } else { + return p_base; //keep, could not reference new + } + } + static _FORCE_INLINE_ void destroy(PackedArrayRefBase *p_array) { + if (p_array->refcount.unref()) { + memdelete(p_array); + } + } + _FORCE_INLINE_ virtual ~PackedArrayRefBase() {} //needs virtual destructor, but make inline + }; + + template <class T> + struct PackedArrayRef : public PackedArrayRefBase { + Vector<T> array; + static _FORCE_INLINE_ PackedArrayRef<T> *create() { + return memnew(PackedArrayRef<T>); + } + static _FORCE_INLINE_ PackedArrayRef<T> *create(const Vector<T> &p_from) { + return memnew(PackedArrayRef<T>(p_from)); + } + + static _FORCE_INLINE_ const Vector<T> &get_array(PackedArrayRefBase *p_base) { + return static_cast<PackedArrayRef<T> *>(p_base)->array; + } + static _FORCE_INLINE_ Vector<T> *get_array_ptr(const PackedArrayRefBase *p_base) { + return &const_cast<PackedArrayRef<T> *>(static_cast<const PackedArrayRef<T> *>(p_base))->array; + } + + _FORCE_INLINE_ PackedArrayRef(const Vector<T> &p_from) { + array = p_from; + refcount.init(); + } + _FORCE_INLINE_ PackedArrayRef() { + refcount.init(); + } + }; + + /* end of array helpers */ _ALWAYS_INLINE_ ObjData &_get_obj(); _ALWAYS_INLINE_ const ObjData &_get_obj() const; union { bool _bool; int64_t _int; - double _real; + double _float; Transform2D *_transform2d; ::AABB *_aabb; Basis *_basis; Transform *_transform; + PackedArrayRefBase *packed_array; void *_ptr; //generic pointer uint8_t _mem[sizeof(ObjData) > (sizeof(real_t) * 4) ? sizeof(ObjData) : (sizeof(real_t) * 4)]; } _data GCC_ALIGNED_8; @@ -149,14 +217,20 @@ private: void clear(); public: - _FORCE_INLINE_ Type get_type() const { return type; } + _FORCE_INLINE_ Type get_type() const { + return type; + } static String get_type_name(Variant::Type p_type); static bool can_convert(Type p_type_from, Type p_type_to); static bool can_convert_strict(Type p_type_from, Type p_type_to); bool is_ref() const; - _FORCE_INLINE_ bool is_num() const { return type == INT || type == REAL; }; - _FORCE_INLINE_ bool is_array() const { return type >= ARRAY; }; + _FORCE_INLINE_ bool is_num() const { + return type == INT || type == FLOAT; + }; + _FORCE_INLINE_ bool is_array() const { + return type >= ARRAY; + }; bool is_shared() const; bool is_zero() const; bool is_one() const; @@ -185,8 +259,11 @@ public: operator String() const; operator StringName() const; operator Vector2() const; + operator Vector2i() const; operator Rect2() const; + operator Rect2i() const; operator Vector3() const; + operator Vector3i() const; operator Plane() const; operator ::AABB() const; operator Quat() const; @@ -202,12 +279,17 @@ public: operator Node *() const; operator Control *() const; + operator Callable() const; + operator Signal() const; + operator Dictionary() const; operator Array() const; operator Vector<uint8_t>() const; - operator Vector<int>() const; - operator Vector<real_t>() const; + operator Vector<int32_t>() const; + operator Vector<int64_t>() const; + operator Vector<float>() const; + operator Vector<double>() const; operator Vector<String>() const; operator Vector<Vector3>() const; operator Vector<Color>() const; @@ -250,8 +332,11 @@ public: Variant(const char *const p_cstring); Variant(const CharType *p_wstring); Variant(const Vector2 &p_vector2); + Variant(const Vector2i &p_vector2i); Variant(const Rect2 &p_rect2); + Variant(const Rect2i &p_rect2i); Variant(const Vector3 &p_vector3); + Variant(const Vector3i &p_vector3i); Variant(const Plane &p_plane); Variant(const ::AABB &p_aabb); Variant(const Quat &p_quat); @@ -262,13 +347,17 @@ public: Variant(const NodePath &p_node_path); Variant(const RID &p_rid); Variant(const Object *p_object); + Variant(const Callable &p_callable); + Variant(const Signal &p_signal); Variant(const Dictionary &p_dictionary); Variant(const Array &p_array); Variant(const Vector<Plane> &p_array); // helper - Variant(const Vector<uint8_t> &p_raw_array); - Variant(const Vector<int> &p_int_array); - Variant(const Vector<real_t> &p_real_array); + Variant(const Vector<uint8_t> &p_byte_array); + Variant(const Vector<int32_t> &p_int32_array); + Variant(const Vector<int64_t> &p_int64_array); + Variant(const Vector<float> &p_float32_array); + Variant(const Vector<double> &p_float64_array); Variant(const Vector<String> &p_string_array); Variant(const Vector<Vector3> &p_vector3_array); Variant(const Vector<Color> &p_color_array); @@ -333,27 +422,14 @@ public: static void blend(const Variant &a, const Variant &b, float c, Variant &r_dst); static void interpolate(const Variant &a, const Variant &b, float c, Variant &r_dst); - struct CallError { - enum Error { - CALL_OK, - CALL_ERROR_INVALID_METHOD, - CALL_ERROR_INVALID_ARGUMENT, - CALL_ERROR_TOO_MANY_ARGUMENTS, - CALL_ERROR_TOO_FEW_ARGUMENTS, - CALL_ERROR_INSTANCE_IS_NULL, - }; - Error error; - int argument; - Type expected; - }; - - void call_ptr(const StringName &p_method, const Variant **p_args, int p_argcount, Variant *r_ret, CallError &r_error); - Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, CallError &r_error); + void call_ptr(const StringName &p_method, const Variant **p_args, int p_argcount, Variant *r_ret, Callable::CallError &r_error); + Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); Variant call(const StringName &p_method, const Variant &p_arg1 = Variant(), const Variant &p_arg2 = Variant(), const Variant &p_arg3 = Variant(), const Variant &p_arg4 = Variant(), const Variant &p_arg5 = Variant()); - static String get_call_error_text(Object *p_base, const StringName &p_method, const Variant **p_argptrs, int p_argcount, const Variant::CallError &ce); + static String get_call_error_text(Object *p_base, const StringName &p_method, const Variant **p_argptrs, int p_argcount, const Callable::CallError &ce); + static String get_callable_error_text(const Callable &p_callable, const Variant **p_argptrs, int p_argcount, const Callable::CallError &ce); - static Variant construct(const Variant::Type, const Variant **p_args, int p_argcount, CallError &r_error, bool p_strict = true); + static Variant construct(const Variant::Type, const Variant **p_args, int p_argcount, Callable::CallError &r_error, bool p_strict = true); void get_method_list(List<MethodInfo> *p_list) const; bool has_method(const StringName &p_method) const; @@ -401,7 +477,9 @@ public: void operator=(const Variant &p_variant); // only this is enough for all the other types Variant(const Variant &p_variant); - _FORCE_INLINE_ Variant() { type = NIL; } + _FORCE_INLINE_ Variant() { + type = NIL; + } _FORCE_INLINE_ ~Variant() { if (type != Variant::NIL) clear(); } diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 6506da58d4..9cc08b54e6 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -61,7 +61,7 @@ struct _VariantCall { VariantFunc func; - _FORCE_INLINE_ bool verify_arguments(const Variant **p_args, Variant::CallError &r_error) { + _FORCE_INLINE_ bool verify_arguments(const Variant **p_args, Callable::CallError &r_error) { if (arg_count == 0) return true; @@ -73,7 +73,7 @@ struct _VariantCall { if (tptr[i] == Variant::NIL || tptr[i] == p_args[i]->type) continue; // all good if (!Variant::can_convert(p_args[i]->type, tptr[i])) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = i; r_error.expected = tptr[i]; return false; @@ -82,10 +82,10 @@ struct _VariantCall { return true; } - _FORCE_INLINE_ void call(Variant &r_ret, Variant &p_self, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { + _FORCE_INLINE_ void call(Variant &r_ret, Variant &p_self, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { #ifdef DEBUG_ENABLED if (p_argcount > arg_count) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = arg_count; return; } else @@ -94,7 +94,7 @@ struct _VariantCall { int def_argcount = default_args.size(); #ifdef DEBUG_ENABLED if (p_argcount < (arg_count - def_argcount)) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = arg_count - def_argcount; return; } @@ -383,6 +383,10 @@ struct _VariantCall { VCALL_LOCALMEM1R(Vector2, clamped); VCALL_LOCALMEM0R(Vector2, sign); + VCALL_LOCALMEM0R(Vector2i, aspect); + VCALL_LOCALMEM0R(Vector2i, sign); + VCALL_LOCALMEM0R(Vector2i, abs); + VCALL_LOCALMEM0R(Rect2, get_area); VCALL_LOCALMEM0R(Rect2, has_no_area); VCALL_LOCALMEM1R(Rect2, has_point); @@ -397,6 +401,19 @@ struct _VariantCall { VCALL_LOCALMEM4R(Rect2, grow_individual); VCALL_LOCALMEM0R(Rect2, abs); + VCALL_LOCALMEM0R(Rect2i, get_area); + VCALL_LOCALMEM0R(Rect2i, has_no_area); + VCALL_LOCALMEM1R(Rect2i, has_point); + VCALL_LOCALMEM1R(Rect2i, intersects); + VCALL_LOCALMEM1R(Rect2i, encloses); + VCALL_LOCALMEM1R(Rect2i, clip); + VCALL_LOCALMEM1R(Rect2i, merge); + VCALL_LOCALMEM1R(Rect2i, expand); + VCALL_LOCALMEM1R(Rect2i, grow); + VCALL_LOCALMEM2R(Rect2i, grow_margin); + VCALL_LOCALMEM4R(Rect2i, grow_individual); + VCALL_LOCALMEM0R(Rect2i, abs); + VCALL_LOCALMEM0R(Vector3, min_axis); VCALL_LOCALMEM0R(Vector3, max_axis); VCALL_LOCALMEM1R(Vector3, distance_to); @@ -431,6 +448,10 @@ struct _VariantCall { VCALL_LOCALMEM1R(Vector3, reflect); VCALL_LOCALMEM0R(Vector3, sign); + VCALL_LOCALMEM0R(Vector3i, min_axis); + VCALL_LOCALMEM0R(Vector3i, max_axis); + VCALL_LOCALMEM0R(Vector3i, sign); + VCALL_LOCALMEM0R(Plane, normalized); VCALL_LOCALMEM0R(Plane, center); VCALL_LOCALMEM0R(Plane, get_any_point); @@ -519,6 +540,23 @@ struct _VariantCall { VCALL_LOCALMEM1R(Dictionary, duplicate); VCALL_LOCALMEM2R(Dictionary, get); + VCALL_LOCALMEM0R(Callable, is_null); + VCALL_LOCALMEM0R(Callable, is_custom); + VCALL_LOCALMEM0(Callable, is_standard); + VCALL_LOCALMEM0(Callable, get_object); + VCALL_LOCALMEM0(Callable, get_object_id); + VCALL_LOCALMEM0(Callable, get_method); + VCALL_LOCALMEM0(Callable, hash); + + VCALL_LOCALMEM0R(Signal, is_null); + VCALL_LOCALMEM0R(Signal, get_object); + VCALL_LOCALMEM0R(Signal, get_object_id); + VCALL_LOCALMEM0R(Signal, get_name); + VCALL_LOCALMEM3R(Signal, connect); + VCALL_LOCALMEM1(Signal, disconnect); + VCALL_LOCALMEM1R(Signal, is_connected); + VCALL_LOCALMEM0R(Signal, get_connections); + VCALL_LOCALMEM2(Array, set); VCALL_LOCALMEM1R(Array, get); VCALL_LOCALMEM0R(Array, size); @@ -628,90 +666,139 @@ struct _VariantCall { r_ret = s; } - VCALL_LOCALMEM0R(PackedByteArray, size); - VCALL_LOCALMEM0R(PackedByteArray, empty); - VCALL_LOCALMEM2(PackedByteArray, set); - VCALL_LOCALMEM1R(PackedByteArray, get); - VCALL_LOCALMEM1(PackedByteArray, push_back); - VCALL_LOCALMEM1(PackedByteArray, resize); - VCALL_LOCALMEM2R(PackedByteArray, insert); - VCALL_LOCALMEM1(PackedByteArray, remove); - VCALL_LOCALMEM1(PackedByteArray, append); - VCALL_LOCALMEM1(PackedByteArray, append_array); - VCALL_LOCALMEM0(PackedByteArray, invert); - VCALL_LOCALMEM2R(PackedByteArray, subarray); - - VCALL_LOCALMEM0R(PackedIntArray, size); - VCALL_LOCALMEM0R(PackedIntArray, empty); - VCALL_LOCALMEM2(PackedIntArray, set); - VCALL_LOCALMEM1R(PackedIntArray, get); - VCALL_LOCALMEM1(PackedIntArray, push_back); - VCALL_LOCALMEM1(PackedIntArray, resize); - VCALL_LOCALMEM2R(PackedIntArray, insert); - VCALL_LOCALMEM1(PackedIntArray, remove); - VCALL_LOCALMEM1(PackedIntArray, append); - VCALL_LOCALMEM1(PackedIntArray, append_array); - VCALL_LOCALMEM0(PackedIntArray, invert); - - VCALL_LOCALMEM0R(PackedRealArray, size); - VCALL_LOCALMEM0R(PackedRealArray, empty); - VCALL_LOCALMEM2(PackedRealArray, set); - VCALL_LOCALMEM1R(PackedRealArray, get); - VCALL_LOCALMEM1(PackedRealArray, push_back); - VCALL_LOCALMEM1(PackedRealArray, resize); - VCALL_LOCALMEM2R(PackedRealArray, insert); - VCALL_LOCALMEM1(PackedRealArray, remove); - VCALL_LOCALMEM1(PackedRealArray, append); - VCALL_LOCALMEM1(PackedRealArray, append_array); - VCALL_LOCALMEM0(PackedRealArray, invert); - - VCALL_LOCALMEM0R(PackedStringArray, size); - VCALL_LOCALMEM0R(PackedStringArray, empty); - VCALL_LOCALMEM2(PackedStringArray, set); - VCALL_LOCALMEM1R(PackedStringArray, get); - VCALL_LOCALMEM1(PackedStringArray, push_back); - VCALL_LOCALMEM1(PackedStringArray, resize); - VCALL_LOCALMEM2R(PackedStringArray, insert); - VCALL_LOCALMEM1(PackedStringArray, remove); - VCALL_LOCALMEM1(PackedStringArray, append); - VCALL_LOCALMEM1(PackedStringArray, append_array); - VCALL_LOCALMEM0(PackedStringArray, invert); - - VCALL_LOCALMEM0R(PackedVector2Array, size); - VCALL_LOCALMEM0R(PackedVector2Array, empty); - VCALL_LOCALMEM2(PackedVector2Array, set); - VCALL_LOCALMEM1R(PackedVector2Array, get); - VCALL_LOCALMEM1(PackedVector2Array, push_back); - VCALL_LOCALMEM1(PackedVector2Array, resize); - VCALL_LOCALMEM2R(PackedVector2Array, insert); - VCALL_LOCALMEM1(PackedVector2Array, remove); - VCALL_LOCALMEM1(PackedVector2Array, append); - VCALL_LOCALMEM1(PackedVector2Array, append_array); - VCALL_LOCALMEM0(PackedVector2Array, invert); - - VCALL_LOCALMEM0R(PackedVector3Array, size); - VCALL_LOCALMEM0R(PackedVector3Array, empty); - VCALL_LOCALMEM2(PackedVector3Array, set); - VCALL_LOCALMEM1R(PackedVector3Array, get); - VCALL_LOCALMEM1(PackedVector3Array, push_back); - VCALL_LOCALMEM1(PackedVector3Array, resize); - VCALL_LOCALMEM2R(PackedVector3Array, insert); - VCALL_LOCALMEM1(PackedVector3Array, remove); - VCALL_LOCALMEM1(PackedVector3Array, append); - VCALL_LOCALMEM1(PackedVector3Array, append_array); - VCALL_LOCALMEM0(PackedVector3Array, invert); - - VCALL_LOCALMEM0R(PackedColorArray, size); - VCALL_LOCALMEM0R(PackedColorArray, empty); - VCALL_LOCALMEM2(PackedColorArray, set); - VCALL_LOCALMEM1R(PackedColorArray, get); - VCALL_LOCALMEM1(PackedColorArray, push_back); - VCALL_LOCALMEM1(PackedColorArray, resize); - VCALL_LOCALMEM2R(PackedColorArray, insert); - VCALL_LOCALMEM1(PackedColorArray, remove); - VCALL_LOCALMEM1(PackedColorArray, append); - VCALL_LOCALMEM1(PackedColorArray, append_array); - VCALL_LOCALMEM0(PackedColorArray, invert); +#define VCALL_PARRMEM0(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(); } +#define VCALL_PARRMEM0R(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { r_ret = Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(); } +#define VCALL_PARRMEM1(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0]); } +#define VCALL_PARRMEM1R(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { r_ret = Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0]); } +#define VCALL_PARRMEM2(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0], *p_args[1]); } +#define VCALL_PARRMEM2R(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { r_ret = Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0], *p_args[1]); } +#define VCALL_PARRMEM3(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0], *p_args[1], *p_args[2]); } +#define VCALL_PARRMEM3R(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { r_ret = Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0], *p_args[1], *p_args[2]); } +#define VCALL_PARRMEM4(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3]); } +#define VCALL_PARRMEM4R(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { r_ret = Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3]); } +#define VCALL_PARRMEM5(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3], *p_args[4]); } +#define VCALL_PARRMEM5R(m_type, m_elemtype, m_method) \ + static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { r_ret = Variant::PackedArrayRef<m_elemtype>::get_array_ptr(p_self._data.packed_array)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3], *p_args[4]); } + + VCALL_PARRMEM0R(PackedByteArray, uint8_t, size); + VCALL_PARRMEM0R(PackedByteArray, uint8_t, empty); + VCALL_PARRMEM2(PackedByteArray, uint8_t, set); + VCALL_PARRMEM1R(PackedByteArray, uint8_t, get); + VCALL_PARRMEM1(PackedByteArray, uint8_t, push_back); + VCALL_PARRMEM1(PackedByteArray, uint8_t, resize); + VCALL_PARRMEM2R(PackedByteArray, uint8_t, insert); + VCALL_PARRMEM1(PackedByteArray, uint8_t, remove); + VCALL_PARRMEM1(PackedByteArray, uint8_t, append); + VCALL_PARRMEM1(PackedByteArray, uint8_t, append_array); + VCALL_PARRMEM0(PackedByteArray, uint8_t, invert); + VCALL_PARRMEM2R(PackedByteArray, uint8_t, subarray); + + VCALL_PARRMEM0R(PackedInt32Array, int32_t, size); + VCALL_PARRMEM0R(PackedInt32Array, int32_t, empty); + VCALL_PARRMEM2(PackedInt32Array, int32_t, set); + VCALL_PARRMEM1R(PackedInt32Array, int32_t, get); + VCALL_PARRMEM1(PackedInt32Array, int32_t, push_back); + VCALL_PARRMEM1(PackedInt32Array, int32_t, resize); + VCALL_PARRMEM2R(PackedInt32Array, int32_t, insert); + VCALL_PARRMEM1(PackedInt32Array, int32_t, remove); + VCALL_PARRMEM1(PackedInt32Array, int32_t, append); + VCALL_PARRMEM1(PackedInt32Array, int32_t, append_array); + VCALL_PARRMEM0(PackedInt32Array, int32_t, invert); + + VCALL_PARRMEM0R(PackedInt64Array, int64_t, size); + VCALL_PARRMEM0R(PackedInt64Array, int64_t, empty); + VCALL_PARRMEM2(PackedInt64Array, int64_t, set); + VCALL_PARRMEM1R(PackedInt64Array, int64_t, get); + VCALL_PARRMEM1(PackedInt64Array, int64_t, push_back); + VCALL_PARRMEM1(PackedInt64Array, int64_t, resize); + VCALL_PARRMEM2R(PackedInt64Array, int64_t, insert); + VCALL_PARRMEM1(PackedInt64Array, int64_t, remove); + VCALL_PARRMEM1(PackedInt64Array, int64_t, append); + VCALL_PARRMEM1(PackedInt64Array, int64_t, append_array); + VCALL_PARRMEM0(PackedInt64Array, int64_t, invert); + + VCALL_PARRMEM0R(PackedFloat32Array, float, size); + VCALL_PARRMEM0R(PackedFloat32Array, float, empty); + VCALL_PARRMEM2(PackedFloat32Array, float, set); + VCALL_PARRMEM1R(PackedFloat32Array, float, get); + VCALL_PARRMEM1(PackedFloat32Array, float, push_back); + VCALL_PARRMEM1(PackedFloat32Array, float, resize); + VCALL_PARRMEM2R(PackedFloat32Array, float, insert); + VCALL_PARRMEM1(PackedFloat32Array, float, remove); + VCALL_PARRMEM1(PackedFloat32Array, float, append); + VCALL_PARRMEM1(PackedFloat32Array, float, append_array); + VCALL_PARRMEM0(PackedFloat32Array, float, invert); + + VCALL_PARRMEM0R(PackedFloat64Array, double, size); + VCALL_PARRMEM0R(PackedFloat64Array, double, empty); + VCALL_PARRMEM2(PackedFloat64Array, double, set); + VCALL_PARRMEM1R(PackedFloat64Array, double, get); + VCALL_PARRMEM1(PackedFloat64Array, double, push_back); + VCALL_PARRMEM1(PackedFloat64Array, double, resize); + VCALL_PARRMEM2R(PackedFloat64Array, double, insert); + VCALL_PARRMEM1(PackedFloat64Array, double, remove); + VCALL_PARRMEM1(PackedFloat64Array, double, append); + VCALL_PARRMEM1(PackedFloat64Array, double, append_array); + VCALL_PARRMEM0(PackedFloat64Array, double, invert); + + VCALL_PARRMEM0R(PackedStringArray, String, size); + VCALL_PARRMEM0R(PackedStringArray, String, empty); + VCALL_PARRMEM2(PackedStringArray, String, set); + VCALL_PARRMEM1R(PackedStringArray, String, get); + VCALL_PARRMEM1(PackedStringArray, String, push_back); + VCALL_PARRMEM1(PackedStringArray, String, resize); + VCALL_PARRMEM2R(PackedStringArray, String, insert); + VCALL_PARRMEM1(PackedStringArray, String, remove); + VCALL_PARRMEM1(PackedStringArray, String, append); + VCALL_PARRMEM1(PackedStringArray, String, append_array); + VCALL_PARRMEM0(PackedStringArray, String, invert); + + VCALL_PARRMEM0R(PackedVector2Array, Vector2, size); + VCALL_PARRMEM0R(PackedVector2Array, Vector2, empty); + VCALL_PARRMEM2(PackedVector2Array, Vector2, set); + VCALL_PARRMEM1R(PackedVector2Array, Vector2, get); + VCALL_PARRMEM1(PackedVector2Array, Vector2, push_back); + VCALL_PARRMEM1(PackedVector2Array, Vector2, resize); + VCALL_PARRMEM2R(PackedVector2Array, Vector2, insert); + VCALL_PARRMEM1(PackedVector2Array, Vector2, remove); + VCALL_PARRMEM1(PackedVector2Array, Vector2, append); + VCALL_PARRMEM1(PackedVector2Array, Vector2, append_array); + VCALL_PARRMEM0(PackedVector2Array, Vector2, invert); + + VCALL_PARRMEM0R(PackedVector3Array, Vector3, size); + VCALL_PARRMEM0R(PackedVector3Array, Vector3, empty); + VCALL_PARRMEM2(PackedVector3Array, Vector3, set); + VCALL_PARRMEM1R(PackedVector3Array, Vector3, get); + VCALL_PARRMEM1(PackedVector3Array, Vector3, push_back); + VCALL_PARRMEM1(PackedVector3Array, Vector3, resize); + VCALL_PARRMEM2R(PackedVector3Array, Vector3, insert); + VCALL_PARRMEM1(PackedVector3Array, Vector3, remove); + VCALL_PARRMEM1(PackedVector3Array, Vector3, append); + VCALL_PARRMEM1(PackedVector3Array, Vector3, append_array); + VCALL_PARRMEM0(PackedVector3Array, Vector3, invert); + + VCALL_PARRMEM0R(PackedColorArray, Color, size); + VCALL_PARRMEM0R(PackedColorArray, Color, empty); + VCALL_PARRMEM2(PackedColorArray, Color, set); + VCALL_PARRMEM1R(PackedColorArray, Color, get); + VCALL_PARRMEM1(PackedColorArray, Color, push_back); + VCALL_PARRMEM1(PackedColorArray, Color, resize); + VCALL_PARRMEM2R(PackedColorArray, Color, insert); + VCALL_PARRMEM1(PackedColorArray, Color, remove); + VCALL_PARRMEM1(PackedColorArray, Color, append); + VCALL_PARRMEM1(PackedColorArray, Color, append_array); + VCALL_PARRMEM0(PackedColorArray, Color, invert); #define VCALL_PTR0(m_type, m_method) \ static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { reinterpret_cast<m_type *>(p_self._data._ptr)->m_method(); } @@ -892,6 +979,11 @@ struct _VariantCall { r_ret = Vector2(*p_args[0], *p_args[1]); } + static void Vector2i_init1(Variant &r_ret, const Variant **p_args) { + + r_ret = Vector2i(*p_args[0], *p_args[1]); + } + static void Rect2_init1(Variant &r_ret, const Variant **p_args) { r_ret = Rect2(*p_args[0], *p_args[1]); @@ -902,6 +994,16 @@ struct _VariantCall { r_ret = Rect2(*p_args[0], *p_args[1], *p_args[2], *p_args[3]); } + static void Rect2i_init1(Variant &r_ret, const Variant **p_args) { + + r_ret = Rect2i(*p_args[0], *p_args[1]); + } + + static void Rect2i_init2(Variant &r_ret, const Variant **p_args) { + + r_ret = Rect2i(*p_args[0], *p_args[1], *p_args[2], *p_args[3]); + } + static void Transform2D_init2(Variant &r_ret, const Variant **p_args) { Transform2D m(*p_args[0], *p_args[1]); @@ -922,6 +1024,11 @@ struct _VariantCall { r_ret = Vector3(*p_args[0], *p_args[1], *p_args[2]); } + static void Vector3i_init1(Variant &r_ret, const Variant **p_args) { + + r_ret = Vector3i(*p_args[0], *p_args[1], *p_args[2]); + } + static void Plane_init1(Variant &r_ret, const Variant **p_args) { r_ret = Plane(*p_args[0], *p_args[1], *p_args[2], *p_args[3]); @@ -1010,6 +1117,16 @@ struct _VariantCall { r_ret = Transform(p_args[0]->operator Basis(), p_args[1]->operator Vector3()); } + static void Callable_init2(Variant &r_ret, const Variant **p_args) { + + r_ret = Callable(p_args[0]->operator ObjectID(), p_args[1]->operator String()); + } + + static void Signal_init2(Variant &r_ret, const Variant **p_args) { + + r_ret = Signal(p_args[0]->operator ObjectID(), p_args[1]->operator String()); + } + static void add_constructor(VariantConstructFunc p_func, const Variant::Type p_type, const String &p_name1 = "", const Variant::Type p_type1 = Variant::NIL, const String &p_name2 = "", const Variant::Type p_type2 = Variant::NIL, @@ -1078,26 +1195,26 @@ _VariantCall::TypeFunc *_VariantCall::type_funcs = NULL; _VariantCall::ConstructFunc *_VariantCall::construct_funcs = NULL; _VariantCall::ConstantData *_VariantCall::constant_data = NULL; -Variant Variant::call(const StringName &p_method, const Variant **p_args, int p_argcount, CallError &r_error) { +Variant Variant::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { Variant ret; call_ptr(p_method, p_args, p_argcount, &ret, r_error); return ret; } -void Variant::call_ptr(const StringName &p_method, const Variant **p_args, int p_argcount, Variant *r_ret, CallError &r_error) { +void Variant::call_ptr(const StringName &p_method, const Variant **p_args, int p_argcount, Variant *r_ret, Callable::CallError &r_error) { Variant ret; if (type == Variant::OBJECT) { //call object Object *obj = _get_obj().obj; if (!obj) { - r_error.error = CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return; } #ifdef DEBUG_ENABLED if (ScriptDebugger::get_singleton() && !_get_obj().id.is_reference() && ObjectDB::get_instance(_get_obj().id) == nullptr) { - r_error.error = CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return; } @@ -1108,31 +1225,57 @@ void Variant::call_ptr(const StringName &p_method, const Variant **p_args, int p } else { - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; Map<StringName, _VariantCall::FuncData>::Element *E = _VariantCall::type_funcs[type].functions.find(p_method); -#ifdef DEBUG_ENABLED - if (!E) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; - return; + + if (E) { + + _VariantCall::FuncData &funcdata = E->get(); + funcdata.call(ret, *this, p_args, p_argcount, r_error); + + } else { + //handle vararg functions manually + bool valid = false; + if (type == CALLABLE) { + if (p_method == CoreStringNames::get_singleton()->call) { + + reinterpret_cast<const Callable *>(_data._mem)->call(p_args, p_argcount, ret, r_error); + valid = true; + } + if (p_method == CoreStringNames::get_singleton()->call_deferred) { + reinterpret_cast<const Callable *>(_data._mem)->call_deferred(p_args, p_argcount); + valid = true; + } + } else if (type == SIGNAL) { + if (p_method == CoreStringNames::get_singleton()->emit) { + if (r_ret) { + *r_ret = Variant(); + } + reinterpret_cast<const Signal *>(_data._mem)->emit(p_args, p_argcount); + valid = true; + } + } + if (!valid) { + //ok fail because not found + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; + return; + } } -#endif - _VariantCall::FuncData &funcdata = E->get(); - funcdata.call(ret, *this, p_args, p_argcount, r_error); } - if (r_error.error == Variant::CallError::CALL_OK && r_ret) + if (r_error.error == Callable::CallError::CALL_OK && r_ret) *r_ret = ret; } #define VCALL(m_type, m_method) _VariantCall::_call_##m_type##_##m_method -Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, int p_argcount, CallError &r_error, bool p_strict) { +Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, int p_argcount, Callable::CallError &r_error, bool p_strict) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; ERR_FAIL_INDEX_V(p_type, VARIANT_MAX, Variant()); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; if (p_argcount == 0) { //generic construct switch (p_type) { @@ -1142,39 +1285,45 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i // atomic types case BOOL: return Variant(false); case INT: return 0; - case REAL: return 0.0f; + case FLOAT: return 0.0f; case STRING: return String(); // math types case VECTOR2: - return Vector2(); // 5 + return Vector2(); case RECT2: return Rect2(); case VECTOR3: return Vector3(); case TRANSFORM2D: return Transform2D(); case PLANE: return Plane(); case QUAT: return Quat(); case AABB: - return ::AABB(); // 10 + return ::AABB(); case BASIS: return Basis(); case TRANSFORM: return Transform(); // misc types case COLOR: return Color(); + case STRING_NAME: + return StringName(); case NODE_PATH: - return NodePath(); // 15 + return NodePath(); case _RID: return RID(); case OBJECT: return (Object *)NULL; + case CALLABLE: return Callable(); + case SIGNAL: return Signal(); case DICTIONARY: return Dictionary(); case ARRAY: - return Array(); // 20 + return Array(); case PACKED_BYTE_ARRAY: return PackedByteArray(); - case PACKED_INT_ARRAY: return PackedIntArray(); - case PACKED_REAL_ARRAY: return PackedRealArray(); + case PACKED_INT32_ARRAY: return PackedInt32Array(); + case PACKED_INT64_ARRAY: return PackedInt64Array(); + case PACKED_FLOAT32_ARRAY: return PackedFloat32Array(); + case PACKED_FLOAT64_ARRAY: return PackedFloat64Array(); case PACKED_STRING_ARRAY: return PackedStringArray(); case PACKED_VECTOR2_ARRAY: - return PackedVector2Array(); // 25 + return PackedVector2Array(); case PACKED_VECTOR3_ARRAY: return PackedVector3Array(); case PACKED_COLOR_ARRAY: return PackedColorArray(); default: return Variant(); @@ -1196,7 +1345,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i case INT: { return (int64_t(*p_args[0])); } - case REAL: { + case FLOAT: { return real_t(*p_args[0]); } case STRING: { @@ -1205,33 +1354,44 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i case VECTOR2: { return Vector2(*p_args[0]); } + case VECTOR2I: { + return Vector2i(*p_args[0]); + } case RECT2: return (Rect2(*p_args[0])); + case RECT2I: return (Rect2i(*p_args[0])); case VECTOR3: return (Vector3(*p_args[0])); + case VECTOR3I: return (Vector3i(*p_args[0])); case PLANE: return (Plane(*p_args[0])); case QUAT: return (p_args[0]->operator Quat()); case AABB: - return (::AABB(*p_args[0])); // 10 + return (::AABB(*p_args[0])); case BASIS: return (Basis(p_args[0]->operator Basis())); case TRANSFORM: return (Transform(p_args[0]->operator Transform())); // misc types case COLOR: return p_args[0]->type == Variant::STRING ? Color::html(*p_args[0]) : Color::hex(*p_args[0]); + case STRING_NAME: + return (StringName(p_args[0]->operator StringName())); case NODE_PATH: - return (NodePath(p_args[0]->operator NodePath())); // 15 + return (NodePath(p_args[0]->operator NodePath())); case _RID: return (RID(*p_args[0])); case OBJECT: return ((Object *)(p_args[0]->operator Object *())); + case CALLABLE: return ((Callable)(p_args[0]->operator Callable())); + case SIGNAL: return ((Signal)(p_args[0]->operator Signal())); case DICTIONARY: return p_args[0]->operator Dictionary(); case ARRAY: - return p_args[0]->operator Array(); // 20 + return p_args[0]->operator Array(); // arrays case PACKED_BYTE_ARRAY: return (PackedByteArray(*p_args[0])); - case PACKED_INT_ARRAY: return (PackedIntArray(*p_args[0])); - case PACKED_REAL_ARRAY: return (PackedRealArray(*p_args[0])); + case PACKED_INT32_ARRAY: return (PackedInt32Array(*p_args[0])); + case PACKED_INT64_ARRAY: return (PackedInt64Array(*p_args[0])); + case PACKED_FLOAT32_ARRAY: return (PackedFloat32Array(*p_args[0])); + case PACKED_FLOAT64_ARRAY: return (PackedFloat64Array(*p_args[0])); case PACKED_STRING_ARRAY: return (PackedStringArray(*p_args[0])); case PACKED_VECTOR2_ARRAY: - return (PackedVector2Array(*p_args[0])); // 25 + return (PackedVector2Array(*p_args[0])); case PACKED_VECTOR3_ARRAY: return (PackedVector3Array(*p_args[0])); case PACKED_COLOR_ARRAY: return (PackedColorArray(*p_args[0])); default: return Variant(); @@ -1249,7 +1409,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i //validate parameters for (int i = 0; i < cd.arg_count; i++) { if (!Variant::can_convert(p_args[i]->type, cd.arg_types[i])) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; //no such constructor + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; //no such constructor r_error.argument = i; r_error.expected = cd.arg_types[i]; return Variant(); @@ -1261,7 +1421,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i return v; } } - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; //no such constructor + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; //no such constructor return Variant(); } @@ -1373,6 +1533,30 @@ void Variant::get_method_list(List<MethodInfo> *p_list) const { p_list->push_back(mi); } + + if (type == CALLABLE) { + + MethodInfo mi; + mi.name = "call"; + mi.return_val.usage = PROPERTY_USAGE_NIL_IS_VARIANT; + mi.flags |= METHOD_FLAG_VARARG; + + p_list->push_back(mi); + + mi.name = "call_deferred"; + mi.return_val.usage = 0; + + p_list->push_back(mi); + } + + if (type == SIGNAL) { + + MethodInfo mi; + mi.name = "emit"; + mi.flags |= METHOD_FLAG_VARARG; + + p_list->push_back(mi); + } } void Variant::get_constructor_list(Variant::Type p_type, List<MethodInfo> *p_list) { @@ -1541,7 +1725,7 @@ void register_variant_methods() { ADDFUNC1R(STRING, BOOL, String, is_subsequence_of, STRING, "text", varray()); ADDFUNC1R(STRING, BOOL, String, is_subsequence_ofi, STRING, "text", varray()); ADDFUNC0R(STRING, PACKED_STRING_ARRAY, String, bigrams, varray()); - ADDFUNC1R(STRING, REAL, String, similarity, STRING, "text", varray()); + ADDFUNC1R(STRING, FLOAT, String, similarity, STRING, "text", varray()); ADDFUNC2R(STRING, STRING, String, format, NIL, "values", STRING, "placeholder", varray("{_}")); ADDFUNC2R(STRING, STRING, String, replace, STRING, "what", STRING, "forwhat", varray()); @@ -1551,7 +1735,7 @@ void register_variant_methods() { ADDFUNC0R(STRING, STRING, String, capitalize, varray()); ADDFUNC3R(STRING, PACKED_STRING_ARRAY, String, split, STRING, "delimiter", BOOL, "allow_empty", INT, "maxsplit", varray(true, 0)); ADDFUNC3R(STRING, PACKED_STRING_ARRAY, String, rsplit, STRING, "delimiter", BOOL, "allow_empty", INT, "maxsplit", varray(true, 0)); - ADDFUNC2R(STRING, PACKED_REAL_ARRAY, String, split_floats, STRING, "delimiter", BOOL, "allow_empty", varray(true)); + ADDFUNC2R(STRING, PACKED_FLOAT32_ARRAY, String, split_floats, STRING, "delimiter", BOOL, "allow_empty", varray(true)); ADDFUNC0R(STRING, STRING, String, to_upper, varray()); ADDFUNC0R(STRING, STRING, String, to_lower, varray()); @@ -1598,7 +1782,7 @@ void register_variant_methods() { ADDFUNC0R(STRING, BOOL, String, is_valid_ip_address, varray()); ADDFUNC0R(STRING, BOOL, String, is_valid_filename, varray()); ADDFUNC0R(STRING, INT, String, to_int, varray()); - ADDFUNC0R(STRING, REAL, String, to_float, varray()); + ADDFUNC0R(STRING, FLOAT, String, to_float, varray()); ADDFUNC0R(STRING, INT, String, hex_to_int, varray()); ADDFUNC1R(STRING, STRING, String, pad_decimals, INT, "digits", varray()); ADDFUNC1R(STRING, STRING, String, pad_zeros, INT, "digits", varray()); @@ -1608,41 +1792,45 @@ void register_variant_methods() { ADDFUNC0R(STRING, PACKED_BYTE_ARRAY, String, to_ascii, varray()); ADDFUNC0R(STRING, PACKED_BYTE_ARRAY, String, to_utf8, varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, angle, varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to, VECTOR2, "to", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, angle_to_point, VECTOR2, "to", varray()); + ADDFUNC0R(VECTOR2, FLOAT, Vector2, angle, varray()); + ADDFUNC1R(VECTOR2, FLOAT, Vector2, angle_to, VECTOR2, "to", varray()); + ADDFUNC1R(VECTOR2, FLOAT, Vector2, angle_to_point, VECTOR2, "to", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, direction_to, VECTOR2, "b", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, distance_to, VECTOR2, "to", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, distance_squared_to, VECTOR2, "to", varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, length, varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, length_squared, varray()); + ADDFUNC1R(VECTOR2, FLOAT, Vector2, distance_to, VECTOR2, "to", varray()); + ADDFUNC1R(VECTOR2, FLOAT, Vector2, distance_squared_to, VECTOR2, "to", varray()); + ADDFUNC0R(VECTOR2, FLOAT, Vector2, length, varray()); + ADDFUNC0R(VECTOR2, FLOAT, Vector2, length_squared, varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, normalized, varray()); ADDFUNC0R(VECTOR2, BOOL, Vector2, is_normalized, varray()); ADDFUNC1R(VECTOR2, BOOL, Vector2, is_equal_approx, VECTOR2, "v", varray()); - ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmod, REAL, "mod", varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmod, FLOAT, "mod", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmodv, VECTOR2, "modv", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, project, VECTOR2, "b", varray()); - ADDFUNC2R(VECTOR2, VECTOR2, Vector2, linear_interpolate, VECTOR2, "b", REAL, "t", varray()); - ADDFUNC2R(VECTOR2, VECTOR2, Vector2, slerp, VECTOR2, "b", REAL, "t", varray()); - ADDFUNC4R(VECTOR2, VECTOR2, Vector2, cubic_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", REAL, "t", varray()); - ADDFUNC2R(VECTOR2, VECTOR2, Vector2, move_toward, VECTOR2, "to", REAL, "delta", varray()); - ADDFUNC1R(VECTOR2, VECTOR2, Vector2, rotated, REAL, "phi", varray()); + ADDFUNC2R(VECTOR2, VECTOR2, Vector2, linear_interpolate, VECTOR2, "b", FLOAT, "t", varray()); + ADDFUNC2R(VECTOR2, VECTOR2, Vector2, slerp, VECTOR2, "b", FLOAT, "t", varray()); + ADDFUNC4R(VECTOR2, VECTOR2, Vector2, cubic_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", FLOAT, "t", varray()); + ADDFUNC2R(VECTOR2, VECTOR2, Vector2, move_toward, VECTOR2, "to", FLOAT, "delta", varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, rotated, FLOAT, "phi", varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, tangent, varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, floor, varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, ceil, varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, round, varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, snapped, VECTOR2, "by", varray()); - ADDFUNC0R(VECTOR2, REAL, Vector2, aspect, varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, dot, VECTOR2, "with", varray()); + ADDFUNC0R(VECTOR2, FLOAT, Vector2, aspect, varray()); + ADDFUNC1R(VECTOR2, FLOAT, Vector2, dot, VECTOR2, "with", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, slide, VECTOR2, "n", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, bounce, VECTOR2, "n", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, reflect, VECTOR2, "n", varray()); - ADDFUNC1R(VECTOR2, REAL, Vector2, cross, VECTOR2, "with", varray()); + ADDFUNC1R(VECTOR2, FLOAT, Vector2, cross, VECTOR2, "with", varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, abs, varray()); - ADDFUNC1R(VECTOR2, VECTOR2, Vector2, clamped, REAL, "length", varray()); + ADDFUNC1R(VECTOR2, VECTOR2, Vector2, clamped, FLOAT, "length", varray()); ADDFUNC0R(VECTOR2, VECTOR2, Vector2, sign, varray()); - ADDFUNC0R(RECT2, REAL, Rect2, get_area, varray()); + ADDFUNC0R(VECTOR2I, FLOAT, Vector2i, aspect, varray()); + ADDFUNC0R(VECTOR2I, VECTOR2I, Vector2i, sign, varray()); + ADDFUNC0R(VECTOR2I, VECTOR2I, Vector2i, abs, varray()); + + ADDFUNC0R(RECT2, FLOAT, Rect2, get_area, varray()); ADDFUNC0R(RECT2, BOOL, Rect2, has_no_area, varray()); ADDFUNC1R(RECT2, BOOL, Rect2, has_point, VECTOR2, "point", varray()); ADDFUNC1R(RECT2, BOOL, Rect2, is_equal_approx, RECT2, "rect", varray()); @@ -1651,30 +1839,43 @@ void register_variant_methods() { ADDFUNC1R(RECT2, RECT2, Rect2, clip, RECT2, "b", varray()); ADDFUNC1R(RECT2, RECT2, Rect2, merge, RECT2, "b", varray()); ADDFUNC1R(RECT2, RECT2, Rect2, expand, VECTOR2, "to", varray()); - ADDFUNC1R(RECT2, RECT2, Rect2, grow, REAL, "by", varray()); - ADDFUNC2R(RECT2, RECT2, Rect2, grow_margin, INT, "margin", REAL, "by", varray()); - ADDFUNC4R(RECT2, RECT2, Rect2, grow_individual, REAL, "left", REAL, "top", REAL, "right", REAL, " bottom", varray()); + ADDFUNC1R(RECT2, RECT2, Rect2, grow, FLOAT, "by", varray()); + ADDFUNC2R(RECT2, RECT2, Rect2, grow_margin, INT, "margin", FLOAT, "by", varray()); + ADDFUNC4R(RECT2, RECT2, Rect2, grow_individual, FLOAT, "left", FLOAT, "top", FLOAT, "right", FLOAT, " bottom", varray()); ADDFUNC0R(RECT2, RECT2, Rect2, abs, varray()); + ADDFUNC0R(RECT2I, INT, Rect2i, get_area, varray()); + ADDFUNC0R(RECT2I, BOOL, Rect2i, has_no_area, varray()); + ADDFUNC1R(RECT2I, BOOL, Rect2i, has_point, VECTOR2I, "point", varray()); + ADDFUNC1R(RECT2I, BOOL, Rect2i, intersects, RECT2I, "b", varray()); + ADDFUNC1R(RECT2I, BOOL, Rect2i, encloses, RECT2I, "b", varray()); + ADDFUNC1R(RECT2I, RECT2I, Rect2i, clip, RECT2I, "b", varray()); + ADDFUNC1R(RECT2I, RECT2I, Rect2i, merge, RECT2I, "b", varray()); + ADDFUNC1R(RECT2I, RECT2I, Rect2i, expand, VECTOR2I, "to", varray()); + ADDFUNC1R(RECT2I, RECT2I, Rect2i, grow, INT, "by", varray()); + ADDFUNC2R(RECT2I, RECT2I, Rect2i, grow_margin, INT, "margin", INT, "by", varray()); + ADDFUNC4R(RECT2I, RECT2I, Rect2i, grow_individual, INT, "left", INT, "top", INT, "right", INT, " bottom", varray()); + ADDFUNC0R(RECT2I, RECT2I, Rect2i, abs, varray()); + ADDFUNC0R(VECTOR3, INT, Vector3, min_axis, varray()); ADDFUNC0R(VECTOR3, INT, Vector3, max_axis, varray()); - ADDFUNC1R(VECTOR3, REAL, Vector3, angle_to, VECTOR3, "to", varray()); + ADDFUNC1R(VECTOR3, FLOAT, Vector3, angle_to, VECTOR3, "to", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, direction_to, VECTOR3, "b", varray()); - ADDFUNC1R(VECTOR3, REAL, Vector3, distance_to, VECTOR3, "b", varray()); - ADDFUNC1R(VECTOR3, REAL, Vector3, distance_squared_to, VECTOR3, "b", varray()); - ADDFUNC0R(VECTOR3, REAL, Vector3, length, varray()); - ADDFUNC0R(VECTOR3, REAL, Vector3, length_squared, varray()); + ADDFUNC1R(VECTOR3, FLOAT, Vector3, distance_to, VECTOR3, "b", varray()); + ADDFUNC1R(VECTOR3, FLOAT, Vector3, distance_squared_to, VECTOR3, "b", varray()); + ADDFUNC0R(VECTOR3, FLOAT, Vector3, length, varray()); + ADDFUNC0R(VECTOR3, FLOAT, Vector3, length_squared, varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, normalized, varray()); ADDFUNC0R(VECTOR3, BOOL, Vector3, is_normalized, varray()); ADDFUNC1R(VECTOR3, BOOL, Vector3, is_equal_approx, VECTOR3, "v", varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, inverse, varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, snapped, VECTOR3, "by", varray()); - ADDFUNC2R(VECTOR3, VECTOR3, Vector3, rotated, VECTOR3, "axis", REAL, "phi", varray()); - ADDFUNC2R(VECTOR3, VECTOR3, Vector3, linear_interpolate, VECTOR3, "b", REAL, "t", varray()); - ADDFUNC2R(VECTOR3, VECTOR3, Vector3, slerp, VECTOR3, "b", REAL, "t", varray()); - ADDFUNC4R(VECTOR3, VECTOR3, Vector3, cubic_interpolate, VECTOR3, "b", VECTOR3, "pre_a", VECTOR3, "post_b", REAL, "t", varray()); - ADDFUNC2R(VECTOR3, VECTOR3, Vector3, move_toward, VECTOR3, "to", REAL, "delta", varray()); - ADDFUNC1R(VECTOR3, REAL, Vector3, dot, VECTOR3, "b", varray()); + ADDFUNC2R(VECTOR3, VECTOR3, Vector3, rotated, VECTOR3, "axis", FLOAT, "phi", varray()); + ADDFUNC2R(VECTOR3, VECTOR3, Vector3, linear_interpolate, VECTOR3, "b", FLOAT, "t", varray()); + ADDFUNC2R(VECTOR3, VECTOR3, Vector3, slerp, VECTOR3, "b", FLOAT, "t", varray()); + ADDFUNC4R(VECTOR3, VECTOR3, Vector3, cubic_interpolate, VECTOR3, "b", VECTOR3, "pre_a", VECTOR3, "post_b", FLOAT, "t", varray()); + ADDFUNC2R(VECTOR3, VECTOR3, Vector3, move_toward, VECTOR3, "to", FLOAT, "delta", varray()); + ADDFUNC1R(VECTOR3, FLOAT, Vector3, dot, VECTOR3, "b", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, cross, VECTOR3, "b", varray()); ADDFUNC1R(VECTOR3, BASIS, Vector3, outer, VECTOR3, "b", varray()); ADDFUNC0R(VECTOR3, BASIS, Vector3, to_diagonal_matrix, varray()); @@ -1682,7 +1883,7 @@ void register_variant_methods() { ADDFUNC0R(VECTOR3, VECTOR3, Vector3, floor, varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, ceil, varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, round, varray()); - ADDFUNC1R(VECTOR3, VECTOR3, Vector3, posmod, REAL, "mod", varray()); + ADDFUNC1R(VECTOR3, VECTOR3, Vector3, posmod, FLOAT, "mod", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, posmodv, VECTOR3, "modv", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, project, VECTOR3, "b", varray()); ADDFUNC1R(VECTOR3, VECTOR3, Vector3, slide, VECTOR3, "n", varray()); @@ -1690,32 +1891,36 @@ void register_variant_methods() { ADDFUNC1R(VECTOR3, VECTOR3, Vector3, reflect, VECTOR3, "n", varray()); ADDFUNC0R(VECTOR3, VECTOR3, Vector3, sign, varray()); + ADDFUNC0R(VECTOR3I, INT, Vector3i, min_axis, varray()); + ADDFUNC0R(VECTOR3I, INT, Vector3i, max_axis, varray()); + ADDFUNC0R(VECTOR3I, VECTOR3I, Vector3i, sign, varray()); + ADDFUNC0R(PLANE, PLANE, Plane, normalized, varray()); ADDFUNC0R(PLANE, VECTOR3, Plane, center, varray()); ADDFUNC0R(PLANE, VECTOR3, Plane, get_any_point, varray()); ADDFUNC1R(PLANE, BOOL, Plane, is_equal_approx, PLANE, "plane", varray()); ADDFUNC1R(PLANE, BOOL, Plane, is_point_over, VECTOR3, "point", varray()); - ADDFUNC1R(PLANE, REAL, Plane, distance_to, VECTOR3, "point", varray()); - ADDFUNC2R(PLANE, BOOL, Plane, has_point, VECTOR3, "point", REAL, "epsilon", varray(CMP_EPSILON)); + ADDFUNC1R(PLANE, FLOAT, Plane, distance_to, VECTOR3, "point", varray()); + ADDFUNC2R(PLANE, BOOL, Plane, has_point, VECTOR3, "point", FLOAT, "epsilon", varray(CMP_EPSILON)); ADDFUNC1R(PLANE, VECTOR3, Plane, project, VECTOR3, "point", varray()); ADDFUNC2R(PLANE, VECTOR3, Plane, intersect_3, PLANE, "b", PLANE, "c", varray()); ADDFUNC2R(PLANE, VECTOR3, Plane, intersects_ray, VECTOR3, "from", VECTOR3, "dir", varray()); ADDFUNC2R(PLANE, VECTOR3, Plane, intersects_segment, VECTOR3, "begin", VECTOR3, "end", varray()); - ADDFUNC0R(QUAT, REAL, Quat, length, varray()); - ADDFUNC0R(QUAT, REAL, Quat, length_squared, varray()); + ADDFUNC0R(QUAT, FLOAT, Quat, length, varray()); + ADDFUNC0R(QUAT, FLOAT, Quat, length_squared, varray()); ADDFUNC0R(QUAT, QUAT, Quat, normalized, varray()); ADDFUNC0R(QUAT, BOOL, Quat, is_normalized, varray()); ADDFUNC1R(QUAT, BOOL, Quat, is_equal_approx, QUAT, "quat", varray()); ADDFUNC0R(QUAT, QUAT, Quat, inverse, varray()); - ADDFUNC1R(QUAT, REAL, Quat, dot, QUAT, "b", varray()); + ADDFUNC1R(QUAT, FLOAT, Quat, dot, QUAT, "b", varray()); ADDFUNC1R(QUAT, VECTOR3, Quat, xform, VECTOR3, "v", varray()); - ADDFUNC2R(QUAT, QUAT, Quat, slerp, QUAT, "b", REAL, "t", varray()); - ADDFUNC2R(QUAT, QUAT, Quat, slerpni, QUAT, "b", REAL, "t", varray()); - ADDFUNC4R(QUAT, QUAT, Quat, cubic_slerp, QUAT, "b", QUAT, "pre_a", QUAT, "post_b", REAL, "t", varray()); + ADDFUNC2R(QUAT, QUAT, Quat, slerp, QUAT, "b", FLOAT, "t", varray()); + ADDFUNC2R(QUAT, QUAT, Quat, slerpni, QUAT, "b", FLOAT, "t", varray()); + ADDFUNC4R(QUAT, QUAT, Quat, cubic_slerp, QUAT, "b", QUAT, "pre_a", QUAT, "post_b", FLOAT, "t", varray()); ADDFUNC0R(QUAT, VECTOR3, Quat, get_euler, varray()); ADDFUNC1(QUAT, NIL, Quat, set_euler, VECTOR3, "euler", varray()); - ADDFUNC2(QUAT, NIL, Quat, set_axis_angle, VECTOR3, "axis", REAL, "angle", varray()); + ADDFUNC2(QUAT, NIL, Quat, set_axis_angle, VECTOR3, "axis", FLOAT, "angle", varray()); ADDFUNC0R(COLOR, INT, Color, to_argb32, varray()); ADDFUNC0R(COLOR, INT, Color, to_abgr32, varray()); @@ -1725,12 +1930,12 @@ void register_variant_methods() { ADDFUNC0R(COLOR, INT, Color, to_rgba64, varray()); ADDFUNC0R(COLOR, COLOR, Color, inverted, varray()); ADDFUNC0R(COLOR, COLOR, Color, contrasted, varray()); - ADDFUNC2R(COLOR, COLOR, Color, linear_interpolate, COLOR, "b", REAL, "t", varray()); + ADDFUNC2R(COLOR, COLOR, Color, linear_interpolate, COLOR, "b", FLOAT, "t", varray()); ADDFUNC1R(COLOR, COLOR, Color, blend, COLOR, "over", varray()); - ADDFUNC1R(COLOR, COLOR, Color, lightened, REAL, "amount", varray()); - ADDFUNC1R(COLOR, COLOR, Color, darkened, REAL, "amount", varray()); + ADDFUNC1R(COLOR, COLOR, Color, lightened, FLOAT, "amount", varray()); + ADDFUNC1R(COLOR, COLOR, Color, darkened, FLOAT, "amount", varray()); ADDFUNC1R(COLOR, STRING, Color, to_html, BOOL, "with_alpha", varray(true)); - ADDFUNC4R(COLOR, COLOR, Color, from_hsv, REAL, "h", REAL, "s", REAL, "v", REAL, "a", varray(1.0)); + ADDFUNC4R(COLOR, COLOR, Color, from_hsv, FLOAT, "h", FLOAT, "s", FLOAT, "v", FLOAT, "a", varray(1.0)); ADDFUNC1R(COLOR, BOOL, Color, is_equal_approx, COLOR, "color", varray()); ADDFUNC0R(_RID, INT, RID, get_id, varray()); @@ -1756,6 +1961,25 @@ void register_variant_methods() { ADDFUNC1R(DICTIONARY, DICTIONARY, Dictionary, duplicate, BOOL, "deep", varray(false)); ADDFUNC2R(DICTIONARY, NIL, Dictionary, get, NIL, "key", NIL, "default", varray(Variant())); + ADDFUNC0R(CALLABLE, BOOL, Callable, is_null, varray()); + ADDFUNC0R(CALLABLE, BOOL, Callable, is_custom, varray()); + ADDFUNC0R(CALLABLE, BOOL, Callable, is_standard, varray()); + ADDFUNC0R(CALLABLE, OBJECT, Callable, get_object, varray()); + ADDFUNC0R(CALLABLE, INT, Callable, get_object_id, varray()); + ADDFUNC0R(CALLABLE, STRING_NAME, Callable, get_method, varray()); + ADDFUNC0R(CALLABLE, INT, Callable, hash, varray()); + + ADDFUNC0R(SIGNAL, BOOL, Signal, is_null, varray()); + ADDFUNC0R(SIGNAL, OBJECT, Signal, get_object, varray()); + ADDFUNC0R(SIGNAL, INT, Signal, get_object_id, varray()); + ADDFUNC0R(SIGNAL, STRING_NAME, Signal, get_name, varray()); + + ADDFUNC3R(SIGNAL, INT, Signal, connect, CALLABLE, "callable", ARRAY, "binds", INT, "flags", varray(Array(), 0)); + + ADDFUNC1R(SIGNAL, NIL, Signal, disconnect, CALLABLE, "callable", varray()); + ADDFUNC1R(SIGNAL, BOOL, Signal, is_connected, CALLABLE, "callable", varray()); + ADDFUNC0R(SIGNAL, ARRAY, Signal, get_connections, varray()); + ADDFUNC0R(ARRAY, INT, Array, size, varray()); ADDFUNC0R(ARRAY, BOOL, Array, empty, varray()); ADDFUNC0NC(ARRAY, NIL, Array, clear, varray()); @@ -1805,27 +2029,49 @@ void register_variant_methods() { ADDFUNC1R(PACKED_BYTE_ARRAY, PACKED_BYTE_ARRAY, PackedByteArray, compress, INT, "compression_mode", varray(0)); ADDFUNC2R(PACKED_BYTE_ARRAY, PACKED_BYTE_ARRAY, PackedByteArray, decompress, INT, "buffer_size", INT, "compression_mode", varray(0)); - ADDFUNC0R(PACKED_INT_ARRAY, INT, PackedIntArray, size, varray()); - ADDFUNC0R(PACKED_INT_ARRAY, BOOL, PackedIntArray, empty, varray()); - ADDFUNC2(PACKED_INT_ARRAY, NIL, PackedIntArray, set, INT, "idx", INT, "integer", varray()); - ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, push_back, INT, "integer", varray()); - ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, append, INT, "integer", varray()); - ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, append_array, PACKED_INT_ARRAY, "array", varray()); - ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, remove, INT, "idx", varray()); - ADDFUNC2R(PACKED_INT_ARRAY, INT, PackedIntArray, insert, INT, "idx", INT, "integer", varray()); - ADDFUNC1(PACKED_INT_ARRAY, NIL, PackedIntArray, resize, INT, "idx", varray()); - ADDFUNC0(PACKED_INT_ARRAY, NIL, PackedIntArray, invert, varray()); - - ADDFUNC0R(PACKED_REAL_ARRAY, INT, PackedRealArray, size, varray()); - ADDFUNC0R(PACKED_REAL_ARRAY, BOOL, PackedRealArray, empty, varray()); - ADDFUNC2(PACKED_REAL_ARRAY, NIL, PackedRealArray, set, INT, "idx", REAL, "value", varray()); - ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, push_back, REAL, "value", varray()); - ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, append, REAL, "value", varray()); - ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, append_array, PACKED_REAL_ARRAY, "array", varray()); - ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, remove, INT, "idx", varray()); - ADDFUNC2R(PACKED_REAL_ARRAY, INT, PackedRealArray, insert, INT, "idx", REAL, "value", varray()); - ADDFUNC1(PACKED_REAL_ARRAY, NIL, PackedRealArray, resize, INT, "idx", varray()); - ADDFUNC0(PACKED_REAL_ARRAY, NIL, PackedRealArray, invert, varray()); + ADDFUNC0R(PACKED_INT32_ARRAY, INT, PackedInt32Array, size, varray()); + ADDFUNC0R(PACKED_INT32_ARRAY, BOOL, PackedInt32Array, empty, varray()); + ADDFUNC2(PACKED_INT32_ARRAY, NIL, PackedInt32Array, set, INT, "idx", INT, "integer", varray()); + ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, push_back, INT, "integer", varray()); + ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, append, INT, "integer", varray()); + ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, append_array, PACKED_INT32_ARRAY, "array", varray()); + ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, remove, INT, "idx", varray()); + ADDFUNC2R(PACKED_INT32_ARRAY, INT, PackedInt32Array, insert, INT, "idx", INT, "integer", varray()); + ADDFUNC1(PACKED_INT32_ARRAY, NIL, PackedInt32Array, resize, INT, "idx", varray()); + ADDFUNC0(PACKED_INT32_ARRAY, NIL, PackedInt32Array, invert, varray()); + + ADDFUNC0R(PACKED_INT64_ARRAY, INT, PackedInt64Array, size, varray()); + ADDFUNC0R(PACKED_INT64_ARRAY, BOOL, PackedInt64Array, empty, varray()); + ADDFUNC2(PACKED_INT64_ARRAY, NIL, PackedInt64Array, set, INT, "idx", INT, "integer", varray()); + ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, push_back, INT, "integer", varray()); + ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, append, INT, "integer", varray()); + ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, append_array, PACKED_INT64_ARRAY, "array", varray()); + ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, remove, INT, "idx", varray()); + ADDFUNC2R(PACKED_INT64_ARRAY, INT, PackedInt64Array, insert, INT, "idx", INT, "integer", varray()); + ADDFUNC1(PACKED_INT64_ARRAY, NIL, PackedInt64Array, resize, INT, "idx", varray()); + ADDFUNC0(PACKED_INT64_ARRAY, NIL, PackedInt64Array, invert, varray()); + + ADDFUNC0R(PACKED_FLOAT32_ARRAY, INT, PackedFloat32Array, size, varray()); + ADDFUNC0R(PACKED_FLOAT32_ARRAY, BOOL, PackedFloat32Array, empty, varray()); + ADDFUNC2(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, set, INT, "idx", FLOAT, "value", varray()); + ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, push_back, FLOAT, "value", varray()); + ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, append, FLOAT, "value", varray()); + ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, append_array, PACKED_FLOAT32_ARRAY, "array", varray()); + ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, remove, INT, "idx", varray()); + ADDFUNC2R(PACKED_FLOAT32_ARRAY, INT, PackedFloat32Array, insert, INT, "idx", FLOAT, "value", varray()); + ADDFUNC1(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, resize, INT, "idx", varray()); + ADDFUNC0(PACKED_FLOAT32_ARRAY, NIL, PackedFloat32Array, invert, varray()); + + ADDFUNC0R(PACKED_FLOAT64_ARRAY, INT, PackedFloat64Array, size, varray()); + ADDFUNC0R(PACKED_FLOAT64_ARRAY, BOOL, PackedFloat64Array, empty, varray()); + ADDFUNC2(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, set, INT, "idx", FLOAT, "value", varray()); + ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, push_back, FLOAT, "value", varray()); + ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, append, FLOAT, "value", varray()); + ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, append_array, PACKED_FLOAT64_ARRAY, "array", varray()); + ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, remove, INT, "idx", varray()); + ADDFUNC2R(PACKED_FLOAT64_ARRAY, INT, PackedFloat64Array, insert, INT, "idx", FLOAT, "value", varray()); + ADDFUNC1(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, resize, INT, "idx", varray()); + ADDFUNC0(PACKED_FLOAT64_ARRAY, NIL, PackedFloat64Array, invert, varray()); ADDFUNC0R(PACKED_STRING_ARRAY, INT, PackedStringArray, size, varray()); ADDFUNC0R(PACKED_STRING_ARRAY, BOOL, PackedStringArray, empty, varray()); @@ -1873,7 +2119,7 @@ void register_variant_methods() { //pointerbased - ADDFUNC0R(AABB, REAL, AABB, get_area, varray()); + ADDFUNC0R(AABB, FLOAT, AABB, get_area, varray()); ADDFUNC0R(AABB, BOOL, AABB, has_no_area, varray()); ADDFUNC0R(AABB, BOOL, AABB, has_no_surface, varray()); ADDFUNC1R(AABB, BOOL, AABB, has_point, VECTOR3, "point", varray()); @@ -1885,93 +2131,101 @@ void register_variant_methods() { ADDFUNC1R(AABB, AABB, AABB, intersection, AABB, "with", varray()); ADDFUNC1R(AABB, AABB, AABB, merge, AABB, "with", varray()); ADDFUNC1R(AABB, AABB, AABB, expand, VECTOR3, "to_point", varray()); - ADDFUNC1R(AABB, AABB, AABB, grow, REAL, "by", varray()); + ADDFUNC1R(AABB, AABB, AABB, grow, FLOAT, "by", varray()); ADDFUNC1R(AABB, VECTOR3, AABB, get_support, VECTOR3, "dir", varray()); ADDFUNC0R(AABB, VECTOR3, AABB, get_longest_axis, varray()); ADDFUNC0R(AABB, INT, AABB, get_longest_axis_index, varray()); - ADDFUNC0R(AABB, REAL, AABB, get_longest_axis_size, varray()); + ADDFUNC0R(AABB, FLOAT, AABB, get_longest_axis_size, varray()); ADDFUNC0R(AABB, VECTOR3, AABB, get_shortest_axis, varray()); ADDFUNC0R(AABB, INT, AABB, get_shortest_axis_index, varray()); - ADDFUNC0R(AABB, REAL, AABB, get_shortest_axis_size, varray()); + ADDFUNC0R(AABB, FLOAT, AABB, get_shortest_axis_size, varray()); ADDFUNC1R(AABB, VECTOR3, AABB, get_endpoint, INT, "idx", varray()); ADDFUNC0R(TRANSFORM2D, TRANSFORM2D, Transform2D, inverse, varray()); ADDFUNC0R(TRANSFORM2D, TRANSFORM2D, Transform2D, affine_inverse, varray()); - ADDFUNC0R(TRANSFORM2D, REAL, Transform2D, get_rotation, varray()); + ADDFUNC0R(TRANSFORM2D, FLOAT, Transform2D, get_rotation, varray()); ADDFUNC0R(TRANSFORM2D, VECTOR2, Transform2D, get_origin, varray()); ADDFUNC0R(TRANSFORM2D, VECTOR2, Transform2D, get_scale, varray()); ADDFUNC0R(TRANSFORM2D, TRANSFORM2D, Transform2D, orthonormalized, varray()); - ADDFUNC1R(TRANSFORM2D, TRANSFORM2D, Transform2D, rotated, REAL, "phi", varray()); + ADDFUNC1R(TRANSFORM2D, TRANSFORM2D, Transform2D, rotated, FLOAT, "phi", varray()); ADDFUNC1R(TRANSFORM2D, TRANSFORM2D, Transform2D, scaled, VECTOR2, "scale", varray()); ADDFUNC1R(TRANSFORM2D, TRANSFORM2D, Transform2D, translated, VECTOR2, "offset", varray()); ADDFUNC1R(TRANSFORM2D, NIL, Transform2D, xform, NIL, "v", varray()); ADDFUNC1R(TRANSFORM2D, NIL, Transform2D, xform_inv, NIL, "v", varray()); ADDFUNC1R(TRANSFORM2D, VECTOR2, Transform2D, basis_xform, VECTOR2, "v", varray()); ADDFUNC1R(TRANSFORM2D, VECTOR2, Transform2D, basis_xform_inv, VECTOR2, "v", varray()); - ADDFUNC2R(TRANSFORM2D, TRANSFORM2D, Transform2D, interpolate_with, TRANSFORM2D, "transform", REAL, "weight", varray()); + ADDFUNC2R(TRANSFORM2D, TRANSFORM2D, Transform2D, interpolate_with, TRANSFORM2D, "transform", FLOAT, "weight", varray()); ADDFUNC1R(TRANSFORM2D, BOOL, Transform2D, is_equal_approx, TRANSFORM2D, "transform", varray()); ADDFUNC0R(BASIS, BASIS, Basis, inverse, varray()); ADDFUNC0R(BASIS, BASIS, Basis, transposed, varray()); ADDFUNC0R(BASIS, BASIS, Basis, orthonormalized, varray()); - ADDFUNC0R(BASIS, REAL, Basis, determinant, varray()); - ADDFUNC2R(BASIS, BASIS, Basis, rotated, VECTOR3, "axis", REAL, "phi", varray()); + ADDFUNC0R(BASIS, FLOAT, Basis, determinant, varray()); + ADDFUNC2R(BASIS, BASIS, Basis, rotated, VECTOR3, "axis", FLOAT, "phi", varray()); ADDFUNC1R(BASIS, BASIS, Basis, scaled, VECTOR3, "scale", varray()); ADDFUNC0R(BASIS, VECTOR3, Basis, get_scale, varray()); ADDFUNC0R(BASIS, VECTOR3, Basis, get_euler, varray()); - ADDFUNC1R(BASIS, REAL, Basis, tdotx, VECTOR3, "with", varray()); - ADDFUNC1R(BASIS, REAL, Basis, tdoty, VECTOR3, "with", varray()); - ADDFUNC1R(BASIS, REAL, Basis, tdotz, VECTOR3, "with", varray()); + ADDFUNC1R(BASIS, FLOAT, Basis, tdotx, VECTOR3, "with", varray()); + ADDFUNC1R(BASIS, FLOAT, Basis, tdoty, VECTOR3, "with", varray()); + ADDFUNC1R(BASIS, FLOAT, Basis, tdotz, VECTOR3, "with", varray()); ADDFUNC1R(BASIS, VECTOR3, Basis, xform, VECTOR3, "v", varray()); ADDFUNC1R(BASIS, VECTOR3, Basis, xform_inv, VECTOR3, "v", varray()); ADDFUNC0R(BASIS, INT, Basis, get_orthogonal_index, varray()); - ADDFUNC2R(BASIS, BASIS, Basis, slerp, BASIS, "b", REAL, "t", varray()); - ADDFUNC2R(BASIS, BOOL, Basis, is_equal_approx, BASIS, "b", REAL, "epsilon", varray(CMP_EPSILON)); // TODO: Replace in 4.0, see other TODO. + ADDFUNC2R(BASIS, BASIS, Basis, slerp, BASIS, "b", FLOAT, "t", varray()); + ADDFUNC2R(BASIS, BOOL, Basis, is_equal_approx, BASIS, "b", FLOAT, "epsilon", varray(CMP_EPSILON)); // TODO: Replace in 4.0, see other TODO. ADDFUNC0R(BASIS, QUAT, Basis, get_rotation_quat, varray()); ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, inverse, varray()); ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, affine_inverse, varray()); ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, orthonormalized, varray()); - ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, rotated, VECTOR3, "axis", REAL, "phi", varray()); + ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, rotated, VECTOR3, "axis", FLOAT, "phi", varray()); ADDFUNC1R(TRANSFORM, TRANSFORM, Transform, scaled, VECTOR3, "scale", varray()); ADDFUNC1R(TRANSFORM, TRANSFORM, Transform, translated, VECTOR3, "offset", varray()); ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, looking_at, VECTOR3, "target", VECTOR3, "up", varray()); - ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, interpolate_with, TRANSFORM, "transform", REAL, "weight", varray()); + ADDFUNC2R(TRANSFORM, TRANSFORM, Transform, interpolate_with, TRANSFORM, "transform", FLOAT, "weight", varray()); ADDFUNC1R(TRANSFORM, BOOL, Transform, is_equal_approx, TRANSFORM, "transform", varray()); ADDFUNC1R(TRANSFORM, NIL, Transform, xform, NIL, "v", varray()); ADDFUNC1R(TRANSFORM, NIL, Transform, xform_inv, NIL, "v", varray()); /* REGISTER CONSTRUCTORS */ - _VariantCall::add_constructor(_VariantCall::Vector2_init1, Variant::VECTOR2, "x", Variant::REAL, "y", Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Vector2_init1, Variant::VECTOR2, "x", Variant::FLOAT, "y", Variant::FLOAT); + _VariantCall::add_constructor(_VariantCall::Vector2i_init1, Variant::VECTOR2I, "x", Variant::INT, "y", Variant::INT); _VariantCall::add_constructor(_VariantCall::Rect2_init1, Variant::RECT2, "position", Variant::VECTOR2, "size", Variant::VECTOR2); - _VariantCall::add_constructor(_VariantCall::Rect2_init2, Variant::RECT2, "x", Variant::REAL, "y", Variant::REAL, "width", Variant::REAL, "height", Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Rect2_init2, Variant::RECT2, "x", Variant::FLOAT, "y", Variant::FLOAT, "width", Variant::FLOAT, "height", Variant::FLOAT); - _VariantCall::add_constructor(_VariantCall::Transform2D_init2, Variant::TRANSFORM2D, "rotation", Variant::REAL, "position", Variant::VECTOR2); + _VariantCall::add_constructor(_VariantCall::Rect2i_init1, Variant::RECT2I, "position", Variant::VECTOR2, "size", Variant::VECTOR2); + _VariantCall::add_constructor(_VariantCall::Rect2i_init2, Variant::RECT2I, "x", Variant::INT, "y", Variant::INT, "width", Variant::INT, "height", Variant::INT); + + _VariantCall::add_constructor(_VariantCall::Transform2D_init2, Variant::TRANSFORM2D, "rotation", Variant::FLOAT, "position", Variant::VECTOR2); _VariantCall::add_constructor(_VariantCall::Transform2D_init3, Variant::TRANSFORM2D, "x_axis", Variant::VECTOR2, "y_axis", Variant::VECTOR2, "origin", Variant::VECTOR2); - _VariantCall::add_constructor(_VariantCall::Vector3_init1, Variant::VECTOR3, "x", Variant::REAL, "y", Variant::REAL, "z", Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Vector3_init1, Variant::VECTOR3, "x", Variant::FLOAT, "y", Variant::FLOAT, "z", Variant::FLOAT); + _VariantCall::add_constructor(_VariantCall::Vector3i_init1, Variant::VECTOR3I, "x", Variant::INT, "y", Variant::INT, "z", Variant::INT); - _VariantCall::add_constructor(_VariantCall::Plane_init1, Variant::PLANE, "a", Variant::REAL, "b", Variant::REAL, "c", Variant::REAL, "d", Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Plane_init1, Variant::PLANE, "a", Variant::FLOAT, "b", Variant::FLOAT, "c", Variant::FLOAT, "d", Variant::FLOAT); _VariantCall::add_constructor(_VariantCall::Plane_init2, Variant::PLANE, "v1", Variant::VECTOR3, "v2", Variant::VECTOR3, "v3", Variant::VECTOR3); - _VariantCall::add_constructor(_VariantCall::Plane_init3, Variant::PLANE, "normal", Variant::VECTOR3, "d", Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Plane_init3, Variant::PLANE, "normal", Variant::VECTOR3, "d", Variant::FLOAT); - _VariantCall::add_constructor(_VariantCall::Quat_init1, Variant::QUAT, "x", Variant::REAL, "y", Variant::REAL, "z", Variant::REAL, "w", Variant::REAL); - _VariantCall::add_constructor(_VariantCall::Quat_init2, Variant::QUAT, "axis", Variant::VECTOR3, "angle", Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Quat_init1, Variant::QUAT, "x", Variant::FLOAT, "y", Variant::FLOAT, "z", Variant::FLOAT, "w", Variant::FLOAT); + _VariantCall::add_constructor(_VariantCall::Quat_init2, Variant::QUAT, "axis", Variant::VECTOR3, "angle", Variant::FLOAT); _VariantCall::add_constructor(_VariantCall::Quat_init3, Variant::QUAT, "euler", Variant::VECTOR3); - _VariantCall::add_constructor(_VariantCall::Color_init1, Variant::COLOR, "r", Variant::REAL, "g", Variant::REAL, "b", Variant::REAL, "a", Variant::REAL); - _VariantCall::add_constructor(_VariantCall::Color_init2, Variant::COLOR, "r", Variant::REAL, "g", Variant::REAL, "b", Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Color_init1, Variant::COLOR, "r", Variant::FLOAT, "g", Variant::FLOAT, "b", Variant::FLOAT, "a", Variant::FLOAT); + _VariantCall::add_constructor(_VariantCall::Color_init2, Variant::COLOR, "r", Variant::FLOAT, "g", Variant::FLOAT, "b", Variant::FLOAT); _VariantCall::add_constructor(_VariantCall::AABB_init1, Variant::AABB, "position", Variant::VECTOR3, "size", Variant::VECTOR3); _VariantCall::add_constructor(_VariantCall::Basis_init1, Variant::BASIS, "x_axis", Variant::VECTOR3, "y_axis", Variant::VECTOR3, "z_axis", Variant::VECTOR3); - _VariantCall::add_constructor(_VariantCall::Basis_init2, Variant::BASIS, "axis", Variant::VECTOR3, "phi", Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Basis_init2, Variant::BASIS, "axis", Variant::VECTOR3, "phi", Variant::FLOAT); _VariantCall::add_constructor(_VariantCall::Transform_init1, Variant::TRANSFORM, "x_axis", Variant::VECTOR3, "y_axis", Variant::VECTOR3, "z_axis", Variant::VECTOR3, "origin", Variant::VECTOR3); _VariantCall::add_constructor(_VariantCall::Transform_init2, Variant::TRANSFORM, "basis", Variant::BASIS, "origin", Variant::VECTOR3); + _VariantCall::add_constructor(_VariantCall::Callable_init2, Variant::CALLABLE, "object", Variant::OBJECT, "method_name", Variant::STRING_NAME); + _VariantCall::add_constructor(_VariantCall::Signal_init2, Variant::SIGNAL, "object", Variant::OBJECT, "signal_name", Variant::STRING_NAME); + /* REGISTER CONSTANTS */ _populate_named_colors(); @@ -1993,9 +2247,25 @@ void register_variant_methods() { _VariantCall::add_variant_constant(Variant::VECTOR3, "FORWARD", Vector3(0, 0, -1)); _VariantCall::add_variant_constant(Variant::VECTOR3, "BACK", Vector3(0, 0, 1)); + _VariantCall::add_constant(Variant::VECTOR3I, "AXIS_X", Vector3::AXIS_X); + _VariantCall::add_constant(Variant::VECTOR3I, "AXIS_Y", Vector3::AXIS_Y); + _VariantCall::add_constant(Variant::VECTOR3I, "AXIS_Z", Vector3::AXIS_Z); + + _VariantCall::add_variant_constant(Variant::VECTOR3I, "ZERO", Vector3i(0, 0, 0)); + _VariantCall::add_variant_constant(Variant::VECTOR3I, "ONE", Vector3i(1, 1, 1)); + _VariantCall::add_variant_constant(Variant::VECTOR3I, "LEFT", Vector3i(-1, 0, 0)); + _VariantCall::add_variant_constant(Variant::VECTOR3I, "RIGHT", Vector3i(1, 0, 0)); + _VariantCall::add_variant_constant(Variant::VECTOR3I, "UP", Vector3i(0, 1, 0)); + _VariantCall::add_variant_constant(Variant::VECTOR3I, "DOWN", Vector3i(0, -1, 0)); + _VariantCall::add_variant_constant(Variant::VECTOR3I, "FORWARD", Vector3i(0, 0, -1)); + _VariantCall::add_variant_constant(Variant::VECTOR3I, "BACK", Vector3i(0, 0, 1)); + _VariantCall::add_constant(Variant::VECTOR2, "AXIS_X", Vector2::AXIS_X); _VariantCall::add_constant(Variant::VECTOR2, "AXIS_Y", Vector2::AXIS_Y); + _VariantCall::add_constant(Variant::VECTOR2I, "AXIS_X", Vector2::AXIS_X); + _VariantCall::add_constant(Variant::VECTOR2I, "AXIS_Y", Vector2::AXIS_Y); + _VariantCall::add_variant_constant(Variant::VECTOR2, "ZERO", Vector2(0, 0)); _VariantCall::add_variant_constant(Variant::VECTOR2, "ONE", Vector2(1, 1)); _VariantCall::add_variant_constant(Variant::VECTOR2, "INF", Vector2(Math_INF, Math_INF)); @@ -2004,6 +2274,13 @@ void register_variant_methods() { _VariantCall::add_variant_constant(Variant::VECTOR2, "UP", Vector2(0, -1)); _VariantCall::add_variant_constant(Variant::VECTOR2, "DOWN", Vector2(0, 1)); + _VariantCall::add_variant_constant(Variant::VECTOR2I, "ZERO", Vector2i(0, 0)); + _VariantCall::add_variant_constant(Variant::VECTOR2I, "ONE", Vector2i(1, 1)); + _VariantCall::add_variant_constant(Variant::VECTOR2I, "LEFT", Vector2i(-1, 0)); + _VariantCall::add_variant_constant(Variant::VECTOR2I, "RIGHT", Vector2i(1, 0)); + _VariantCall::add_variant_constant(Variant::VECTOR2I, "UP", Vector2i(0, -1)); + _VariantCall::add_variant_constant(Variant::VECTOR2I, "DOWN", Vector2i(0, 1)); + _VariantCall::add_variant_constant(Variant::TRANSFORM2D, "IDENTITY", Transform2D()); _VariantCall::add_variant_constant(Variant::TRANSFORM2D, "FLIP_X", Transform2D(-1, 0, 0, 1, 0, 0)); _VariantCall::add_variant_constant(Variant::TRANSFORM2D, "FLIP_Y", Transform2D(1, 0, 0, -1, 0, 0)); diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 566c87dac1..36d1278929 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -41,11 +41,14 @@ #define CASE_TYPE_ALL_BUT_INT(PREFIX, OP) \ CASE_TYPE(PREFIX, OP, NIL) \ CASE_TYPE(PREFIX, OP, BOOL) \ - CASE_TYPE(PREFIX, OP, REAL) \ + CASE_TYPE(PREFIX, OP, FLOAT) \ CASE_TYPE(PREFIX, OP, STRING) \ CASE_TYPE(PREFIX, OP, VECTOR2) \ + CASE_TYPE(PREFIX, OP, VECTOR2I) \ CASE_TYPE(PREFIX, OP, RECT2) \ + CASE_TYPE(PREFIX, OP, RECT2I) \ CASE_TYPE(PREFIX, OP, VECTOR3) \ + CASE_TYPE(PREFIX, OP, VECTOR3I) \ CASE_TYPE(PREFIX, OP, TRANSFORM2D) \ CASE_TYPE(PREFIX, OP, PLANE) \ CASE_TYPE(PREFIX, OP, QUAT) \ @@ -53,14 +56,19 @@ CASE_TYPE(PREFIX, OP, BASIS) \ CASE_TYPE(PREFIX, OP, TRANSFORM) \ CASE_TYPE(PREFIX, OP, COLOR) \ + CASE_TYPE(PREFIX, OP, STRING_NAME) \ CASE_TYPE(PREFIX, OP, NODE_PATH) \ CASE_TYPE(PREFIX, OP, _RID) \ CASE_TYPE(PREFIX, OP, OBJECT) \ + CASE_TYPE(PREFIX, OP, CALLABLE) \ + CASE_TYPE(PREFIX, OP, SIGNAL) \ CASE_TYPE(PREFIX, OP, DICTIONARY) \ CASE_TYPE(PREFIX, OP, ARRAY) \ CASE_TYPE(PREFIX, OP, PACKED_BYTE_ARRAY) \ - CASE_TYPE(PREFIX, OP, PACKED_INT_ARRAY) \ - CASE_TYPE(PREFIX, OP, PACKED_REAL_ARRAY) \ + CASE_TYPE(PREFIX, OP, PACKED_INT32_ARRAY) \ + CASE_TYPE(PREFIX, OP, PACKED_INT64_ARRAY) \ + CASE_TYPE(PREFIX, OP, PACKED_FLOAT32_ARRAY) \ + CASE_TYPE(PREFIX, OP, PACKED_FLOAT64_ARRAY) \ CASE_TYPE(PREFIX, OP, PACKED_STRING_ARRAY) \ CASE_TYPE(PREFIX, OP, PACKED_VECTOR2_ARRAY) \ CASE_TYPE(PREFIX, OP, PACKED_VECTOR3_ARRAY) \ @@ -74,11 +82,14 @@ TYPE(PREFIX, OP, NIL), \ TYPE(PREFIX, OP, BOOL), \ TYPE(PREFIX, OP, INT), \ - TYPE(PREFIX, OP, REAL), \ + TYPE(PREFIX, OP, FLOAT), \ TYPE(PREFIX, OP, STRING), \ TYPE(PREFIX, OP, VECTOR2), \ + TYPE(PREFIX, OP, VECTOR2I), \ TYPE(PREFIX, OP, RECT2), \ + TYPE(PREFIX, OP, RECT2I), \ TYPE(PREFIX, OP, VECTOR3), \ + TYPE(PREFIX, OP, VECTOR3I), \ TYPE(PREFIX, OP, TRANSFORM2D), \ TYPE(PREFIX, OP, PLANE), \ TYPE(PREFIX, OP, QUAT), \ @@ -86,14 +97,19 @@ TYPE(PREFIX, OP, BASIS), \ TYPE(PREFIX, OP, TRANSFORM), \ TYPE(PREFIX, OP, COLOR), \ + TYPE(PREFIX, OP, STRING_NAME), \ TYPE(PREFIX, OP, NODE_PATH), \ TYPE(PREFIX, OP, _RID), \ TYPE(PREFIX, OP, OBJECT), \ + TYPE(PREFIX, OP, CALLABLE), \ + TYPE(PREFIX, OP, SIGNAL), \ TYPE(PREFIX, OP, DICTIONARY), \ TYPE(PREFIX, OP, ARRAY), \ TYPE(PREFIX, OP, PACKED_BYTE_ARRAY), \ - TYPE(PREFIX, OP, PACKED_INT_ARRAY), \ - TYPE(PREFIX, OP, PACKED_REAL_ARRAY), \ + TYPE(PREFIX, OP, PACKED_INT32_ARRAY), \ + TYPE(PREFIX, OP, PACKED_INT64_ARRAY), \ + TYPE(PREFIX, OP, PACKED_FLOAT32_ARRAY), \ + TYPE(PREFIX, OP, PACKED_FLOAT64_ARRAY), \ TYPE(PREFIX, OP, PACKED_STRING_ARRAY), \ TYPE(PREFIX, OP, PACKED_VECTOR2_ARRAY), \ TYPE(PREFIX, OP, PACKED_VECTOR3_ARRAY), \ @@ -101,32 +117,32 @@ } /* clang-format on */ -#define CASES(PREFIX) static const void *switch_table_##PREFIX[25][27] = { \ - TYPES(PREFIX, OP_EQUAL), \ - TYPES(PREFIX, OP_NOT_EQUAL), \ - TYPES(PREFIX, OP_LESS), \ - TYPES(PREFIX, OP_LESS_EQUAL), \ - TYPES(PREFIX, OP_GREATER), \ - TYPES(PREFIX, OP_GREATER_EQUAL), \ - TYPES(PREFIX, OP_ADD), \ - TYPES(PREFIX, OP_SUBTRACT), \ - TYPES(PREFIX, OP_MULTIPLY), \ - TYPES(PREFIX, OP_DIVIDE), \ - TYPES(PREFIX, OP_NEGATE), \ - TYPES(PREFIX, OP_POSITIVE), \ - TYPES(PREFIX, OP_MODULE), \ - TYPES(PREFIX, OP_STRING_CONCAT), \ - TYPES(PREFIX, OP_SHIFT_LEFT), \ - TYPES(PREFIX, OP_SHIFT_RIGHT), \ - TYPES(PREFIX, OP_BIT_AND), \ - TYPES(PREFIX, OP_BIT_OR), \ - TYPES(PREFIX, OP_BIT_XOR), \ - TYPES(PREFIX, OP_BIT_NEGATE), \ - TYPES(PREFIX, OP_AND), \ - TYPES(PREFIX, OP_OR), \ - TYPES(PREFIX, OP_XOR), \ - TYPES(PREFIX, OP_NOT), \ - TYPES(PREFIX, OP_IN), \ +#define CASES(PREFIX) static const void *switch_table_##PREFIX[25][Variant::VARIANT_MAX] = { \ + TYPES(PREFIX, OP_EQUAL), \ + TYPES(PREFIX, OP_NOT_EQUAL), \ + TYPES(PREFIX, OP_LESS), \ + TYPES(PREFIX, OP_LESS_EQUAL), \ + TYPES(PREFIX, OP_GREATER), \ + TYPES(PREFIX, OP_GREATER_EQUAL), \ + TYPES(PREFIX, OP_ADD), \ + TYPES(PREFIX, OP_SUBTRACT), \ + TYPES(PREFIX, OP_MULTIPLY), \ + TYPES(PREFIX, OP_DIVIDE), \ + TYPES(PREFIX, OP_NEGATE), \ + TYPES(PREFIX, OP_POSITIVE), \ + TYPES(PREFIX, OP_MODULE), \ + TYPES(PREFIX, OP_STRING_CONCAT), \ + TYPES(PREFIX, OP_SHIFT_LEFT), \ + TYPES(PREFIX, OP_SHIFT_RIGHT), \ + TYPES(PREFIX, OP_BIT_AND), \ + TYPES(PREFIX, OP_BIT_OR), \ + TYPES(PREFIX, OP_BIT_XOR), \ + TYPES(PREFIX, OP_BIT_NEGATE), \ + TYPES(PREFIX, OP_AND), \ + TYPES(PREFIX, OP_OR), \ + TYPES(PREFIX, OP_XOR), \ + TYPES(PREFIX, OP_NOT), \ + TYPES(PREFIX, OP_IN), \ } #define SWITCH(PREFIX, op, val) goto *switch_table_##PREFIX[op][val]; @@ -165,21 +181,21 @@ bool Variant::booleanize() const { return; \ } -#define DEFAULT_OP_NUM(m_prefix, m_op_name, m_name, m_op, m_type) \ - CASE_TYPE(m_prefix, m_op_name, m_name) { \ - if (p_b.type == INT) _RETURN(p_a._data.m_type m_op p_b._data._int); \ - if (p_b.type == REAL) _RETURN(p_a._data.m_type m_op p_b._data._real); \ - \ - _RETURN_FAIL \ +#define DEFAULT_OP_NUM(m_prefix, m_op_name, m_name, m_op, m_type) \ + CASE_TYPE(m_prefix, m_op_name, m_name) { \ + if (p_b.type == INT) _RETURN(p_a._data.m_type m_op p_b._data._int); \ + if (p_b.type == FLOAT) _RETURN(p_a._data.m_type m_op p_b._data._float); \ + \ + _RETURN_FAIL \ }; -#define DEFAULT_OP_NUM_NULL(m_prefix, m_op_name, m_name, m_op, m_type) \ - CASE_TYPE(m_prefix, m_op_name, m_name) { \ - if (p_b.type == INT) _RETURN(p_a._data.m_type m_op p_b._data._int); \ - if (p_b.type == REAL) _RETURN(p_a._data.m_type m_op p_b._data._real); \ - if (p_b.type == NIL) _RETURN(!(p_b.type m_op NIL)); \ - \ - _RETURN_FAIL \ +#define DEFAULT_OP_NUM_NULL(m_prefix, m_op_name, m_name, m_op, m_type) \ + CASE_TYPE(m_prefix, m_op_name, m_name) { \ + if (p_b.type == INT) _RETURN(p_a._data.m_type m_op p_b._data._int); \ + if (p_b.type == FLOAT) _RETURN(p_a._data.m_type m_op p_b._data._float); \ + if (p_b.type == NIL) _RETURN(!(p_b.type m_op NIL)); \ + \ + _RETURN_FAIL \ }; #ifdef DEBUG_ENABLED @@ -192,23 +208,23 @@ bool Variant::booleanize() const { } \ _RETURN(p_a._data.m_type / p_b._data._int); \ } \ - if (p_b.type == REAL) { \ - if (p_b._data._real == 0) { \ + if (p_b.type == FLOAT) { \ + if (p_b._data._float == 0) { \ r_valid = false; \ _RETURN("Division By Zero"); \ } \ - _RETURN(p_a._data.m_type / p_b._data._real); \ + _RETURN(p_a._data.m_type / p_b._data._float); \ } \ \ _RETURN_FAIL \ }; #else -#define DEFAULT_OP_NUM_DIV(m_prefix, m_op_name, m_name, m_type) \ - CASE_TYPE(m_prefix, m_op_name, m_name) { \ - if (p_b.type == INT) _RETURN(p_a._data.m_type / p_b._data._int); \ - if (p_b.type == REAL) _RETURN(p_a._data.m_type / p_b._data._real); \ - \ - _RETURN_FAIL \ +#define DEFAULT_OP_NUM_DIV(m_prefix, m_op_name, m_name, m_type) \ + CASE_TYPE(m_prefix, m_op_name, m_name) { \ + if (p_b.type == INT) _RETURN(p_a._data.m_type / p_b._data._int); \ + if (p_b.type == FLOAT) _RETURN(p_a._data.m_type / p_b._data._float); \ + \ + _RETURN_FAIL \ }; #endif @@ -222,33 +238,47 @@ bool Variant::booleanize() const { _RETURN(p_a._data.m_type); \ }; -#define DEFAULT_OP_NUM_VEC(m_prefix, m_op_name, m_name, m_op, m_type) \ - CASE_TYPE(m_prefix, m_op_name, m_name) { \ - if (p_b.type == INT) _RETURN(p_a._data.m_type m_op p_b._data._int); \ - if (p_b.type == REAL) _RETURN(p_a._data.m_type m_op p_b._data._real); \ - if (p_b.type == VECTOR2) _RETURN(p_a._data.m_type m_op *reinterpret_cast<const Vector2 *>(p_b._data._mem)); \ - if (p_b.type == VECTOR3) _RETURN(p_a._data.m_type m_op *reinterpret_cast<const Vector3 *>(p_b._data._mem)); \ - \ - _RETURN_FAIL \ +#define DEFAULT_OP_NUM_VEC(m_prefix, m_op_name, m_name, m_op, m_type) \ + CASE_TYPE(m_prefix, m_op_name, m_name) { \ + if (p_b.type == INT) _RETURN(p_a._data.m_type m_op p_b._data._int); \ + if (p_b.type == FLOAT) _RETURN(p_a._data.m_type m_op p_b._data._float); \ + if (p_b.type == VECTOR2) _RETURN(p_a._data.m_type m_op *reinterpret_cast<const Vector2 *>(p_b._data._mem)); \ + if (p_b.type == VECTOR3) _RETURN(p_a._data.m_type m_op *reinterpret_cast<const Vector3 *>(p_b._data._mem)); \ + if (p_b.type == VECTOR2I) _RETURN(p_a._data.m_type m_op *reinterpret_cast<const Vector2 *>(p_b._data._mem)); \ + if (p_b.type == VECTOR3I) _RETURN(p_a._data.m_type m_op *reinterpret_cast<const Vector3 *>(p_b._data._mem)); \ + \ + _RETURN_FAIL \ }; -#define DEFAULT_OP_STR_REV(m_prefix, m_op_name, m_name, m_op, m_type) \ - CASE_TYPE(m_prefix, m_op_name, m_name) { \ - if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_b._data._mem) m_op *reinterpret_cast<const String *>(p_a._data._mem)); \ - if (p_b.type == NODE_PATH) _RETURN(*reinterpret_cast<const m_type *>(p_b._data._mem) m_op *reinterpret_cast<const NodePath *>(p_a._data._mem)); \ - \ - _RETURN_FAIL \ +#define DEFAULT_OP_STR_REV(m_prefix, m_op_name, m_name, m_op, m_type) \ + CASE_TYPE(m_prefix, m_op_name, m_name) { \ + if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_b._data._mem) m_op *reinterpret_cast<const String *>(p_a._data._mem)); \ + if (p_b.type == STRING_NAME) _RETURN(*reinterpret_cast<const m_type *>(p_b._data._mem) m_op *reinterpret_cast<const StringName *>(p_a._data._mem)); \ + if (p_b.type == NODE_PATH) _RETURN(*reinterpret_cast<const m_type *>(p_b._data._mem) m_op *reinterpret_cast<const NodePath *>(p_a._data._mem)); \ + \ + _RETURN_FAIL \ }; -#define DEFAULT_OP_STR(m_prefix, m_op_name, m_name, m_op, m_type) \ - CASE_TYPE(m_prefix, m_op_name, m_name) { \ - if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const String *>(p_b._data._mem)); \ - if (p_b.type == NODE_PATH) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const NodePath *>(p_b._data._mem)); \ - \ - _RETURN_FAIL \ +#define DEFAULT_OP_STR(m_prefix, m_op_name, m_name, m_op, m_type) \ + CASE_TYPE(m_prefix, m_op_name, m_name) { \ + if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const String *>(p_b._data._mem)); \ + if (p_b.type == STRING_NAME) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const StringName *>(p_b._data._mem)); \ + if (p_b.type == NODE_PATH) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const NodePath *>(p_b._data._mem)); \ + \ + _RETURN_FAIL \ + }; + +#define DEFAULT_OP_STR_NULL(m_prefix, m_op_name, m_name, m_op, m_type) \ + CASE_TYPE(m_prefix, m_op_name, m_name) { \ + if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const String *>(p_b._data._mem)); \ + if (p_b.type == STRING_NAME) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const StringName *>(p_b._data._mem)); \ + if (p_b.type == NODE_PATH) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const NodePath *>(p_b._data._mem)); \ + if (p_b.type == NIL) _RETURN(!(p_b.type m_op NIL)); \ + \ + _RETURN_FAIL \ }; -#define DEFAULT_OP_STR_NULL(m_prefix, m_op_name, m_name, m_op, m_type) \ +#define DEFAULT_OP_STR_NULL_NP(m_prefix, m_op_name, m_name, m_op, m_type) \ CASE_TYPE(m_prefix, m_op_name, m_name) { \ if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const String *>(p_b._data._mem)); \ if (p_b.type == NODE_PATH) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const NodePath *>(p_b._data._mem)); \ @@ -257,6 +287,15 @@ bool Variant::booleanize() const { _RETURN_FAIL \ }; +#define DEFAULT_OP_STR_NULL_SN(m_prefix, m_op_name, m_name, m_op, m_type) \ + CASE_TYPE(m_prefix, m_op_name, m_name) { \ + if (p_b.type == STRING) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const String *>(p_b._data._mem)); \ + if (p_b.type == STRING_NAME) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const StringName *>(p_b._data._mem)); \ + if (p_b.type == NIL) _RETURN(!(p_b.type m_op NIL)); \ + \ + _RETURN_FAIL \ + }; + #define DEFAULT_OP_LOCALMEM_REV(m_prefix, m_op_name, m_name, m_op, m_type) \ CASE_TYPE(m_prefix, m_op_name, m_name) { \ if (p_b.type == m_name) \ @@ -297,7 +336,7 @@ bool Variant::booleanize() const { CASE_TYPE(m_prefix, m_op_name, m_name) { \ if (p_b.type == m_name) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op *reinterpret_cast<const m_type *>(p_b._data._mem)); \ if (p_b.type == INT) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op p_b._data._int); \ - if (p_b.type == REAL) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op p_b._data._real); \ + if (p_b.type == FLOAT) _RETURN(*reinterpret_cast<const m_type *>(p_a._data._mem) m_op p_b._data._float); \ \ _RETURN_FAIL \ } @@ -357,8 +396,8 @@ bool Variant::booleanize() const { if (p_a.type != p_b.type) \ _RETURN_FAIL \ \ - const Vector<m_type> &array_a = *reinterpret_cast<const Vector<m_type> *>(p_a._data._mem); \ - const Vector<m_type> &array_b = *reinterpret_cast<const Vector<m_type> *>(p_b._data._mem); \ + const Vector<m_type> &array_a = PackedArrayRef<m_type>::get_array(p_a._data.packed_array); \ + const Vector<m_type> &array_b = PackedArrayRef<m_type>::get_array(p_b._data.packed_array); \ \ int a_len = array_a.size(); \ if (a_len m_opa array_b.size()) { \ @@ -381,8 +420,8 @@ bool Variant::booleanize() const { if (p_a.type != p_b.type) \ _RETURN_FAIL; \ \ - const Vector<m_type> &array_a = *reinterpret_cast<const Vector<m_type> *>(p_a._data._mem); \ - const Vector<m_type> &array_b = *reinterpret_cast<const Vector<m_type> *>(p_b._data._mem); \ + const Vector<m_type> &array_a = PackedArrayRef<m_type>::get_array(p_a._data.packed_array); \ + const Vector<m_type> &array_b = PackedArrayRef<m_type>::get_array(p_b._data.packed_array); \ Vector<m_type> sum = array_a; \ sum.append_array(array_b); \ _RETURN(sum); \ @@ -423,6 +462,9 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, _RETURN_FAIL; } + DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, CALLABLE, ==, Callable); + DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, SIGNAL, ==, Signal); + CASE_TYPE(math, OP_EQUAL, DICTIONARY) { if (p_b.type != DICTIONARY) { if (p_b.type == NIL) @@ -458,24 +500,30 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, } DEFAULT_OP_NUM_NULL(math, OP_EQUAL, INT, ==, _int); - DEFAULT_OP_NUM_NULL(math, OP_EQUAL, REAL, ==, _real); + DEFAULT_OP_NUM_NULL(math, OP_EQUAL, FLOAT, ==, _float); DEFAULT_OP_STR_NULL(math, OP_EQUAL, STRING, ==, String); DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, VECTOR2, ==, Vector2); + DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, VECTOR2I, ==, Vector2i); DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, RECT2, ==, Rect2); + DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, RECT2I, ==, Rect2i); DEFAULT_OP_PTRREF_NULL(math, OP_EQUAL, TRANSFORM2D, ==, _transform2d); DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, VECTOR3, ==, Vector3); + DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, VECTOR3I, ==, Vector3i); DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, PLANE, ==, Plane); DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, QUAT, ==, Quat); DEFAULT_OP_PTRREF_NULL(math, OP_EQUAL, AABB, ==, _aabb); DEFAULT_OP_PTRREF_NULL(math, OP_EQUAL, BASIS, ==, _basis); DEFAULT_OP_PTRREF_NULL(math, OP_EQUAL, TRANSFORM, ==, _transform); DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, COLOR, ==, Color); - DEFAULT_OP_STR_NULL(math, OP_EQUAL, NODE_PATH, ==, NodePath); + DEFAULT_OP_STR_NULL_SN(math, OP_EQUAL, STRING_NAME, ==, StringName); + DEFAULT_OP_STR_NULL_NP(math, OP_EQUAL, NODE_PATH, ==, NodePath); DEFAULT_OP_LOCALMEM_NULL(math, OP_EQUAL, _RID, ==, RID); DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_BYTE_ARRAY, uint8_t); - DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_INT_ARRAY, int); - DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_REAL_ARRAY, real_t); + DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_INT32_ARRAY, int32_t); + DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_INT64_ARRAY, int64_t); + DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_FLOAT32_ARRAY, float); + DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_FLOAT64_ARRAY, double); DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_STRING_ARRAY, String); DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_VECTOR2_ARRAY, Vector2); DEFAULT_OP_ARRAY_EQ(math, OP_EQUAL, PACKED_VECTOR3_ARRAY, Vector3); @@ -511,6 +559,9 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, _RETURN_FAIL; } + DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, CALLABLE, !=, Callable); + DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, SIGNAL, !=, Signal); + CASE_TYPE(math, OP_NOT_EQUAL, DICTIONARY) { if (p_b.type != DICTIONARY) { if (p_b.type == NIL) @@ -548,24 +599,30 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, } DEFAULT_OP_NUM_NULL(math, OP_NOT_EQUAL, INT, !=, _int); - DEFAULT_OP_NUM_NULL(math, OP_NOT_EQUAL, REAL, !=, _real); + DEFAULT_OP_NUM_NULL(math, OP_NOT_EQUAL, FLOAT, !=, _float); DEFAULT_OP_STR_NULL(math, OP_NOT_EQUAL, STRING, !=, String); DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, VECTOR2, !=, Vector2); + DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, VECTOR2I, !=, Vector2i); DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, RECT2, !=, Rect2); + DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, RECT2I, !=, Rect2i); DEFAULT_OP_PTRREF_NULL(math, OP_NOT_EQUAL, TRANSFORM2D, !=, _transform2d); DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, VECTOR3, !=, Vector3); + DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, VECTOR3I, !=, Vector3i); DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, PLANE, !=, Plane); DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, QUAT, !=, Quat); DEFAULT_OP_PTRREF_NULL(math, OP_NOT_EQUAL, AABB, !=, _aabb); DEFAULT_OP_PTRREF_NULL(math, OP_NOT_EQUAL, BASIS, !=, _basis); DEFAULT_OP_PTRREF_NULL(math, OP_NOT_EQUAL, TRANSFORM, !=, _transform); DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, COLOR, !=, Color); - DEFAULT_OP_STR_NULL(math, OP_NOT_EQUAL, NODE_PATH, !=, NodePath); + DEFAULT_OP_STR_NULL_SN(math, OP_NOT_EQUAL, STRING_NAME, !=, StringName); + DEFAULT_OP_STR_NULL_NP(math, OP_NOT_EQUAL, NODE_PATH, !=, NodePath); DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, _RID, !=, RID); DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_BYTE_ARRAY, uint8_t); - DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_INT_ARRAY, int); - DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_REAL_ARRAY, real_t); + DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_INT32_ARRAY, int32_t); + DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_INT64_ARRAY, int64_t); + DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_FLOAT32_ARRAY, float); + DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_FLOAT64_ARRAY, double); DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_STRING_ARRAY, String); DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_VECTOR2_ARRAY, Vector2); DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, PACKED_VECTOR3_ARRAY, Vector3); @@ -592,6 +649,9 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, _RETURN((p_a._get_obj().obj < p_b._get_obj().obj)); } + DEFAULT_OP_LOCALMEM_NULL(math, OP_LESS, CALLABLE, <, Callable); + DEFAULT_OP_LOCALMEM_NULL(math, OP_LESS, SIGNAL, <, Signal); + CASE_TYPE(math, OP_LESS, ARRAY) { if (p_b.type != ARRAY) _RETURN_FAIL; @@ -612,14 +672,18 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, } DEFAULT_OP_NUM(math, OP_LESS, INT, <, _int); - DEFAULT_OP_NUM(math, OP_LESS, REAL, <, _real); + DEFAULT_OP_NUM(math, OP_LESS, FLOAT, <, _float); DEFAULT_OP_STR(math, OP_LESS, STRING, <, String); DEFAULT_OP_LOCALMEM(math, OP_LESS, VECTOR2, <, Vector2); + DEFAULT_OP_LOCALMEM(math, OP_LESS, VECTOR2I, <, Vector2i); DEFAULT_OP_LOCALMEM(math, OP_LESS, VECTOR3, <, Vector3); + DEFAULT_OP_LOCALMEM(math, OP_LESS, VECTOR3I, <, Vector3i); DEFAULT_OP_LOCALMEM(math, OP_LESS, _RID, <, RID); DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_BYTE_ARRAY, uint8_t); - DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_INT_ARRAY, int); - DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_REAL_ARRAY, real_t); + DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_INT32_ARRAY, int32_t); + DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_INT64_ARRAY, int64_t); + DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_FLOAT32_ARRAY, float); + DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_FLOAT64_ARRAY, double); DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_STRING_ARRAY, String); DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_VECTOR2_ARRAY, Vector3); DEFAULT_OP_ARRAY_LT(math, OP_LESS, PACKED_VECTOR3_ARRAY, Vector3); @@ -627,6 +691,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_LESS, NIL) CASE_TYPE(math, OP_LESS, RECT2) + CASE_TYPE(math, OP_LESS, RECT2I) CASE_TYPE(math, OP_LESS, TRANSFORM2D) CASE_TYPE(math, OP_LESS, PLANE) CASE_TYPE(math, OP_LESS, QUAT) @@ -634,6 +699,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_LESS, BASIS) CASE_TYPE(math, OP_LESS, TRANSFORM) CASE_TYPE(math, OP_LESS, COLOR) + CASE_TYPE(math, OP_LESS, STRING_NAME) CASE_TYPE(math, OP_LESS, NODE_PATH) CASE_TYPE(math, OP_LESS, DICTIONARY) _RETURN_FAIL; @@ -647,15 +713,18 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, } DEFAULT_OP_NUM(math, OP_LESS_EQUAL, INT, <=, _int); - DEFAULT_OP_NUM(math, OP_LESS_EQUAL, REAL, <=, _real); + DEFAULT_OP_NUM(math, OP_LESS_EQUAL, FLOAT, <=, _float); DEFAULT_OP_STR(math, OP_LESS_EQUAL, STRING, <=, String); DEFAULT_OP_LOCALMEM(math, OP_LESS_EQUAL, VECTOR2, <=, Vector2); + DEFAULT_OP_LOCALMEM(math, OP_LESS_EQUAL, VECTOR2I, <=, Vector2i); DEFAULT_OP_LOCALMEM(math, OP_LESS_EQUAL, VECTOR3, <=, Vector3); + DEFAULT_OP_LOCALMEM(math, OP_LESS_EQUAL, VECTOR3I, <=, Vector3i); DEFAULT_OP_LOCALMEM(math, OP_LESS_EQUAL, _RID, <=, RID); CASE_TYPE(math, OP_LESS_EQUAL, NIL) CASE_TYPE(math, OP_LESS_EQUAL, BOOL) CASE_TYPE(math, OP_LESS_EQUAL, RECT2) + CASE_TYPE(math, OP_LESS_EQUAL, RECT2I) CASE_TYPE(math, OP_LESS_EQUAL, TRANSFORM2D) CASE_TYPE(math, OP_LESS_EQUAL, PLANE) CASE_TYPE(math, OP_LESS_EQUAL, QUAT) @@ -663,12 +732,18 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_LESS_EQUAL, BASIS) CASE_TYPE(math, OP_LESS_EQUAL, TRANSFORM) CASE_TYPE(math, OP_LESS_EQUAL, COLOR) + CASE_TYPE(math, OP_LESS_EQUAL, STRING_NAME) CASE_TYPE(math, OP_LESS_EQUAL, NODE_PATH) + CASE_TYPE(math, OP_LESS_EQUAL, CALLABLE) + CASE_TYPE(math, OP_LESS_EQUAL, SIGNAL) + CASE_TYPE(math, OP_LESS_EQUAL, DICTIONARY) CASE_TYPE(math, OP_LESS_EQUAL, ARRAY) CASE_TYPE(math, OP_LESS_EQUAL, PACKED_BYTE_ARRAY); - CASE_TYPE(math, OP_LESS_EQUAL, PACKED_INT_ARRAY); - CASE_TYPE(math, OP_LESS_EQUAL, PACKED_REAL_ARRAY); + CASE_TYPE(math, OP_LESS_EQUAL, PACKED_INT32_ARRAY); + CASE_TYPE(math, OP_LESS_EQUAL, PACKED_INT64_ARRAY); + CASE_TYPE(math, OP_LESS_EQUAL, PACKED_FLOAT32_ARRAY); + CASE_TYPE(math, OP_LESS_EQUAL, PACKED_FLOAT64_ARRAY); CASE_TYPE(math, OP_LESS_EQUAL, PACKED_STRING_ARRAY); CASE_TYPE(math, OP_LESS_EQUAL, PACKED_VECTOR2_ARRAY); CASE_TYPE(math, OP_LESS_EQUAL, PACKED_VECTOR3_ARRAY); @@ -716,14 +791,18 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, } DEFAULT_OP_NUM(math, OP_GREATER, INT, >, _int); - DEFAULT_OP_NUM(math, OP_GREATER, REAL, >, _real); + DEFAULT_OP_NUM(math, OP_GREATER, FLOAT, >, _float); DEFAULT_OP_STR_REV(math, OP_GREATER, STRING, <, String); DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER, VECTOR2, <, Vector2); + DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER, VECTOR2I, <, Vector2i); DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER, VECTOR3, <, Vector3); + DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER, VECTOR3I, <, Vector3i); DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER, _RID, <, RID); DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_BYTE_ARRAY, uint8_t); - DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_INT_ARRAY, int); - DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_REAL_ARRAY, real_t); + DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_INT32_ARRAY, int32_t); + DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_INT64_ARRAY, int64_t); + DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_FLOAT32_ARRAY, float); + DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_FLOAT64_ARRAY, double); DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_STRING_ARRAY, String); DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_VECTOR2_ARRAY, Vector3); DEFAULT_OP_ARRAY_GT(math, OP_GREATER, PACKED_VECTOR3_ARRAY, Vector3); @@ -731,6 +810,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_GREATER, NIL) CASE_TYPE(math, OP_GREATER, RECT2) + CASE_TYPE(math, OP_GREATER, RECT2I) CASE_TYPE(math, OP_GREATER, TRANSFORM2D) CASE_TYPE(math, OP_GREATER, PLANE) CASE_TYPE(math, OP_GREATER, QUAT) @@ -738,8 +818,12 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_GREATER, BASIS) CASE_TYPE(math, OP_GREATER, TRANSFORM) CASE_TYPE(math, OP_GREATER, COLOR) + CASE_TYPE(math, OP_GREATER, STRING_NAME) CASE_TYPE(math, OP_GREATER, NODE_PATH) CASE_TYPE(math, OP_GREATER, DICTIONARY) + CASE_TYPE(math, OP_GREATER, CALLABLE) + CASE_TYPE(math, OP_GREATER, SIGNAL) + _RETURN_FAIL; } @@ -751,15 +835,18 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, } DEFAULT_OP_NUM(math, OP_GREATER_EQUAL, INT, >=, _int); - DEFAULT_OP_NUM(math, OP_GREATER_EQUAL, REAL, >=, _real); + DEFAULT_OP_NUM(math, OP_GREATER_EQUAL, FLOAT, >=, _float); DEFAULT_OP_STR_REV(math, OP_GREATER_EQUAL, STRING, <=, String); DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER_EQUAL, VECTOR2, <=, Vector2); + DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER_EQUAL, VECTOR2I, <=, Vector2i); DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER_EQUAL, VECTOR3, <=, Vector3); + DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER_EQUAL, VECTOR3I, <=, Vector3i); DEFAULT_OP_LOCALMEM_REV(math, OP_GREATER_EQUAL, _RID, <=, RID); CASE_TYPE(math, OP_GREATER_EQUAL, NIL) CASE_TYPE(math, OP_GREATER_EQUAL, BOOL) CASE_TYPE(math, OP_GREATER_EQUAL, RECT2) + CASE_TYPE(math, OP_GREATER_EQUAL, RECT2I) CASE_TYPE(math, OP_GREATER_EQUAL, TRANSFORM2D) CASE_TYPE(math, OP_GREATER_EQUAL, PLANE) CASE_TYPE(math, OP_GREATER_EQUAL, QUAT) @@ -767,12 +854,18 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_GREATER_EQUAL, BASIS) CASE_TYPE(math, OP_GREATER_EQUAL, TRANSFORM) CASE_TYPE(math, OP_GREATER_EQUAL, COLOR) + CASE_TYPE(math, OP_GREATER_EQUAL, STRING_NAME) CASE_TYPE(math, OP_GREATER_EQUAL, NODE_PATH) + CASE_TYPE(math, OP_GREATER_EQUAL, CALLABLE) + CASE_TYPE(math, OP_GREATER_EQUAL, SIGNAL) + CASE_TYPE(math, OP_GREATER_EQUAL, DICTIONARY) CASE_TYPE(math, OP_GREATER_EQUAL, ARRAY) CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_BYTE_ARRAY); - CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_INT_ARRAY); - CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_REAL_ARRAY); + CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_INT32_ARRAY); + CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_INT64_ARRAY); + CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_FLOAT32_ARRAY); + CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_FLOAT64_ARRAY); CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_STRING_ARRAY); CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_VECTOR2_ARRAY); CASE_TYPE(math, OP_GREATER_EQUAL, PACKED_VECTOR3_ARRAY); @@ -799,16 +892,20 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, } DEFAULT_OP_NUM(math, OP_ADD, INT, +, _int); - DEFAULT_OP_NUM(math, OP_ADD, REAL, +, _real); + DEFAULT_OP_NUM(math, OP_ADD, FLOAT, +, _float); DEFAULT_OP_STR(math, OP_ADD, STRING, +, String); DEFAULT_OP_LOCALMEM(math, OP_ADD, VECTOR2, +, Vector2); + DEFAULT_OP_LOCALMEM(math, OP_ADD, VECTOR2I, +, Vector2i); DEFAULT_OP_LOCALMEM(math, OP_ADD, VECTOR3, +, Vector3); + DEFAULT_OP_LOCALMEM(math, OP_ADD, VECTOR3I, +, Vector3i); DEFAULT_OP_LOCALMEM(math, OP_ADD, QUAT, +, Quat); DEFAULT_OP_LOCALMEM(math, OP_ADD, COLOR, +, Color); DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_BYTE_ARRAY, uint8_t); - DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_INT_ARRAY, int); - DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_REAL_ARRAY, real_t); + DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_INT32_ARRAY, int32_t); + DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_INT64_ARRAY, int64_t); + DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_FLOAT32_ARRAY, float); + DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_FLOAT64_ARRAY, double); DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_STRING_ARRAY, String); DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_VECTOR2_ARRAY, Vector2); DEFAULT_OP_ARRAY_ADD(math, OP_ADD, PACKED_VECTOR3_ARRAY, Vector3); @@ -817,23 +914,30 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_ADD, NIL) CASE_TYPE(math, OP_ADD, BOOL) CASE_TYPE(math, OP_ADD, RECT2) + CASE_TYPE(math, OP_ADD, RECT2I) CASE_TYPE(math, OP_ADD, TRANSFORM2D) CASE_TYPE(math, OP_ADD, PLANE) CASE_TYPE(math, OP_ADD, AABB) CASE_TYPE(math, OP_ADD, BASIS) CASE_TYPE(math, OP_ADD, TRANSFORM) + CASE_TYPE(math, OP_ADD, STRING_NAME) CASE_TYPE(math, OP_ADD, NODE_PATH) CASE_TYPE(math, OP_ADD, _RID) CASE_TYPE(math, OP_ADD, OBJECT) + CASE_TYPE(math, OP_ADD, CALLABLE) + CASE_TYPE(math, OP_ADD, SIGNAL) + CASE_TYPE(math, OP_ADD, DICTIONARY) _RETURN_FAIL; } SWITCH_OP(math, OP_SUBTRACT, p_a.type) { DEFAULT_OP_NUM(math, OP_SUBTRACT, INT, -, _int); - DEFAULT_OP_NUM(math, OP_SUBTRACT, REAL, -, _real); + DEFAULT_OP_NUM(math, OP_SUBTRACT, FLOAT, -, _float); DEFAULT_OP_LOCALMEM(math, OP_SUBTRACT, VECTOR2, -, Vector2); + DEFAULT_OP_LOCALMEM(math, OP_SUBTRACT, VECTOR2I, -, Vector2i); DEFAULT_OP_LOCALMEM(math, OP_SUBTRACT, VECTOR3, -, Vector3); + DEFAULT_OP_LOCALMEM(math, OP_SUBTRACT, VECTOR3I, -, Vector3i); DEFAULT_OP_LOCALMEM(math, OP_SUBTRACT, QUAT, -, Quat); DEFAULT_OP_LOCALMEM(math, OP_SUBTRACT, COLOR, -, Color); @@ -841,19 +945,26 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_SUBTRACT, BOOL) CASE_TYPE(math, OP_SUBTRACT, STRING) CASE_TYPE(math, OP_SUBTRACT, RECT2) + CASE_TYPE(math, OP_SUBTRACT, RECT2I) CASE_TYPE(math, OP_SUBTRACT, TRANSFORM2D) CASE_TYPE(math, OP_SUBTRACT, PLANE) CASE_TYPE(math, OP_SUBTRACT, AABB) CASE_TYPE(math, OP_SUBTRACT, BASIS) CASE_TYPE(math, OP_SUBTRACT, TRANSFORM) + CASE_TYPE(math, OP_SUBTRACT, STRING_NAME) CASE_TYPE(math, OP_SUBTRACT, NODE_PATH) CASE_TYPE(math, OP_SUBTRACT, _RID) CASE_TYPE(math, OP_SUBTRACT, OBJECT) + CASE_TYPE(math, OP_SUBTRACT, CALLABLE) + CASE_TYPE(math, OP_SUBTRACT, SIGNAL) + CASE_TYPE(math, OP_SUBTRACT, DICTIONARY) CASE_TYPE(math, OP_SUBTRACT, ARRAY) CASE_TYPE(math, OP_SUBTRACT, PACKED_BYTE_ARRAY); - CASE_TYPE(math, OP_SUBTRACT, PACKED_INT_ARRAY); - CASE_TYPE(math, OP_SUBTRACT, PACKED_REAL_ARRAY); + CASE_TYPE(math, OP_SUBTRACT, PACKED_INT32_ARRAY); + CASE_TYPE(math, OP_SUBTRACT, PACKED_INT64_ARRAY); + CASE_TYPE(math, OP_SUBTRACT, PACKED_FLOAT32_ARRAY); + CASE_TYPE(math, OP_SUBTRACT, PACKED_FLOAT64_ARRAY); CASE_TYPE(math, OP_SUBTRACT, PACKED_STRING_ARRAY); CASE_TYPE(math, OP_SUBTRACT, PACKED_VECTOR2_ARRAY); CASE_TYPE(math, OP_SUBTRACT, PACKED_VECTOR3_ARRAY); @@ -882,8 +993,8 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, case QUAT: { _RETURN(*reinterpret_cast<const Quat *>(p_a._data._mem) * *reinterpret_cast<const Quat *>(p_b._data._mem)); } - case REAL: { - _RETURN(*reinterpret_cast<const Quat *>(p_a._data._mem) * p_b._data._real); + case FLOAT: { + _RETURN(*reinterpret_cast<const Quat *>(p_a._data._mem) * p_b._data._float); } default: _RETURN_FAIL; } @@ -914,25 +1025,34 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, } DEFAULT_OP_NUM_VEC(math, OP_MULTIPLY, INT, *, _int); - DEFAULT_OP_NUM_VEC(math, OP_MULTIPLY, REAL, *, _real); + DEFAULT_OP_NUM_VEC(math, OP_MULTIPLY, FLOAT, *, _float); DEFAULT_OP_LOCALMEM_NUM(math, OP_MULTIPLY, VECTOR2, *, Vector2); + DEFAULT_OP_LOCALMEM_NUM(math, OP_MULTIPLY, VECTOR2I, *, Vector2i); DEFAULT_OP_LOCALMEM_NUM(math, OP_MULTIPLY, VECTOR3, *, Vector3); + DEFAULT_OP_LOCALMEM_NUM(math, OP_MULTIPLY, VECTOR3I, *, Vector3i); DEFAULT_OP_LOCALMEM_NUM(math, OP_MULTIPLY, COLOR, *, Color); CASE_TYPE(math, OP_MULTIPLY, NIL) CASE_TYPE(math, OP_MULTIPLY, BOOL) CASE_TYPE(math, OP_MULTIPLY, STRING) CASE_TYPE(math, OP_MULTIPLY, RECT2) + CASE_TYPE(math, OP_MULTIPLY, RECT2I) CASE_TYPE(math, OP_MULTIPLY, PLANE) CASE_TYPE(math, OP_MULTIPLY, AABB) + CASE_TYPE(math, OP_MULTIPLY, STRING_NAME) CASE_TYPE(math, OP_MULTIPLY, NODE_PATH) CASE_TYPE(math, OP_MULTIPLY, _RID) CASE_TYPE(math, OP_MULTIPLY, OBJECT) + CASE_TYPE(math, OP_MULTIPLY, CALLABLE) + CASE_TYPE(math, OP_MULTIPLY, SIGNAL) + CASE_TYPE(math, OP_MULTIPLY, DICTIONARY) CASE_TYPE(math, OP_MULTIPLY, ARRAY) CASE_TYPE(math, OP_MULTIPLY, PACKED_BYTE_ARRAY); - CASE_TYPE(math, OP_MULTIPLY, PACKED_INT_ARRAY); - CASE_TYPE(math, OP_MULTIPLY, PACKED_REAL_ARRAY); + CASE_TYPE(math, OP_MULTIPLY, PACKED_INT32_ARRAY); + CASE_TYPE(math, OP_MULTIPLY, PACKED_INT64_ARRAY); + CASE_TYPE(math, OP_MULTIPLY, PACKED_FLOAT32_ARRAY); + CASE_TYPE(math, OP_MULTIPLY, PACKED_FLOAT64_ARRAY); CASE_TYPE(math, OP_MULTIPLY, PACKED_STRING_ARRAY); CASE_TYPE(math, OP_MULTIPLY, PACKED_VECTOR2_ARRAY); CASE_TYPE(math, OP_MULTIPLY, PACKED_VECTOR3_ARRAY); @@ -942,40 +1062,49 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, SWITCH_OP(math, OP_DIVIDE, p_a.type) { CASE_TYPE(math, OP_DIVIDE, QUAT) { - if (p_b.type != REAL) + if (p_b.type != FLOAT) _RETURN_FAIL; #ifdef DEBUG_ENABLED - if (p_b._data._real == 0) { + if (p_b._data._float == 0) { r_valid = false; _RETURN("Division By Zero"); } #endif - _RETURN(*reinterpret_cast<const Quat *>(p_a._data._mem) / p_b._data._real); + _RETURN(*reinterpret_cast<const Quat *>(p_a._data._mem) / p_b._data._float); } DEFAULT_OP_NUM_DIV(math, OP_DIVIDE, INT, _int); - DEFAULT_OP_NUM_DIV(math, OP_DIVIDE, REAL, _real); + DEFAULT_OP_NUM_DIV(math, OP_DIVIDE, FLOAT, _float); DEFAULT_OP_LOCALMEM_NUM(math, OP_DIVIDE, VECTOR2, /, Vector2); + DEFAULT_OP_LOCALMEM_NUM(math, OP_DIVIDE, VECTOR2I, /, Vector2i); DEFAULT_OP_LOCALMEM_NUM(math, OP_DIVIDE, VECTOR3, /, Vector3); + DEFAULT_OP_LOCALMEM_NUM(math, OP_DIVIDE, VECTOR3I, /, Vector3i); DEFAULT_OP_LOCALMEM_NUM(math, OP_DIVIDE, COLOR, /, Color); CASE_TYPE(math, OP_DIVIDE, NIL) CASE_TYPE(math, OP_DIVIDE, BOOL) CASE_TYPE(math, OP_DIVIDE, STRING) CASE_TYPE(math, OP_DIVIDE, RECT2) + CASE_TYPE(math, OP_DIVIDE, RECT2I) CASE_TYPE(math, OP_DIVIDE, TRANSFORM2D) CASE_TYPE(math, OP_DIVIDE, PLANE) CASE_TYPE(math, OP_DIVIDE, AABB) CASE_TYPE(math, OP_DIVIDE, BASIS) CASE_TYPE(math, OP_DIVIDE, TRANSFORM) + CASE_TYPE(math, OP_DIVIDE, STRING_NAME) CASE_TYPE(math, OP_DIVIDE, NODE_PATH) CASE_TYPE(math, OP_DIVIDE, _RID) CASE_TYPE(math, OP_DIVIDE, OBJECT) + CASE_TYPE(math, OP_DIVIDE, CALLABLE) + CASE_TYPE(math, OP_DIVIDE, SIGNAL) + CASE_TYPE(math, OP_DIVIDE, DICTIONARY) CASE_TYPE(math, OP_DIVIDE, ARRAY) CASE_TYPE(math, OP_DIVIDE, PACKED_BYTE_ARRAY); - CASE_TYPE(math, OP_DIVIDE, PACKED_INT_ARRAY); - CASE_TYPE(math, OP_DIVIDE, PACKED_REAL_ARRAY); + CASE_TYPE(math, OP_DIVIDE, PACKED_INT32_ARRAY); + CASE_TYPE(math, OP_DIVIDE, PACKED_INT64_ARRAY); + CASE_TYPE(math, OP_DIVIDE, PACKED_FLOAT32_ARRAY); + CASE_TYPE(math, OP_DIVIDE, PACKED_FLOAT64_ARRAY); CASE_TYPE(math, OP_DIVIDE, PACKED_STRING_ARRAY); CASE_TYPE(math, OP_DIVIDE, PACKED_VECTOR2_ARRAY); CASE_TYPE(math, OP_DIVIDE, PACKED_VECTOR3_ARRAY); @@ -985,29 +1114,38 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, SWITCH_OP(math, OP_POSITIVE, p_a.type) { DEFAULT_OP_NUM_POS(math, OP_POSITIVE, INT, _int); - DEFAULT_OP_NUM_POS(math, OP_POSITIVE, REAL, _real); + DEFAULT_OP_NUM_POS(math, OP_POSITIVE, FLOAT, _float); DEFAULT_OP_LOCALMEM_POS(math, OP_POSITIVE, VECTOR3, Vector3); + DEFAULT_OP_LOCALMEM_POS(math, OP_POSITIVE, VECTOR3I, Vector3i); DEFAULT_OP_LOCALMEM_POS(math, OP_POSITIVE, PLANE, Plane); DEFAULT_OP_LOCALMEM_POS(math, OP_POSITIVE, QUAT, Quat); DEFAULT_OP_LOCALMEM_POS(math, OP_POSITIVE, VECTOR2, Vector2); + DEFAULT_OP_LOCALMEM_POS(math, OP_POSITIVE, VECTOR2I, Vector2i); CASE_TYPE(math, OP_POSITIVE, NIL) CASE_TYPE(math, OP_POSITIVE, BOOL) CASE_TYPE(math, OP_POSITIVE, STRING) CASE_TYPE(math, OP_POSITIVE, RECT2) + CASE_TYPE(math, OP_POSITIVE, RECT2I) CASE_TYPE(math, OP_POSITIVE, TRANSFORM2D) CASE_TYPE(math, OP_POSITIVE, AABB) CASE_TYPE(math, OP_POSITIVE, BASIS) CASE_TYPE(math, OP_POSITIVE, TRANSFORM) CASE_TYPE(math, OP_POSITIVE, COLOR) + CASE_TYPE(math, OP_POSITIVE, STRING_NAME) CASE_TYPE(math, OP_POSITIVE, NODE_PATH) CASE_TYPE(math, OP_POSITIVE, _RID) CASE_TYPE(math, OP_POSITIVE, OBJECT) + CASE_TYPE(math, OP_POSITIVE, CALLABLE) + CASE_TYPE(math, OP_POSITIVE, SIGNAL) + CASE_TYPE(math, OP_POSITIVE, DICTIONARY) CASE_TYPE(math, OP_POSITIVE, ARRAY) CASE_TYPE(math, OP_POSITIVE, PACKED_BYTE_ARRAY) - CASE_TYPE(math, OP_POSITIVE, PACKED_INT_ARRAY) - CASE_TYPE(math, OP_POSITIVE, PACKED_REAL_ARRAY) + CASE_TYPE(math, OP_POSITIVE, PACKED_INT32_ARRAY) + CASE_TYPE(math, OP_POSITIVE, PACKED_INT64_ARRAY) + CASE_TYPE(math, OP_POSITIVE, PACKED_FLOAT32_ARRAY) + CASE_TYPE(math, OP_POSITIVE, PACKED_FLOAT64_ARRAY) CASE_TYPE(math, OP_POSITIVE, PACKED_STRING_ARRAY) CASE_TYPE(math, OP_POSITIVE, PACKED_VECTOR2_ARRAY) CASE_TYPE(math, OP_POSITIVE, PACKED_VECTOR3_ARRAY) @@ -1017,10 +1155,12 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, SWITCH_OP(math, OP_NEGATE, p_a.type) { DEFAULT_OP_NUM_NEG(math, OP_NEGATE, INT, _int); - DEFAULT_OP_NUM_NEG(math, OP_NEGATE, REAL, _real); + DEFAULT_OP_NUM_NEG(math, OP_NEGATE, FLOAT, _float); DEFAULT_OP_LOCALMEM_NEG(math, OP_NEGATE, VECTOR2, Vector2); + DEFAULT_OP_LOCALMEM_NEG(math, OP_NEGATE, VECTOR2I, Vector2i); DEFAULT_OP_LOCALMEM_NEG(math, OP_NEGATE, VECTOR3, Vector3); + DEFAULT_OP_LOCALMEM_NEG(math, OP_NEGATE, VECTOR3I, Vector3i); DEFAULT_OP_LOCALMEM_NEG(math, OP_NEGATE, PLANE, Plane); DEFAULT_OP_LOCALMEM_NEG(math, OP_NEGATE, QUAT, Quat); DEFAULT_OP_LOCALMEM_NEG(math, OP_NEGATE, COLOR, Color); @@ -1029,18 +1169,25 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_NEGATE, BOOL) CASE_TYPE(math, OP_NEGATE, STRING) CASE_TYPE(math, OP_NEGATE, RECT2) + CASE_TYPE(math, OP_NEGATE, RECT2I) CASE_TYPE(math, OP_NEGATE, TRANSFORM2D) CASE_TYPE(math, OP_NEGATE, AABB) CASE_TYPE(math, OP_NEGATE, BASIS) CASE_TYPE(math, OP_NEGATE, TRANSFORM) + CASE_TYPE(math, OP_NEGATE, STRING_NAME) CASE_TYPE(math, OP_NEGATE, NODE_PATH) CASE_TYPE(math, OP_NEGATE, _RID) CASE_TYPE(math, OP_NEGATE, OBJECT) + CASE_TYPE(math, OP_NEGATE, CALLABLE) + CASE_TYPE(math, OP_NEGATE, SIGNAL) + CASE_TYPE(math, OP_NEGATE, DICTIONARY) CASE_TYPE(math, OP_NEGATE, ARRAY) CASE_TYPE(math, OP_NEGATE, PACKED_BYTE_ARRAY) - CASE_TYPE(math, OP_NEGATE, PACKED_INT_ARRAY) - CASE_TYPE(math, OP_NEGATE, PACKED_REAL_ARRAY) + CASE_TYPE(math, OP_NEGATE, PACKED_INT32_ARRAY) + CASE_TYPE(math, OP_NEGATE, PACKED_INT64_ARRAY) + CASE_TYPE(math, OP_NEGATE, PACKED_FLOAT32_ARRAY) + CASE_TYPE(math, OP_NEGATE, PACKED_FLOAT64_ARRAY) CASE_TYPE(math, OP_NEGATE, PACKED_STRING_ARRAY) CASE_TYPE(math, OP_NEGATE, PACKED_VECTOR2_ARRAY) CASE_TYPE(math, OP_NEGATE, PACKED_VECTOR3_ARRAY) @@ -1082,10 +1229,13 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_MODULE, NIL) CASE_TYPE(math, OP_MODULE, BOOL) - CASE_TYPE(math, OP_MODULE, REAL) + CASE_TYPE(math, OP_MODULE, FLOAT) CASE_TYPE(math, OP_MODULE, VECTOR2) + CASE_TYPE(math, OP_MODULE, VECTOR2I) CASE_TYPE(math, OP_MODULE, RECT2) + CASE_TYPE(math, OP_MODULE, RECT2I) CASE_TYPE(math, OP_MODULE, VECTOR3) + CASE_TYPE(math, OP_MODULE, VECTOR3I) CASE_TYPE(math, OP_MODULE, TRANSFORM2D) CASE_TYPE(math, OP_MODULE, PLANE) CASE_TYPE(math, OP_MODULE, QUAT) @@ -1093,14 +1243,20 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, CASE_TYPE(math, OP_MODULE, BASIS) CASE_TYPE(math, OP_MODULE, TRANSFORM) CASE_TYPE(math, OP_MODULE, COLOR) + CASE_TYPE(math, OP_MODULE, STRING_NAME) CASE_TYPE(math, OP_MODULE, NODE_PATH) CASE_TYPE(math, OP_MODULE, _RID) CASE_TYPE(math, OP_MODULE, OBJECT) + CASE_TYPE(math, OP_MODULE, CALLABLE) + CASE_TYPE(math, OP_MODULE, SIGNAL) + CASE_TYPE(math, OP_MODULE, DICTIONARY) CASE_TYPE(math, OP_MODULE, ARRAY) CASE_TYPE(math, OP_MODULE, PACKED_BYTE_ARRAY) - CASE_TYPE(math, OP_MODULE, PACKED_INT_ARRAY) - CASE_TYPE(math, OP_MODULE, PACKED_REAL_ARRAY) + CASE_TYPE(math, OP_MODULE, PACKED_INT32_ARRAY) + CASE_TYPE(math, OP_MODULE, PACKED_INT64_ARRAY) + CASE_TYPE(math, OP_MODULE, PACKED_FLOAT32_ARRAY) + CASE_TYPE(math, OP_MODULE, PACKED_FLOAT64_ARRAY) CASE_TYPE(math, OP_MODULE, PACKED_STRING_ARRAY) CASE_TYPE(math, OP_MODULE, PACKED_VECTOR2_ARRAY) CASE_TYPE(math, OP_MODULE, PACKED_VECTOR3_ARRAY) @@ -1237,13 +1393,35 @@ void Variant::set_named(const StringName &p_index, const Variant &p_value, bool v->y = p_value._data._int; valid = true; } - } else if (p_value.type == Variant::REAL) { + } else if (p_value.type == Variant::FLOAT) { Vector2 *v = reinterpret_cast<Vector2 *>(_data._mem); if (p_index == CoreStringNames::singleton->x) { - v->x = p_value._data._real; + v->x = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->y) { - v->y = p_value._data._real; + v->y = p_value._data._float; + valid = true; + } + } + + } break; + case VECTOR2I: { + if (p_value.type == Variant::INT) { + Vector2i *v = reinterpret_cast<Vector2i *>(_data._mem); + if (p_index == CoreStringNames::singleton->x) { + v->x = p_value._data._int; + valid = true; + } else if (p_index == CoreStringNames::singleton->y) { + v->y = p_value._data._int; + valid = true; + } + } else if (p_value.type == Variant::FLOAT) { + Vector2i *v = reinterpret_cast<Vector2i *>(_data._mem); + if (p_index == CoreStringNames::singleton->x) { + v->x = p_value._data._float; + valid = true; + } else if (p_index == CoreStringNames::singleton->y) { + v->y = p_value._data._float; valid = true; } } @@ -1266,6 +1444,23 @@ void Variant::set_named(const StringName &p_index, const Variant &p_value, bool } } } break; + case RECT2I: { + + if (p_value.type == Variant::VECTOR2I) { + Rect2i *v = reinterpret_cast<Rect2i *>(_data._mem); + //scalar name + if (p_index == CoreStringNames::singleton->position) { + v->position = *reinterpret_cast<const Vector2i *>(p_value._data._mem); + valid = true; + } else if (p_index == CoreStringNames::singleton->size) { + v->size = *reinterpret_cast<const Vector2i *>(p_value._data._mem); + valid = true; + } else if (p_index == CoreStringNames::singleton->end) { + v->size = *reinterpret_cast<const Vector2i *>(p_value._data._mem) - v->position; + valid = true; + } + } + } break; case TRANSFORM2D: { if (p_value.type == Variant::VECTOR2) { @@ -1297,16 +1492,45 @@ void Variant::set_named(const StringName &p_index, const Variant &p_value, bool v->z = p_value._data._int; valid = true; } - } else if (p_value.type == Variant::REAL) { + } else if (p_value.type == Variant::FLOAT) { Vector3 *v = reinterpret_cast<Vector3 *>(_data._mem); if (p_index == CoreStringNames::singleton->x) { - v->x = p_value._data._real; + v->x = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->y) { - v->y = p_value._data._real; + v->y = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->z) { - v->z = p_value._data._real; + v->z = p_value._data._float; + valid = true; + } + } + + } break; + case VECTOR3I: { + + if (p_value.type == Variant::INT) { + Vector3i *v = reinterpret_cast<Vector3i *>(_data._mem); + if (p_index == CoreStringNames::singleton->x) { + v->x = p_value._data._int; + valid = true; + } else if (p_index == CoreStringNames::singleton->y) { + v->y = p_value._data._int; + valid = true; + } else if (p_index == CoreStringNames::singleton->z) { + v->z = p_value._data._int; + valid = true; + } + } else if (p_value.type == Variant::FLOAT) { + Vector3i *v = reinterpret_cast<Vector3i *>(_data._mem); + if (p_index == CoreStringNames::singleton->x) { + v->x = p_value._data._float; + valid = true; + } else if (p_index == CoreStringNames::singleton->y) { + v->y = p_value._data._float; + valid = true; + } else if (p_index == CoreStringNames::singleton->z) { + v->z = p_value._data._float; valid = true; } } @@ -1329,19 +1553,19 @@ void Variant::set_named(const StringName &p_index, const Variant &p_value, bool v->d = p_value._data._int; valid = true; } - } else if (p_value.type == Variant::REAL) { + } else if (p_value.type == Variant::FLOAT) { Plane *v = reinterpret_cast<Plane *>(_data._mem); if (p_index == CoreStringNames::singleton->x) { - v->normal.x = p_value._data._real; + v->normal.x = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->y) { - v->normal.y = p_value._data._real; + v->normal.y = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->z) { - v->normal.z = p_value._data._real; + v->normal.z = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->d) { - v->d = p_value._data._real; + v->d = p_value._data._float; valid = true; } @@ -1371,24 +1595,24 @@ void Variant::set_named(const StringName &p_index, const Variant &p_value, bool v->w = p_value._data._int; valid = true; } - } else if (p_value.type == Variant::REAL) { + } else if (p_value.type == Variant::FLOAT) { Quat *v = reinterpret_cast<Quat *>(_data._mem); if (p_index == CoreStringNames::singleton->x) { - v->x = p_value._data._real; + v->x = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->y) { - v->y = p_value._data._real; + v->y = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->z) { - v->z = p_value._data._real; + v->z = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->w) { - v->w = p_value._data._real; + v->w = p_value._data._float; valid = true; } } - } break; // 10 + } break; case AABB: { if (p_value.type == Variant::VECTOR3) { @@ -1472,40 +1696,40 @@ void Variant::set_named(const StringName &p_index, const Variant &p_value, bool v->set_hsv(v->get_h(), v->get_v(), p_value._data._int, v->a); valid = true; } - } else if (p_value.type == Variant::REAL) { + } else if (p_value.type == Variant::FLOAT) { Color *v = reinterpret_cast<Color *>(_data._mem); if (p_index == CoreStringNames::singleton->r) { - v->r = p_value._data._real; + v->r = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->g) { - v->g = p_value._data._real; + v->g = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->b) { - v->b = p_value._data._real; + v->b = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->a) { - v->a = p_value._data._real; + v->a = p_value._data._float; valid = true; } else if (p_index == CoreStringNames::singleton->r8) { - v->r = p_value._data._real / 255.0; + v->r = p_value._data._float / 255.0; valid = true; } else if (p_index == CoreStringNames::singleton->g8) { - v->g = p_value._data._real / 255.0; + v->g = p_value._data._float / 255.0; valid = true; } else if (p_index == CoreStringNames::singleton->b8) { - v->b = p_value._data._real / 255.0; + v->b = p_value._data._float / 255.0; valid = true; } else if (p_index == CoreStringNames::singleton->a8) { - v->a = p_value._data._real / 255.0; + v->a = p_value._data._float / 255.0; valid = true; } else if (p_index == CoreStringNames::singleton->h) { - v->set_hsv(p_value._data._real, v->get_s(), v->get_v(), v->a); + v->set_hsv(p_value._data._float, v->get_s(), v->get_v(), v->a); valid = true; } else if (p_index == CoreStringNames::singleton->s) { - v->set_hsv(v->get_h(), p_value._data._real, v->get_v(), v->a); + v->set_hsv(v->get_h(), p_value._data._float, v->get_v(), v->a); valid = true; } else if (p_index == CoreStringNames::singleton->v) { - v->set_hsv(v->get_h(), v->get_s(), p_value._data._real, v->a); + v->set_hsv(v->get_h(), v->get_s(), p_value._data._float, v->a); valid = true; } } @@ -1548,6 +1772,15 @@ Variant Variant::get_named(const StringName &p_index, bool *r_valid) const { } } break; + case VECTOR2I: { + const Vector2i *v = reinterpret_cast<const Vector2i *>(_data._mem); + if (p_index == CoreStringNames::singleton->x) { + return v->x; + } else if (p_index == CoreStringNames::singleton->y) { + return v->y; + } + + } break; case RECT2: { const Rect2 *v = reinterpret_cast<const Rect2 *>(_data._mem); @@ -1560,6 +1793,18 @@ Variant Variant::get_named(const StringName &p_index, bool *r_valid) const { return v->size + v->position; } } break; + case RECT2I: { + + const Rect2i *v = reinterpret_cast<const Rect2i *>(_data._mem); + //scalar name + if (p_index == CoreStringNames::singleton->position) { + return v->position; + } else if (p_index == CoreStringNames::singleton->size) { + return v->size; + } else if (p_index == CoreStringNames::singleton->end) { + return v->size + v->position; + } + } break; case TRANSFORM2D: { const Transform2D *v = _data._transform2d; @@ -1584,6 +1829,18 @@ Variant Variant::get_named(const StringName &p_index, bool *r_valid) const { } } break; + case VECTOR3I: { + + const Vector3i *v = reinterpret_cast<const Vector3i *>(_data._mem); + if (p_index == CoreStringNames::singleton->x) { + return v->x; + } else if (p_index == CoreStringNames::singleton->y) { + return v->y; + } else if (p_index == CoreStringNames::singleton->z) { + return v->z; + } + + } break; case PLANE: { const Plane *v = reinterpret_cast<const Plane *>(_data._mem); @@ -1613,7 +1870,7 @@ Variant Variant::get_named(const StringName &p_index, bool *r_valid) const { return v->w; } - } break; // 10 + } break; case AABB: { const ::AABB *v = _data._aabb; @@ -1707,28 +1964,55 @@ Variant Variant::get_named(const StringName &p_index, bool *r_valid) const { return Variant(); } -#define DEFAULT_OP_ARRAY_CMD(m_name, m_type, skip_test, cmd) \ - case m_name: { \ - skip_test; \ - \ - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { \ - int index = p_index; \ - m_type *arr = reinterpret_cast<m_type *>(_data._mem); \ - \ - if (index < 0) \ - index += arr->size(); \ - if (index >= 0 && index < arr->size()) { \ - valid = true; \ - cmd; \ - } \ - } \ +#define DEFAULT_OP_ARRAY_CMD(m_name, m_type, skip_test, cmd) \ + case m_name: { \ + skip_test; \ + \ + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { \ + int index = p_index; \ + m_type *arr = reinterpret_cast<m_type *>(_data._mem); \ + \ + if (index < 0) \ + index += arr->size(); \ + if (index >= 0 && index < arr->size()) { \ + valid = true; \ + cmd; \ + } \ + } \ } break; -#define DEFAULT_OP_DVECTOR_SET(m_name, dv_type, skip_cond) \ - DEFAULT_OP_ARRAY_CMD(m_name, Vector<dv_type>, if (skip_cond) return;, arr->set(index, p_value); return ) +#define DEFAULT_OP_DVECTOR_SET(m_name, m_type, skip_cond) \ + case m_name: { \ + if (skip_cond) return; \ + \ + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { \ + int index = p_index; \ + Vector<m_type> *arr = PackedArrayRef<m_type>::get_array_ptr(_data.packed_array); \ + \ + if (index < 0) \ + index += arr->size(); \ + if (index >= 0 && index < arr->size()) { \ + valid = true; \ + arr->set(index, p_value); \ + } \ + } \ + } break; -#define DEFAULT_OP_DVECTOR_GET(m_name, dv_type) \ - DEFAULT_OP_ARRAY_CMD(m_name, const Vector<dv_type>, ;, return arr->get(index)) +#define DEFAULT_OP_DVECTOR_GET(m_name, m_type) \ + case m_name: { \ + \ + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { \ + int index = p_index; \ + const Vector<m_type> *arr = &PackedArrayRef<m_type>::get_array(_data.packed_array); \ + \ + if (index < 0) \ + index += arr->size(); \ + if (index >= 0 && index < arr->size()) { \ + valid = true; \ + return arr->get(index); \ + } \ + } \ + } break; void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) { @@ -1747,12 +2031,12 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) case INT: { return; } break; - case REAL: { + case FLOAT: { return; } break; case STRING: { - if (p_index.type != Variant::INT && p_index.type != Variant::REAL) + if (p_index.type != Variant::INT && p_index.type != Variant::FLOAT) return; int idx = p_index; @@ -1764,7 +2048,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) return; String chr; - if (p_value.type == Variant::INT || p_value.type == Variant::REAL) { + if (p_value.type == Variant::INT || p_value.type == Variant::FLOAT) { chr = String::chr(p_value); } else if (p_value.type == Variant::STRING) { @@ -1781,10 +2065,10 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } break; case VECTOR2: { - if (p_value.type != Variant::INT && p_value.type != Variant::REAL) + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) return; - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { // scalar index int idx = p_index; @@ -1813,7 +2097,42 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } } - } break; // 5 + } break; + case VECTOR2I: { + + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) + return; + + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { + // scalar index + int idx = p_index; + + if (idx < 0) + idx += 2; + if (idx >= 0 && idx < 2) { + + Vector2i *v = reinterpret_cast<Vector2i *>(_data._mem); + valid = true; + (*v)[idx] = p_value; + return; + } + } else if (p_index.get_type() == Variant::STRING) { + //scalar name + + const String *str = reinterpret_cast<const String *>(p_index._data._mem); + Vector2i *v = reinterpret_cast<Vector2i *>(_data._mem); + if (*str == "x") { + valid = true; + v->x = p_value; + return; + } else if (*str == "y") { + valid = true; + v->y = p_value; + return; + } + } + + } break; case RECT2: { if (p_value.type != Variant::VECTOR2) @@ -1839,12 +2158,37 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } } } break; + case RECT2I: { + + if (p_value.type != Variant::VECTOR2I) + return; + + if (p_index.get_type() == Variant::STRING) { + //scalar name + + const String *str = reinterpret_cast<const String *>(p_index._data._mem); + Rect2i *v = reinterpret_cast<Rect2i *>(_data._mem); + if (*str == "position") { + valid = true; + v->position = p_value; + return; + } else if (*str == "size") { + valid = true; + v->size = p_value; + return; + } else if (*str == "end") { + valid = true; + v->size = Vector2i(p_value) - v->position; + return; + } + } + } break; case TRANSFORM2D: { if (p_value.type != Variant::VECTOR2) return; - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { int index = p_index; @@ -1880,10 +2224,10 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } break; case VECTOR3: { - if (p_value.type != Variant::INT && p_value.type != Variant::REAL) + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) return; - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { //scalar index int idx = p_index; if (idx < 0) @@ -1916,6 +2260,44 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } } break; + case VECTOR3I: { + + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) + return; + + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { + //scalar index + int idx = p_index; + if (idx < 0) + idx += 3; + if (idx >= 0 && idx < 3) { + + Vector3i *v = reinterpret_cast<Vector3i *>(_data._mem); + valid = true; + (*v)[idx] = p_value; + return; + } + } else if (p_index.get_type() == Variant::STRING) { + + //scalar name + const String *str = reinterpret_cast<const String *>(p_index._data._mem); + Vector3i *v = reinterpret_cast<Vector3i *>(_data._mem); + if (*str == "x") { + valid = true; + v->x = p_value; + return; + } else if (*str == "y") { + valid = true; + v->y = p_value; + return; + } else if (*str == "z") { + valid = true; + v->z = p_value; + return; + } + } + + } break; case PLANE: { if (p_index.get_type() == Variant::STRING) { @@ -1923,21 +2305,21 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) const String *str = reinterpret_cast<const String *>(p_index._data._mem); Plane *v = reinterpret_cast<Plane *>(_data._mem); if (*str == "x") { - if (p_value.type != Variant::INT && p_value.type != Variant::REAL) + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) return; valid = true; v->normal.x = p_value; return; } else if (*str == "y") { - if (p_value.type != Variant::INT && p_value.type != Variant::REAL) + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) return; valid = true; v->normal.y = p_value; return; } else if (*str == "z") { - if (p_value.type != Variant::INT && p_value.type != Variant::REAL) + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) return; valid = true; @@ -1960,7 +2342,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } break; case QUAT: { - if (p_value.type != Variant::INT && p_value.type != Variant::REAL) + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) return; if (p_index.get_type() == Variant::STRING) { @@ -1986,7 +2368,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } } - } break; // 10 + } break; case AABB: { if (p_value.type != Variant::VECTOR3) @@ -2017,7 +2399,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) if (p_value.type != Variant::VECTOR3) return; - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { int index = p_index; @@ -2053,7 +2435,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } break; case TRANSFORM: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { if (p_value.type != Variant::VECTOR3) return; @@ -2096,7 +2478,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } break; case COLOR: { - if (p_value.type != Variant::INT && p_value.type != Variant::REAL) + if (p_value.type != Variant::INT && p_value.type != Variant::FLOAT) return; if (p_index.get_type() == Variant::STRING) { @@ -2161,8 +2543,10 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } } break; + case STRING_NAME: { + } break; case NODE_PATH: { - } break; // 15 + } break; case _RID: { } break; case OBJECT: { @@ -2180,7 +2564,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) } #endif - if (p_index.get_type() != Variant::STRING) { + if (p_index.get_type() != Variant::STRING_NAME && p_index.get_type() != Variant::STRING) { obj->setvar(p_index, p_value, r_valid); return; } @@ -2196,12 +2580,14 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) valid = true; //always valid, i guess? should this really be ok? return; } break; - DEFAULT_OP_ARRAY_CMD(ARRAY, Array, ;, (*arr)[index] = p_value; return ) // 20 - DEFAULT_OP_DVECTOR_SET(PACKED_BYTE_ARRAY, uint8_t, p_value.type != Variant::REAL && p_value.type != Variant::INT) - DEFAULT_OP_DVECTOR_SET(PACKED_INT_ARRAY, int, p_value.type != Variant::REAL && p_value.type != Variant::INT) - DEFAULT_OP_DVECTOR_SET(PACKED_REAL_ARRAY, real_t, p_value.type != Variant::REAL && p_value.type != Variant::INT) + DEFAULT_OP_ARRAY_CMD(ARRAY, Array, ;, (*arr)[index] = p_value; return ) + DEFAULT_OP_DVECTOR_SET(PACKED_BYTE_ARRAY, uint8_t, p_value.type != Variant::FLOAT && p_value.type != Variant::INT) + DEFAULT_OP_DVECTOR_SET(PACKED_INT32_ARRAY, int32_t, p_value.type != Variant::FLOAT && p_value.type != Variant::INT) + DEFAULT_OP_DVECTOR_SET(PACKED_INT64_ARRAY, int64_t, p_value.type != Variant::FLOAT && p_value.type != Variant::INT) + DEFAULT_OP_DVECTOR_SET(PACKED_FLOAT32_ARRAY, float, p_value.type != Variant::FLOAT && p_value.type != Variant::INT) + DEFAULT_OP_DVECTOR_SET(PACKED_FLOAT64_ARRAY, double, p_value.type != Variant::FLOAT && p_value.type != Variant::INT) DEFAULT_OP_DVECTOR_SET(PACKED_STRING_ARRAY, String, p_value.type != Variant::STRING) - DEFAULT_OP_DVECTOR_SET(PACKED_VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2) // 25 + DEFAULT_OP_DVECTOR_SET(PACKED_VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2) DEFAULT_OP_DVECTOR_SET(PACKED_VECTOR3_ARRAY, Vector3, p_value.type != Variant::VECTOR3) DEFAULT_OP_DVECTOR_SET(PACKED_COLOR_ARRAY, Color, p_value.type != Variant::COLOR) default: @@ -2227,12 +2613,12 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { case INT: { return Variant(); } break; - case REAL: { + case FLOAT: { return Variant(); } break; case STRING: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { //string index int idx = p_index; @@ -2249,7 +2635,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } break; case VECTOR2: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { // scalar index int idx = p_index; if (idx < 0) @@ -2274,7 +2660,35 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } } - } break; // 5 + } break; + case VECTOR2I: { + + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { + // scalar index + int idx = p_index; + if (idx < 0) + idx += 2; + if (idx >= 0 && idx < 2) { + + const Vector2i *v = reinterpret_cast<const Vector2i *>(_data._mem); + valid = true; + return (*v)[idx]; + } + } else if (p_index.get_type() == Variant::STRING) { + //scalar name + + const String *str = reinterpret_cast<const String *>(p_index._data._mem); + const Vector2i *v = reinterpret_cast<const Vector2i *>(_data._mem); + if (*str == "x") { + valid = true; + return v->x; + } else if (*str == "y") { + valid = true; + return v->y; + } + } + + } break; case RECT2: { if (p_index.get_type() == Variant::STRING) { @@ -2294,9 +2708,28 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } } } break; + case RECT2I: { + + if (p_index.get_type() == Variant::STRING) { + //scalar name + + const String *str = reinterpret_cast<const String *>(p_index._data._mem); + const Rect2i *v = reinterpret_cast<const Rect2i *>(_data._mem); + if (*str == "position") { + valid = true; + return v->position; + } else if (*str == "size") { + valid = true; + return v->size; + } else if (*str == "end") { + valid = true; + return v->size + v->position; + } + } + } break; case VECTOR3: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { //scalar index int idx = p_index; if (idx < 0) @@ -2325,9 +2758,40 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } } break; + case VECTOR3I: { + + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { + //scalar index + int idx = p_index; + if (idx < 0) + idx += 3; + if (idx >= 0 && idx < 3) { + + const Vector3i *v = reinterpret_cast<const Vector3i *>(_data._mem); + valid = true; + return (*v)[idx]; + } + } else if (p_index.get_type() == Variant::STRING) { + + //scalar name + const String *str = reinterpret_cast<const String *>(p_index._data._mem); + const Vector3i *v = reinterpret_cast<const Vector3i *>(_data._mem); + if (*str == "x") { + valid = true; + return v->x; + } else if (*str == "y") { + valid = true; + return v->y; + } else if (*str == "z") { + valid = true; + return v->z; + } + } + + } break; case TRANSFORM2D: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { int index = p_index; @@ -2403,7 +2867,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } } - } break; // 10 + } break; case AABB: { if (p_index.get_type() == Variant::STRING) { @@ -2425,7 +2889,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } break; case BASIS: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { int index = p_index; if (index < 0) @@ -2456,7 +2920,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } break; case TRANSFORM: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { int index = p_index; if (index < 0) @@ -2535,8 +2999,10 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } } break; + case STRING_NAME: { + } break; case NODE_PATH: { - } break; // 15 + } break; case _RID: { } break; case OBJECT: { @@ -2568,12 +3034,14 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { return *res; } } break; - DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, ;, return (*arr)[index]) // 20 + DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, ;, return (*arr)[index]) DEFAULT_OP_DVECTOR_GET(PACKED_BYTE_ARRAY, uint8_t) - DEFAULT_OP_DVECTOR_GET(PACKED_INT_ARRAY, int) - DEFAULT_OP_DVECTOR_GET(PACKED_REAL_ARRAY, real_t) + DEFAULT_OP_DVECTOR_GET(PACKED_INT32_ARRAY, int32_t) + DEFAULT_OP_DVECTOR_GET(PACKED_INT64_ARRAY, int64_t) + DEFAULT_OP_DVECTOR_GET(PACKED_FLOAT32_ARRAY, float) + DEFAULT_OP_DVECTOR_GET(PACKED_FLOAT64_ARRAY, double) DEFAULT_OP_DVECTOR_GET(PACKED_STRING_ARRAY, String) - DEFAULT_OP_DVECTOR_GET(PACKED_VECTOR2_ARRAY, Vector2) // 25 + DEFAULT_OP_DVECTOR_GET(PACKED_VECTOR2_ARRAY, Vector2) DEFAULT_OP_DVECTOR_GET(PACKED_VECTOR3_ARRAY, Vector3) DEFAULT_OP_DVECTOR_GET(PACKED_COLOR_ARRAY, Color) default: @@ -2635,7 +3103,7 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { const Dictionary *dic = reinterpret_cast<const Dictionary *>(_data._mem); return dic->has(p_index); - } break; // 20 + } break; case ARRAY: { const Array *arr = reinterpret_cast<const Array *>(_data._mem); @@ -2652,10 +3120,10 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { } break; case PACKED_BYTE_ARRAY: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { int index = p_index; - const Vector<uint8_t> *arr = reinterpret_cast<const Vector<uint8_t> *>(_data._mem); + const Vector<uint8_t> *arr = &PackedArrayRef<uint8_t>::get_array(_data.packed_array); int l = arr->size(); if (l) { const uint8_t *r = arr->ptr(); @@ -2669,14 +3137,49 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { } } break; - case PACKED_INT_ARRAY: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + case PACKED_INT32_ARRAY: { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { - int index = p_index; - const Vector<int> *arr = reinterpret_cast<const Vector<int> *>(_data._mem); + int32_t index = p_index; + const Vector<int32_t> *arr = &PackedArrayRef<int32_t>::get_array(_data.packed_array); + int32_t l = arr->size(); + if (l) { + const int32_t *r = arr->ptr(); + for (int32_t i = 0; i < l; i++) { + if (r[i] == index) + return true; + } + } + + return false; + } + } break; + case PACKED_INT64_ARRAY: { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { + + int64_t index = p_index; + const Vector<int64_t> *arr = &PackedArrayRef<int64_t>::get_array(_data.packed_array); + int64_t l = arr->size(); + if (l) { + const int64_t *r = arr->ptr(); + for (int64_t i = 0; i < l; i++) { + if (r[i] == index) + return true; + } + } + + return false; + } + } break; + case PACKED_FLOAT32_ARRAY: { + + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { + + real_t index = p_index; + const Vector<float> *arr = &PackedArrayRef<float>::get_array(_data.packed_array); int l = arr->size(); if (l) { - const int *r = arr->ptr(); + const float *r = arr->ptr(); for (int i = 0; i < l; i++) { if (r[i] == index) return true; @@ -2685,16 +3188,17 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { return false; } + } break; - case PACKED_REAL_ARRAY: { + case PACKED_FLOAT64_ARRAY: { - if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::REAL) { + if (p_index.get_type() == Variant::INT || p_index.get_type() == Variant::FLOAT) { real_t index = p_index; - const Vector<real_t> *arr = reinterpret_cast<const Vector<real_t> *>(_data._mem); + const Vector<double> *arr = &PackedArrayRef<double>::get_array(_data.packed_array); int l = arr->size(); if (l) { - const real_t *r = arr->ptr(); + const double *r = arr->ptr(); for (int i = 0; i < l; i++) { if (r[i] == index) return true; @@ -2709,7 +3213,7 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { if (p_index.get_type() == Variant::STRING) { String index = p_index; - const Vector<String> *arr = reinterpret_cast<const Vector<String> *>(_data._mem); + const Vector<String> *arr = &PackedArrayRef<String>::get_array(_data.packed_array); int l = arr->size(); if (l) { @@ -2728,7 +3232,7 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { if (p_index.get_type() == Variant::VECTOR2) { Vector2 index = p_index; - const Vector<Vector2> *arr = reinterpret_cast<const Vector<Vector2> *>(_data._mem); + const Vector<Vector2> *arr = &PackedArrayRef<Vector2>::get_array(_data.packed_array); int l = arr->size(); if (l) { @@ -2747,7 +3251,7 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { if (p_index.get_type() == Variant::VECTOR3) { Vector3 index = p_index; - const Vector<Vector3> *arr = reinterpret_cast<const Vector<Vector3> *>(_data._mem); + const Vector<Vector3> *arr = &PackedArrayRef<Vector3>::get_array(_data.packed_array); int l = arr->size(); if (l) { @@ -2767,7 +3271,7 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { if (p_index.get_type() == Variant::COLOR) { Color index = p_index; - const Vector<Color> *arr = reinterpret_cast<const Vector<Color> *>(_data._mem); + const Vector<Color> *arr = &PackedArrayRef<Color>::get_array(_data.packed_array); int l = arr->size(); if (l) { @@ -2795,10 +3299,16 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { switch (type) { case VECTOR2: { - p_list->push_back(PropertyInfo(Variant::REAL, "x")); - p_list->push_back(PropertyInfo(Variant::REAL, "y")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "x")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "y")); + + } break; + case VECTOR2I: { + + p_list->push_back(PropertyInfo(Variant::INT, "x")); + p_list->push_back(PropertyInfo(Variant::INT, "y")); - } break; // 5 + } break; case RECT2: { p_list->push_back(PropertyInfo(Variant::VECTOR2, "position")); @@ -2806,11 +3316,25 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::VECTOR2, "end")); } break; + case RECT2I: { + + p_list->push_back(PropertyInfo(Variant::VECTOR2I, "position")); + p_list->push_back(PropertyInfo(Variant::VECTOR2I, "size")); + p_list->push_back(PropertyInfo(Variant::VECTOR2I, "end")); + + } break; case VECTOR3: { - p_list->push_back(PropertyInfo(Variant::REAL, "x")); - p_list->push_back(PropertyInfo(Variant::REAL, "y")); - p_list->push_back(PropertyInfo(Variant::REAL, "z")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "x")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "y")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "z")); + + } break; + case VECTOR3I: { + + p_list->push_back(PropertyInfo(Variant::INT, "x")); + p_list->push_back(PropertyInfo(Variant::INT, "y")); + p_list->push_back(PropertyInfo(Variant::INT, "z")); } break; case TRANSFORM2D: { @@ -2823,20 +3347,20 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { case PLANE: { p_list->push_back(PropertyInfo(Variant::VECTOR3, "normal")); - p_list->push_back(PropertyInfo(Variant::REAL, "x")); - p_list->push_back(PropertyInfo(Variant::REAL, "y")); - p_list->push_back(PropertyInfo(Variant::REAL, "z")); - p_list->push_back(PropertyInfo(Variant::REAL, "d")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "x")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "y")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "z")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "d")); } break; case QUAT: { - p_list->push_back(PropertyInfo(Variant::REAL, "x")); - p_list->push_back(PropertyInfo(Variant::REAL, "y")); - p_list->push_back(PropertyInfo(Variant::REAL, "z")); - p_list->push_back(PropertyInfo(Variant::REAL, "w")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "x")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "y")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "z")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "w")); - } break; // 10 + } break; case AABB: { p_list->push_back(PropertyInfo(Variant::VECTOR3, "position")); p_list->push_back(PropertyInfo(Variant::VECTOR3, "size")); @@ -2856,21 +3380,23 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { } break; case COLOR: { - p_list->push_back(PropertyInfo(Variant::REAL, "r")); - p_list->push_back(PropertyInfo(Variant::REAL, "g")); - p_list->push_back(PropertyInfo(Variant::REAL, "b")); - p_list->push_back(PropertyInfo(Variant::REAL, "a")); - p_list->push_back(PropertyInfo(Variant::REAL, "h")); - p_list->push_back(PropertyInfo(Variant::REAL, "s")); - p_list->push_back(PropertyInfo(Variant::REAL, "v")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "r")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "g")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "b")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "a")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "h")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "s")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "v")); p_list->push_back(PropertyInfo(Variant::INT, "r8")); p_list->push_back(PropertyInfo(Variant::INT, "g8")); p_list->push_back(PropertyInfo(Variant::INT, "b8")); p_list->push_back(PropertyInfo(Variant::INT, "a8")); } break; + case STRING_NAME: { + } break; case NODE_PATH: { - } break; // 15 + } break; case _RID: { } break; case OBJECT: { @@ -2901,12 +3427,14 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { } } } break; - case ARRAY: // 20 + case ARRAY: case PACKED_BYTE_ARRAY: - case PACKED_INT_ARRAY: - case PACKED_REAL_ARRAY: + case PACKED_INT32_ARRAY: + case PACKED_INT64_ARRAY: + case PACKED_FLOAT32_ARRAY: + case PACKED_FLOAT64_ARRAY: case PACKED_STRING_ARRAY: - case PACKED_VECTOR2_ARRAY: // 25 + case PACKED_VECTOR2_ARRAY: case PACKED_VECTOR3_ARRAY: case PACKED_COLOR_ARRAY: { @@ -2925,9 +3453,9 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { r_iter = 0; return _data._int > 0; } break; - case REAL: { + case FLOAT: { r_iter = 0; - return _data._real > 0.0; + return _data._float > 0.0; } break; case VECTOR2: { int64_t from = reinterpret_cast<const Vector2 *>(_data._mem)->x; @@ -2968,15 +3496,15 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { } #endif - Variant::CallError ce; - ce.error = Variant::CallError::CALL_OK; + Callable::CallError ce; + ce.error = Callable::CallError::CALL_OK; Array ref; ref.push_back(r_iter); Variant vref = ref; const Variant *refp[] = { &vref }; Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->_iter_init, refp, 1, ce); - if (ref.size() != 1 || ce.error != Variant::CallError::CALL_OK) { + if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) { valid = false; return false; } @@ -3013,23 +3541,39 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { return true; } break; case PACKED_BYTE_ARRAY: { - const Vector<uint8_t> *arr = reinterpret_cast<const Vector<uint8_t> *>(_data._mem); + const Vector<uint8_t> *arr = &PackedArrayRef<uint8_t>::get_array(_data.packed_array); if (arr->size() == 0) return false; r_iter = 0; return true; } break; - case PACKED_INT_ARRAY: { - const Vector<int> *arr = reinterpret_cast<const Vector<int> *>(_data._mem); + case PACKED_INT32_ARRAY: { + const Vector<int32_t> *arr = &PackedArrayRef<int32_t>::get_array(_data.packed_array); if (arr->size() == 0) return false; r_iter = 0; return true; } break; - case PACKED_REAL_ARRAY: { - const Vector<real_t> *arr = reinterpret_cast<const Vector<real_t> *>(_data._mem); + case PACKED_INT64_ARRAY: { + const Vector<int64_t> *arr = &PackedArrayRef<int64_t>::get_array(_data.packed_array); + if (arr->size() == 0) + return false; + r_iter = 0; + return true; + + } break; + case PACKED_FLOAT32_ARRAY: { + const Vector<float> *arr = &PackedArrayRef<float>::get_array(_data.packed_array); + if (arr->size() == 0) + return false; + r_iter = 0; + return true; + + } break; + case PACKED_FLOAT64_ARRAY: { + const Vector<double> *arr = &PackedArrayRef<double>::get_array(_data.packed_array); if (arr->size() == 0) return false; r_iter = 0; @@ -3037,7 +3581,7 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { } break; case PACKED_STRING_ARRAY: { - const Vector<String> *arr = reinterpret_cast<const Vector<String> *>(_data._mem); + const Vector<String> *arr = &PackedArrayRef<String>::get_array(_data.packed_array); if (arr->size() == 0) return false; r_iter = 0; @@ -3045,7 +3589,7 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { } break; case PACKED_VECTOR2_ARRAY: { - const Vector<Vector2> *arr = reinterpret_cast<const Vector<Vector2> *>(_data._mem); + const Vector<Vector2> *arr = &PackedArrayRef<Vector2>::get_array(_data.packed_array); if (arr->size() == 0) return false; r_iter = 0; @@ -3053,7 +3597,7 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { } break; case PACKED_VECTOR3_ARRAY: { - const Vector<Vector3> *arr = reinterpret_cast<const Vector<Vector3> *>(_data._mem); + const Vector<Vector3> *arr = &PackedArrayRef<Vector3>::get_array(_data.packed_array); if (arr->size() == 0) return false; r_iter = 0; @@ -3061,7 +3605,7 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { } break; case PACKED_COLOR_ARRAY: { - const Vector<Color> *arr = reinterpret_cast<const Vector<Color> *>(_data._mem); + const Vector<Color> *arr = &PackedArrayRef<Color>::get_array(_data.packed_array); if (arr->size() == 0) return false; r_iter = 0; @@ -3087,10 +3631,10 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { r_iter = idx; return true; } break; - case REAL: { + case FLOAT: { int64_t idx = r_iter; idx++; - if (idx >= _data._real) + if (idx >= _data._float) return false; r_iter = idx; return true; @@ -3138,15 +3682,15 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { } #endif - Variant::CallError ce; - ce.error = Variant::CallError::CALL_OK; + Callable::CallError ce; + ce.error = Callable::CallError::CALL_OK; Array ref; ref.push_back(r_iter); Variant vref = ref; const Variant *refp[] = { &vref }; Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->_iter_next, refp, 1, ce); - if (ref.size() != 1 || ce.error != Variant::CallError::CALL_OK) { + if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) { valid = false; return false; } @@ -3188,7 +3732,7 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { return true; } break; case PACKED_BYTE_ARRAY: { - const Vector<uint8_t> *arr = reinterpret_cast<const Vector<uint8_t> *>(_data._mem); + const Vector<uint8_t> *arr = &PackedArrayRef<uint8_t>::get_array(_data.packed_array); int idx = r_iter; idx++; if (idx >= arr->size()) @@ -3197,8 +3741,28 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { return true; } break; - case PACKED_INT_ARRAY: { - const Vector<int> *arr = reinterpret_cast<const Vector<int> *>(_data._mem); + case PACKED_INT32_ARRAY: { + const Vector<int32_t> *arr = &PackedArrayRef<int32_t>::get_array(_data.packed_array); + int32_t idx = r_iter; + idx++; + if (idx >= arr->size()) + return false; + r_iter = idx; + return true; + + } break; + case PACKED_INT64_ARRAY: { + const Vector<int64_t> *arr = &PackedArrayRef<int64_t>::get_array(_data.packed_array); + int64_t idx = r_iter; + idx++; + if (idx >= arr->size()) + return false; + r_iter = idx; + return true; + + } break; + case PACKED_FLOAT32_ARRAY: { + const Vector<float> *arr = &PackedArrayRef<float>::get_array(_data.packed_array); int idx = r_iter; idx++; if (idx >= arr->size()) @@ -3207,8 +3771,8 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { return true; } break; - case PACKED_REAL_ARRAY: { - const Vector<real_t> *arr = reinterpret_cast<const Vector<real_t> *>(_data._mem); + case PACKED_FLOAT64_ARRAY: { + const Vector<double> *arr = &PackedArrayRef<double>::get_array(_data.packed_array); int idx = r_iter; idx++; if (idx >= arr->size()) @@ -3218,7 +3782,7 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { } break; case PACKED_STRING_ARRAY: { - const Vector<String> *arr = reinterpret_cast<const Vector<String> *>(_data._mem); + const Vector<String> *arr = &PackedArrayRef<String>::get_array(_data.packed_array); int idx = r_iter; idx++; if (idx >= arr->size()) @@ -3228,7 +3792,7 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { } break; case PACKED_VECTOR2_ARRAY: { - const Vector<Vector2> *arr = reinterpret_cast<const Vector<Vector2> *>(_data._mem); + const Vector<Vector2> *arr = &PackedArrayRef<Vector2>::get_array(_data.packed_array); int idx = r_iter; idx++; if (idx >= arr->size()) @@ -3238,7 +3802,7 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { } break; case PACKED_VECTOR3_ARRAY: { - const Vector<Vector3> *arr = reinterpret_cast<const Vector<Vector3> *>(_data._mem); + const Vector<Vector3> *arr = &PackedArrayRef<Vector3>::get_array(_data.packed_array); int idx = r_iter; idx++; if (idx >= arr->size()) @@ -3248,7 +3812,7 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { } break; case PACKED_COLOR_ARRAY: { - const Vector<Color> *arr = reinterpret_cast<const Vector<Color> *>(_data._mem); + const Vector<Color> *arr = &PackedArrayRef<Color>::get_array(_data.packed_array); int idx = r_iter; idx++; if (idx >= arr->size()) @@ -3272,7 +3836,7 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { return r_iter; } break; - case REAL: { + case FLOAT: { return r_iter; } break; @@ -3297,12 +3861,12 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { } #endif - Variant::CallError ce; - ce.error = Variant::CallError::CALL_OK; + Callable::CallError ce; + ce.error = Callable::CallError::CALL_OK; const Variant *refp[] = { &r_iter }; Variant ret = _get_obj().obj->call(CoreStringNames::get_singleton()->_iter_get, refp, 1, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { r_valid = false; return Variant(); } @@ -3335,7 +3899,7 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { return arr->get(idx); } break; case PACKED_BYTE_ARRAY: { - const Vector<uint8_t> *arr = reinterpret_cast<const Vector<uint8_t> *>(_data._mem); + const Vector<uint8_t> *arr = &PackedArrayRef<uint8_t>::get_array(_data.packed_array); int idx = r_iter; #ifdef DEBUG_ENABLED if (idx < 0 || idx >= arr->size()) { @@ -3345,8 +3909,30 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { #endif return arr->get(idx); } break; - case PACKED_INT_ARRAY: { - const Vector<int> *arr = reinterpret_cast<const Vector<int> *>(_data._mem); + case PACKED_INT32_ARRAY: { + const Vector<int32_t> *arr = &PackedArrayRef<int32_t>::get_array(_data.packed_array); + int32_t idx = r_iter; +#ifdef DEBUG_ENABLED + if (idx < 0 || idx >= arr->size()) { + r_valid = false; + return Variant(); + } +#endif + return arr->get(idx); + } break; + case PACKED_INT64_ARRAY: { + const Vector<int64_t> *arr = &PackedArrayRef<int64_t>::get_array(_data.packed_array); + int64_t idx = r_iter; +#ifdef DEBUG_ENABLED + if (idx < 0 || idx >= arr->size()) { + r_valid = false; + return Variant(); + } +#endif + return arr->get(idx); + } break; + case PACKED_FLOAT32_ARRAY: { + const Vector<float> *arr = &PackedArrayRef<float>::get_array(_data.packed_array); int idx = r_iter; #ifdef DEBUG_ENABLED if (idx < 0 || idx >= arr->size()) { @@ -3356,8 +3942,8 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { #endif return arr->get(idx); } break; - case PACKED_REAL_ARRAY: { - const Vector<real_t> *arr = reinterpret_cast<const Vector<real_t> *>(_data._mem); + case PACKED_FLOAT64_ARRAY: { + const Vector<double> *arr = &PackedArrayRef<double>::get_array(_data.packed_array); int idx = r_iter; #ifdef DEBUG_ENABLED if (idx < 0 || idx >= arr->size()) { @@ -3368,7 +3954,7 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { return arr->get(idx); } break; case PACKED_STRING_ARRAY: { - const Vector<String> *arr = reinterpret_cast<const Vector<String> *>(_data._mem); + const Vector<String> *arr = &PackedArrayRef<String>::get_array(_data.packed_array); int idx = r_iter; #ifdef DEBUG_ENABLED if (idx < 0 || idx >= arr->size()) { @@ -3380,7 +3966,7 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { } break; case PACKED_VECTOR2_ARRAY: { - const Vector<Vector2> *arr = reinterpret_cast<const Vector<Vector2> *>(_data._mem); + const Vector<Vector2> *arr = &PackedArrayRef<Vector2>::get_array(_data.packed_array); int idx = r_iter; #ifdef DEBUG_ENABLED if (idx < 0 || idx >= arr->size()) { @@ -3392,7 +3978,7 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { } break; case PACKED_VECTOR3_ARRAY: { - const Vector<Vector3> *arr = reinterpret_cast<const Vector<Vector3> *>(_data._mem); + const Vector<Vector3> *arr = &PackedArrayRef<Vector3>::get_array(_data.packed_array); int idx = r_iter; #ifdef DEBUG_ENABLED if (idx < 0 || idx >= arr->size()) { @@ -3404,7 +3990,7 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { } break; case PACKED_COLOR_ARRAY: { - const Vector<Color> *arr = reinterpret_cast<const Vector<Color> *>(_data._mem); + const Vector<Color> *arr = &PackedArrayRef<Color>::get_array(_data.packed_array); int idx = r_iter; #ifdef DEBUG_ENABLED if (idx < 0 || idx >= arr->size()) { @@ -3467,9 +4053,9 @@ void Variant::blend(const Variant &a, const Variant &b, float c, Variant &r_dst) r_dst = int(va + vb * c + 0.5); } return; - case REAL: { - double ra = a._data._real; - double rb = b._data._real; + case FLOAT: { + double ra = a._data._float; + double rb = b._data._float; r_dst = ra + rb * c; } return; @@ -3477,16 +4063,50 @@ void Variant::blend(const Variant &a, const Variant &b, float c, Variant &r_dst) r_dst = *reinterpret_cast<const Vector2 *>(a._data._mem) + *reinterpret_cast<const Vector2 *>(b._data._mem) * c; } return; + case VECTOR2I: { + int32_t vax = reinterpret_cast<const Vector2i *>(a._data._mem)->x; + int32_t vbx = reinterpret_cast<const Vector2i *>(b._data._mem)->x; + int32_t vay = reinterpret_cast<const Vector2i *>(a._data._mem)->y; + int32_t vby = reinterpret_cast<const Vector2i *>(b._data._mem)->y; + r_dst = Vector2i(int32_t(vax + vbx * c + 0.5), int32_t(vay + vby * c + 0.5)); + } + return; case RECT2: { const Rect2 *ra = reinterpret_cast<const Rect2 *>(a._data._mem); const Rect2 *rb = reinterpret_cast<const Rect2 *>(b._data._mem); r_dst = Rect2(ra->position + rb->position * c, ra->size + rb->size * c); } return; + case RECT2I: { + const Rect2i *ra = reinterpret_cast<const Rect2i *>(a._data._mem); + const Rect2i *rb = reinterpret_cast<const Rect2i *>(b._data._mem); + + int32_t vax = ra->position.x; + int32_t vay = ra->position.y; + int32_t vbx = ra->size.x; + int32_t vby = ra->size.y; + int32_t vcx = rb->position.x; + int32_t vcy = rb->position.y; + int32_t vdx = rb->size.x; + int32_t vdy = rb->size.y; + + r_dst = Rect2i(int32_t(vax + vbx * c + 0.5), int32_t(vay + vby * c + 0.5), int32_t(vcx + vdx * c + 0.5), int32_t(vcy + vdy * c + 0.5)); + } + return; case VECTOR3: { r_dst = *reinterpret_cast<const Vector3 *>(a._data._mem) + *reinterpret_cast<const Vector3 *>(b._data._mem) * c; } return; + case VECTOR3I: { + int32_t vax = reinterpret_cast<const Vector3i *>(a._data._mem)->x; + int32_t vbx = reinterpret_cast<const Vector3i *>(b._data._mem)->x; + int32_t vay = reinterpret_cast<const Vector3i *>(a._data._mem)->y; + int32_t vby = reinterpret_cast<const Vector3i *>(b._data._mem)->y; + int32_t vaz = reinterpret_cast<const Vector3i *>(a._data._mem)->z; + int32_t vbz = reinterpret_cast<const Vector3i *>(b._data._mem)->z; + r_dst = Vector3i(int32_t(vax + vbx * c + 0.5), int32_t(vay + vby * c + 0.5), int32_t(vaz + vbz * c + 0.5)); + } + return; case AABB: { const ::AABB *ra = reinterpret_cast<const ::AABB *>(a._data._mem); const ::AABB *rb = reinterpret_cast<const ::AABB *>(b._data._mem); @@ -3552,9 +4172,9 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & r_dst = int(va + (vb - va) * c); } return; - case REAL: { - real_t va = a._data._real; - real_t vb = b._data._real; + case FLOAT: { + real_t va = a._data._float; + real_t vb = b._data._float; r_dst = va + (vb - va) * c; } return; @@ -3603,14 +4223,51 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & r_dst = reinterpret_cast<const Vector2 *>(a._data._mem)->linear_interpolate(*reinterpret_cast<const Vector2 *>(b._data._mem), c); } return; + case VECTOR2I: { + int32_t vax = reinterpret_cast<const Vector2i *>(a._data._mem)->x; + int32_t vbx = reinterpret_cast<const Vector2i *>(b._data._mem)->x; + int32_t vay = reinterpret_cast<const Vector2i *>(a._data._mem)->y; + int32_t vby = reinterpret_cast<const Vector2i *>(b._data._mem)->y; + r_dst = Vector2i(int32_t(vax + vbx * c + 0.5), int32_t(vay + vby * c + 0.5)); + } + return; + case RECT2: { r_dst = Rect2(reinterpret_cast<const Rect2 *>(a._data._mem)->position.linear_interpolate(reinterpret_cast<const Rect2 *>(b._data._mem)->position, c), reinterpret_cast<const Rect2 *>(a._data._mem)->size.linear_interpolate(reinterpret_cast<const Rect2 *>(b._data._mem)->size, c)); } return; + case RECT2I: { + const Rect2i *ra = reinterpret_cast<const Rect2i *>(a._data._mem); + const Rect2i *rb = reinterpret_cast<const Rect2i *>(b._data._mem); + + int32_t vax = ra->position.x; + int32_t vay = ra->position.y; + int32_t vbx = ra->size.x; + int32_t vby = ra->size.y; + int32_t vcx = rb->position.x; + int32_t vcy = rb->position.y; + int32_t vdx = rb->size.x; + int32_t vdy = rb->size.y; + + r_dst = Rect2i(int32_t(vax + vbx * c + 0.5), int32_t(vay + vby * c + 0.5), int32_t(vcx + vdx * c + 0.5), int32_t(vcy + vdy * c + 0.5)); + } + return; + case VECTOR3: { r_dst = reinterpret_cast<const Vector3 *>(a._data._mem)->linear_interpolate(*reinterpret_cast<const Vector3 *>(b._data._mem), c); } return; + case VECTOR3I: { + int32_t vax = reinterpret_cast<const Vector3i *>(a._data._mem)->x; + int32_t vbx = reinterpret_cast<const Vector3i *>(b._data._mem)->x; + int32_t vay = reinterpret_cast<const Vector3i *>(a._data._mem)->y; + int32_t vby = reinterpret_cast<const Vector3i *>(b._data._mem)->y; + int32_t vaz = reinterpret_cast<const Vector3i *>(a._data._mem)->z; + int32_t vbz = reinterpret_cast<const Vector3i *>(b._data._mem)->z; + r_dst = Vector3i(int32_t(vax + vbx * c + 0.5), int32_t(vay + vby * c + 0.5), int32_t(vaz + vbz * c + 0.5)); + } + return; + case TRANSFORM2D: { r_dst = a._data._transform2d->interpolate_with(*b._data._transform2d, c); } @@ -3639,6 +4296,10 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & r_dst = reinterpret_cast<const Color *>(a._data._mem)->linear_interpolate(*reinterpret_cast<const Color *>(b._data._mem), c); } return; + case STRING_NAME: { + r_dst = a; + } + return; case NODE_PATH: { r_dst = a; } @@ -3662,21 +4323,73 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & r_dst = a; } return; - case PACKED_INT_ARRAY: { - const Vector<int> *arr_a = reinterpret_cast<const Vector<int> *>(a._data._mem); - const Vector<int> *arr_b = reinterpret_cast<const Vector<int> *>(b._data._mem); + case PACKED_INT32_ARRAY: { + const Vector<int32_t> *arr_a = &PackedArrayRef<int32_t>::get_array(a._data.packed_array); + const Vector<int32_t> *arr_b = &PackedArrayRef<int32_t>::get_array(b._data.packed_array); + int32_t sz = arr_a->size(); + if (sz == 0 || arr_b->size() != sz) { + + r_dst = a; + } else { + + Vector<int32_t> v; + v.resize(sz); + { + int32_t *vw = v.ptrw(); + const int32_t *ar = arr_a->ptr(); + const int32_t *br = arr_b->ptr(); + + Variant va; + for (int32_t i = 0; i < sz; i++) { + Variant::interpolate(ar[i], br[i], c, va); + vw[i] = va; + } + } + r_dst = v; + } + } + return; + case PACKED_INT64_ARRAY: { + const Vector<int64_t> *arr_a = &PackedArrayRef<int64_t>::get_array(a._data.packed_array); + const Vector<int64_t> *arr_b = &PackedArrayRef<int64_t>::get_array(b._data.packed_array); + int64_t sz = arr_a->size(); + if (sz == 0 || arr_b->size() != sz) { + + r_dst = a; + } else { + + Vector<int64_t> v; + v.resize(sz); + { + int64_t *vw = v.ptrw(); + const int64_t *ar = arr_a->ptr(); + const int64_t *br = arr_b->ptr(); + + Variant va; + for (int64_t i = 0; i < sz; i++) { + Variant::interpolate(ar[i], br[i], c, va); + vw[i] = va; + } + } + r_dst = v; + } + } + return; + case PACKED_FLOAT32_ARRAY: { + const Vector<float> *arr_a = &PackedArrayRef<float>::get_array(a._data.packed_array); + const Vector<float> *arr_b = &PackedArrayRef<float>::get_array(b._data.packed_array); int sz = arr_a->size(); if (sz == 0 || arr_b->size() != sz) { r_dst = a; } else { - Vector<int> v; + Vector<float> v; v.resize(sz); { - int *vw = v.ptrw(); - const int *ar = arr_a->ptr(); - const int *br = arr_b->ptr(); + float *vw = v.ptrw(); + const float *ar = arr_a->ptr(); + const float *br = arr_b->ptr(); Variant va; for (int i = 0; i < sz; i++) { @@ -3688,21 +4401,21 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & } } return; - case PACKED_REAL_ARRAY: { - const Vector<real_t> *arr_a = reinterpret_cast<const Vector<real_t> *>(a._data._mem); - const Vector<real_t> *arr_b = reinterpret_cast<const Vector<real_t> *>(b._data._mem); + case PACKED_FLOAT64_ARRAY: { + const Vector<double> *arr_a = &PackedArrayRef<double>::get_array(a._data.packed_array); + const Vector<double> *arr_b = &PackedArrayRef<double>::get_array(b._data.packed_array); int sz = arr_a->size(); if (sz == 0 || arr_b->size() != sz) { r_dst = a; } else { - Vector<real_t> v; + Vector<double> v; v.resize(sz); { - real_t *vw = v.ptrw(); - const real_t *ar = arr_a->ptr(); - const real_t *br = arr_b->ptr(); + double *vw = v.ptrw(); + const double *ar = arr_a->ptr(); + const double *br = arr_b->ptr(); Variant va; for (int i = 0; i < sz; i++) { @@ -3719,8 +4432,8 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & } return; case PACKED_VECTOR2_ARRAY: { - const Vector<Vector2> *arr_a = reinterpret_cast<const Vector<Vector2> *>(a._data._mem); - const Vector<Vector2> *arr_b = reinterpret_cast<const Vector<Vector2> *>(b._data._mem); + const Vector<Vector2> *arr_a = &PackedArrayRef<Vector2>::get_array(a._data.packed_array); + const Vector<Vector2> *arr_b = &PackedArrayRef<Vector2>::get_array(b._data.packed_array); int sz = arr_a->size(); if (sz == 0 || arr_b->size() != sz) { @@ -3744,8 +4457,8 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & return; case PACKED_VECTOR3_ARRAY: { - const Vector<Vector3> *arr_a = reinterpret_cast<const Vector<Vector3> *>(a._data._mem); - const Vector<Vector3> *arr_b = reinterpret_cast<const Vector<Vector3> *>(b._data._mem); + const Vector<Vector3> *arr_a = &PackedArrayRef<Vector3>::get_array(a._data.packed_array); + const Vector<Vector3> *arr_b = &PackedArrayRef<Vector3>::get_array(b._data.packed_array); int sz = arr_a->size(); if (sz == 0 || arr_b->size() != sz) { @@ -3768,8 +4481,8 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & } return; case PACKED_COLOR_ARRAY: { - const Vector<Color> *arr_a = reinterpret_cast<const Vector<Color> *>(a._data._mem); - const Vector<Color> *arr_b = reinterpret_cast<const Vector<Color> *>(b._data._mem); + const Vector<Color> *arr_a = &PackedArrayRef<Color>::get_array(a._data.packed_array); + const Vector<Color> *arr_b = &PackedArrayRef<Color>::get_array(b._data.packed_array); int sz = arr_a->size(); if (sz == 0 || arr_b->size() != sz) { diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index f036e00ed5..12fd9976bd 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -81,6 +81,7 @@ const char *VariantParser::tk_name[TK_MAX] = { "')'", "identifier", "string", + "string_name", "number", "color", "':'", @@ -93,6 +94,8 @@ const char *VariantParser::tk_name[TK_MAX] = { Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, String &r_err_str) { + bool string_name = false; + while (true) { CharType cchar; @@ -204,6 +207,17 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri r_token.type = TK_COLOR; return OK; }; + case '@': { + cchar = p_stream->get_char(); + if (cchar != '"') { + r_err_str = "Expected '\"' after '@'"; + r_token.type = TK_ERROR; + return ERR_PARSE_ERROR; + } + + string_name = true; + [[fallthrough]]; + } case '"': { String str; @@ -285,8 +299,14 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri if (p_stream->is_utf8()) { str.parse_utf8(str.ascii(true).get_data()); } - r_token.type = TK_STRING; - r_token.value = str; + if (string_name) { + r_token.type = TK_STRING_NAME; + r_token.value = StringName(str); + string_name = false; //reset + } else { + r_token.type = TK_STRING; + r_token.value = str; + } return OK; } break; @@ -525,6 +545,19 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, value = Vector2(args[0], args[1]); return OK; + } else if (id == "Vector2i") { + + Vector<int32_t> args; + Error err = _parse_construct<int32_t>(p_stream, args, line, r_err_str); + if (err) + return err; + + if (args.size() != 2) { + r_err_str = "Expected 2 arguments for constructor"; + } + + value = Vector2i(args[0], args[1]); + return OK; } else if (id == "Rect2") { Vector<float> args; @@ -538,6 +571,19 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, value = Rect2(args[0], args[1], args[2], args[3]); return OK; + } else if (id == "Rect2i") { + + Vector<int32_t> args; + Error err = _parse_construct<int32_t>(p_stream, args, line, r_err_str); + if (err) + return err; + + if (args.size() != 4) { + r_err_str = "Expected 4 arguments for constructor"; + } + + value = Rect2i(args[0], args[1], args[2], args[3]); + return OK; } else if (id == "Vector3") { Vector<float> args; @@ -551,6 +597,19 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, value = Vector3(args[0], args[1], args[2]); return OK; + } else if (id == "Vector3i") { + + Vector<int32_t> args; + Error err = _parse_construct<int32_t>(p_stream, args, line, r_err_str); + if (err) + return err; + + if (args.size() != 3) { + r_err_str = "Expected 3 arguments for constructor"; + } + + value = Vector3i(args[0], args[1], args[2]); + return OK; } else if (id == "Transform2D" || id == "Matrix32") { //compatibility Vector<float> args; @@ -882,20 +941,20 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, return OK; - } else if (id == "PackedIntArray" || id == "PoolIntArray" || id == "IntArray") { + } else if (id == "PackedInt32Array" || id == "PackedIntArray" || id == "PoolIntArray" || id == "IntArray") { - Vector<int> args; - Error err = _parse_construct<int>(p_stream, args, line, r_err_str); + Vector<int32_t> args; + Error err = _parse_construct<int32_t>(p_stream, args, line, r_err_str); if (err) return err; - Vector<int> arr; + Vector<int32_t> arr; { - int len = args.size(); + int32_t len = args.size(); arr.resize(len); - int *w = arr.ptrw(); - for (int i = 0; i < len; i++) { - w[i] = int(args[i]); + int32_t *w = arr.ptrw(); + for (int32_t i = 0; i < len; i++) { + w[i] = int32_t(args[i]); } } @@ -903,7 +962,28 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, return OK; - } else if (id == "PackedRealArray" || id == "PoolRealArray" || id == "FloatArray") { + } else if (id == "PackedInt64Array") { + + Vector<int64_t> args; + Error err = _parse_construct<int64_t>(p_stream, args, line, r_err_str); + if (err) + return err; + + Vector<int64_t> arr; + { + int64_t len = args.size(); + arr.resize(len); + int64_t *w = arr.ptrw(); + for (int64_t i = 0; i < len; i++) { + w[i] = int64_t(args[i]); + } + } + + value = arr; + + return OK; + + } else if (id == "PackedFloat32Array" || id == "PackedRealArray" || id == "PoolRealArray" || id == "FloatArray") { Vector<float> args; Error err = _parse_construct<float>(p_stream, args, line, r_err_str); @@ -923,6 +1003,26 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, value = arr; return OK; + } else if (id == "PackedFloat64Array") { + + Vector<double> args; + Error err = _parse_construct<double>(p_stream, args, line, r_err_str); + if (err) + return err; + + Vector<double> arr; + { + int len = args.size(); + arr.resize(len); + double *w = arr.ptrw(); + for (int i = 0; i < len; i++) { + w[i] = args[i]; + } + } + + value = arr; + + return OK; } else if (id == "PackedStringArray" || id == "PoolStringArray" || id == "StringArray") { get_token(p_stream, token, line, r_err_str); @@ -1051,6 +1151,10 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, value = token.value; return OK; + } else if (token.type == TK_STRING_NAME) { + + value = token.value; + return OK; } else if (token.type == TK_COLOR) { value = token.value; @@ -1392,7 +1496,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, itos(p_variant.operator int64_t())); } break; - case Variant::REAL: { + case Variant::FLOAT: { String s = rtosfix(p_variant.operator real_t()); if (s.find(".") == -1 && s.find("e") == -1) @@ -1411,17 +1515,33 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str Vector2 v = p_variant; p_store_string_func(p_store_string_ud, "Vector2( " + rtosfix(v.x) + ", " + rtosfix(v.y) + " )"); } break; + case Variant::VECTOR2I: { + + Vector2i v = p_variant; + p_store_string_func(p_store_string_ud, "Vector2i( " + itos(v.x) + ", " + itos(v.y) + " )"); + } break; case Variant::RECT2: { Rect2 aabb = p_variant; p_store_string_func(p_store_string_ud, "Rect2( " + rtosfix(aabb.position.x) + ", " + rtosfix(aabb.position.y) + ", " + rtosfix(aabb.size.x) + ", " + rtosfix(aabb.size.y) + " )"); } break; + case Variant::RECT2I: { + + Rect2i aabb = p_variant; + p_store_string_func(p_store_string_ud, "Rect2i( " + itos(aabb.position.x) + ", " + itos(aabb.position.y) + ", " + itos(aabb.size.x) + ", " + itos(aabb.size.y) + " )"); + + } break; case Variant::VECTOR3: { Vector3 v = p_variant; p_store_string_func(p_store_string_ud, "Vector3( " + rtosfix(v.x) + ", " + rtosfix(v.y) + ", " + rtosfix(v.z) + " )"); } break; + case Variant::VECTOR3I: { + + Vector3i v = p_variant; + p_store_string_func(p_store_string_ud, "Vector3i( " + itos(v.x) + ", " + itos(v.y) + ", " + itos(v.z) + " )"); + } break; case Variant::PLANE: { Plane p = p_variant; @@ -1498,6 +1618,14 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, "Color( " + rtosfix(c.r) + ", " + rtosfix(c.g) + ", " + rtosfix(c.b) + ", " + rtosfix(c.a) + " )"); } break; + case Variant::STRING_NAME: { + + String str = p_variant; + + str = "@\"" + str.c_escape() + "\""; + p_store_string_func(p_store_string_ud, str); + + } break; case Variant::NODE_PATH: { String str = p_variant; @@ -1628,14 +1756,32 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, " )"); } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedIntArray( "); - Vector<int> data = p_variant; - int len = data.size(); - const int *ptr = data.ptr(); + p_store_string_func(p_store_string_ud, "PackedInt32Array( "); + Vector<int32_t> data = p_variant; + int32_t len = data.size(); + const int32_t *ptr = data.ptr(); - for (int i = 0; i < len; i++) { + for (int32_t i = 0; i < len; i++) { + + if (i > 0) + p_store_string_func(p_store_string_ud, ", "); + + p_store_string_func(p_store_string_ud, itos(ptr[i])); + } + + p_store_string_func(p_store_string_ud, " )"); + + } break; + case Variant::PACKED_INT64_ARRAY: { + + p_store_string_func(p_store_string_ud, "PackedInt64Array( "); + Vector<int64_t> data = p_variant; + int64_t len = data.size(); + const int64_t *ptr = data.ptr(); + + for (int64_t i = 0; i < len; i++) { if (i > 0) p_store_string_func(p_store_string_ud, ", "); @@ -1646,12 +1792,29 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud, " )"); } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_FLOAT32_ARRAY: { + + p_store_string_func(p_store_string_ud, "PackedFloat32Array( "); + Vector<float> data = p_variant; + int len = data.size(); + const float *ptr = data.ptr(); + + for (int i = 0; i < len; i++) { + + if (i > 0) + p_store_string_func(p_store_string_ud, ", "); + p_store_string_func(p_store_string_ud, rtosfix(ptr[i])); + } + + p_store_string_func(p_store_string_ud, " )"); + + } break; + case Variant::PACKED_FLOAT64_ARRAY: { - p_store_string_func(p_store_string_ud, "PackedRealArray( "); - Vector<real_t> data = p_variant; + p_store_string_func(p_store_string_ud, "PackedFloat64Array( "); + Vector<double> data = p_variant; int len = data.size(); - const real_t *ptr = data.ptr(); + const double *ptr = data.ptr(); for (int i = 0; i < len; i++) { diff --git a/core/variant_parser.h b/core/variant_parser.h index 89db3ada0d..ad0a4d6682 100644 --- a/core/variant_parser.h +++ b/core/variant_parser.h @@ -92,6 +92,7 @@ public: TK_PARENTHESIS_CLOSE, TK_IDENTIFIER, TK_STRING, + TK_STRING_NAME, TK_NUMBER, TK_COLOR, TK_COLON, diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 5899829e95..3d22c5c6ed 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -53,7 +53,7 @@ The [JavaScript] singleton. [b]Note:[/b] Only implemented on HTML5. </member> - <member name="Marshalls" type="Reference" setter="" getter=""> + <member name="Marshalls" type="Marshalls" setter="" getter=""> The [Marshalls] singleton. </member> <member name="Navigation2DServer" type="Navigation2DServer" setter="" getter=""> @@ -1480,70 +1480,94 @@ <constant name="TYPE_VECTOR2" value="5" enum="Variant.Type"> Variable is of type [Vector2]. </constant> - <constant name="TYPE_RECT2" value="6" enum="Variant.Type"> + <constant name="TYPE_VECTOR2I" value="6" enum="Variant.Type"> + Variable is of type [Vector2i]. + </constant> + <constant name="TYPE_RECT2" value="7" enum="Variant.Type"> Variable is of type [Rect2]. </constant> - <constant name="TYPE_VECTOR3" value="7" enum="Variant.Type"> + <constant name="TYPE_RECT2I" value="8" enum="Variant.Type"> + Variable is of type [Rect2i]. + </constant> + <constant name="TYPE_VECTOR3" value="9" enum="Variant.Type"> Variable is of type [Vector3]. </constant> - <constant name="TYPE_TRANSFORM2D" value="8" enum="Variant.Type"> + <constant name="TYPE_VECTOR3I" value="10" enum="Variant.Type"> + Variable is of type [Vector3i]. + </constant> + <constant name="TYPE_TRANSFORM2D" value="11" enum="Variant.Type"> Variable is of type [Transform2D]. </constant> - <constant name="TYPE_PLANE" value="9" enum="Variant.Type"> + <constant name="TYPE_PLANE" value="12" enum="Variant.Type"> Variable is of type [Plane]. </constant> - <constant name="TYPE_QUAT" value="10" enum="Variant.Type"> + <constant name="TYPE_QUAT" value="13" enum="Variant.Type"> Variable is of type [Quat]. </constant> - <constant name="TYPE_AABB" value="11" enum="Variant.Type"> + <constant name="TYPE_AABB" value="14" enum="Variant.Type"> Variable is of type [AABB]. </constant> - <constant name="TYPE_BASIS" value="12" enum="Variant.Type"> + <constant name="TYPE_BASIS" value="15" enum="Variant.Type"> Variable is of type [Basis]. </constant> - <constant name="TYPE_TRANSFORM" value="13" enum="Variant.Type"> + <constant name="TYPE_TRANSFORM" value="16" enum="Variant.Type"> Variable is of type [Transform]. </constant> - <constant name="TYPE_COLOR" value="14" enum="Variant.Type"> + <constant name="TYPE_COLOR" value="17" enum="Variant.Type"> Variable is of type [Color]. </constant> - <constant name="TYPE_NODE_PATH" value="15" enum="Variant.Type"> + <constant name="TYPE_STRING_NAME" value="18" enum="Variant.Type"> + Variable is of type [StringName]. + </constant> + <constant name="TYPE_NODE_PATH" value="19" enum="Variant.Type"> Variable is of type [NodePath]. </constant> - <constant name="TYPE_RID" value="16" enum="Variant.Type"> + <constant name="TYPE_RID" value="20" enum="Variant.Type"> Variable is of type [RID]. </constant> - <constant name="TYPE_OBJECT" value="17" enum="Variant.Type"> + <constant name="TYPE_OBJECT" value="21" enum="Variant.Type"> Variable is of type [Object]. </constant> - <constant name="TYPE_DICTIONARY" value="18" enum="Variant.Type"> + <constant name="TYPE_CALLABLE" value="22" enum="Variant.Type"> + Variable is of type [Callable]. + </constant> + <constant name="TYPE_SIGNAL" value="23" enum="Variant.Type"> + Variable is of type [Signal]. + </constant> + <constant name="TYPE_DICTIONARY" value="24" enum="Variant.Type"> Variable is of type [Dictionary]. </constant> - <constant name="TYPE_ARRAY" value="19" enum="Variant.Type"> + <constant name="TYPE_ARRAY" value="25" enum="Variant.Type"> Variable is of type [Array]. </constant> - <constant name="TYPE_RAW_ARRAY" value="20" enum="Variant.Type"> + <constant name="TYPE_RAW_ARRAY" value="26" enum="Variant.Type"> Variable is of type [PackedByteArray]. </constant> - <constant name="TYPE_INT_ARRAY" value="21" enum="Variant.Type"> - Variable is of type [PackedIntArray]. + <constant name="TYPE_INT32_ARRAY" value="27" enum="Variant.Type"> + Variable is of type [PackedInt32Array]. + </constant> + <constant name="TYPE_INT64_ARRAY" value="28" enum="Variant.Type"> + Variable is of type [PackedInt64Array]. + </constant> + <constant name="TYPE_FLOAT32_ARRAY" value="29" enum="Variant.Type"> + Variable is of type [PackedFloat32Array]. </constant> - <constant name="TYPE_REAL_ARRAY" value="22" enum="Variant.Type"> - Variable is of type [PackedRealArray]. + <constant name="TYPE_FLOAT64_ARRAY" value="30" enum="Variant.Type"> + Variable is of type [PackedFloat64Array]. </constant> - <constant name="TYPE_STRING_ARRAY" value="23" enum="Variant.Type"> + <constant name="TYPE_STRING_ARRAY" value="31" enum="Variant.Type"> Variable is of type [PackedStringArray]. </constant> - <constant name="TYPE_VECTOR2_ARRAY" value="24" enum="Variant.Type"> + <constant name="TYPE_VECTOR2_ARRAY" value="32" enum="Variant.Type"> Variable is of type [PackedVector2Array]. </constant> - <constant name="TYPE_VECTOR3_ARRAY" value="25" enum="Variant.Type"> + <constant name="TYPE_VECTOR3_ARRAY" value="33" enum="Variant.Type"> Variable is of type [PackedVector3Array]. </constant> - <constant name="TYPE_COLOR_ARRAY" value="26" enum="Variant.Type"> + <constant name="TYPE_COLOR_ARRAY" value="34" enum="Variant.Type"> Variable is of type [PackedColorArray]. </constant> - <constant name="TYPE_MAX" value="27" enum="Variant.Type"> + <constant name="TYPE_MAX" value="35" enum="Variant.Type"> Represents the size of the [enum Variant.Type] enum. </constant> <constant name="OP_EQUAL" value="0" enum="Variant.Operator"> diff --git a/doc/classes/ARVRInterface.xml b/doc/classes/ARVRInterface.xml index d9757ad023..0727bda668 100644 --- a/doc/classes/ARVRInterface.xml +++ b/doc/classes/ARVRInterface.xml @@ -26,7 +26,7 @@ </description> </method> <method name="get_name" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <description> Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc). diff --git a/doc/classes/ARVRPositionalTracker.xml b/doc/classes/ARVRPositionalTracker.xml index a151f8d652..9225717978 100644 --- a/doc/classes/ARVRPositionalTracker.xml +++ b/doc/classes/ARVRPositionalTracker.xml @@ -34,7 +34,7 @@ </description> </method> <method name="get_name" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <description> Returns the controller or anchor point's name if available. diff --git a/doc/classes/ARVRServer.xml b/doc/classes/ARVRServer.xml index 6f0e4488fa..6db7121858 100644 --- a/doc/classes/ARVRServer.xml +++ b/doc/classes/ARVRServer.xml @@ -120,21 +120,21 @@ </members> <signals> <signal name="interface_added"> - <argument index="0" name="interface_name" type="String"> + <argument index="0" name="interface_name" type="StringName"> </argument> <description> Emitted when a new interface has been added. </description> </signal> <signal name="interface_removed"> - <argument index="0" name="interface_name" type="String"> + <argument index="0" name="interface_name" type="StringName"> </argument> <description> Emitted when an interface is removed. </description> </signal> <signal name="tracker_added"> - <argument index="0" name="tracker_name" type="String"> + <argument index="0" name="tracker_name" type="StringName"> </argument> <argument index="1" name="type" type="int"> </argument> @@ -145,7 +145,7 @@ </description> </signal> <signal name="tracker_removed"> - <argument index="0" name="tracker_name" type="String"> + <argument index="0" name="tracker_name" type="StringName"> </argument> <argument index="1" name="type" type="int"> </argument> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index d175aa6f45..e930abba87 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -152,7 +152,7 @@ </description> </method> <method name="get_id_path"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="from_id" type="int"> </argument> @@ -185,7 +185,7 @@ </description> </method> <method name="get_point_connections"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="id" type="int"> </argument> diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index af1fb3e273..2639f62552 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -111,7 +111,7 @@ </description> </method> <method name="get_id_path"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="from_id" type="int"> </argument> @@ -144,7 +144,7 @@ </description> </method> <method name="get_point_connections"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="id" type="int"> </argument> diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index b0b9c155bb..01540383dc 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -76,7 +76,7 @@ </description> </signal> <signal name="custom_action"> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Emitted when a custom button is pressed. See [method add_button]. diff --git a/doc/classes/AnimatedSprite.xml b/doc/classes/AnimatedSprite.xml index 3caad10f6d..03c23b6fdd 100644 --- a/doc/classes/AnimatedSprite.xml +++ b/doc/classes/AnimatedSprite.xml @@ -19,7 +19,7 @@ <method name="play"> <return type="void"> </return> - <argument index="0" name="anim" type="String" default=""""> + <argument index="0" name="anim" type="StringName" default="@"""> </argument> <argument index="1" name="backwards" type="bool" default="false"> </argument> @@ -36,7 +36,7 @@ </method> </methods> <members> - <member name="animation" type="String" setter="set_animation" getter="get_animation" default=""default""> + <member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="@"default""> The current animation from the [code]frames[/code] resource. If this value changes, the [code]frame[/code] counter is reset. </member> <member name="centered" type="bool" setter="set_centered" getter="is_centered" default="true"> diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml index e24119c6c7..ad9706a52a 100644 --- a/doc/classes/AnimatedSprite3D.xml +++ b/doc/classes/AnimatedSprite3D.xml @@ -19,7 +19,7 @@ <method name="play"> <return type="void"> </return> - <argument index="0" name="anim" type="String" default=""""> + <argument index="0" name="anim" type="StringName" default="@"""> </argument> <description> Plays the animation named [code]anim[/code]. If no [code]anim[/code] is provided, the current animation is played. @@ -34,7 +34,7 @@ </method> </methods> <members> - <member name="animation" type="String" setter="set_animation" getter="get_animation" default=""default""> + <member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="@"default""> The current animation from the [code]frames[/code] resource. If this value changes, the [code]frame[/code] counter is reset. </member> <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 46b0b952b6..0926ef9855 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -32,7 +32,7 @@ </description> </method> <method name="animation_track_get_key_animation" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="track_idx" type="int"> </argument> @@ -48,7 +48,7 @@ </argument> <argument index="1" name="time" type="float"> </argument> - <argument index="2" name="animation" type="String"> + <argument index="2" name="animation" type="StringName"> </argument> <description> </description> @@ -60,7 +60,7 @@ </argument> <argument index="1" name="key_idx" type="int"> </argument> - <argument index="2" name="animation" type="String"> + <argument index="2" name="animation" type="StringName"> </argument> <description> </description> @@ -274,7 +274,7 @@ </description> </method> <method name="method_track_get_key_indices" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="track_idx" type="int"> </argument> @@ -287,7 +287,7 @@ </description> </method> <method name="method_track_get_name" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="track_idx" type="int"> </argument> @@ -627,7 +627,7 @@ </description> </method> <method name="value_track_get_key_indices" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="track_idx" type="int"> </argument> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 331a30bd9e..3d6ebd5934 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -23,7 +23,7 @@ <method name="blend_animation"> <return type="void"> </return> - <argument index="0" name="animation" type="String"> + <argument index="0" name="animation" type="StringName"> </argument> <argument index="1" name="time" type="float"> </argument> @@ -59,7 +59,7 @@ <method name="blend_node"> <return type="float"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="node" type="AnimationNode"> </argument> @@ -119,7 +119,7 @@ <method name="get_parameter" qualifiers="const"> <return type="Variant"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. @@ -128,7 +128,7 @@ <method name="get_parameter_default_value" qualifiers="virtual"> <return type="Variant"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. @@ -142,7 +142,7 @@ </description> </method> <method name="has_filter" qualifiers="virtual"> - <return type="String"> + <return type="bool"> </return> <description> Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node. @@ -193,7 +193,7 @@ <method name="set_parameter"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml index 369969a2d4..ab44148c15 100644 --- a/doc/classes/AnimationNodeAnimation.xml +++ b/doc/classes/AnimationNodeAnimation.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="animation" type="String" setter="set_animation" getter="get_animation" default=""""> + <member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="@"""> Animation to use as an output. It is one of the animations provided by [member AnimationTree.anim_player]. </member> </members> diff --git a/doc/classes/AnimationNodeBlendTree.xml b/doc/classes/AnimationNodeBlendTree.xml index 5a86af6865..0befb79577 100644 --- a/doc/classes/AnimationNodeBlendTree.xml +++ b/doc/classes/AnimationNodeBlendTree.xml @@ -11,7 +11,7 @@ <method name="add_node"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="node" type="AnimationNode"> </argument> @@ -23,11 +23,11 @@ <method name="connect_node"> <return type="void"> </return> - <argument index="0" name="input_node" type="String"> + <argument index="0" name="input_node" type="StringName"> </argument> <argument index="1" name="input_index" type="int"> </argument> - <argument index="2" name="output_node" type="String"> + <argument index="2" name="output_node" type="StringName"> </argument> <description> </description> @@ -35,7 +35,7 @@ <method name="disconnect_node"> <return type="void"> </return> - <argument index="0" name="input_node" type="String"> + <argument index="0" name="input_node" type="StringName"> </argument> <argument index="1" name="input_index" type="int"> </argument> @@ -45,7 +45,7 @@ <method name="get_node" qualifiers="const"> <return type="AnimationNode"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> </description> @@ -53,7 +53,7 @@ <method name="get_node_position" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> </description> @@ -61,7 +61,7 @@ <method name="has_node" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> </description> @@ -69,7 +69,7 @@ <method name="remove_node"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> </description> @@ -77,9 +77,9 @@ <method name="rename_node"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="new_name" type="String"> + <argument index="1" name="new_name" type="StringName"> </argument> <description> </description> @@ -87,7 +87,7 @@ <method name="set_node_position"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="position" type="Vector2"> </argument> diff --git a/doc/classes/AnimationNodeStateMachine.xml b/doc/classes/AnimationNodeStateMachine.xml index 39a9af5ead..b647ff70b8 100644 --- a/doc/classes/AnimationNodeStateMachine.xml +++ b/doc/classes/AnimationNodeStateMachine.xml @@ -18,7 +18,7 @@ <method name="add_node"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="node" type="AnimationNode"> </argument> @@ -31,9 +31,9 @@ <method name="add_transition"> <return type="void"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> - <argument index="1" name="to" type="String"> + <argument index="1" name="to" type="StringName"> </argument> <argument index="2" name="transition" type="AnimationNodeStateMachineTransition"> </argument> @@ -58,14 +58,14 @@ <method name="get_node" qualifiers="const"> <return type="AnimationNode"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns the animation node with the given name. </description> </method> <method name="get_node_name" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="node" type="AnimationNode"> </argument> @@ -76,7 +76,7 @@ <method name="get_node_position" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns the given node's coordinates. Used for display in the editor. @@ -106,7 +106,7 @@ </description> </method> <method name="get_transition_from" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -115,7 +115,7 @@ </description> </method> <method name="get_transition_to" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -126,7 +126,7 @@ <method name="has_node" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if the graph contains the given node. @@ -135,9 +135,9 @@ <method name="has_transition" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> - <argument index="1" name="to" type="String"> + <argument index="1" name="to" type="StringName"> </argument> <description> Returns [code]true[/code] if there is a transition between the given nodes. @@ -146,7 +146,7 @@ <method name="remove_node"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Deletes the given node from the graph. @@ -155,9 +155,9 @@ <method name="remove_transition"> <return type="void"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> - <argument index="1" name="to" type="String"> + <argument index="1" name="to" type="StringName"> </argument> <description> Deletes the transition between the two specified nodes. @@ -175,9 +175,9 @@ <method name="rename_node"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="new_name" type="String"> + <argument index="1" name="new_name" type="StringName"> </argument> <description> Renames the given node. @@ -186,7 +186,7 @@ <method name="set_end_node"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Sets the given node as the graph end point. @@ -204,7 +204,7 @@ <method name="set_node_position"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="position" type="Vector2"> </argument> @@ -215,7 +215,7 @@ <method name="set_start_node"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Sets the given node as the graph start point. diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml index b75ff04329..f4b89a5086 100644 --- a/doc/classes/AnimationNodeStateMachinePlayback.xml +++ b/doc/classes/AnimationNodeStateMachinePlayback.xml @@ -16,7 +16,7 @@ </tutorials> <methods> <method name="get_current_node" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <description> Returns the currently playing animation state. @@ -39,7 +39,7 @@ <method name="start"> <return type="void"> </return> - <argument index="0" name="node" type="String"> + <argument index="0" name="node" type="StringName"> </argument> <description> Starts playing the given animation. @@ -55,7 +55,7 @@ <method name="travel"> <return type="void"> </return> - <argument index="0" name="to_node" type="String"> + <argument index="0" name="to_node" type="StringName"> </argument> <description> Transitions from the current state to another one, following the shortest path. diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml index d40a6f1e46..f0b7cc4099 100644 --- a/doc/classes/AnimationNodeStateMachineTransition.xml +++ b/doc/classes/AnimationNodeStateMachineTransition.xml @@ -10,7 +10,7 @@ <methods> </methods> <members> - <member name="advance_condition" type="String" setter="set_advance_condition" getter="get_advance_condition" default=""""> + <member name="advance_condition" type="StringName" setter="set_advance_condition" getter="get_advance_condition" default="@"""> Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree] that can be controlled from code (see [url=https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#controlling-from-code][/url]). For example, if [member AnimationTree.tree_root] is an [AnimationNodeStateMachine] and [member advance_condition] is set to [code]"idle"[/code]: [codeblock] $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0) diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index cedfca4c31..1420b1bf64 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -16,7 +16,7 @@ <method name="add_animation"> <return type="int" enum="Error"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="animation" type="Animation"> </argument> @@ -34,9 +34,9 @@ </description> </method> <method name="animation_get_next" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> - <argument index="0" name="anim_from" type="String"> + <argument index="0" name="anim_from" type="StringName"> </argument> <description> Returns the name of the next animation in the queue. @@ -45,9 +45,9 @@ <method name="animation_set_next"> <return type="void"> </return> - <argument index="0" name="anim_from" type="String"> + <argument index="0" name="anim_from" type="StringName"> </argument> - <argument index="1" name="anim_to" type="String"> + <argument index="1" name="anim_to" type="StringName"> </argument> <description> Triggers the [code]anim_to[/code] animation when the [code]anim_from[/code] animation completes. @@ -68,7 +68,7 @@ </description> </method> <method name="find_animation" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="animation" type="Animation"> </argument> @@ -79,7 +79,7 @@ <method name="get_animation" qualifiers="const"> <return type="Animation"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns the [Animation] with key [code]name[/code] or [code]null[/code] if not found. @@ -95,9 +95,9 @@ <method name="get_blend_time" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="anim_from" type="String"> + <argument index="0" name="anim_from" type="StringName"> </argument> - <argument index="1" name="anim_to" type="String"> + <argument index="1" name="anim_to" type="StringName"> </argument> <description> Gets the blend time (in seconds) between two animations, referenced by their names. @@ -120,7 +120,7 @@ <method name="has_animation" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if the [AnimationPlayer] stores an [Animation] with key [code]name[/code]. @@ -136,7 +136,7 @@ <method name="play"> <return type="void"> </return> - <argument index="0" name="name" type="String" default=""""> + <argument index="0" name="name" type="StringName" default=""""> </argument> <argument index="1" name="custom_blend" type="float" default="-1"> </argument> @@ -153,7 +153,7 @@ <method name="play_backwards"> <return type="void"> </return> - <argument index="0" name="name" type="String" default=""""> + <argument index="0" name="name" type="StringName" default=""""> </argument> <argument index="1" name="custom_blend" type="float" default="-1"> </argument> @@ -165,7 +165,7 @@ <method name="queue"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Queues an animation for playback once the current one is done. @@ -175,7 +175,7 @@ <method name="remove_animation"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Removes the animation with key [code]name[/code]. @@ -184,9 +184,9 @@ <method name="rename_animation"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="newname" type="String"> + <argument index="1" name="newname" type="StringName"> </argument> <description> Renames an existing animation with key [code]name[/code] to [code]newname[/code]. @@ -206,9 +206,9 @@ <method name="set_blend_time"> <return type="void"> </return> - <argument index="0" name="anim_from" type="String"> + <argument index="0" name="anim_from" type="StringName"> </argument> - <argument index="1" name="anim_to" type="String"> + <argument index="1" name="anim_to" type="StringName"> </argument> <argument index="2" name="sec" type="float"> </argument> @@ -264,23 +264,23 @@ </members> <signals> <signal name="animation_changed"> - <argument index="0" name="old_name" type="String"> + <argument index="0" name="old_name" type="StringName"> </argument> - <argument index="1" name="new_name" type="String"> + <argument index="1" name="new_name" type="StringName"> </argument> <description> If the currently being played animation changes, this signal will notify of such change. </description> </signal> <signal name="animation_finished"> - <argument index="0" name="anim_name" type="String"> + <argument index="0" name="anim_name" type="StringName"> </argument> <description> Notifies when an animation finished playing. </description> </signal> <signal name="animation_started"> - <argument index="0" name="anim_name" type="String"> + <argument index="0" name="anim_name" type="StringName"> </argument> <description> Notifies when an animation starts playing. diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml index f2f9284ae3..b273a7a9d9 100644 --- a/doc/classes/Area.xml +++ b/doc/classes/Area.xml @@ -89,7 +89,7 @@ <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="0.1"> The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping). </member> - <member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus" default=""Master""> + <member name="audio_bus_name" type="StringName" setter="set_audio_bus" getter="get_audio_bus" default="@"Master""> The name of the area's audio bus. </member> <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" default="false"> @@ -131,7 +131,7 @@ <member name="reverb_bus_enable" type="bool" setter="set_use_reverb_bus" getter="is_using_reverb_bus" default="false"> If [code]true[/code], the area applies reverb to its associated audio. </member> - <member name="reverb_bus_name" type="String" setter="set_reverb_bus" getter="get_reverb_bus" default=""Master""> + <member name="reverb_bus_name" type="StringName" setter="set_reverb_bus" getter="get_reverb_bus" default="@"Master""> The reverb bus name to use for this area's associated audio. </member> <member name="reverb_bus_uniformity" type="float" setter="set_reverb_uniformity" getter="get_reverb_uniformity" default="0.0"> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 715e9b3286..0c1317f19d 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -90,7 +90,7 @@ <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" default="1.0"> The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping). </member> - <member name="audio_bus_name" type="String" setter="set_audio_bus_name" getter="get_audio_bus_name" default=""Master""> + <member name="audio_bus_name" type="StringName" setter="set_audio_bus_name" getter="get_audio_bus_name" default="@"Master""> The name of the area's audio bus. </member> <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" default="false"> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 6c3e9e8fed..a294967fc9 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -58,19 +58,37 @@ <method name="Array"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedRealArray"> + <argument index="0" name="from" type="PackedFloat64Array"> </argument> <description> - Constructs an array from a [PackedRealArray]. + Constructs an array from a [PackedFloat64Array]. </description> </method> <method name="Array"> <return type="Array"> </return> - <argument index="0" name="from" type="PackedIntArray"> + <argument index="0" name="from" type="PackedFloat32Array"> </argument> <description> - Constructs an array from a [PackedIntArray]. + Constructs an array from a [PackedFloat32Array]. + </description> + </method> + <method name="Array"> + <return type="Array"> + </return> + <argument index="0" name="from" type="PackedInt64Array"> + </argument> + <description> + Constructs an array from a [PackedInt64Array]. + </description> + </method> + <method name="Array"> + <return type="Array"> + </return> + <argument index="0" name="from" type="PackedInt32Array"> + </argument> + <description> + Constructs an array from a [PackedInt32Array]. </description> </method> <method name="Array"> @@ -83,6 +101,8 @@ </description> </method> <method name="append"> + <return type="void"> + </return> <argument index="0" name="value" type="Variant"> </argument> <description> @@ -90,7 +110,7 @@ </description> </method> <method name="back"> - <return type="Variant"> + <return type="void"> </return> <description> Returns the last element of the array, or [code]null[/code] if the array is empty. @@ -125,6 +145,8 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clears the array. This is equivalent to using [method resize] with a size of [code]0[/code]. </description> @@ -156,6 +178,8 @@ </description> </method> <method name="erase"> + <return type="void"> + </return> <argument index="0" name="value" type="Variant"> </argument> <description> @@ -183,7 +207,7 @@ </description> </method> <method name="front"> - <return type="Variant"> + <return type="void"> </return> <description> Returns the first element of the array, or [code]null[/code] if the array is empty. @@ -212,6 +236,8 @@ </description> </method> <method name="insert"> + <return type="void"> + </return> <argument index="0" name="position" type="int"> </argument> <argument index="1" name="value" type="Variant"> @@ -221,39 +247,43 @@ </description> </method> <method name="invert"> + <return type="void"> + </return> <description> Reverses the order of the elements in the array. </description> </method> <method name="max"> - <return type="Variant"> + <return type="void"> </return> <description> Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. </description> </method> <method name="min"> - <return type="Variant"> + <return type="void"> </return> <description> Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. </description> </method> <method name="pop_back"> - <return type="Variant"> + <return type="void"> </return> <description> Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty. </description> </method> <method name="pop_front"> - <return type="Variant"> + <return type="void"> </return> <description> Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty. </description> </method> <method name="push_back"> + <return type="void"> + </return> <argument index="0" name="value" type="Variant"> </argument> <description> @@ -261,6 +291,8 @@ </description> </method> <method name="push_front"> + <return type="void"> + </return> <argument index="0" name="value" type="Variant"> </argument> <description> @@ -268,6 +300,8 @@ </description> </method> <method name="remove"> + <return type="void"> + </return> <argument index="0" name="position" type="int"> </argument> <description> @@ -275,6 +309,8 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="size" type="int"> </argument> <description> @@ -293,6 +329,8 @@ </description> </method> <method name="shuffle"> + <return type="void"> + </return> <description> Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GDScript.randi]. Call [method @GDScript.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling. </description> @@ -320,6 +358,8 @@ </description> </method> <method name="sort"> + <return type="void"> + </return> <description> Sorts the array. [b]Note:[/b] Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example: @@ -331,6 +371,8 @@ </description> </method> <method name="sort_custom"> + <return type="void"> + </return> <argument index="0" name="obj" type="Object"> </argument> <argument index="1" name="func" type="String"> diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index 857897dab4..33b62054df 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -30,7 +30,7 @@ <method name="add_blend_shape"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Adds name for a blend shape that will be added with [method add_surface_from_arrays]. Must be called before surface is added. @@ -80,7 +80,7 @@ </description> </method> <method name="get_blend_shape_name" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="index" type="int"> </argument> @@ -208,7 +208,7 @@ [PackedVector3Array] of vertex normals. </constant> <constant name="ARRAY_TANGENT" value="2" enum="ArrayType"> - [PackedRealArray] of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. + [PackedFloat32Array] of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. </constant> <constant name="ARRAY_COLOR" value="3" enum="ArrayType"> [PackedColorArray] of vertex colors. @@ -220,13 +220,13 @@ [PackedVector2Array] for second UV coordinates. </constant> <constant name="ARRAY_BONES" value="6" enum="ArrayType"> - [PackedRealArray] or [PackedIntArray] of bone indices. Each element in groups of 4 floats. + [PackedFloat32Array] or [PackedInt32Array] of bone indices. Each element in groups of 4 floats. </constant> <constant name="ARRAY_WEIGHTS" value="7" enum="ArrayType"> - [PackedRealArray] of bone weights. Each element in groups of 4 floats. + [PackedFloat32Array] of bone weights. Each element in groups of 4 floats. </constant> <constant name="ARRAY_INDEX" value="8" enum="ArrayType"> - [PackedIntArray] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. + [PackedInt32Array] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line. </constant> <constant name="ARRAY_MAX" value="9" enum="ArrayType"> diff --git a/doc/classes/AudioEffectCompressor.xml b/doc/classes/AudioEffectCompressor.xml index fe0d63777f..3117978d8a 100644 --- a/doc/classes/AudioEffectCompressor.xml +++ b/doc/classes/AudioEffectCompressor.xml @@ -32,7 +32,7 @@ <member name="release_ms" type="float" setter="set_release_ms" getter="get_release_ms" default="250.0"> Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000. </member> - <member name="sidechain" type="String" setter="set_sidechain" getter="get_sidechain" default=""""> + <member name="sidechain" type="StringName" setter="set_sidechain" getter="get_sidechain" default="@"""> Reduce the sound level using another audio bus for threshold detection. </member> <member name="threshold" type="float" setter="set_threshold" getter="get_threshold" default="0.0"> diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index 72acf616a9..49c6f5bb34 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -107,7 +107,7 @@ <method name="get_bus_index" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="bus_name" type="String"> + <argument index="0" name="bus_name" type="StringName"> </argument> <description> Returns the index of the bus with the name [code]bus_name[/code]. @@ -145,7 +145,7 @@ </description> </method> <method name="get_bus_send" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="bus_idx" type="int"> </argument> @@ -341,7 +341,7 @@ </return> <argument index="0" name="bus_idx" type="int"> </argument> - <argument index="1" name="send" type="String"> + <argument index="1" name="send" type="StringName"> </argument> <description> Connects the output of the bus at [code]bus_idx[/code] to the bus named [code]send[/code]. diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 2d65defad3..eab6505734 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -54,7 +54,7 @@ <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" default="false"> If [code]true[/code], audio plays when added to scene tree. </member> - <member name="bus" type="String" setter="set_bus" getter="get_bus" default=""Master""> + <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="@"Master""> Bus on which this audio is playing. </member> <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" enum="AudioStreamPlayer.MixTarget" default="0"> diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 66254b504a..fdbef1b89e 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -60,7 +60,7 @@ <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" default="false"> If [code]true[/code], audio plays when added to scene tree. </member> - <member name="bus" type="String" setter="set_bus" getter="get_bus" default=""Master""> + <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="@"Master""> Bus on which this audio is playing. </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="2000.0"> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index f476bec323..4ec8dba2c6 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -66,7 +66,7 @@ <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" default="false"> If [code]true[/code], audio plays when added to scene tree. </member> - <member name="bus" type="String" setter="set_bus" getter="get_bus" default=""Master""> + <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="@"Master""> Bus on which this audio is playing. </member> <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="AudioStreamPlayer3D.DopplerTracking" default="0"> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 46a96020d0..2e4ca9677d 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -428,11 +428,11 @@ </constant> <constant name="TEXTURE_FILTER_LINEAR" value="1" enum="TextureFilter"> </constant> - <constant name="TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS" value="2" enum="TextureFilter"> + <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="2" enum="TextureFilter"> </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="3" enum="TextureFilter"> </constant> - <constant name="TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC" value="4" enum="TextureFilter"> + <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC" value="4" enum="TextureFilter"> </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC" value="5" enum="TextureFilter"> </constant> diff --git a/doc/classes/BoxContainer.xml b/doc/classes/BoxContainer.xml index 4b5d4c853a..0d8233e6ff 100644 --- a/doc/classes/BoxContainer.xml +++ b/doc/classes/BoxContainer.xml @@ -4,7 +4,7 @@ Base class for box containers. </brief_description> <description> - Arranges child controls vertically or horizontally, and rearranges the controls automatically when their minimum size changes. + Arranges child [Control] nodes vertically or horizontally, and rearranges them automatically when their minimum size changes. </description> <tutorials> </tutorials> @@ -15,13 +15,13 @@ <argument index="0" name="begin" type="bool"> </argument> <description> - Adds a control to the box as a spacer. If [code]true[/code], [code]begin[/code] will insert the spacer control in front of other children. + Adds a [Control] node to the box as a spacer. If [code]begin[/code] is [code]true[/code], it will insert the [Control] node in front of all other children. </description> </method> </methods> <members> <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="BoxContainer.AlignMode" default="0"> - The alignment of the container's children (must be one of [constant ALIGN_BEGIN], [constant ALIGN_CENTER] or [constant ALIGN_END]). + The alignment of the container's children (must be one of [constant ALIGN_BEGIN], [constant ALIGN_CENTER], or [constant ALIGN_END]). </member> </members> <constants> diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml new file mode 100644 index 0000000000..ec38128c1e --- /dev/null +++ b/doc/classes/Callable.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Callable" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="Callable"> + <return type="Callable"> + </return> + <argument index="0" name="object" type="Object"> + </argument> + <argument index="1" name="method_name" type="StringName"> + </argument> + <description> + </description> + </method> + <method name="call" qualifiers="vararg"> + <return type="Variant"> + </return> + <description> + </description> + </method> + <method name="call_deferred" qualifiers="vararg"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="get_method"> + <return type="StringName"> + </return> + <description> + </description> + </method> + <method name="get_object"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_object_id"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="hash"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="is_custom"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_null"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_standard"> + <return type="bool"> + </return> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index aed02e27e7..dec7c907a4 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -260,7 +260,7 @@ <argument index="9" name="texture_repeat" type="int" enum="CanvasItem.TextureRepeat" default="0"> </argument> <description> - Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle and 4 points for a quad. + Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. </description> </method> <method name="draw_rect"> @@ -661,11 +661,11 @@ </constant> <constant name="TEXTURE_FILTER_LINEAR" value="2" enum="TextureFilter"> </constant> - <constant name="TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS" value="3" enum="TextureFilter"> + <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="3" enum="TextureFilter"> </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="4" enum="TextureFilter"> </constant> - <constant name="TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC" value="5" enum="TextureFilter"> + <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC" value="5" enum="TextureFilter"> </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC" value="6" enum="TextureFilter"> </constant> diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml index a0f13494af..2a6a2ddd91 100644 --- a/doc/classes/ClassDB.xml +++ b/doc/classes/ClassDB.xml @@ -12,7 +12,7 @@ <method name="can_instance" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <description> Returns [code]true[/code] if you can instance objects from the specified [code]class[/code], [code]false[/code] in other case. @@ -21,16 +21,16 @@ <method name="class_exists" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <description> Returns whether the specified [code]class[/code] is available or not. </description> </method> <method name="class_get_category" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <description> Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required. @@ -39,9 +39,9 @@ <method name="class_get_integer_constant" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> - <argument index="1" name="name" type="String"> + <argument index="1" name="name" type="StringName"> </argument> <description> Returns the value of the integer constant [code]name[/code] of [code]class[/code] or its ancestry. Always returns 0 when the constant could not be found. @@ -50,7 +50,7 @@ <method name="class_get_integer_constant_list" qualifiers="const"> <return type="PackedStringArray"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <argument index="1" name="no_inheritance" type="bool" default="false"> </argument> @@ -61,7 +61,7 @@ <method name="class_get_method_list" qualifiers="const"> <return type="Array"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <argument index="1" name="no_inheritance" type="bool" default="false"> </argument> @@ -74,7 +74,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="property" type="String"> + <argument index="1" name="property" type="StringName"> </argument> <description> Returns the value of [code]property[/code] of [code]class[/code] or its ancestry. @@ -83,7 +83,7 @@ <method name="class_get_property_list" qualifiers="const"> <return type="Array"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <argument index="1" name="no_inheritance" type="bool" default="false"> </argument> @@ -94,9 +94,9 @@ <method name="class_get_signal" qualifiers="const"> <return type="Dictionary"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> - <argument index="1" name="signal" type="String"> + <argument index="1" name="signal" type="StringName"> </argument> <description> Returns the [code]signal[/code] data of [code]class[/code] or its ancestry. The returned value is a [Dictionary] with the following keys: [code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/code], [code]return: (class_name, hint, hint_string, name, type, usage)[/code]. @@ -105,7 +105,7 @@ <method name="class_get_signal_list" qualifiers="const"> <return type="Array"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <argument index="1" name="no_inheritance" type="bool" default="false"> </argument> @@ -116,9 +116,9 @@ <method name="class_has_integer_constant" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> - <argument index="1" name="name" type="String"> + <argument index="1" name="name" type="StringName"> </argument> <description> Returns whether [code]class[/code] or its ancestry has an integer constant called [code]name[/code] or not. @@ -127,9 +127,9 @@ <method name="class_has_method" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <argument index="2" name="no_inheritance" type="bool" default="false"> </argument> @@ -140,9 +140,9 @@ <method name="class_has_signal" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> - <argument index="1" name="signal" type="String"> + <argument index="1" name="signal" type="StringName"> </argument> <description> Returns whether [code]class[/code] or its ancestry has a signal called [code]signal[/code] or not. @@ -153,7 +153,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="property" type="String"> + <argument index="1" name="property" type="StringName"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -171,16 +171,16 @@ <method name="get_inheriters_from_class" qualifiers="const"> <return type="PackedStringArray"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <description> Returns the names of all the classes that directly or indirectly inherit from [code]class[/code]. </description> </method> <method name="get_parent_class" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <description> Returns the parent class of [code]class[/code]. @@ -189,7 +189,7 @@ <method name="instance" qualifiers="const"> <return type="Variant"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <description> Creates an instance of [code]class[/code]. @@ -198,7 +198,7 @@ <method name="is_class_enabled" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> <description> Returns whether this [code]class[/code] is enabled or not. @@ -207,9 +207,9 @@ <method name="is_parent_class" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class" type="String"> + <argument index="0" name="class" type="StringName"> </argument> - <argument index="1" name="inherits" type="String"> + <argument index="1" name="inherits" type="StringName"> </argument> <description> Returns whether [code]inherits[/code] is an ancestor of [code]class[/code] or not. diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 0805a87d18..5ab929d911 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -4,7 +4,7 @@ Color picker control. </brief_description> <description> - [Control] node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace. + Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace. </description> <tutorials> </tutorials> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 3bf2ede896..89db5baf8a 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -90,7 +90,7 @@ <method name="add_color_override"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="color" type="Color"> </argument> @@ -101,7 +101,7 @@ <method name="add_constant_override"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="constant" type="int"> </argument> @@ -112,7 +112,7 @@ <method name="add_font_override"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="font" type="Font"> </argument> @@ -123,7 +123,7 @@ <method name="add_icon_override"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="texture" type="Texture2D"> </argument> @@ -134,7 +134,7 @@ <method name="add_shader_override"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="shader" type="Shader"> </argument> @@ -145,7 +145,7 @@ <method name="add_stylebox_override"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="stylebox" type="StyleBox"> </argument> @@ -220,9 +220,9 @@ <method name="get_color" qualifiers="const"> <return type="Color"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. @@ -242,9 +242,9 @@ <method name="get_constant" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. @@ -301,9 +301,9 @@ <method name="get_font" qualifiers="const"> <return type="Font"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. @@ -319,9 +319,9 @@ <method name="get_icon" qualifiers="const"> <return type="Texture2D"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. @@ -374,9 +374,9 @@ <method name="get_stylebox" qualifiers="const"> <return type="StyleBox"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code]. @@ -412,9 +412,9 @@ <method name="has_color" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. @@ -423,7 +423,7 @@ <method name="has_color_override" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if [Color] with given [code]name[/code] has a valid override in this [Control] node. @@ -432,9 +432,9 @@ <method name="has_constant" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. @@ -443,7 +443,7 @@ <method name="has_constant_override" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if constant with given [code]name[/code] has a valid override in this [Control] node. @@ -459,9 +459,9 @@ <method name="has_font" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. @@ -470,7 +470,7 @@ <method name="has_font_override" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if font with given [code]name[/code] has a valid override in this [Control] node. @@ -479,9 +479,9 @@ <method name="has_icon" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. @@ -490,7 +490,7 @@ <method name="has_icon_override" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if icon with given [code]name[/code] has a valid override in this [Control] node. @@ -510,7 +510,7 @@ <method name="has_shader_override" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if [Shader] with given [code]name[/code] has a valid override in this [Control] node. @@ -519,9 +519,9 @@ <method name="has_stylebox" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String" default=""""> + <argument index="1" name="type" type="StringName" default=""""> </argument> <description> Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme]. @@ -530,7 +530,7 @@ <method name="has_stylebox_override" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if [StyleBox] with given [code]name[/code] has a valid override in this [Control] node. diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index c5345c8025..5024cdefbd 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -48,10 +48,10 @@ </description> </method> <method name="get_baked_tilts" qualifiers="const"> - <return type="PackedRealArray"> + <return type="PackedFloat32Array"> </return> <description> - Returns the cache of tilts as a [PackedRealArray]. + Returns the cache of tilts as a [PackedFloat32Array]. </description> </method> <method name="get_baked_up_vectors" qualifiers="const"> diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml index 8c05f30550..8c71b61553 100644 --- a/doc/classes/DTLSServer.xml +++ b/doc/classes/DTLSServer.xml @@ -31,7 +31,7 @@ for p in peers: p.poll() # Must poll to update the state. if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED: - while p.get_available_packet_count() > 0: + while p.get_available_packet_count() > 0: print("Received message from client: %s" % p.get_packet().get_string_from_utf8()) p.put_packet("Hello DTLS client".to_utf8()) [/codeblock] @@ -53,7 +53,7 @@ if !connected: # Try to contact server dtls.put_packet("The answer is... 42!".to_utf8()) - while dtls.get_available_packet_count() > 0: + while dtls.get_available_packet_count() > 0: print("Connected: %s" % dtls.get_packet().get_string_from_utf8()) connected = true [/codeblock] @@ -68,7 +68,7 @@ </argument> <argument index="1" name="certificate" type="X509Certificate"> </argument> - <argument index="2" name="ca_chain" type="X509Certificate"> + <argument index="2" name="chain" type="X509Certificate" default="null"> </argument> <description> Setup the DTLS server to use the given [code]private_key[/code] and provide the given [code]certificate[/code] to clients. You can pass the optional [code]chain[/code] parameter to provide additional CA chain information along with the certificate. diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 8432744ea7..6104cf165e 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -66,6 +66,8 @@ </tutorials> <methods> <method name="clear"> + <return type="void"> + </return> <description> Clear the dictionary, removing all key/value pairs. </description> @@ -96,7 +98,7 @@ </description> </method> <method name="get"> - <return type="Variant"> + <return type="void"> </return> <argument index="0" name="key" type="Variant"> </argument> diff --git a/doc/classes/EditorFeatureProfile.xml b/doc/classes/EditorFeatureProfile.xml index 5fac4f7822..387962cf6a 100644 --- a/doc/classes/EditorFeatureProfile.xml +++ b/doc/classes/EditorFeatureProfile.xml @@ -18,7 +18,7 @@ <method name="is_class_disabled" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class_name" type="String"> + <argument index="0" name="class_name" type="StringName"> </argument> <description> </description> @@ -26,7 +26,7 @@ <method name="is_class_editor_disabled" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class_name" type="String"> + <argument index="0" name="class_name" type="StringName"> </argument> <description> </description> @@ -34,9 +34,9 @@ <method name="is_class_property_disabled" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="class_name" type="String"> + <argument index="0" name="class_name" type="StringName"> </argument> - <argument index="1" name="property" type="String"> + <argument index="1" name="property" type="StringName"> </argument> <description> </description> @@ -68,7 +68,7 @@ <method name="set_disable_class"> <return type="void"> </return> - <argument index="0" name="class_name" type="String"> + <argument index="0" name="class_name" type="StringName"> </argument> <argument index="1" name="disable" type="bool"> </argument> @@ -78,7 +78,7 @@ <method name="set_disable_class_editor"> <return type="void"> </return> - <argument index="0" name="class_name" type="String"> + <argument index="0" name="class_name" type="StringName"> </argument> <argument index="1" name="disable" type="bool"> </argument> @@ -88,9 +88,9 @@ <method name="set_disable_class_property"> <return type="void"> </return> - <argument index="0" name="class_name" type="String"> + <argument index="0" name="class_name" type="StringName"> </argument> - <argument index="1" name="property" type="String"> + <argument index="1" name="property" type="StringName"> </argument> <argument index="2" name="disable" type="bool"> </argument> diff --git a/doc/classes/EditorFileSystemDirectory.xml b/doc/classes/EditorFileSystemDirectory.xml index bbd3ee9b17..096fe5df8f 100644 --- a/doc/classes/EditorFileSystemDirectory.xml +++ b/doc/classes/EditorFileSystemDirectory.xml @@ -78,7 +78,7 @@ </description> </method> <method name="get_file_type" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index 338ebcd770..3216541b20 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -21,11 +21,11 @@ <method name="emit_changed"> <return type="void"> </return> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> - <argument index="2" name="field" type="String" default=""""> + <argument index="2" name="field" type="StringName" default="@"""> </argument> <argument index="3" name="changing" type="bool" default="false"> </argument> @@ -41,7 +41,7 @@ </description> </method> <method name="get_edited_property"> - <return type="String"> + <return type="StringName"> </return> <description> Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin.parse_property]), then this will return the property. @@ -102,7 +102,7 @@ </description> </signal> <signal name="object_id_selected"> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="id" type="int"> </argument> @@ -111,7 +111,7 @@ </description> </signal> <signal name="property_changed"> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> @@ -120,7 +120,7 @@ </description> </signal> <signal name="property_checked"> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="bool" type="String"> </argument> @@ -129,14 +129,14 @@ </description> </signal> <signal name="property_keyed"> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <description> Emit it if you want to add this value as an animation key (check for keying being enabled first). </description> </signal> <signal name="property_keyed_with_value"> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> diff --git a/doc/classes/EditorResourcePreview.xml b/doc/classes/EditorResourcePreview.xml index 8e0f8842e9..aac75c5c8e 100644 --- a/doc/classes/EditorResourcePreview.xml +++ b/doc/classes/EditorResourcePreview.xml @@ -34,7 +34,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="receiver_func" type="String"> + <argument index="2" name="receiver_func" type="StringName"> </argument> <argument index="3" name="userdata" type="Variant"> </argument> @@ -49,7 +49,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="receiver_func" type="String"> + <argument index="2" name="receiver_func" type="StringName"> </argument> <argument index="3" name="userdata" type="Variant"> </argument> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index ace5f0f11b..73ef807c5f 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -135,7 +135,7 @@ <method name="set_initial_value"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> diff --git a/doc/classes/FuncRef.xml b/doc/classes/FuncRef.xml index 37c3597a95..bf0c0b0d34 100644 --- a/doc/classes/FuncRef.xml +++ b/doc/classes/FuncRef.xml @@ -36,7 +36,7 @@ <method name="set_function"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> The name of the referenced function to call on the object, without parentheses or any parameters. diff --git a/doc/classes/GIProbeData.xml b/doc/classes/GIProbeData.xml index 3504d127b8..228e1afb4c 100644 --- a/doc/classes/GIProbeData.xml +++ b/doc/classes/GIProbeData.xml @@ -22,7 +22,7 @@ </argument> <argument index="5" name="distance_field" type="PackedByteArray"> </argument> - <argument index="6" name="level_counts" type="PackedIntArray"> + <argument index="6" name="level_counts" type="PackedInt32Array"> </argument> <description> </description> @@ -40,7 +40,7 @@ </description> </method> <method name="get_level_counts" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <description> </description> diff --git a/doc/classes/Geometry.xml b/doc/classes/Geometry.xml index 9d4e0d0388..b2d77f6f92 100644 --- a/doc/classes/Geometry.xml +++ b/doc/classes/Geometry.xml @@ -445,21 +445,21 @@ </description> </method> <method name="triangulate_delaunay_2d"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="points" type="PackedVector2Array"> </argument> <description> - Triangulates the area specified by discrete set of [code]points[/code] such that no point is inside the circumcircle of any resulting triangle. Returns a [PackedIntArray] where each triangle consists of three consecutive point indices into [code]points[/code] (i.e. the returned array will have [code]n * 3[/code] elements, with [code]n[/code] being the number of found triangles). If the triangulation did not succeed, an empty [PackedIntArray] is returned. + Triangulates the area specified by discrete set of [code]points[/code] such that no point is inside the circumcircle of any resulting triangle. Returns a [PackedInt32Array] where each triangle consists of three consecutive point indices into [code]points[/code] (i.e. the returned array will have [code]n * 3[/code] elements, with [code]n[/code] being the number of found triangles). If the triangulation did not succeed, an empty [PackedInt32Array] is returned. </description> </method> <method name="triangulate_polygon"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="polygon" type="PackedVector2Array"> </argument> <description> - Triangulates the polygon specified by the points in [code]polygon[/code]. Returns a [PackedIntArray] where each triangle consists of three consecutive point indices into [code]polygon[/code] (i.e. the returned array will have [code]n * 3[/code] elements, with [code]n[/code] being the number of found triangles). If the triangulation did not succeed, an empty [PackedIntArray] is returned. + Triangulates the polygon specified by the points in [code]polygon[/code]. Returns a [PackedInt32Array] where each triangle consists of three consecutive point indices into [code]polygon[/code] (i.e. the returned array will have [code]n * 3[/code] elements, with [code]n[/code] being the number of found triangles). If the triangulation did not succeed, an empty [PackedInt32Array] is returned. </description> </method> </methods> diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml index 12c87f9cff..05aebef9de 100644 --- a/doc/classes/Gradient.xml +++ b/doc/classes/Gradient.xml @@ -90,8 +90,8 @@ <member name="colors" type="PackedColorArray" setter="set_colors" getter="get_colors" default="PackedColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )"> Gradient's colors returned as a [PackedColorArray]. </member> - <member name="offsets" type="PackedRealArray" setter="set_offsets" getter="get_offsets" default="PackedRealArray( 0, 1 )"> - Gradient's offsets returned as a [PackedRealArray]. + <member name="offsets" type="PackedFloat32Array" setter="set_offsets" getter="get_offsets" default="PackedFloat32Array( 0, 1 )"> + Gradient's offsets returned as a [PackedFloat32Array]. </member> </members> <constants> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 8733b94ee7..543afb01ee 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -49,11 +49,11 @@ <method name="connect_node"> <return type="int" enum="Error"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> <argument index="1" name="from_port" type="int"> </argument> - <argument index="2" name="to" type="String"> + <argument index="2" name="to" type="StringName"> </argument> <argument index="3" name="to_port" type="int"> </argument> @@ -64,11 +64,11 @@ <method name="disconnect_node"> <return type="void"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> <argument index="1" name="from_port" type="int"> </argument> - <argument index="2" name="to" type="String"> + <argument index="2" name="to" type="StringName"> </argument> <argument index="3" name="to_port" type="int"> </argument> @@ -94,11 +94,11 @@ <method name="is_node_connected"> <return type="bool"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> <argument index="1" name="from_port" type="int"> </argument> - <argument index="2" name="to" type="String"> + <argument index="2" name="to" type="StringName"> </argument> <argument index="3" name="to_port" type="int"> </argument> @@ -149,11 +149,11 @@ <method name="set_connection_activity"> <return type="void"> </return> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> <argument index="1" name="from_port" type="int"> </argument> - <argument index="2" name="to" type="String"> + <argument index="2" name="to" type="StringName"> </argument> <argument index="3" name="to_port" type="int"> </argument> @@ -204,7 +204,7 @@ </description> </signal> <signal name="connection_from_empty"> - <argument index="0" name="to" type="String"> + <argument index="0" name="to" type="StringName"> </argument> <argument index="1" name="to_slot" type="int"> </argument> @@ -215,11 +215,11 @@ </description> </signal> <signal name="connection_request"> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> <argument index="1" name="from_slot" type="int"> </argument> - <argument index="2" name="to" type="String"> + <argument index="2" name="to" type="StringName"> </argument> <argument index="3" name="to_slot" type="int"> </argument> @@ -228,7 +228,7 @@ </description> </signal> <signal name="connection_to_empty"> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> <argument index="1" name="from_slot" type="int"> </argument> @@ -249,11 +249,11 @@ </description> </signal> <signal name="disconnection_request"> - <argument index="0" name="from" type="String"> + <argument index="0" name="from" type="StringName"> </argument> <argument index="1" name="from_slot" type="int"> </argument> - <argument index="2" name="to" type="String"> + <argument index="2" name="to" type="StringName"> </argument> <argument index="3" name="to_slot" type="int"> </argument> diff --git a/doc/classes/HeightMapShape.xml b/doc/classes/HeightMapShape.xml index 505961cd0c..029f3642d2 100644 --- a/doc/classes/HeightMapShape.xml +++ b/doc/classes/HeightMapShape.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="map_data" type="PackedRealArray" setter="set_map_data" getter="get_map_data" default="PackedRealArray( 0, 0, 0, 0 )"> + <member name="map_data" type="PackedFloat32Array" setter="set_map_data" getter="get_map_data" default="PackedFloat32Array( 0, 0, 0, 0 )"> Height map data, pool array must be of [member map_width] * [member map_depth] size. </member> <member name="map_depth" type="int" setter="set_map_depth" getter="get_map_depth" default="2"> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index b7afe57218..c6de27a775 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -13,7 +13,7 @@ <method name="action_press"> <return type="void"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <argument index="1" name="strength" type="float" default="1.0"> </argument> @@ -26,7 +26,7 @@ <method name="action_release"> <return type="void"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> If the specified action is already pressed, this will release it. @@ -54,7 +54,7 @@ <method name="get_action_strength" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis as the keyboard, the value returned will be 0 or 1. @@ -202,7 +202,7 @@ <method name="is_action_just_pressed" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Returns [code]true[/code] when the user starts pressing the action event, meaning it's [code]true[/code] only on the frame that the user pressed down the button. @@ -212,7 +212,7 @@ <method name="is_action_just_released" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Returns [code]true[/code] when the user stops pressing the action event, meaning it's [code]true[/code] only on the frame that the user released the button. @@ -221,7 +221,7 @@ <method name="is_action_pressed" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> 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. diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 9e3764206b..413e217b45 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -31,7 +31,7 @@ <method name="get_action_strength" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type [InputEventJoypadMotion]. @@ -40,7 +40,7 @@ <method name="is_action" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Returns [code]true[/code] if this input event matches a pre-defined action of any type. @@ -49,7 +49,7 @@ <method name="is_action_pressed" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <argument index="1" name="allow_echo" type="bool" default="false"> </argument> @@ -60,7 +60,7 @@ <method name="is_action_released" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Returns [code]true[/code] if the given action is released (i.e. not pressed). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. diff --git a/doc/classes/InputEventAction.xml b/doc/classes/InputEventAction.xml index 2dac693a52..1c38ff8e8f 100644 --- a/doc/classes/InputEventAction.xml +++ b/doc/classes/InputEventAction.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="action" type="String" setter="set_action" getter="get_action" default=""""> + <member name="action" type="StringName" setter="set_action" getter="get_action" default="@"""> The action's name. Actions are accessed via this [String]. </member> <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false"> diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index aa3400dd97..da93d7fb53 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -13,7 +13,7 @@ <method name="action_add_event"> <return type="void"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <argument index="1" name="event" type="InputEvent"> </argument> @@ -24,7 +24,7 @@ <method name="action_erase_event"> <return type="void"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <argument index="1" name="event" type="InputEvent"> </argument> @@ -35,7 +35,7 @@ <method name="action_erase_events"> <return type="void"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Removes all events from an action. @@ -44,7 +44,7 @@ <method name="action_has_event"> <return type="bool"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <argument index="1" name="event" type="InputEvent"> </argument> @@ -55,7 +55,7 @@ <method name="action_set_deadzone"> <return type="void"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <argument index="1" name="deadzone" type="float"> </argument> @@ -66,7 +66,7 @@ <method name="add_action"> <return type="void"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <argument index="1" name="deadzone" type="float" default="0.5"> </argument> @@ -78,7 +78,7 @@ <method name="erase_action"> <return type="void"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Removes an action from the [InputMap]. @@ -89,7 +89,7 @@ </return> <argument index="0" name="event" type="InputEvent"> </argument> - <argument index="1" name="action" type="String"> + <argument index="1" name="action" type="StringName"> </argument> <description> Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. @@ -98,7 +98,7 @@ <method name="get_action_list"> <return type="Array"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Returns an array of [InputEvent]s associated with a given action. @@ -114,7 +114,7 @@ <method name="has_action" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="action" type="String"> + <argument index="0" name="action" type="StringName"> </argument> <description> Returns [code]true[/code] if the [InputMap] has a registered action with the given name. diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index d53fabaacb..c6ed1e22ed 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -142,7 +142,7 @@ </description> </method> <method name="get_selected_items"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <description> Returns an array with the indexes of the selected items. diff --git a/doc/classes/Marshalls.xml b/doc/classes/Marshalls.xml index 6707068c5a..4250ffd700 100644 --- a/doc/classes/Marshalls.xml +++ b/doc/classes/Marshalls.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Marshalls" inherits="Reference" version="4.0"> +<class name="Marshalls" inherits="Object" version="4.0"> <brief_description> Data transformation (marshalling) and encoding helpers. </brief_description> diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml index bdc9d20305..81ff5969e3 100644 --- a/doc/classes/MeshDataTool.xml +++ b/doc/classes/MeshDataTool.xml @@ -57,7 +57,7 @@ </description> </method> <method name="get_edge_faces" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -160,7 +160,7 @@ </description> </method> <method name="get_vertex_bones" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -185,7 +185,7 @@ </description> </method> <method name="get_vertex_edges" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -194,7 +194,7 @@ </description> </method> <method name="get_vertex_faces" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -248,7 +248,7 @@ </description> </method> <method name="get_vertex_weights" qualifiers="const"> - <return type="PackedRealArray"> + <return type="PackedFloat32Array"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -303,7 +303,7 @@ </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="bones" type="PackedIntArray"> + <argument index="1" name="bones" type="PackedInt32Array"> </argument> <description> Sets the bones of the given vertex. @@ -380,7 +380,7 @@ </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="weights" type="PackedRealArray"> + <argument index="1" name="weights" type="PackedFloat32Array"> </argument> <description> Sets the bone weights of the given vertex. diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml index ec12a0ff42..e8431e64f4 100644 --- a/doc/classes/MeshLibrary.xml +++ b/doc/classes/MeshLibrary.xml @@ -36,7 +36,7 @@ </description> </method> <method name="get_item_list" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <description> Returns the list of item IDs in use. diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 6831fc88df..24b87f8e28 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -105,7 +105,7 @@ </method> </methods> <members> - <member name="buffer" type="PackedRealArray" setter="set_buffer" getter="get_buffer" default="PackedRealArray( )"> + <member name="buffer" type="PackedFloat32Array" setter="set_buffer" getter="get_buffer" default="PackedFloat32Array( )"> </member> <member name="color_array" type="PackedColorArray" setter="_set_color_array" getter="_get_color_array"> </member> diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml index 968357ea07..9c753818d9 100644 --- a/doc/classes/MultiplayerAPI.xml +++ b/doc/classes/MultiplayerAPI.xml @@ -19,7 +19,7 @@ </description> </method> <method name="get_network_connected_peers" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <description> Returns the peer IDs of all connected peers of this MultiplayerAPI's [member network_peer]. diff --git a/doc/classes/Navigation.xml b/doc/classes/Navigation.xml index 8057aca127..0000ca6bd5 100644 --- a/doc/classes/Navigation.xml +++ b/doc/classes/Navigation.xml @@ -9,31 +9,39 @@ <tutorials> </tutorials> <methods> - <method name="get_rid" qualifiers="const"> - <return type="RID"> + <method name="get_closest_point" qualifiers="const"> + <return type="Vector3"> </return> + <argument index="0" name="to_point" type="Vector3"> + </argument> <description> + Returns the point closest to the provided [code]to_point[/code] on the navigation mesh surface. </description> </method> - <method name="get_simple_path" qualifiers="const"> - <return type="PackedVector3Array"> + <method name="get_closest_point_normal" qualifiers="const"> + <return type="Vector3"> </return> - <argument index="0" name="start" type="Vector3"> - </argument> - <argument index="1" name="end" type="Vector3"> + <argument index="0" name="to_point" type="Vector3"> </argument> - <argument index="2" name="optimize" type="bool" default="true"> + <description> + Returns the normal for the point returned by [method get_closest_point]. + </description> + </method> + <method name="get_closest_point_owner" qualifiers="const"> + <return type="RID"> + </return> + <argument index="0" name="to_point" type="Vector3"> </argument> <description> - Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the agent properties associated with each [NavigationMesh] (radius, height, etc.) are considered in the path calculation, otherwise they are ignored. + Returns the owner region RID for the point returned by [method get_closest_point]. </description> </method> <method name="get_closest_point_to_segment" qualifiers="const"> <return type="Vector3"> </return> - <argument index="0" name="from" type="Vector3"> + <argument index="0" name="start" type="Vector3"> </argument> - <argument index="1" name="to" type="Vector3"> + <argument index="1" name="end" type="Vector3"> </argument> <argument index="2" name="use_collision" type="bool" default="false"> </argument> @@ -41,31 +49,23 @@ Returns the closest point between the navigation surface and the segment. </description> </method> - <method name="get_closest_point" qualifiers="const"> - <return type="Vector3"> + <method name="get_rid" qualifiers="const"> + <return type="RID"> </return> - <argument index="0" name="point" type="Vector3"> - </argument> <description> - Returns the point closest to the provided [code]point[/code] on the navigation mesh surface. </description> </method> - <method name="get_closest_point_normal" qualifiers="const"> - <return type="Vector3"> + <method name="get_simple_path" qualifiers="const"> + <return type="PackedVector3Array"> </return> - <argument index="0" name="point" type="Vector3"> + <argument index="0" name="start" type="Vector3"> </argument> - <description> - Returns the normal for the point returned by [method get_closest_point]. - </description> - </method> - <method name="get_closest_point_owner" qualifiers="const"> - <return type="RID"> - </return> - <argument index="0" name="point" type="Vector3"> + <argument index="1" name="end" type="Vector3"> + </argument> + <argument index="2" name="optimize" type="bool" default="true"> </argument> <description> - Returns the owner region RID for the point returned by [method get_closest_point]. + Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the agent properties associated with each [NavigationMesh] (radius, height, etc.) are considered in the path calculation, otherwise they are ignored. </description> </method> </methods> diff --git a/doc/classes/Navigation2D.xml b/doc/classes/Navigation2D.xml index 20c666106a..0d016a3210 100644 --- a/doc/classes/Navigation2D.xml +++ b/doc/classes/Navigation2D.xml @@ -9,6 +9,24 @@ <tutorials> </tutorials> <methods> + <method name="get_closest_point" qualifiers="const"> + <return type="Vector2"> + </return> + <argument index="0" name="to_point" type="Vector2"> + </argument> + <description> + Returns the point closest to the provided [code]to_point[/code] on the navigation mesh surface. + </description> + </method> + <method name="get_closest_point_owner" qualifiers="const"> + <return type="RID"> + </return> + <argument index="0" name="to_point" type="Vector2"> + </argument> + <description> + Returns the owner region RID for the point returned by [method get_closest_point]. + </description> + </method> <method name="get_rid" qualifiers="const"> <return type="RID"> </return> @@ -28,24 +46,6 @@ Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the path is smoothed by merging path segments where possible. </description> </method> - <method name="get_closest_point" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="point" type="Vector2"> - </argument> - <description> - Returns the point closest to the provided [code]point[/code] on the navigation mesh surface. - </description> - </method> - <method name="get_closest_point_owner" qualifiers="const"> - <return type="RID"> - </return> - <argument index="0" name="point" type="Vector2"> - </argument> - <description> - Returns the owner region RID for the point returned by [method get_closest_point]. - </description> - </method> </methods> <members> <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="10.0"> diff --git a/doc/classes/Navigation2DServer.xml b/doc/classes/Navigation2DServer.xml index 22b5d2574e..110844c492 100644 --- a/doc/classes/Navigation2DServer.xml +++ b/doc/classes/Navigation2DServer.xml @@ -32,7 +32,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <argument index="3" name="userdata" type="Variant" default="null"> </argument> @@ -164,50 +164,50 @@ Returns the map cell size. </description> </method> - <method name="map_get_edge_connection_margin" qualifiers="const"> - <return type="float"> + <method name="map_get_closest_point" qualifiers="const"> + <return type="Vector2"> </return> <argument index="0" name="map" type="RID"> </argument> + <argument index="1" name="to_point" type="Vector2"> + </argument> <description> - Returns the edge connection margin of the map. The edge connection margin is a distance used to connect two regions. + Returns the point closest to the provided [code]to_point[/code] on the navigation mesh surface. </description> </method> - <method name="map_get_path" qualifiers="const"> - <return type="PackedVector2Array"> + <method name="map_get_closest_point_owner" qualifiers="const"> + <return type="RID"> </return> <argument index="0" name="map" type="RID"> </argument> - <argument index="1" name="origin" type="Vector2"> - </argument> - <argument index="2" name="destination" type="Vector2"> - </argument> - <argument index="3" name="optimize" type="bool"> + <argument index="1" name="to_point" type="Vector2"> </argument> <description> - Returns the navigation path to reach the destination from the origin, while avoiding static obstacles. + Returns the owner region RID for the point returned by [method map_get_closest_point]. </description> </method> - <method name="map_get_closest_point" qualifiers="const"> - <return type="Vector2"> + <method name="map_get_edge_connection_margin" qualifiers="const"> + <return type="float"> </return> <argument index="0" name="map" type="RID"> </argument> - <argument index="1" name="point" type="Vector2"> - </argument> <description> - Returns the point closest to the provided [code]point[/code] on the navigation mesh surface. + Returns the edge connection margin of the map. The edge connection margin is a distance used to connect two regions. </description> </method> - <method name="map_get_closest_point_owner" qualifiers="const"> - <return type="RID"> + <method name="map_get_path" qualifiers="const"> + <return type="PackedVector2Array"> </return> <argument index="0" name="map" type="RID"> </argument> - <argument index="1" name="point" type="Vector2"> + <argument index="1" name="origin" type="Vector2"> + </argument> + <argument index="2" name="destination" type="Vector2"> + </argument> + <argument index="3" name="optimize" type="bool"> </argument> <description> - Returns the owner region RID for the point returned by [method map_get_closest_point]. + Returns the navigation path to reach the destination from the origin, while avoiding static obstacles. </description> </method> <method name="map_is_active" qualifiers="const"> diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml index 5b7a188e5a..6deca4394f 100644 --- a/doc/classes/NavigationMesh.xml +++ b/doc/classes/NavigationMesh.xml @@ -10,7 +10,7 @@ <method name="add_polygon"> <return type="void"> </return> - <argument index="0" name="polygon" type="PackedIntArray"> + <argument index="0" name="polygon" type="PackedInt32Array"> </argument> <description> </description> @@ -38,7 +38,7 @@ </description> </method> <method name="get_polygon"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -109,7 +109,7 @@ </member> <member name="geometry/source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" default="0"> </member> - <member name="geometry/source_group_name" type="String" setter="set_source_group_name" getter="get_source_group_name"> + <member name="geometry/source_group_name" type="StringName" setter="set_source_group_name" getter="get_source_group_name"> </member> <member name="polygon/verts_per_poly" type="float" setter="set_verts_per_poly" getter="get_verts_per_poly" default="6.0"> </member> diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml index 908617fb91..da291b7337 100644 --- a/doc/classes/NavigationPolygon.xml +++ b/doc/classes/NavigationPolygon.xml @@ -18,7 +18,7 @@ var polygon = NavigationPolygon.new() var vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) polygon.set_vertices(vertices) - var indices = PackedIntArray(0, 3, 1) + var indices = PackedInt32Array(0, 3, 1) polygon.add_polygon(indices) $NavigationPolygonInstance.navpoly = polygon [/codeblock] @@ -49,7 +49,7 @@ <method name="add_polygon"> <return type="void"> </return> - <argument index="0" name="polygon" type="PackedIntArray"> + <argument index="0" name="polygon" type="PackedInt32Array"> </argument> <description> Adds a polygon using the indices of the vertices you get when calling [method get_vertices]. @@ -86,12 +86,12 @@ </description> </method> <method name="get_polygon"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="idx" type="int"> </argument> <description> - Returns a [PackedIntArray] containing the indices of the vertices of a created polygon. + Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon. </description> </method> <method name="get_polygon_count" qualifiers="const"> diff --git a/doc/classes/NavigationServer.xml b/doc/classes/NavigationServer.xml index 61ea6f47b6..1f65a6004e 100644 --- a/doc/classes/NavigationServer.xml +++ b/doc/classes/NavigationServer.xml @@ -32,7 +32,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <argument index="3" name="userdata" type="Variant" default="null"> </argument> @@ -164,28 +164,37 @@ Returns the map cell size. </description> </method> - <method name="map_get_edge_connection_margin" qualifiers="const"> - <return type="float"> + <method name="map_get_closest_point" qualifiers="const"> + <return type="Vector3"> </return> <argument index="0" name="map" type="RID"> </argument> + <argument index="1" name="to_point" type="Vector3"> + </argument> <description> - Returns the edge connection margin of the map. + Returns the point closest to the provided [code]point[/code] on the navigation mesh surface. </description> </method> - <method name="map_get_path" qualifiers="const"> - <return type="PackedVector3Array"> + <method name="map_get_closest_point_normal" qualifiers="const"> + <return type="Vector3"> </return> <argument index="0" name="map" type="RID"> </argument> - <argument index="1" name="origin" type="Vector3"> + <argument index="1" name="to_point" type="Vector3"> </argument> - <argument index="2" name="destination" type="Vector3"> + <description> + Returns the normal for the point returned by [method map_get_closest_point]. + </description> + </method> + <method name="map_get_closest_point_owner" qualifiers="const"> + <return type="RID"> + </return> + <argument index="0" name="map" type="RID"> </argument> - <argument index="3" name="optimize" type="bool"> + <argument index="1" name="to_point" type="Vector3"> </argument> <description> - Returns the navigation path to reach the destination from the origin. + Returns the owner region RID for the point returned by [method map_get_closest_point]. </description> </method> <method name="map_get_closest_point_to_segment" qualifiers="const"> @@ -193,9 +202,9 @@ </return> <argument index="0" name="map" type="RID"> </argument> - <argument index="1" name="from" type="Vector3"> + <argument index="1" name="start" type="Vector3"> </argument> - <argument index="2" name="to" type="Vector3"> + <argument index="2" name="end" type="Vector3"> </argument> <argument index="3" name="use_collision" type="bool" default="false"> </argument> @@ -203,37 +212,28 @@ Returns the closest point between the navigation surface and the segment. </description> </method> - <method name="map_get_closest_point" qualifiers="const"> - <return type="Vector3"> + <method name="map_get_edge_connection_margin" qualifiers="const"> + <return type="float"> </return> <argument index="0" name="map" type="RID"> </argument> - <argument index="1" name="point" type="Vector3"> - </argument> <description> - Returns the point closest to the provided [code]point[/code] on the navigation mesh surface. + Returns the edge connection margin of the map. </description> </method> - <method name="map_get_closest_point_normal" qualifiers="const"> - <return type="Vector3"> + <method name="map_get_path" qualifiers="const"> + <return type="PackedVector3Array"> </return> <argument index="0" name="map" type="RID"> </argument> - <argument index="1" name="point" type="Vector3"> + <argument index="1" name="origin" type="Vector3"> </argument> - <description> - Returns the normal for the point returned by [method map_get_closest_point]. - </description> - </method> - <method name="map_get_closest_point_owner" qualifiers="const"> - <return type="RID"> - </return> - <argument index="0" name="map" type="RID"> + <argument index="2" name="destination" type="Vector3"> </argument> - <argument index="1" name="point" type="Vector3"> + <argument index="3" name="optimize" type="bool"> </argument> <description> - Returns the owner region RID for the point returned by [method map_get_closest_point]. + Returns the navigation path to reach the destination from the origin. </description> </method> <method name="map_get_up" qualifiers="const"> @@ -358,13 +358,15 @@ Control activation of this server. </description> </method> - <method name="step"> + <method name="process"> <return type="void"> </return> <argument index="0" name="delta_time" type="float"> </argument> <description> - Steps the server. This is not threadsafe and must be called in single thread. + Process the collision avoidance agents. + The result of this process is needed by the physics server, so this must be called in the main thread. + Note: This function is not thread safe. </description> </method> </methods> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 5fd0da7452..eb15bc2ad9 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -129,27 +129,29 @@ child_node.get_parent().remove_child(child_node) add_child(child_node) [/codeblock] + If you need the child node to be added below a specific node in the list of children, use [method add_child_below_node] instead of this method. [b]Note:[/b] If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=https://godot.readthedocs.io/en/latest/tutorials/misc/running_code_in_the_editor.html]tool scripts[/url] and [url=https://godot.readthedocs.io/en/latest/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. </description> </method> <method name="add_child_below_node"> <return type="void"> </return> - <argument index="0" name="node" type="Node"> + <argument index="0" name="preceding_node" type="Node"> </argument> - <argument index="1" name="child_node" type="Node"> + <argument index="1" name="node" type="Node"> </argument> <argument index="2" name="legible_unique_name" type="bool" default="false"> </argument> <description> - Adds a child node. The child is placed below the given node in the list of children. + Adds a child node below the [code]preceding_node[/code]. If [code]legible_unique_name[/code] is [code]true[/code], the child node will have an human-readable name based on the name of the node being instanced instead of its type. + Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children. </description> </method> <method name="add_to_group"> <return type="void"> </return> - <argument index="0" name="group" type="String"> + <argument index="0" name="group" type="StringName"> </argument> <argument index="1" name="persistent" type="bool" default="false"> </argument> @@ -410,7 +412,7 @@ <method name="is_in_group" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="group" type="String"> + <argument index="0" name="group" type="StringName"> </argument> <description> Returns [code]true[/code] if this node is in the specified group. See notes in the description, and the group methods in [SceneTree]. @@ -532,7 +534,7 @@ <method name="propagate_call"> <return type="void"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <argument index="1" name="args" type="Array" default="[ ]"> </argument> @@ -584,7 +586,7 @@ <method name="remove_from_group"> <return type="void"> </return> - <argument index="0" name="group" type="String"> + <argument index="0" name="group" type="StringName"> </argument> <description> Removes a node from a group. See notes in the description, and the group methods in [SceneTree]. @@ -611,7 +613,7 @@ <method name="rpc" qualifiers="vararg"> <return type="Variant"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <description> Sends a remote procedure call request for the given [code]method[/code] to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same node name. Behaviour depends on the RPC configuration for the given method, see [method rpc_config]. Methods are not exposed to RPCs by default. See also [method rset] and [method rset_config] for properties. Returns an empty [Variant]. @@ -621,7 +623,7 @@ <method name="rpc_config"> <return type="int"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <argument index="1" name="mode" type="int" enum="MultiplayerAPI.RPCMode"> </argument> @@ -634,7 +636,7 @@ </return> <argument index="0" name="peer_id" type="int"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <description> Sends a [method rpc] to a specific peer identified by [code]peer_id[/code] (see [method NetworkedMultiplayerPeer.set_target_peer]). Returns an empty [Variant]. @@ -643,7 +645,7 @@ <method name="rpc_unreliable" qualifiers="vararg"> <return type="Variant"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <description> Sends a [method rpc] using an unreliable protocol. Returns an empty [Variant]. @@ -654,7 +656,7 @@ </return> <argument index="0" name="peer_id" type="int"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <description> Sends a [method rpc] to a specific peer identified by [code]peer_id[/code] using an unreliable protocol (see [method NetworkedMultiplayerPeer.set_target_peer]). Returns an empty [Variant]. @@ -663,7 +665,7 @@ <method name="rset"> <return type="void"> </return> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> @@ -674,7 +676,7 @@ <method name="rset_config"> <return type="int"> </return> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="mode" type="int" enum="MultiplayerAPI.RPCMode"> </argument> @@ -687,7 +689,7 @@ </return> <argument index="0" name="peer_id" type="int"> </argument> - <argument index="1" name="property" type="String"> + <argument index="1" name="property" type="StringName"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -698,7 +700,7 @@ <method name="rset_unreliable"> <return type="void"> </return> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> @@ -711,7 +713,7 @@ </return> <argument index="0" name="peer_id" type="int"> </argument> - <argument index="1" name="property" type="String"> + <argument index="1" name="property" type="StringName"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -830,7 +832,7 @@ <member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer"> The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree). </member> - <member name="name" type="String" setter="set_name" getter="get_name"> + <member name="name" type="StringName" setter="set_name" getter="get_name"> The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed. </member> <member name="owner" type="Node" setter="set_owner" getter="get_owner"> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 5388d93b8d..a3faccae1a 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -23,7 +23,7 @@ <method name="_get" qualifiers="virtual"> <return type="Variant"> </return> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <description> Virtual method which can be overridden to customize the return value of [method get]. @@ -58,7 +58,7 @@ <method name="_set" qualifiers="virtual"> <return type="bool"> </return> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> @@ -89,7 +89,7 @@ <method name="call" qualifiers="vararg"> <return type="Variant"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <description> Calls the [code]method[/code] on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: @@ -101,7 +101,7 @@ <method name="call_deferred" qualifiers="vararg"> <return type="void"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <description> Calls the [code]method[/code] on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: @@ -113,7 +113,7 @@ <method name="callv"> <return type="Variant"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <argument index="1" name="arg_array" type="Array"> </argument> @@ -134,17 +134,16 @@ <method name="connect"> <return type="int" enum="Error"> </return> - <argument index="0" name="signal" type="String"> + <argument index="0" name="signal" type="StringName"> </argument> - <argument index="1" name="target" type="Object"> + <argument index="1" name="callable" type="Callable"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="binds" type="Array" default="[ ]"> </argument> - <argument index="3" name="binds" type="Array" default="[ ]"> - </argument> - <argument index="4" name="flags" type="int" default="0"> + <argument index="3" name="flags" type="int" default="0"> </argument> <description> + [b]FIXME:[/b] The syntax changed with the addition of [Callable], this should be updated. Connects a [code]signal[/code] to a [code]method[/code] on a [code]target[/code] object. Pass optional [code]binds[/code] to the call as an [Array] of parameters. These parameters will be passed to the method after any parameter used in the call to [method emit_signal]. Use [code]flags[/code] to set deferred or one-shot connections. See [enum ConnectFlags] constants. A [code]signal[/code] can only be connected once to a [code]method[/code]. It will throw an error if already connected, unless the signal was connected with [constant CONNECT_REFERENCE_COUNTED]. To avoid this, first, use [method is_connected] to check for existing connections. If the [code]target[/code] is destroyed in the game's lifecycle, the connection will be lost. @@ -166,13 +165,12 @@ <method name="disconnect"> <return type="void"> </return> - <argument index="0" name="signal" type="String"> - </argument> - <argument index="1" name="target" type="Object"> + <argument index="0" name="signal" type="StringName"> </argument> - <argument index="2" name="method" type="String"> + <argument index="1" name="callable" type="Callable"> </argument> <description> + [b]FIXME:[/b] The syntax changed with the addition of [Callable], this should be updated. Disconnects a [code]signal[/code] from a [code]method[/code] on the given [code]target[/code]. If you try to disconnect a connection that does not exist, the method will throw an error. Use [method is_connected] to ensure that the connection exists. </description> @@ -180,7 +178,7 @@ <method name="emit_signal" qualifiers="vararg"> <return type="void"> </return> - <argument index="0" name="signal" type="String"> + <argument index="0" name="signal" type="StringName"> </argument> <description> Emits the given [code]signal[/code]. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: @@ -307,7 +305,7 @@ <method name="has_method" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <description> Returns [code]true[/code] if the object contains the given [code]method[/code]. @@ -316,7 +314,7 @@ <method name="has_user_signal" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="signal" type="String"> + <argument index="0" name="signal" type="StringName"> </argument> <description> Returns [code]true[/code] if the given user-defined [code]signal[/code] exists. @@ -341,13 +339,12 @@ <method name="is_connected" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="signal" type="String"> + <argument index="0" name="signal" type="StringName"> </argument> - <argument index="1" name="target" type="Object"> - </argument> - <argument index="2" name="method" type="String"> + <argument index="1" name="callable" type="Callable"> </argument> <description> + [b]FIXME:[/b] The syntax changed with the addition of [Callable], this should be updated. Returns [code]true[/code] if a connection exists for a given [code]signal[/code], [code]target[/code], and [code]method[/code]. </description> </method> @@ -409,7 +406,7 @@ <method name="set_deferred"> <return type="void"> </return> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> @@ -472,9 +469,9 @@ </description> </method> <method name="tr" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> - <argument index="0" name="message" type="String"> + <argument index="0" name="message" type="StringName"> </argument> <description> Translates a message using translation catalogs configured in the Project Settings. diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index e9b86e93dd..b08357e278 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -20,6 +20,8 @@ </description> </method> <method name="append"> + <return type="void"> + </return> <argument index="0" name="byte" type="int"> </argument> <description> @@ -27,6 +29,8 @@ </description> </method> <method name="append_array"> + <return type="void"> + </return> <argument index="0" name="array" type="PackedByteArray"> </argument> <description> @@ -97,11 +101,15 @@ </description> </method> <method name="invert"> + <return type="void"> + </return> <description> Reverses the order of the elements in the array. </description> </method> <method name="push_back"> + <return type="void"> + </return> <argument index="0" name="byte" type="int"> </argument> <description> @@ -109,6 +117,8 @@ </description> </method> <method name="remove"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -116,6 +126,8 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -123,6 +135,8 @@ </description> </method> <method name="set"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="byte" type="int"> diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index 1d1614b081..06228e4dac 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -20,6 +20,8 @@ </description> </method> <method name="append"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -27,6 +29,8 @@ </description> </method> <method name="append_array"> + <return type="void"> + </return> <argument index="0" name="array" type="PackedColorArray"> </argument> <description> @@ -52,11 +56,15 @@ </description> </method> <method name="invert"> + <return type="void"> + </return> <description> Reverses the order of the elements in the array. </description> </method> <method name="push_back"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -64,6 +72,8 @@ </description> </method> <method name="remove"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -71,6 +81,8 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -78,6 +90,8 @@ </description> </method> <method name="set"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="color" type="Color"> diff --git a/doc/classes/PackedRealArray.xml b/doc/classes/PackedFloat32Array.xml index 7a7415b279..ee82586cdb 100644 --- a/doc/classes/PackedRealArray.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -1,25 +1,28 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PackedRealArray" version="4.0"> +<class name="PackedFloat32Array" version="4.0"> <brief_description> - A packed [Array] of reals ([float]). + A packed [Array] of 32-bit floating-point values. </brief_description> <description> - An [Array] specifically designed to hold floating-point values ([float]). Packs data tightly, so it saves memory for large array sizes. + An [Array] specifically designed to hold 32-bit floating-point values. Packs data tightly, so it saves memory for large array sizes. [b]Note:[/b] This type is passed by value and not by reference. + If you need to pack 64-bit floats tightly, see [PackedFloat64Array]. </description> <tutorials> </tutorials> <methods> - <method name="PackedRealArray"> - <return type="PackedRealArray"> + <method name="PackedFloat32Array"> + <return type="PackedFloat32Array"> </return> <argument index="0" name="from" type="Array"> </argument> <description> - Constructs a new [PackedRealArray]. Optionally, you can pass in a generic [Array] that will be converted. + Constructs a new [PackedFloat32Array]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> @@ -27,10 +30,12 @@ </description> </method> <method name="append_array"> - <argument index="0" name="array" type="PackedRealArray"> + <return type="void"> + </return> + <argument index="0" name="array" type="PackedFloat32Array"> </argument> <description> - Appends a [PackedRealArray] at the end of this array. + Appends a [PackedFloat32Array] at the end of this array. </description> </method> <method name="empty"> @@ -52,11 +57,15 @@ </description> </method> <method name="invert"> + <return type="void"> + </return> <description> Reverses the order of the elements in the array. </description> </method> <method name="push_back"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> @@ -64,6 +73,8 @@ </description> </method> <method name="remove"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -71,6 +82,8 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -78,6 +91,8 @@ </description> </method> <method name="set"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="value" type="float"> diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml new file mode 100644 index 0000000000..ce2300c65a --- /dev/null +++ b/doc/classes/PackedFloat64Array.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PackedFloat64Array" version="4.0"> + <brief_description> + A packed [Array] of 64-bit floating-point values. + </brief_description> + <description> + An [Array] specifically designed to hold 64-bit floating-point values. Packs data tightly, so it saves memory for large array sizes. + [b]Note:[/b] This type is passed by value and not by reference. + If you only need to pack 32-bit floats tightly, see [PackedFloat32Array] for a more memory-friendly alternative. + </description> + <tutorials> + </tutorials> + <methods> + <method name="PackedFloat64Array"> + <return type="PackedFloat64Array"> + </return> + <argument index="0" name="from" type="Array"> + </argument> + <description> + Constructs a new [PackedFloat64Array]. Optionally, you can pass in a generic [Array] that will be converted. + </description> + </method> + <method name="append"> + <return type="void"> + </return> + <argument index="0" name="value" type="float"> + </argument> + <description> + Appends an element at the end of the array (alias of [method push_back]). + </description> + </method> + <method name="append_array"> + <return type="void"> + </return> + <argument index="0" name="array" type="PackedFloat64Array"> + </argument> + <description> + Appends a [PackedFloat64Array] at the end of this array. + </description> + </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> + <method name="insert"> + <return type="int"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). + </description> + </method> + <method name="invert"> + <return type="void"> + </return> + <description> + Reverses the order of the elements in the array. + </description> + </method> + <method name="push_back"> + <return type="void"> + </return> + <argument index="0" name="value" type="float"> + </argument> + <description> + Appends an element at the end of the array. + </description> + </method> + <method name="remove"> + <return type="void"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + Removes an element from the array by index. + </description> + </method> + <method name="resize"> + <return type="void"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + </description> + </method> + <method name="set"> + <return type="void"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + Changes the float at the given index. + </description> + </method> + <method name="size"> + <return type="int"> + </return> + <description> + Returns the size of the array. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml new file mode 100644 index 0000000000..176c624956 --- /dev/null +++ b/doc/classes/PackedInt32Array.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="PackedInt32Array" version="4.0"> + <brief_description> + A packed [Array] of 32-bit integers. + </brief_description> + <description> + An [Array] specifically designed to hold 32-bit integer values. Packs data tightly, so it saves memory for large array sizes. + [b]Note:[/b] This type is passed by value and not by reference. + [b]Note:[/b] This type stores signed 32-bit integers, which means it can take values in the interval [code][-2^31, 2^31 - 1][/code], i.e. [code][-2147483648, 2147483647][/code]. Exceeding those bounds will wrap around. In comparison, [int] uses signed 64-bit integers which can hold much larger values. If you need to pack 64-bit integers tightly, see [PackedInt64Array]. + </description> + <tutorials> + </tutorials> + <methods> + <method name="PackedInt32Array"> + <return type="PackedInt32Array"> + </return> + <argument index="0" name="from" type="Array"> + </argument> + <description> + Constructs a new [PackedInt32Array]. Optionally, you can pass in a generic [Array] that will be converted. + </description> + </method> + <method name="append"> + <return type="void"> + </return> + <argument index="0" name="integer" type="int"> + </argument> + <description> + Appends an element at the end of the array (alias of [method push_back]). + </description> + </method> + <method name="append_array"> + <return type="void"> + </return> + <argument index="0" name="array" type="PackedInt32Array"> + </argument> + <description> + Appends a [PackedInt32Array] at the end of this array. + </description> + </method> + <method name="empty"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the array is empty. + </description> + </method> + <method name="insert"> + <return type="int"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <argument index="1" name="integer" type="int"> + </argument> + <description> + Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]). + </description> + </method> + <method name="invert"> + <return type="void"> + </return> + <description> + Reverses the order of the elements in the array. + </description> + </method> + <method name="push_back"> + <return type="void"> + </return> + <argument index="0" name="integer" type="int"> + </argument> + <description> + Appends a value to the array. + </description> + </method> + <method name="remove"> + <return type="void"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + Removes an element from the array by index. + </description> + </method> + <method name="resize"> + <return type="void"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + </description> + </method> + <method name="set"> + <return type="void"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <argument index="1" name="integer" type="int"> + </argument> + <description> + Changes the integer at the given index. + </description> + </method> + <method name="size"> + <return type="int"> + </return> + <description> + Returns the array size. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/PackedIntArray.xml b/doc/classes/PackedInt64Array.xml index 536b4d9aaf..d8a8071590 100644 --- a/doc/classes/PackedIntArray.xml +++ b/doc/classes/PackedInt64Array.xml @@ -1,26 +1,28 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PackedIntArray" version="4.0"> +<class name="PackedInt64Array" version="4.0"> <brief_description> - A packed [Array] of integers ([int]). + A packed [Array] of 64-bit integers. </brief_description> <description> - An [Array] specifically designed to hold integer values ([int]). Packs data tightly, so it saves memory for large array sizes. + An [Array] specifically designed to hold 64-bit integer values. Packs data tightly, so it saves memory for large array sizes. [b]Note:[/b] This type is passed by value and not by reference. - [b]Note:[/b] This type is limited to signed 32-bit integers, which means it can only take values in the interval [code][-2^31, 2^31 - 1][/code], i.e. [code][-2147483648, 2147483647][/code]. Exceeding those bounds will wrap around. In comparison, [int] uses signed 64-bit integers which can hold much larger values. + [b]Note:[/b] This type stores signed 64-bit integers, which means it can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around. If you only need to pack 32-bit integers tightly, see [PackedInt32Array] for a more memory-friendly alternative. </description> <tutorials> </tutorials> <methods> - <method name="PackedIntArray"> - <return type="PackedIntArray"> + <method name="PackedInt64Array"> + <return type="PackedInt64Array"> </return> <argument index="0" name="from" type="Array"> </argument> <description> - Constructs a new [PackedIntArray]. Optionally, you can pass in a generic [Array] that will be converted. + Constructs a new [PackedInt64Array]. Optionally, you can pass in a generic [Array] that will be converted. </description> </method> <method name="append"> + <return type="void"> + </return> <argument index="0" name="integer" type="int"> </argument> <description> @@ -28,10 +30,12 @@ </description> </method> <method name="append_array"> - <argument index="0" name="array" type="PackedIntArray"> + <return type="void"> + </return> + <argument index="0" name="array" type="PackedInt64Array"> </argument> <description> - Appends a [PackedIntArray] at the end of this array. + Appends a [PackedInt64Array] at the end of this array. </description> </method> <method name="empty"> @@ -53,11 +57,15 @@ </description> </method> <method name="invert"> + <return type="void"> + </return> <description> Reverses the order of the elements in the array. </description> </method> <method name="push_back"> + <return type="void"> + </return> <argument index="0" name="integer" type="int"> </argument> <description> @@ -65,6 +73,8 @@ </description> </method> <method name="remove"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -72,6 +82,8 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -79,6 +91,8 @@ </description> </method> <method name="set"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="integer" type="int"> diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index 8efe1e2b4b..e422545b7b 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -65,7 +65,7 @@ </method> </methods> <members> - <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{"conn_count": 0,"conns": PackedIntArray( ),"editable_instances": [ ],"names": PackedStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PackedIntArray( ),"variants": [ ],"version": 2}"> + <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{"conn_count": 0,"conns": PackedInt32Array( ),"editable_instances": [ ],"names": PackedStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PackedInt32Array( ),"variants": [ ],"version": 2}"> A dictionary representation of the scene contents. Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for base scene children overrides, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. </member> diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 8824f7f8a5..9526f5899d 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -20,6 +20,8 @@ </description> </method> <method name="append"> + <return type="void"> + </return> <argument index="0" name="string" type="String"> </argument> <description> @@ -27,6 +29,8 @@ </description> </method> <method name="append_array"> + <return type="void"> + </return> <argument index="0" name="array" type="PackedStringArray"> </argument> <description> @@ -52,11 +56,15 @@ </description> </method> <method name="invert"> + <return type="void"> + </return> <description> Reverses the order of the elements in the array. </description> </method> <method name="push_back"> + <return type="void"> + </return> <argument index="0" name="string" type="String"> </argument> <description> @@ -64,6 +72,8 @@ </description> </method> <method name="remove"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -71,6 +81,8 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -78,6 +90,8 @@ </description> </method> <method name="set"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="string" type="String"> diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 339296180b..87f202357c 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -20,6 +20,8 @@ </description> </method> <method name="append"> + <return type="void"> + </return> <argument index="0" name="vector2" type="Vector2"> </argument> <description> @@ -27,6 +29,8 @@ </description> </method> <method name="append_array"> + <return type="void"> + </return> <argument index="0" name="array" type="PackedVector2Array"> </argument> <description> @@ -52,11 +56,15 @@ </description> </method> <method name="invert"> + <return type="void"> + </return> <description> Reverses the order of the elements in the array. </description> </method> <method name="push_back"> + <return type="void"> + </return> <argument index="0" name="vector2" type="Vector2"> </argument> <description> @@ -64,6 +72,8 @@ </description> </method> <method name="remove"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -71,6 +81,8 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -78,6 +90,8 @@ </description> </method> <method name="set"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="vector2" type="Vector2"> diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index 2c5e2a63e3..7bfa684ff5 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -20,6 +20,8 @@ </description> </method> <method name="append"> + <return type="void"> + </return> <argument index="0" name="vector3" type="Vector3"> </argument> <description> @@ -27,6 +29,8 @@ </description> </method> <method name="append_array"> + <return type="void"> + </return> <argument index="0" name="array" type="PackedVector3Array"> </argument> <description> @@ -52,11 +56,15 @@ </description> </method> <method name="invert"> + <return type="void"> + </return> <description> Reverses the order of the elements in the array. </description> </method> <method name="push_back"> + <return type="void"> + </return> <argument index="0" name="vector3" type="Vector3"> </argument> <description> @@ -64,6 +72,8 @@ </description> </method> <method name="remove"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -71,6 +81,8 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -78,6 +90,8 @@ </description> </method> <method name="set"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="vector3" type="Vector3"> diff --git a/doc/classes/PacketPeerDTLS.xml b/doc/classes/PacketPeerDTLS.xml index a9ba6dea00..19ebb9d81e 100644 --- a/doc/classes/PacketPeerDTLS.xml +++ b/doc/classes/PacketPeerDTLS.xml @@ -14,7 +14,7 @@ </return> <argument index="0" name="packet_peer" type="PacketPeerUDP"> </argument> - <argument index="1" name="validate_certs" type="bool" default="false"> + <argument index="1" name="validate_certs" type="bool" default="true"> </argument> <argument index="2" name="for_hostname" type="String" default=""""> </argument> diff --git a/doc/classes/PanoramaSky.xml b/doc/classes/PanoramaSky.xml index c600a4425b..0ddf1cb054 100644 --- a/doc/classes/PanoramaSky.xml +++ b/doc/classes/PanoramaSky.xml @@ -5,6 +5,8 @@ </brief_description> <description> A resource referenced in an [Environment] that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map. + Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR ([code].hdr[/code]) and OpenEXR ([code].exr[/code]) image formats for this purpose. + You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cube map to an equirectangular sky map. </description> <tutorials> </tutorials> diff --git a/doc/classes/Physics2DServer.xml b/doc/classes/Physics2DServer.xml index 4fac27a82b..45215253be 100644 --- a/doc/classes/Physics2DServer.xml +++ b/doc/classes/Physics2DServer.xml @@ -165,7 +165,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <description> </description> @@ -199,7 +199,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <description> Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: @@ -661,7 +661,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <argument index="3" name="userdata" type="Variant" default="null"> </argument> diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml index d54a907d3d..592d3d8e4e 100644 --- a/doc/classes/PhysicsServer.xml +++ b/doc/classes/PhysicsServer.xml @@ -156,7 +156,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <description> </description> @@ -190,7 +190,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <description> Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: @@ -678,7 +678,7 @@ </argument> <argument index="1" name="receiver" type="Object"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <argument index="3" name="userdata" type="Variant" default="null"> </argument> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 2a408e277a..f777545733 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -14,7 +14,7 @@ </return> <argument index="0" name="path" type="NodePath"> </argument> - <argument index="1" name="weights" type="PackedRealArray"> + <argument index="1" name="weights" type="PackedFloat32Array"> </argument> <description> </description> @@ -48,7 +48,7 @@ </description> </method> <method name="get_bone_weights" qualifiers="const"> - <return type="PackedRealArray"> + <return type="PackedFloat32Array"> </return> <argument index="0" name="index" type="int"> </argument> @@ -70,7 +70,7 @@ </return> <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="weights" type="PackedRealArray"> + <argument index="1" name="weights" type="PackedFloat32Array"> </argument> <description> </description> diff --git a/doc/classes/PolygonPathFinder.xml b/doc/classes/PolygonPathFinder.xml index 0b535159a7..49453d32ac 100644 --- a/doc/classes/PolygonPathFinder.xml +++ b/doc/classes/PolygonPathFinder.xml @@ -72,7 +72,7 @@ </return> <argument index="0" name="points" type="PackedVector2Array"> </argument> - <argument index="1" name="connections" type="PackedIntArray"> + <argument index="1" name="connections" type="PackedInt32Array"> </argument> <description> </description> diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index f11f20f1f9..327fa882e5 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -132,6 +132,8 @@ </description> </method> <method name="set_axis_angle"> + <return type="void"> + </return> <argument index="0" name="axis" type="Vector3"> </argument> <argument index="1" name="angle" type="float"> @@ -141,6 +143,8 @@ </description> </method> <method name="set_euler"> + <return type="void"> + </return> <argument index="0" name="euler" type="Vector3"> </argument> <description> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index e32b19ff00..26abfb538b 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Rect2" version="4.0"> <brief_description> - 2D axis-aligned bounding box. + 2D axis-aligned bounding box using floating point coordinates. </brief_description> <description> - Rect2 consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. + [Rect2] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. + It uses floating point coordinates. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> @@ -36,6 +37,15 @@ Constructs a [Rect2] by x, y, width, and height. </description> </method> + <method name="Rect2"> + <return type="Rect2"> + </return> + <argument index="0" name="from" type="Rect2i"> + </argument> + <description> + Constructs a [Rect2] from a [Rect2i]. + </description> + </method> <method name="abs"> <return type="Rect2"> </return> diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml new file mode 100644 index 0000000000..2e8be384c1 --- /dev/null +++ b/doc/classes/Rect2i.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Rect2i" version="4.0"> + <brief_description> + 2D axis-aligned bounding box using integer coordinates. + </brief_description> + <description> + [Rect2i] consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. + It uses integer coordinates. + </description> + <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + </tutorials> + <methods> + <method name="Rect2i"> + <return type="Rect2i"> + </return> + <argument index="0" name="position" type="Vector2"> + </argument> + <argument index="1" name="size" type="Vector2"> + </argument> + <description> + Constructs a [Rect2i] by position and size. + </description> + </method> + <method name="Rect2i"> + <return type="Rect2i"> + </return> + <argument index="0" name="x" type="int"> + </argument> + <argument index="1" name="y" type="int"> + </argument> + <argument index="2" name="width" type="int"> + </argument> + <argument index="3" name="height" type="int"> + </argument> + <description> + Constructs a [Rect2i] by x, y, width, and height. + </description> + </method> + <method name="Rect2i"> + <return type="Rect2i"> + </return> + <argument index="0" name="from" type="Rect2"> + </argument> + <description> + Constructs a new [Rect2i] from [Rect2]. The floating point coordinates will be truncated. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml index 828f4cd5d1..713f2c1726 100644 --- a/doc/classes/ResourceFormatLoader.xml +++ b/doc/classes/ResourceFormatLoader.xml @@ -43,7 +43,7 @@ <method name="handles_type" qualifiers="virtual"> <return type="bool"> </return> - <argument index="0" name="typename" type="String"> + <argument index="0" name="typename" type="StringName"> </argument> <description> Tells which resource class this loader can load. diff --git a/doc/classes/ResourcePreloader.xml b/doc/classes/ResourcePreloader.xml index b1e8096c3a..3159a4c424 100644 --- a/doc/classes/ResourcePreloader.xml +++ b/doc/classes/ResourcePreloader.xml @@ -13,7 +13,7 @@ <method name="add_resource"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="resource" type="Resource"> </argument> @@ -24,7 +24,7 @@ <method name="get_resource" qualifiers="const"> <return type="Resource"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns the resource associated to [code]name[/code]. @@ -40,7 +40,7 @@ <method name="has_resource" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if the preloader contains a resource associated to [code]name[/code]. @@ -49,7 +49,7 @@ <method name="remove_resource"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Removes the resource associated to [code]name[/code] from the preloader. @@ -58,9 +58,9 @@ <method name="rename_resource"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="newname" type="String"> + <argument index="1" name="newname" type="StringName"> </argument> <description> Renames a resource inside the preloader from [code]name[/code] to [code]newname[/code]. diff --git a/doc/classes/SceneState.xml b/doc/classes/SceneState.xml index 2fcb831270..abc429d5fe 100644 --- a/doc/classes/SceneState.xml +++ b/doc/classes/SceneState.xml @@ -37,7 +37,7 @@ </description> </method> <method name="get_connection_method" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -46,7 +46,7 @@ </description> </method> <method name="get_connection_signal" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -117,7 +117,7 @@ </description> </method> <method name="get_node_name" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -157,7 +157,7 @@ </description> </method> <method name="get_node_property_name" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -179,7 +179,7 @@ </description> </method> <method name="get_node_type" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="idx" type="int"> </argument> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index b1d559986c..e6778013cf 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -16,9 +16,9 @@ <method name="call_group" qualifiers="vararg"> <return type="Variant"> </return> - <argument index="0" name="group" type="String"> + <argument index="0" name="group" type="StringName"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <description> Calls [code]method[/code] on each member of the given group. @@ -29,9 +29,9 @@ </return> <argument index="0" name="flags" type="int"> </argument> - <argument index="1" name="group" type="String"> + <argument index="1" name="group" type="StringName"> </argument> - <argument index="2" name="method" type="String"> + <argument index="2" name="method" type="StringName"> </argument> <description> Calls [code]method[/code] on each member of the given group, respecting the given [enum GroupCallFlags]. @@ -83,7 +83,7 @@ </description> </method> <method name="get_network_connected_peers" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <description> Returns the peer IDs of all connected peers of this [SceneTree]'s [member network_peer]. @@ -106,7 +106,7 @@ <method name="get_nodes_in_group"> <return type="Array"> </return> - <argument index="0" name="group" type="String"> + <argument index="0" name="group" type="StringName"> </argument> <description> Returns a list of all nodes assigned to the given group. @@ -122,7 +122,7 @@ <method name="has_group" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if the given group exists. @@ -152,7 +152,7 @@ <method name="notify_group"> <return type="void"> </return> - <argument index="0" name="group" type="String"> + <argument index="0" name="group" type="StringName"> </argument> <argument index="1" name="notification" type="int"> </argument> @@ -165,7 +165,7 @@ </return> <argument index="0" name="call_flags" type="int"> </argument> - <argument index="1" name="group" type="String"> + <argument index="1" name="group" type="StringName"> </argument> <argument index="2" name="notification" type="int"> </argument> @@ -212,7 +212,7 @@ <method name="set_group"> <return type="void"> </return> - <argument index="0" name="group" type="String"> + <argument index="0" name="group" type="StringName"> </argument> <argument index="1" name="property" type="String"> </argument> @@ -227,7 +227,7 @@ </return> <argument index="0" name="call_flags" type="int"> </argument> - <argument index="1" name="group" type="String"> + <argument index="1" name="group" type="StringName"> </argument> <argument index="2" name="property" type="String"> </argument> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index 0f07cb83f3..f671315620 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -26,7 +26,7 @@ </description> </method> <method name="get_instance_base_type" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> <description> Returns the script's base type. @@ -35,7 +35,7 @@ <method name="get_property_default_value"> <return type="Variant"> </return> - <argument index="0" name="property" type="String"> + <argument index="0" name="property" type="StringName"> </argument> <description> </description> @@ -67,7 +67,7 @@ <method name="has_script_signal" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="signal_name" type="String"> + <argument index="0" name="signal_name" type="StringName"> </argument> <description> Returns [code]true[/code] if the script, or a base class, defines a signal with the given name. diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 0b113bebe5..9c5634f43a 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -4,7 +4,9 @@ A helper node for displaying scrollable elements such as lists. </brief_description> <description> - A ScrollContainer node meant to contain a [Control] child. ScrollContainers will automatically create a scrollbar child ([HScrollBar], [VScrollBar], or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the [member Control.rect_min_size] of the Control relative to the ScrollContainer. Works great with a [Panel] control. You can set [code]EXPAND[/code] on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension). + A ScrollContainer node meant to contain a [Control] child. + ScrollContainers will automatically create a scrollbar child ([HScrollBar], [VScrollBar], or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the [member Control.rect_min_size] of the Control relative to the ScrollContainer. + Works great with a [Panel] control. You can set [code]EXPAND[/code] on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension). </description> <tutorials> </tutorials> diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml index a2fbf5a1b1..14c5d7a03c 100644 --- a/doc/classes/Shader.xml +++ b/doc/classes/Shader.xml @@ -14,7 +14,7 @@ <method name="get_default_texture_param" qualifiers="const"> <return type="Texture2D"> </return> - <argument index="0" name="param" type="String"> + <argument index="0" name="param" type="StringName"> </argument> <description> Returns the texture that is set as default for the specified parameter. @@ -31,7 +31,7 @@ <method name="has_param" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns [code]true[/code] if the shader has this param defined as a uniform in its code. @@ -41,7 +41,7 @@ <method name="set_default_texture_param"> <return type="void"> </return> - <argument index="0" name="param" type="String"> + <argument index="0" name="param" type="StringName"> </argument> <argument index="1" name="texture" type="Texture2D"> </argument> diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml index adb30c14d1..7e0e1ce831 100644 --- a/doc/classes/ShaderMaterial.xml +++ b/doc/classes/ShaderMaterial.xml @@ -13,7 +13,7 @@ <method name="get_shader_param" qualifiers="const"> <return type="Variant"> </return> - <argument index="0" name="param" type="String"> + <argument index="0" name="param" type="StringName"> </argument> <description> Returns the current value set for this material of a uniform in the shader. @@ -40,7 +40,7 @@ <method name="set_shader_param"> <return type="void"> </return> - <argument index="0" name="param" type="String"> + <argument index="0" name="param" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml new file mode 100644 index 0000000000..ff428b887d --- /dev/null +++ b/doc/classes/Signal.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Signal" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="Signal"> + <return type="Signal"> + </return> + <argument index="0" name="object" type="Object"> + </argument> + <argument index="1" name="signal_name" type="StringName"> + </argument> + <description> + </description> + </method> + <method name="connect"> + <return type="int"> + </return> + <argument index="0" name="callable" type="Callable"> + </argument> + <argument index="1" name="binds" type="Array" default="[]"> + </argument> + <argument index="2" name="flags" type="int" default="0"> + </argument> + <description> + </description> + </method> + <method name="disconnect"> + <return type="void"> + </return> + <argument index="0" name="callable" type="Callable"> + </argument> + <description> + </description> + </method> + <method name="emit" qualifiers="vararg"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="get_connections"> + <return type="Array"> + </return> + <description> + </description> + </method> + <method name="get_name"> + <return type="StringName"> + </return> + <description> + </description> + </method> + <method name="get_object"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_object_id"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="is_connected"> + <return type="bool"> + </return> + <argument index="0" name="callable" type="Callable"> + </argument> + <description> + </description> + </method> + <method name="is_null"> + <return type="bool"> + </return> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/SkeletonIK.xml b/doc/classes/SkeletonIK.xml index 0f07031708..1db78314d2 100644 --- a/doc/classes/SkeletonIK.xml +++ b/doc/classes/SkeletonIK.xml @@ -45,13 +45,13 @@ </member> <member name="override_tip_basis" type="bool" setter="set_override_tip_basis" getter="is_override_tip_basis" default="true"> </member> - <member name="root_bone" type="String" setter="set_root_bone" getter="get_root_bone" default=""""> + <member name="root_bone" type="StringName" setter="set_root_bone" getter="get_root_bone" default="@"""> </member> <member name="target" type="Transform" setter="set_target_transform" getter="get_target_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> </member> <member name="target_node" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> </member> - <member name="tip_bone" type="String" setter="set_tip_bone" getter="get_tip_bone" default=""""> + <member name="tip_bone" type="StringName" setter="set_tip_bone" getter="get_tip_bone" default="@"""> </member> <member name="use_magnet" type="bool" setter="set_use_magnet" getter="is_using_magnet" default="false"> </member> diff --git a/doc/classes/Skin.xml b/doc/classes/Skin.xml index b65d9d8f98..e22feb42f0 100644 --- a/doc/classes/Skin.xml +++ b/doc/classes/Skin.xml @@ -37,6 +37,14 @@ <description> </description> </method> + <method name="get_bind_name" qualifiers="const"> + <return type="StringName"> + </return> + <argument index="0" name="bind_index" type="int"> + </argument> + <description> + </description> + </method> <method name="get_bind_pose" qualifiers="const"> <return type="Transform"> </return> @@ -63,6 +71,16 @@ <description> </description> </method> + <method name="set_bind_name"> + <return type="void"> + </return> + <argument index="0" name="bind_index" type="int"> + </argument> + <argument index="1" name="name" type="StringName"> + </argument> + <description> + </description> + </method> <method name="set_bind_pose"> <return type="void"> </return> diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml index a4f24f0603..9facdde681 100644 --- a/doc/classes/SpriteFrames.xml +++ b/doc/classes/SpriteFrames.xml @@ -12,7 +12,7 @@ <method name="add_animation"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <description> Adds a new animation to the library. @@ -21,7 +21,7 @@ <method name="add_frame"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <argument index="1" name="frame" type="Texture2D"> </argument> @@ -34,7 +34,7 @@ <method name="clear"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <description> Removes all frames from the given animation. @@ -50,7 +50,7 @@ <method name="get_animation_loop" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <description> If [code]true[/code], the given animation will loop. @@ -66,7 +66,7 @@ <method name="get_animation_speed" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <description> The animation's speed in frames per second. @@ -75,7 +75,7 @@ <method name="get_frame" qualifiers="const"> <return type="Texture2D"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <argument index="1" name="idx" type="int"> </argument> @@ -86,7 +86,7 @@ <method name="get_frame_count" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <description> Returns the number of frames in the animation. @@ -95,7 +95,7 @@ <method name="has_animation" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <description> If [code]true[/code], the named animation exists. @@ -104,7 +104,7 @@ <method name="remove_animation"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <description> Removes the given animation. @@ -113,7 +113,7 @@ <method name="remove_frame"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <argument index="1" name="idx" type="int"> </argument> @@ -124,9 +124,9 @@ <method name="rename_animation"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> - <argument index="1" name="newname" type="String"> + <argument index="1" name="newname" type="StringName"> </argument> <description> Changes the animation's name to [code]newname[/code]. @@ -135,7 +135,7 @@ <method name="set_animation_loop"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <argument index="1" name="loop" type="bool"> </argument> @@ -146,7 +146,7 @@ <method name="set_animation_speed"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <argument index="1" name="speed" type="float"> </argument> @@ -157,7 +157,7 @@ <method name="set_frame"> <return type="void"> </return> - <argument index="0" name="anim" type="String"> + <argument index="0" name="anim" type="StringName"> </argument> <argument index="1" name="idx" type="int"> </argument> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index fdf4e780de..1a5182b76e 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -49,6 +49,15 @@ <method name="String"> <return type="String"> </return> + <argument index="0" name="from" type="Vector2i"> + </argument> + <description> + Constructs a new String from the given [Vector2i]. + </description> + </method> + <method name="String"> + <return type="String"> + </return> <argument index="0" name="from" type="Rect2"> </argument> <description> @@ -58,6 +67,15 @@ <method name="String"> <return type="String"> </return> + <argument index="0" name="from" type="Rect2i"> + </argument> + <description> + Constructs a new String from the given [Rect2i]. + </description> + </method> + <method name="String"> + <return type="String"> + </return> <argument index="0" name="from" type="Vector3"> </argument> <description> @@ -67,6 +85,15 @@ <method name="String"> <return type="String"> </return> + <argument index="0" name="from" type="Vector3i"> + </argument> + <description> + Constructs a new String from the given [Vector3i]. + </description> + </method> + <method name="String"> + <return type="String"> + </return> <argument index="0" name="from" type="Transform2D"> </argument> <description> @@ -130,6 +157,15 @@ <method name="String"> <return type="String"> </return> + <argument index="0" name="from" type="StringName"> + </argument> + <description> + Constructs a new String from the given [StringName]. + </description> + </method> + <method name="String"> + <return type="String"> + </return> <argument index="0" name="from" type="NodePath"> </argument> <description> @@ -148,6 +184,24 @@ <method name="String"> <return type="String"> </return> + <argument index="0" name="from" type="Callable"> + </argument> + <description> + Constructs a new String from the given [Callable]. + </description> + </method> + <method name="String"> + <return type="String"> + </return> + <argument index="0" name="from" type="Signal"> + </argument> + <description> + Constructs a new String from the given [Signal]. + </description> + </method> + <method name="String"> + <return type="String"> + </return> <argument index="0" name="from" type="Dictionary"> </argument> <description> @@ -175,19 +229,37 @@ <method name="String"> <return type="String"> </return> - <argument index="0" name="from" type="PackedIntArray"> + <argument index="0" name="from" type="PackedInt32Array"> + </argument> + <description> + Constructs a new String from the given [PackedInt32Array]. + </description> + </method> + <method name="String"> + <return type="String"> + </return> + <argument index="0" name="from" type="PackedInt64Array"> + </argument> + <description> + Constructs a new String from the given [PackedInt64Array]. + </description> + </method> + <method name="String"> + <return type="String"> + </return> + <argument index="0" name="from" type="PackedFloat32Array"> </argument> <description> - Constructs a new String from the given [PackedIntArray]. + Constructs a new String from the given [PackedFloat32Array]. </description> </method> <method name="String"> <return type="String"> </return> - <argument index="0" name="from" type="PackedRealArray"> + <argument index="0" name="from" type="PackedFloat64Array"> </argument> <description> - Constructs a new String from the given [PackedRealArray]. + Constructs a new String from the given [PackedFloat64Array]. </description> </method> <method name="String"> @@ -322,6 +394,8 @@ </description> </method> <method name="erase"> + <return type="void"> + </return> <argument index="0" name="position" type="int"> </argument> <argument index="1" name="chars" type="int"> @@ -823,7 +897,7 @@ </description> </method> <method name="split_floats"> - <return type="PackedRealArray"> + <return type="PackedFloat32Array"> </return> <argument index="0" name="delimiter" type="String"> </argument> diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml new file mode 100644 index 0000000000..f323a4bb6a --- /dev/null +++ b/doc/classes/StringName.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="StringName" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="StringName"> + <return type="StringName"> + </return> + <argument index="0" name="from" type="String"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index a265d16cd9..4304a8df5e 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -22,7 +22,7 @@ <method name="add_bones"> <return type="void"> </return> - <argument index="0" name="bones" type="PackedIntArray"> + <argument index="0" name="bones" type="PackedInt32Array"> </argument> <description> Adds an array of bones for the next vertex to use. [code]bones[/code] must contain 4 integers. @@ -123,7 +123,7 @@ <method name="add_weights"> <return type="void"> </return> - <argument index="0" name="weights" type="PackedRealArray"> + <argument index="0" name="weights" type="PackedFloat32Array"> </argument> <description> Specifies weight values for next vertex to use. [code]weights[/code] must contain 4 values. diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 73b5afe6a7..3c4fd4c41a 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -204,10 +204,6 @@ </theme_item> <theme_item name="increment_highlight" type="Texture2D"> </theme_item> - <theme_item name="label_valign_bg" type="int" default="2"> - </theme_item> - <theme_item name="label_valign_fg" type="int" default="0"> - </theme_item> <theme_item name="menu" type="Texture2D"> </theme_item> <theme_item name="menu_highlight" type="Texture2D"> @@ -222,7 +218,5 @@ </theme_item> <theme_item name="tab_fg" type="StyleBox"> </theme_item> - <theme_item name="top_margin" type="int" default="24"> - </theme_item> </theme_items> </class> diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index 266a733f8f..8f31b24131 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -285,10 +285,6 @@ </theme_item> <theme_item name="increment_highlight" type="Texture2D"> </theme_item> - <theme_item name="label_valign_bg" type="int" default="2"> - </theme_item> - <theme_item name="label_valign_fg" type="int" default="0"> - </theme_item> <theme_item name="panel" type="StyleBox"> </theme_item> <theme_item name="tab_bg" type="StyleBox"> @@ -297,7 +293,5 @@ </theme_item> <theme_item name="tab_fg" type="StyleBox"> </theme_item> - <theme_item name="top_margin" type="int" default="24"> - </theme_item> </theme_items> </class> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 2ab8b939c7..d4eeb574eb 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -299,7 +299,7 @@ </description> </method> <method name="search" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="key" type="String"> </argument> @@ -311,7 +311,7 @@ </argument> <description> Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum. - Returns an empty [code]PackedIntArray[/code] if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [enum SearchResult] enum, e.g: + Returns an empty [code]PackedInt32Array[/code] if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [enum SearchResult] enum, e.g: [codeblock] var result = search(key, flags, line, column) if result.size() > 0: diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 45f49e7b31..70a4eda867 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -21,9 +21,9 @@ <method name="clear_color"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Clears the [Color] at [code]name[/code] if the theme has [code]type[/code]. @@ -32,9 +32,9 @@ <method name="clear_constant"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Clears the constant at [code]name[/code] if the theme has [code]type[/code]. @@ -43,9 +43,9 @@ <method name="clear_font"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Clears the [Font] at [code]name[/code] if the theme has [code]type[/code]. @@ -54,9 +54,9 @@ <method name="clear_icon"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Clears the icon at [code]name[/code] if the theme has [code]type[/code]. @@ -65,9 +65,9 @@ <method name="clear_stylebox"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Clears [StyleBox] at [code]name[/code] if the theme has [code]type[/code]. @@ -92,9 +92,9 @@ <method name="get_color" qualifiers="const"> <return type="Color"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns the [Color] at [code]name[/code] if the theme has [code]type[/code]. @@ -112,9 +112,9 @@ <method name="get_constant" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns the constant at [code]name[/code] if the theme has [code]type[/code]. @@ -132,9 +132,9 @@ <method name="get_font" qualifiers="const"> <return type="Font"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns the [Font] at [code]name[/code] if the theme has [code]type[/code]. @@ -152,9 +152,9 @@ <method name="get_icon" qualifiers="const"> <return type="Texture2D"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]type[/code]. @@ -172,9 +172,9 @@ <method name="get_stylebox" qualifiers="const"> <return type="StyleBox"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]type[/code]. @@ -208,9 +208,9 @@ <method name="has_color" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]type[/code]. @@ -220,9 +220,9 @@ <method name="has_constant" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns [code]true[/code] if constant with [code]name[/code] is in [code]type[/code]. @@ -232,9 +232,9 @@ <method name="has_font" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]type[/code]. @@ -244,9 +244,9 @@ <method name="has_icon" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns [code]true[/code] if icon [Texture2D] with [code]name[/code] is in [code]type[/code]. @@ -256,9 +256,9 @@ <method name="has_stylebox" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <description> Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]type[/code]. @@ -268,9 +268,9 @@ <method name="set_color"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <argument index="2" name="color" type="Color"> </argument> @@ -282,9 +282,9 @@ <method name="set_constant"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <argument index="2" name="constant" type="int"> </argument> @@ -296,9 +296,9 @@ <method name="set_font"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <argument index="2" name="font" type="Font"> </argument> @@ -310,9 +310,9 @@ <method name="set_icon"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <argument index="2" name="texture" type="Texture2D"> </argument> @@ -324,9 +324,9 @@ <method name="set_stylebox"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="type" type="String"> + <argument index="1" name="type" type="StringName"> </argument> <argument index="2" name="texture" type="StyleBox"> </argument> diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml index f616a9d9b1..3bb5797df5 100644 --- a/doc/classes/Thread.xml +++ b/doc/classes/Thread.xml @@ -29,7 +29,7 @@ </return> <argument index="0" name="instance" type="Object"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <argument index="2" name="userdata" type="Variant" default="null"> </argument> diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index e4d367c344..72f9c5493a 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -149,7 +149,7 @@ </description> </method> <method name="xform"> - <return type="Variant"> + <return type="void"> </return> <argument index="0" name="v" type="Variant"> </argument> @@ -158,7 +158,7 @@ </description> </method> <method name="xform_inv"> - <return type="Variant"> + <return type="void"> </return> <argument index="0" name="v" type="Variant"> </argument> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index af93d4c654..164efd4e5e 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -151,7 +151,7 @@ </description> </method> <method name="xform"> - <return type="Variant"> + <return type="void"> </return> <argument index="0" name="v" type="Variant"> </argument> @@ -160,7 +160,7 @@ </description> </method> <method name="xform_inv"> - <return type="Variant"> + <return type="void"> </return> <argument index="0" name="v" type="Variant"> </argument> diff --git a/doc/classes/Translation.xml b/doc/classes/Translation.xml index c0c5a3ffbd..11245195bf 100644 --- a/doc/classes/Translation.xml +++ b/doc/classes/Translation.xml @@ -14,9 +14,9 @@ <method name="add_message"> <return type="void"> </return> - <argument index="0" name="src_message" type="String"> + <argument index="0" name="src_message" type="StringName"> </argument> - <argument index="1" name="xlated_message" type="String"> + <argument index="1" name="xlated_message" type="StringName"> </argument> <description> Adds a message if nonexistent, followed by its translation. @@ -25,16 +25,16 @@ <method name="erase_message"> <return type="void"> </return> - <argument index="0" name="src_message" type="String"> + <argument index="0" name="src_message" type="StringName"> </argument> <description> Erases a message. </description> </method> <method name="get_message" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> - <argument index="0" name="src_message" type="String"> + <argument index="0" name="src_message" type="StringName"> </argument> <description> Returns a message's translation. diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml index 8a2a8b9768..aaf7a4d160 100644 --- a/doc/classes/TranslationServer.xml +++ b/doc/classes/TranslationServer.xml @@ -69,9 +69,9 @@ </description> </method> <method name="translate" qualifiers="const"> - <return type="String"> + <return type="StringName"> </return> - <argument index="0" name="message" type="String"> + <argument index="0" name="message" type="StringName"> </argument> <description> Returns the current locale's translation for the given message (key). diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index e4d2af0c6e..f498919f9e 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -30,7 +30,7 @@ <method name="call_recursive" qualifiers="vararg"> <return type="Variant"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <description> Calls the [code]method[/code] on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. @@ -452,7 +452,7 @@ </argument> <argument index="1" name="object" type="Object"> </argument> - <argument index="2" name="callback" type="String"> + <argument index="2" name="callback" type="StringName"> </argument> <description> Sets the given column's custom draw callback to [code]callback[/code] method on [code]object[/code]. diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index e60dc07e99..342acaae96 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -25,13 +25,13 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <argument index="2" name="initial_val" type="Variant"> </argument> <argument index="3" name="target" type="Object"> </argument> - <argument index="4" name="target_method" type="String"> + <argument index="4" name="target_method" type="StringName"> </argument> <argument index="5" name="duration" type="float"> </argument> @@ -130,7 +130,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <argument index="2" name="initial_val" type="Variant"> </argument> @@ -186,7 +186,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="key" type="String" default=""""> + <argument index="1" name="key" type="StringName" default=""""> </argument> <description> Stops animation and removes a tween, given its object and property/method pair. By default, all tweens are removed, unless [code]key[/code] is specified. @@ -204,7 +204,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="key" type="String" default=""""> + <argument index="1" name="key" type="StringName" default=""""> </argument> <description> Resets a tween to its initial value (the one given, not the one before the tween), given its object and property/method pair. By default, all tweens are removed, unless [code]key[/code] is specified. @@ -222,7 +222,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="key" type="String" default=""""> + <argument index="1" name="key" type="StringName" default=""""> </argument> <description> Continues animating a stopped tween, given its object and property/method pair. By default, all tweens are resumed, unless [code]key[/code] is specified. @@ -265,7 +265,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="key" type="String" default=""""> + <argument index="1" name="key" type="StringName" default=""""> </argument> <description> Stops a tween, given its object and property/method pair. By default, all tweens are stopped, unless [code]key[/code] is specified. @@ -283,11 +283,11 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <argument index="2" name="initial" type="Object"> </argument> - <argument index="3" name="initial_method" type="String"> + <argument index="3" name="initial_method" type="StringName"> </argument> <argument index="4" name="final_val" type="Variant"> </argument> diff --git a/doc/classes/UDPServer.xml b/doc/classes/UDPServer.xml index 7f40edf61d..f3c865c392 100644 --- a/doc/classes/UDPServer.xml +++ b/doc/classes/UDPServer.xml @@ -45,7 +45,7 @@ if !connected: # Try to contact server udp.put_packet("The answer is... 42!".to_utf8()) - if udp.get_available_packet_count() > 0: + if udp.get_available_packet_count() > 0: print("Connected: %s" % udp.get_packet().get_string_from_utf8()) connected = true [/codeblock] diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 06fcb1ca03..766ebf7e32 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -36,7 +36,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <description> Register a method that will be called when the action is committed. @@ -47,7 +47,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="property" type="String"> + <argument index="1" name="property" type="StringName"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -69,7 +69,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <description> Register a method that will be called when the action is undone. @@ -80,7 +80,7 @@ </return> <argument index="0" name="object" type="Object"> </argument> - <argument index="1" name="property" type="String"> + <argument index="1" name="property" type="StringName"> </argument> <argument index="2" name="value" type="Variant"> </argument> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 4eef103d1f..7b02a1a4c9 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Vector2" version="4.0"> <brief_description> - Vector used for 2D math. + Vector used for 2D math using floating point coordinates. </brief_description> <description> 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. + It uses floating point coordinates. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> @@ -13,12 +14,21 @@ <method name="Vector2"> <return type="Vector2"> </return> + <argument index="0" name="from" type="Vector2i"> + </argument> + <description> + Constructs a new [Vector2] from [Vector2i]. + </description> + </method> + <method name="Vector2"> + <return type="Vector2"> + </return> <argument index="0" name="x" type="float"> </argument> <argument index="1" name="y" type="float"> </argument> <description> - Constructs a new Vector2 from the given [code]x[/code] and [code]y[/code]. + Constructs a new [Vector2] from the given [code]x[/code] and [code]y[/code]. </description> </method> <method name="abs"> diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml new file mode 100644 index 0000000000..a516eb01dd --- /dev/null +++ b/doc/classes/Vector2i.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Vector2i" version="4.0"> + <brief_description> + Vector used for 2D math using integer coordinates. + </brief_description> + <description> + 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. + It uses integer coordinates. + </description> + <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + </tutorials> + <methods> + <method name="Vector2i"> + <return type="Vector2i"> + </return> + <argument index="0" name="x" type="int"> + </argument> + <argument index="1" name="y" type="int"> + </argument> + <description> + Constructs a new [Vector2i] from the given [code]x[/code] and [code]y[/code]. + </description> + </method> + <method name="Vector2i"> + <return type="Vector2i"> + </return> + <argument index="0" name="from" type="Vector2"> + </argument> + <description> + Constructs a new [Vector2i] from [Vector2]. The floating point coordinates will be truncated. + </description> + </method> + </methods> + <constants> + <constant name="AXIS_X" value="0"> + Enumerated value for the X axis. + </constant> + <constant name="AXIS_Y" value="1"> + Enumerated value for the Y axis. + </constant> + <constant name="ZERO" value="Vector2i( 0, 0 )"> + Zero vector. + </constant> + <constant name="ONE" value="Vector2i( 1, 1 )"> + One vector. + </constant> + <constant name="LEFT" value="Vector2i( -1, 0 )"> + Left unit vector. + </constant> + <constant name="RIGHT" value="Vector2i( 1, 0 )"> + Right unit vector. + </constant> + <constant name="UP" value="Vector2i( 0, -1 )"> + Up unit vector. + </constant> + <constant name="DOWN" value="Vector2i( 0, 1 )"> + Down unit vector. + </constant> + </constants> +</class> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 7ae89cc450..600c03ba7d 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Vector3" version="4.0"> <brief_description> - Vector used for 3D math. + Vector used for 3D math using floating point coordinates. </brief_description> <description> 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. + It uses floating point coordinates. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> @@ -13,6 +14,15 @@ <method name="Vector3"> <return type="Vector3"> </return> + <argument index="0" name="from" type="Vector3i"> + </argument> + <description> + Constructs a new [Vector3] from [Vector3i]. + </description> + </method> + <method name="Vector3"> + <return type="Vector3"> + </return> <argument index="0" name="x" type="float"> </argument> <argument index="1" name="y" type="float"> @@ -20,7 +30,7 @@ <argument index="2" name="z" type="float"> </argument> <description> - Returns a Vector3 with the given components. + Returns a [Vector3] with the given components. </description> </method> <method name="abs"> diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml new file mode 100644 index 0000000000..4f5a658b89 --- /dev/null +++ b/doc/classes/Vector3i.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Vector3i" version="4.0"> + <brief_description> + Vector used for 3D math using integer coordinates. + </brief_description> + <description> + 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. + It uses integer coordinates. + </description> + <tutorials> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + </tutorials> + <methods> + <method name="Vector3i"> + <return type="Vector3i"> + </return> + <argument index="0" name="x" type="int"> + </argument> + <argument index="1" name="y" type="int"> + </argument> + <argument index="2" name="z" type="int"> + </argument> + <description> + Returns a [Vector3i] with the given components. + </description> + </method> + <method name="Vector3i"> + <return type="Vector3i"> + </return> + <argument index="0" name="from" type="Vector3"> + </argument> + <description> + Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated. + </description> + </method> + </methods> + <constants> + <constant name="AXIS_X" value="0"> + Enumerated value for the X axis. + </constant> + <constant name="AXIS_Y" value="1"> + Enumerated value for the Y axis. + </constant> + <constant name="AXIS_Z" value="2"> + Enumerated value for the Z axis. + </constant> + <constant name="ZERO" value="Vector3i( 0, 0, 0 )"> + Zero vector. + </constant> + <constant name="ONE" value="Vector3i( 1, 1, 1 )"> + One vector. + </constant> + <constant name="LEFT" value="Vector3i( -1, 0, 0 )"> + Left unit vector. + </constant> + <constant name="RIGHT" value="Vector3i( 1, 0, 0 )"> + Right unit vector. + </constant> + <constant name="UP" value="Vector3i( 0, 1, 0 )"> + Up unit vector. + </constant> + <constant name="DOWN" value="Vector3i( 0, -1, 0 )"> + Down unit vector. + </constant> + <constant name="FORWARD" value="Vector3i( 0, 0, -1 )"> + Forward unit vector. + </constant> + <constant name="BACK" value="Vector3i( 0, 0, 1 )"> + Back unit vector. + </constant> + </constants> +</class> diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml index d2b9af4580..91c8ad0a77 100644 --- a/doc/classes/VideoPlayer.xml +++ b/doc/classes/VideoPlayer.xml @@ -58,7 +58,7 @@ <member name="buffering_msec" type="int" setter="set_buffering_msec" getter="get_buffering_msec" default="500"> Amount of time in milliseconds to store in buffer while playing. </member> - <member name="bus" type="String" setter="set_bus" getter="get_bus" default=""Master""> + <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="@"Master""> Audio bus to use for sound playback. </member> <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="true"> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 076977c364..0632be28e1 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -425,7 +425,7 @@ </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="2" enum="DefaultCanvasItemTextureFilter"> </constant> - <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS" value="3" enum="DefaultCanvasItemTextureFilter"> + <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="3" enum="DefaultCanvasItemTextureFilter"> </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX" value="4" enum="DefaultCanvasItemTextureFilter"> </constant> diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index de8bb2c33f..ca2058ddbb 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -1671,7 +1671,7 @@ </return> <argument index="0" name="material" type="RID"> </argument> - <argument index="1" name="parameter" type="String"> + <argument index="1" name="parameter" type="StringName"> </argument> <description> Returns the value of a certain material's parameter. @@ -1693,7 +1693,7 @@ </return> <argument index="0" name="material" type="RID"> </argument> - <argument index="1" name="parameter" type="String"> + <argument index="1" name="parameter" type="StringName"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -1943,7 +1943,7 @@ </description> </method> <method name="multimesh_get_buffer" qualifiers="const"> - <return type="PackedRealArray"> + <return type="PackedFloat32Array"> </return> <argument index="0" name="multimesh" type="RID"> </argument> @@ -2078,7 +2078,7 @@ </return> <argument index="0" name="multimesh" type="RID"> </argument> - <argument index="1" name="buffer" type="PackedRealArray"> + <argument index="1" name="buffer" type="PackedFloat32Array"> </argument> <description> </description> @@ -2503,7 +2503,7 @@ </return> <argument index="0" name="where" type="Object"> </argument> - <argument index="1" name="method" type="String"> + <argument index="1" name="method" type="StringName"> </argument> <argument index="2" name="userdata" type="Variant"> </argument> @@ -2609,7 +2609,7 @@ </return> <argument index="0" name="shader" type="RID"> </argument> - <argument index="1" name="name" type="String"> + <argument index="1" name="name" type="StringName"> </argument> <description> Returns a default texture from a shader searched by name. @@ -2620,7 +2620,7 @@ </return> <argument index="0" name="material" type="RID"> </argument> - <argument index="1" name="parameter" type="String"> + <argument index="1" name="parameter" type="StringName"> </argument> <description> </description> @@ -2650,7 +2650,7 @@ </return> <argument index="0" name="shader" type="RID"> </argument> - <argument index="1" name="name" type="String"> + <argument index="1" name="name" type="StringName"> </argument> <argument index="2" name="texture" type="RID"> </argument> @@ -3641,11 +3641,11 @@ </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_LINEAR" value="2" enum="CanvasItemTextureFilter"> </constant> - <constant name="CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS" value="3" enum="CanvasItemTextureFilter"> + <constant name="CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="3" enum="CanvasItemTextureFilter"> </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="4" enum="CanvasItemTextureFilter"> </constant> - <constant name="CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC" value="5" enum="CanvasItemTextureFilter"> + <constant name="CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC" value="5" enum="CanvasItemTextureFilter"> </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC" value="6" enum="CanvasItemTextureFilter"> </constant> diff --git a/doc/classes/VisualShader.xml b/doc/classes/VisualShader.xml index 99ba665979..27ba54cb68 100644 --- a/doc/classes/VisualShader.xml +++ b/doc/classes/VisualShader.xml @@ -107,7 +107,7 @@ </description> </method> <method name="get_node_list" qualifiers="const"> - <return type="PackedIntArray"> + <return type="PackedInt32Array"> </return> <argument index="0" name="type" type="int" enum="VisualShader.Type"> </argument> diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml index d3227f421e..72ce743656 100644 --- a/doc/classes/VisualShaderNode.xml +++ b/doc/classes/VisualShaderNode.xml @@ -61,19 +61,22 @@ <constant name="PORT_TYPE_SCALAR" value="0" enum="PortType"> Floating-point scalar. Translated to [code]float[/code] type in shader code. </constant> - <constant name="PORT_TYPE_VECTOR" value="1" enum="PortType"> + <constant name="PORT_TYPE_SCALAR_INT" value="1" enum="PortType"> + Integer scalar. Translated to [code]int[/code] type in shader code. + </constant> + <constant name="PORT_TYPE_VECTOR" value="2" enum="PortType"> 3D vector of floating-point values. Translated to [code]vec3[/code] type in shader code. </constant> - <constant name="PORT_TYPE_BOOLEAN" value="2" enum="PortType"> + <constant name="PORT_TYPE_BOOLEAN" value="3" enum="PortType"> Boolean type. Translated to [code]bool[/code] type in shader code. </constant> - <constant name="PORT_TYPE_TRANSFORM" value="3" enum="PortType"> + <constant name="PORT_TYPE_TRANSFORM" value="4" enum="PortType"> Transform type. Translated to [code]mat4[/code] type in shader code. </constant> - <constant name="PORT_TYPE_SAMPLER" value="4" enum="PortType"> + <constant name="PORT_TYPE_SAMPLER" value="5" enum="PortType"> Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes. </constant> - <constant name="PORT_TYPE_MAX" value="5" enum="PortType"> + <constant name="PORT_TYPE_MAX" value="6" enum="PortType"> Represents the size of the [enum PortType] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeCompare.xml b/doc/classes/VisualShaderNodeCompare.xml index f207cba0a5..32f7be3ec3 100644 --- a/doc/classes/VisualShaderNodeCompare.xml +++ b/doc/classes/VisualShaderNodeCompare.xml @@ -50,7 +50,7 @@ Comparison for less than ([code]a < b[/code]). Cannot be used if [member type] set to [constant CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM]. </constant> <constant name="FUNC_LESS_THAN_EQUAL" value="5" enum="Function"> - Comparison for less than or equal ([code]a < b[/code]). Cannot be used if [member type] set to [constant CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM]. + Comparison for less than or equal ([code]a <= b[/code]). Cannot be used if [member type] set to [constant CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM]. </constant> <constant name="COND_ALL" value="0" enum="Condition"> The result will be true if all of component in vector satisfy the comparison condition. diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index 0d1bcc754f..5bd8ec38ed 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -20,8 +20,8 @@ <return type="String"> </return> <description> - Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. - Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the "Custom" category. + Override this method to define the path to the associated custom node in the Visual Shader Editor's members dialog. The path may looks like [code]"MyGame/MyFunctions/Noise"[/code]. + Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the "Addons" category. </description> </method> <method name="_get_code" qualifiers="virtual"> @@ -72,7 +72,7 @@ </description> </method> <method name="_get_input_port_name" qualifiers="virtual"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="port" type="int"> </argument> @@ -108,7 +108,7 @@ </description> </method> <method name="_get_output_port_name" qualifiers="virtual"> - <return type="String"> + <return type="StringName"> </return> <argument index="0" name="port" type="int"> </argument> @@ -135,14 +135,6 @@ Defining this method is [b]optional[/b]. If not overridden, no return icon is shown. </description> </method> - <method name="_get_subcategory" qualifiers="virtual"> - <return type="String"> - </return> - <description> - Override this method to define the subcategory of the associated custom node in the Visual Shader Editor's members dialog. - Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the root of the main category (see [method _get_category]). - </description> - </method> <method name="_is_highend" qualifiers="virtual"> <return type="bool"> </return> diff --git a/doc/classes/VisualShaderNodeScalarConstant.xml b/doc/classes/VisualShaderNodeFloatConstant.xml index f7b94d9e39..3ba9ff07d3 100644 --- a/doc/classes/VisualShaderNodeScalarConstant.xml +++ b/doc/classes/VisualShaderNodeFloatConstant.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualShaderNodeScalarConstant" inherits="VisualShaderNode" version="4.0"> +<class name="VisualShaderNodeFloatConstant" inherits="VisualShaderNode" version="4.0"> <brief_description> + A scalar floating-point constant to be used within the visual shader graph. </brief_description> <description> + Translated to [code]float[/code] in the shader language. </description> <tutorials> </tutorials> @@ -10,6 +12,7 @@ </methods> <members> <member name="constant" type="float" setter="set_constant" getter="get_constant" default="0.0"> + A floating-point constant which represents a state of this node. </member> </members> <constants> diff --git a/doc/classes/VisualShaderNodeFloatFunc.xml b/doc/classes/VisualShaderNodeFloatFunc.xml new file mode 100644 index 0000000000..bb7486e8cf --- /dev/null +++ b/doc/classes/VisualShaderNodeFloatFunc.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeFloatFunc" inherits="VisualShaderNode" version="4.0"> + <brief_description> + A scalar floating-point function to be used within the visual shader graph. + </brief_description> + <description> + Accept a floating-point scalar ([code]x[/code]) to the input port and transform it according to [member function]. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeFloatFunc.Function" default="13"> + A function to be applied to the scalar. See [enum Function] for options. + </member> + </members> + <constants> + <constant name="FUNC_SIN" value="0" enum="Function"> + Returns the sine of the parameter. Translates to [code]sin(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_COS" value="1" enum="Function"> + Returns the cosine of the parameter. Translates to [code]cos(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_TAN" value="2" enum="Function"> + Returns the tangent of the parameter. Translates to [code]tan(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_ASIN" value="3" enum="Function"> + Returns the arc-sine of the parameter. Translates to [code]asin(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_ACOS" value="4" enum="Function"> + Returns the arc-cosine of the parameter. Translates to [code]acos(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_ATAN" value="5" enum="Function"> + Returns the arc-tangent of the parameter. Translates to [code]atan(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_SINH" value="6" enum="Function"> + Returns the hyperbolic sine of the parameter. Translates to [code]sinh(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_COSH" value="7" enum="Function"> + Returns the hyperbolic cosine of the parameter. Translates to [code]cosh(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_TANH" value="8" enum="Function"> + Returns the hyperbolic tangent of the parameter. Translates to [code]tanh(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_LOG" value="9" enum="Function"> + Returns the natural logarithm of the parameter. Translates to [code]log(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_EXP" value="10" enum="Function"> + Returns the natural exponentiation of the parameter. Translates to [code]exp(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_SQRT" value="11" enum="Function"> + Returns the square root of the parameter. Translates to [code]sqrt(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_ABS" value="12" enum="Function"> + Returns the absolute value of the parameter. Translates to [code]abs(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_SIGN" value="13" enum="Function"> + Extracts the sign of the parameter. Translates to [code]sign(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_FLOOR" value="14" enum="Function"> + Finds the nearest integer less than or equal to the parameter. Translates to [code]floor(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_ROUND" value="15" enum="Function"> + Finds the nearest integer to the parameter. Translates to [code]round(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_CEIL" value="16" enum="Function"> + Finds the nearest integer that is greater than or equal to the parameter. Translates to [code]ceil(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_FRAC" value="17" enum="Function"> + Computes the fractional part of the argument. Translates to [code]fract(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_SATURATE" value="18" enum="Function"> + Clamps the value between [code]0.0[/code] and [code]1.0[/code] using [code]min(max(x, 0.0), 1.0)[/code]. + </constant> + <constant name="FUNC_NEGATE" value="19" enum="Function"> + Negates the [code]x[/code] using [code]-(x)[/code]. + </constant> + <constant name="FUNC_ACOSH" value="20" enum="Function"> + Returns the arc-hyperbolic-cosine of the parameter. Translates to [code]acosh(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_ASINH" value="21" enum="Function"> + Returns the arc-hyperbolic-sine of the parameter. Translates to [code]asinh(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_ATANH" value="22" enum="Function"> + Returns the arc-hyperbolic-tangent of the parameter. Translates to [code]atanh(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_DEGREES" value="23" enum="Function"> + Convert a quantity in radians to degrees. Translates to [code]degrees(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_EXP2" value="24" enum="Function"> + Returns 2 raised by the power of the parameter. Translates to [code]exp2(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_INVERSE_SQRT" value="25" enum="Function"> + Returns the inverse of the square root of the parameter. Translates to [code]inversesqrt(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_LOG2" value="26" enum="Function"> + Returns the base 2 logarithm of the parameter. Translates to [code]log2(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_RADIANS" value="27" enum="Function"> + Convert a quantity in degrees to radians. Translates to [code]radians(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_RECIPROCAL" value="28" enum="Function"> + Finds reciprocal value of dividing 1 by [code]x[/code] (i.e. [code]1 / x[/code]). + </constant> + <constant name="FUNC_ROUNDEVEN" value="29" enum="Function"> + Finds the nearest even integer to the parameter. Translates to [code]roundEven(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_TRUNC" value="30" enum="Function"> + Returns a value equal to the nearest integer to [code]x[/code] whose absolute value is not larger than the absolute value of [code]x[/code]. Translates to [code]trunc(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_ONEMINUS" value="31" enum="Function"> + Subtracts scalar [code]x[/code] from 1 (i.e. [code]1 - x[/code]). + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeFloatOp.xml b/doc/classes/VisualShaderNodeFloatOp.xml new file mode 100644 index 0000000000..2c9ebabb89 --- /dev/null +++ b/doc/classes/VisualShaderNodeFloatOp.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeFloatOp" inherits="VisualShaderNode" version="4.0"> + <brief_description> + A floating-point scalar operator to be used within the visual shader graph. + </brief_description> + <description> + Applies [member operator] to two floating-point inputs: [code]a[/code] and [code]b[/code]. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeFloatOp.Operator" default="0"> + An operator to be applied to the inputs. See [enum Operator] for options. + </member> + </members> + <constants> + <constant name="OP_ADD" value="0" enum="Operator"> + Sums two numbers using [code]a + b[/code]. + </constant> + <constant name="OP_SUB" value="1" enum="Operator"> + Subtracts two numbers using [code]a - b[/code]. + </constant> + <constant name="OP_MUL" value="2" enum="Operator"> + Multiplies two numbers using [code]a * b[/code]. + </constant> + <constant name="OP_DIV" value="3" enum="Operator"> + Divides two numbers using [code]a / b[/code]. + </constant> + <constant name="OP_MOD" value="4" enum="Operator"> + Calculates the remainder of two numbers. Translates to [code]mod(a, b)[/code] in the Godot Shader Language. + </constant> + <constant name="OP_POW" value="5" enum="Operator"> + Raises the [code]a[/code] to the power of [code]b[/code]. Translates to [code]pow(a, b)[/code] in the Godot Shader Language. + </constant> + <constant name="OP_MAX" value="6" enum="Operator"> + Returns the greater of two numbers. Translates to [code]max(a, b)[/code] in the Godot Shader Language. + </constant> + <constant name="OP_MIN" value="7" enum="Operator"> + Returns the lesser of two numbers. Translates to [code]min(a, b)[/code] in the Godot Shader Language. + </constant> + <constant name="OP_ATAN2" value="8" enum="Operator"> + Returns the arc-tangent of the parameters. Translates to [code]atan(a, b)[/code] in the Godot Shader Language. + </constant> + <constant name="OP_STEP" value="9" enum="Operator"> + Generates a step function by comparing [code]b[/code](x) to [code]a[/code](edge). Returns 0.0 if [code]x[/code] is smaller than [code]edge[/code] and otherwise 1.0. Translates to [code]step(a, b)[/code] in the Godot Shader Language. + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeScalarUniform.xml b/doc/classes/VisualShaderNodeFloatUniform.xml index fab766d3f9..33ece8ac1b 100644 --- a/doc/classes/VisualShaderNodeScalarUniform.xml +++ b/doc/classes/VisualShaderNodeFloatUniform.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualShaderNodeScalarUniform" inherits="VisualShaderNodeUniform" version="4.0"> +<class name="VisualShaderNodeFloatUniform" inherits="VisualShaderNodeUniform" version="4.0"> <brief_description> - A scalar uniform to be used within the visual shader graph. + A scalar float uniform to be used within the visual shader graph. </brief_description> <description> Translated to [code]uniform float[/code] in the shader language. @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="hint" type="int" setter="set_hint" getter="get_hint" enum="VisualShaderNodeScalarUniform.Hint" default="0"> + <member name="hint" type="int" setter="set_hint" getter="get_hint" enum="VisualShaderNodeFloatUniform.Hint" default="0"> A hint applied to the uniform, which controls the values it can take when set through the inspector. </member> <member name="max" type="float" setter="set_max" getter="get_max" default="1.0"> diff --git a/doc/classes/VisualShaderNodeIf.xml b/doc/classes/VisualShaderNodeIf.xml index 0a8fdcfd4d..1ebd945d42 100644 --- a/doc/classes/VisualShaderNodeIf.xml +++ b/doc/classes/VisualShaderNodeIf.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisualShaderNodeIf" inherits="VisualShaderNode" version="4.0"> <brief_description> + Compares two floating-point numbers in order to return a required vector within the visual shader graph. </brief_description> <description> + First two ports are scalar floatin-point numbers to compare, third is tolerance comparsion amount and last three ports represents a vectors returned if [code]a == b[/code], [code]a > b[/code] and [code]a < b[/code] respectivly. </description> <tutorials> </tutorials> diff --git a/doc/classes/VisualShaderNodeInput.xml b/doc/classes/VisualShaderNodeInput.xml index 1c8d8d84c4..ed629508d0 100644 --- a/doc/classes/VisualShaderNodeInput.xml +++ b/doc/classes/VisualShaderNodeInput.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="VisualShaderNodeInput" inherits="VisualShaderNode" version="4.0"> <brief_description> + Represents the input shader parameter within the visual shader graph. </brief_description> <description> </description> @@ -11,16 +12,19 @@ <return type="String"> </return> <description> + Returns a translated name of the current constant in the Godot Shader Language. eg. [code]"ALBEDO"[/code] if the [member input_name] equal to [code]"albedo"[/code]. </description> </method> </methods> <members> <member name="input_name" type="String" setter="set_input_name" getter="get_input_name" default=""[None]""> + One of the several input constants in lower-case style like: "vertex"([/code]VERTEX[code]) or "point_size"([code]POINT_SIZE[/code]). </member> </members> <signals> <signal name="input_type_changed"> <description> + Emitted when input is changed via [member input_name]. </description> </signal> </signals> diff --git a/doc/classes/VisualShaderNodeIntConstant.xml b/doc/classes/VisualShaderNodeIntConstant.xml new file mode 100644 index 0000000000..1c407b21ca --- /dev/null +++ b/doc/classes/VisualShaderNodeIntConstant.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeIntConstant" inherits="VisualShaderNode" version="4.0"> + <brief_description> + A scalar integer constant to be used within the visual shader graph. + </brief_description> + <description> + Translated to [code]int[/code] in the shader language. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="constant" type="int" setter="set_constant" getter="get_constant" default="0"> + An integer constant which represents a state of this node. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeIntFunc.xml b/doc/classes/VisualShaderNodeIntFunc.xml new file mode 100644 index 0000000000..4b5d4ca8d2 --- /dev/null +++ b/doc/classes/VisualShaderNodeIntFunc.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeIntFunc" inherits="VisualShaderNode" version="4.0"> + <brief_description> + A scalar integer function to be used within the visual shader graph. + </brief_description> + <description> + Accept an integer scalar ([code]x[/code]) to the input port and transform it according to [member function]. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeIntFunc.Function" default="0"> + A function to be applied to the scalar. See [enum Function] for options. + </member> + </members> + <constants> + <constant name="FUNC_ABS" value="0" enum="Function"> + Returns the absolute value of the parameter. Translates to [code]abs(x)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_CLAMP" value="1" enum="Function"> + Constrains a parameter between [code]min[/code] and [code]max[/code]. Translates to [code]clamp(x, min, max)[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_NEGATE" value="2" enum="Function"> + Negates the [code]x[/code] using [code]-(x)[/code]. + </constant> + <constant name="FUNC_SIGN" value="3" enum="Function"> + Extracts the sign of the parameter. Translates to [code]sign(x)[/code] in the Godot Shader Language. + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeIntOp.xml b/doc/classes/VisualShaderNodeIntOp.xml new file mode 100644 index 0000000000..fc9a0a9a0a --- /dev/null +++ b/doc/classes/VisualShaderNodeIntOp.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeIntOp" inherits="VisualShaderNode" version="4.0"> + <brief_description> + An integer scalar operator to be used within the visual shader graph. + </brief_description> + <description> + Applies [member operator] to two integer inputs: [code]a[/code] and [code]b[/code]. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeIntOp.Operator" default="0"> + An operator to be applied to the inputs. See [enum Operator] for options. + </member> + </members> + <constants> + <constant name="OP_ADD" value="0" enum="Operator"> + Sums two numbers using [code]a + b[/code]. + </constant> + <constant name="OP_SUB" value="1" enum="Operator"> + Subtracts two numbers using [code]a - b[/code]. + </constant> + <constant name="OP_MUL" value="2" enum="Operator"> + Multiplies two numbers using [code]a * b[/code]. + </constant> + <constant name="OP_DIV" value="3" enum="Operator"> + Divides two numbers using [code]a / b[/code]. + </constant> + <constant name="OP_MOD" value="4" enum="Operator"> + Calculates the remainder of two numbers using [code]a % b[/code]. + </constant> + <constant name="OP_MAX" value="5" enum="Operator"> + Returns the greater of two numbers. Translates to [code]max(a, b)[/code] in the Godot Shader Language. + </constant> + <constant name="OP_MIN" value="6" enum="Operator"> + Returns the lesser of two numbers. Translates to [code]max(a, b)[/code] in the Godot Shader Language. + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeIntUniform.xml b/doc/classes/VisualShaderNodeIntUniform.xml new file mode 100644 index 0000000000..8c7c288177 --- /dev/null +++ b/doc/classes/VisualShaderNodeIntUniform.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeIntUniform" inherits="VisualShaderNodeUniform" version="4.0"> + <brief_description> + A scalar integer uniform to be used within the visual shader graph. + </brief_description> + <description> + Translated to [code]uniform int[/code] in the shader language. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="hint" type="int" setter="set_hint" getter="get_hint" enum="VisualShaderNodeIntUniform.Hint" default="0"> + A hint applied to the uniform, which controls the values it can take when set through the inspector. + </member> + <member name="max" type="int" setter="set_max" getter="get_max" default="100"> + Minimum value for range hints. Used if [member hint] is set to [constant HINT_RANGE] or [constant HINT_RANGE_STEP]. + </member> + <member name="min" type="int" setter="set_min" getter="get_min" default="0"> + Maximum value for range hints. Used if [member hint] is set to [constant HINT_RANGE] or [constant HINT_RANGE_STEP]. + </member> + <member name="step" type="int" setter="set_step" getter="get_step" default="1"> + Step (increment) value for the range hint with step. Used if [member hint] is set to [constant HINT_RANGE_STEP]. + </member> + </members> + <constants> + <constant name="HINT_NONE" value="0" enum="Hint"> + No hint used. + </constant> + <constant name="HINT_RANGE" value="1" enum="Hint"> + A range hint for scalar value, which limits possible input values between [member min] and [member max]. Translated to [code]hint_range(min, max)[/code] in shader code. + </constant> + <constant name="HINT_RANGE_STEP" value="2" enum="Hint"> + A range hint for scalar value with step, which limits possible input values between [member min] and [member max], with a step (increment) of [member step]). Translated to [code]hint_range(min, max, step)[/code] in shader code. + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeScalarFunc.xml b/doc/classes/VisualShaderNodeScalarFunc.xml deleted file mode 100644 index b306d198f6..0000000000 --- a/doc/classes/VisualShaderNodeScalarFunc.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualShaderNodeScalarFunc" inherits="VisualShaderNode" version="4.0"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <members> - <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeScalarFunc.Function" default="13"> - </member> - </members> - <constants> - <constant name="FUNC_SIN" value="0" enum="Function"> - </constant> - <constant name="FUNC_COS" value="1" enum="Function"> - </constant> - <constant name="FUNC_TAN" value="2" enum="Function"> - </constant> - <constant name="FUNC_ASIN" value="3" enum="Function"> - </constant> - <constant name="FUNC_ACOS" value="4" enum="Function"> - </constant> - <constant name="FUNC_ATAN" value="5" enum="Function"> - </constant> - <constant name="FUNC_SINH" value="6" enum="Function"> - </constant> - <constant name="FUNC_COSH" value="7" enum="Function"> - </constant> - <constant name="FUNC_TANH" value="8" enum="Function"> - </constant> - <constant name="FUNC_LOG" value="9" enum="Function"> - </constant> - <constant name="FUNC_EXP" value="10" enum="Function"> - </constant> - <constant name="FUNC_SQRT" value="11" enum="Function"> - </constant> - <constant name="FUNC_ABS" value="12" enum="Function"> - </constant> - <constant name="FUNC_SIGN" value="13" enum="Function"> - </constant> - <constant name="FUNC_FLOOR" value="14" enum="Function"> - </constant> - <constant name="FUNC_ROUND" value="15" enum="Function"> - </constant> - <constant name="FUNC_CEIL" value="16" enum="Function"> - </constant> - <constant name="FUNC_FRAC" value="17" enum="Function"> - </constant> - <constant name="FUNC_SATURATE" value="18" enum="Function"> - </constant> - <constant name="FUNC_NEGATE" value="19" enum="Function"> - </constant> - <constant name="FUNC_ACOSH" value="20" enum="Function"> - </constant> - <constant name="FUNC_ASINH" value="21" enum="Function"> - </constant> - <constant name="FUNC_ATANH" value="22" enum="Function"> - </constant> - <constant name="FUNC_DEGREES" value="23" enum="Function"> - </constant> - <constant name="FUNC_EXP2" value="24" enum="Function"> - </constant> - <constant name="FUNC_INVERSE_SQRT" value="25" enum="Function"> - </constant> - <constant name="FUNC_LOG2" value="26" enum="Function"> - </constant> - <constant name="FUNC_RADIANS" value="27" enum="Function"> - </constant> - <constant name="FUNC_RECIPROCAL" value="28" enum="Function"> - </constant> - <constant name="FUNC_ROUNDEVEN" value="29" enum="Function"> - </constant> - <constant name="FUNC_TRUNC" value="30" enum="Function"> - </constant> - <constant name="FUNC_ONEMINUS" value="31" enum="Function"> - </constant> - </constants> -</class> diff --git a/doc/classes/VisualShaderNodeScalarOp.xml b/doc/classes/VisualShaderNodeScalarOp.xml deleted file mode 100644 index f13f16cdd2..0000000000 --- a/doc/classes/VisualShaderNodeScalarOp.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualShaderNodeScalarOp" inherits="VisualShaderNode" version="4.0"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <members> - <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeScalarOp.Operator" default="0"> - </member> - </members> - <constants> - <constant name="OP_ADD" value="0" enum="Operator"> - </constant> - <constant name="OP_SUB" value="1" enum="Operator"> - </constant> - <constant name="OP_MUL" value="2" enum="Operator"> - </constant> - <constant name="OP_DIV" value="3" enum="Operator"> - </constant> - <constant name="OP_MOD" value="4" enum="Operator"> - </constant> - <constant name="OP_POW" value="5" enum="Operator"> - </constant> - <constant name="OP_MAX" value="6" enum="Operator"> - </constant> - <constant name="OP_MIN" value="7" enum="Operator"> - </constant> - <constant name="OP_ATAN2" value="8" enum="Operator"> - </constant> - <constant name="OP_STEP" value="9" enum="Operator"> - </constant> - </constants> -</class> diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index fa45aeeda8..55b1c7e560 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1681,11 +1681,11 @@ void RasterizerStorageGLES2::shader_get_param_list(RID p_shader, List<PropertyIn case ShaderLanguage::TYPE_UVEC3: case ShaderLanguage::TYPE_IVEC4: case ShaderLanguage::TYPE_UVEC4: { - pi.type = Variant::PACKED_INT_ARRAY; + pi.type = Variant::PACKED_INT32_ARRAY; } break; case ShaderLanguage::TYPE_FLOAT: { - pi.type = Variant::REAL; + pi.type = Variant::FLOAT; if (u.hint == ShaderLanguage::ShaderNode::Uniform::HINT_RANGE) { pi.hint = PROPERTY_HINT_RANGE; pi.hint_string = rtos(u.hint_range[0]) + "," + rtos(u.hint_range[1]) + "," + rtos(u.hint_range[2]); diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index f7e412be63..4adeeb1d9b 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -676,8 +676,6 @@ void NetSocketPosix::set_reuse_address_enabled(bool p_enabled) { // On Windows, enabling SO_REUSEADDR actually would also enable reuse port, very bad on TCP. Denying... // Windows does not have this option, SO_REUSEADDR in this magical world means SO_REUSEPORT #ifndef WINDOWS_ENABLED - if (_is_stream) - return; int par = p_enabled ? 1 : 0; if (setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, SOCK_CBUF(&par), sizeof(int)) < 0) { WARN_PRINT("Unable to set socket REUSEADDR option!"); diff --git a/drivers/vulkan/SCsub b/drivers/vulkan/SCsub index 2576f68f92..85a5ae8d26 100644 --- a/drivers/vulkan/SCsub +++ b/drivers/vulkan/SCsub @@ -49,6 +49,14 @@ if env['builtin_vulkan']: 'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share', 'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg' ]) + elif env['platform'] == "iphone": + env_thirdparty.AppendUnique(CPPDEFINES=[ + 'VK_USE_PLATFORM_IOS_MVK', + 'VULKAN_NON_CMAKE_BUILD', + 'SYSCONFDIR=\\"%s\\"' % '/etc', + 'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share', + 'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg' + ]) elif env['platform'] == "x11": env_thirdparty.AppendUnique(CPPDEFINES=[ 'VK_USE_PLATFORM_XLIB_KHR', diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 7f7c787da2..2bf8a16091 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -5977,7 +5977,7 @@ void RenderingDeviceVulkan::draw_list_draw(DrawListID p_list, bool p_use_indices if (p_procedural_vertices > 0) { #ifdef DEBUG_ENABLED - ERR_FAIL_COND_MSG(dl->validation.pipeline_vertex_format == INVALID_ID, + ERR_FAIL_COND_MSG(dl->validation.pipeline_vertex_format != INVALID_ID, "Procedural vertices requested, but pipeline expects a vertex array."); #endif to_draw = p_procedural_vertices; diff --git a/drivers/vulkan/rendering_device_vulkan.h b/drivers/vulkan/rendering_device_vulkan.h index 05534e75ef..30c10e922e 100644 --- a/drivers/vulkan/rendering_device_vulkan.h +++ b/drivers/vulkan/rendering_device_vulkan.h @@ -354,7 +354,9 @@ class RenderingDeviceVulkan : public RenderingDevice { if (a.stride != b.stride) { return false; } - return a.frequency != b.frequency; + if (a.frequency != b.frequency) { + return false; + } } return true; //they are equal } diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 72acedb88f..51d66cf97e 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -29,11 +29,14 @@ /*************************************************************************/ #include "vulkan_context.h" + #include "core/engine.h" #include "core/project_settings.h" #include "core/ustring.h" #include "core/version.h" + #include "vk_enum_string_helper.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -47,16 +50,20 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanContext::_debug_messenger_callback(VkDebugU const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData) { - //This error needs to be ignored because the AMD allocator will mix up memory types on IGP processors + // This error needs to be ignored because the AMD allocator will mix up memory types on IGP processors. if (strstr(pCallbackData->pMessage, "Mapping an image with layout") != NULL && strstr(pCallbackData->pMessage, "can result in undefined behavior if this memory is used by the device") != NULL) { return VK_FALSE; } - // This needs to be ignored because Validator is wrong here + // This needs to be ignored because Validator is wrong here. if (strstr(pCallbackData->pMessage, "SPIR-V module not valid: Pointer operand") != NULL && strstr(pCallbackData->pMessage, "must be a memory object") != NULL) { return VK_FALSE; } + // Workaround for Vulkan-Loader usability bug: https://github.com/KhronosGroup/Vulkan-Loader/issues/262. + if (strstr(pCallbackData->pMessage, "wrong ELF class: ELFCLASS32") != NULL) { + return VK_FALSE; + } if (strstr(pCallbackData->pMessageIdName, "UNASSIGNED-CoreValidation-DrawState-ClearCmdBeforeDraw") != NULL) { return VK_FALSE; } diff --git a/editor/SCsub b/editor/SCsub index 2b560f68e8..4431166ee6 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -82,6 +82,7 @@ if env['tools']: SConscript('collada/SCsub') SConscript('doc/SCsub') + SConscript('debugger/SCsub') SConscript('fileserver/SCsub') SConscript('icons/SCsub') SConscript('import/SCsub') diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 719e4af6b5..69e3c3b19d 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -502,12 +502,12 @@ void AnimationBezierTrackEdit::set_animation_and_track(const Ref<Animation> &p_a animation = p_animation; track = p_track; - if (is_connected("select_key", editor, "_key_selected")) - disconnect("select_key", editor, "_key_selected"); - if (is_connected("deselect_key", editor, "_key_deselected")) - disconnect("deselect_key", editor, "_key_deselected"); - connect("select_key", editor, "_key_selected", varray(p_track), CONNECT_DEFERRED); - connect("deselect_key", editor, "_key_deselected", varray(p_track), CONNECT_DEFERRED); + if (is_connected_compat("select_key", editor, "_key_selected")) + disconnect_compat("select_key", editor, "_key_selected"); + if (is_connected_compat("deselect_key", editor, "_key_deselected")) + disconnect_compat("deselect_key", editor, "_key_deselected"); + connect_compat("select_key", editor, "_key_selected", varray(p_track), CONNECT_DEFERRED); + connect_compat("deselect_key", editor, "_key_deselected", varray(p_track), CONNECT_DEFERRED); update(); } @@ -522,11 +522,11 @@ void AnimationBezierTrackEdit::set_undo_redo(UndoRedo *p_undo_redo) { void AnimationBezierTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) { timeline = p_timeline; - timeline->connect("zoom_changed", this, "_zoom_changed"); + timeline->connect_compat("zoom_changed", this, "_zoom_changed"); } void AnimationBezierTrackEdit::set_editor(AnimationTrackEditor *p_editor) { editor = p_editor; - connect("clear_selection", editor, "_clear_selection", varray(false)); + connect_compat("clear_selection", editor, "_clear_selection", varray(false)); } void AnimationBezierTrackEdit::_play_position_draw() { @@ -1150,16 +1150,16 @@ void AnimationBezierTrackEdit::_bind_methods() { ClassDB::bind_method("_clear_selection_for_anim", &AnimationBezierTrackEdit::_clear_selection_for_anim); ClassDB::bind_method("_select_at_anim", &AnimationBezierTrackEdit::_select_at_anim); - ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag"))); + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"))); ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track"))); - ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::REAL, "ofs"))); + ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::FLOAT, "ofs"))); ADD_SIGNAL(MethodInfo("select_key", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "single"))); ADD_SIGNAL(MethodInfo("deselect_key", PropertyInfo(Variant::INT, "index"))); ADD_SIGNAL(MethodInfo("clear_selection")); ADD_SIGNAL(MethodInfo("close_request")); ADD_SIGNAL(MethodInfo("move_selection_begin")); - ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::REAL, "ofs"))); + ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::FLOAT, "ofs"))); ADD_SIGNAL(MethodInfo("move_selection_commit")); ADD_SIGNAL(MethodInfo("move_selection_cancel")); } @@ -1184,7 +1184,7 @@ AnimationBezierTrackEdit::AnimationBezierTrackEdit() { play_position->set_mouse_filter(MOUSE_FILTER_PASS); add_child(play_position); play_position->set_anchors_and_margins_preset(PRESET_WIDE); - play_position->connect("draw", this, "_play_position_draw"); + play_position->connect_compat("draw", this, "_play_position_draw"); set_focus_mode(FOCUS_CLICK); v_scroll = 0; @@ -1198,7 +1198,7 @@ AnimationBezierTrackEdit::AnimationBezierTrackEdit() { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_menu_selected"); + menu->connect_compat("id_pressed", this, "_menu_selected"); //set_mouse_filter(MOUSE_FILTER_PASS); //scroll has to work too for selection } diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index cc64db22cc..8758fbcfc9 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -235,7 +235,7 @@ public: Variant::Type t = Variant::Type(int(p_value)); if (t != args[idx].get_type()) { - Variant::CallError err; + Callable::CallError err; if (Variant::can_convert(args[idx].get_type(), t)) { Variant old = args[idx]; Variant *ptrs[1] = { &old }; @@ -548,9 +548,9 @@ public: if (use_fps && animation->get_step() > 0) { float max_frame = animation->get_length() / animation->get_step(); - p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); } else { - p_list->push_back(PropertyInfo(Variant::REAL, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); } switch (animation->track_get_type(track)) { @@ -593,7 +593,7 @@ public: } break; case Animation::TYPE_METHOD: { - p_list->push_back(PropertyInfo(Variant::STRING, "name")); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "name")); p_list->push_back(PropertyInfo(Variant::INT, "arg_count", PROPERTY_HINT_RANGE, "0,5,1")); Dictionary d = animation->track_get_key_value(track, key); @@ -617,7 +617,7 @@ public: } break; case Animation::TYPE_BEZIER: { - p_list->push_back(PropertyInfo(Variant::REAL, "value")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "value")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "in_handle")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "out_handle")); @@ -625,8 +625,8 @@ public: case Animation::TYPE_AUDIO: { p_list->push_back(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream")); - p_list->push_back(PropertyInfo(Variant::REAL, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); - p_list->push_back(PropertyInfo(Variant::REAL, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); } break; case Animation::TYPE_ANIMATION: { @@ -654,13 +654,13 @@ public: } animations += "[stop]"; - p_list->push_back(PropertyInfo(Variant::STRING, "animation", PROPERTY_HINT_ENUM, animations)); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "animation", PROPERTY_HINT_ENUM, animations)); } break; } if (animation->track_get_type(track) == Animation::TYPE_VALUE) { - p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "easing", PROPERTY_HINT_EXP_EASING)); } } @@ -898,7 +898,7 @@ public: Variant::Type t = Variant::Type(int(p_value)); if (t != args[idx].get_type()) { - Variant::CallError err; + Callable::CallError err; if (Variant::can_convert(args[idx].get_type(), t)) { Variant old = args[idx]; Variant *ptrs[1] = { &old }; @@ -1243,9 +1243,9 @@ public: if (use_fps && animation->get_step() > 0) { float max_frame = animation->get_length() / animation->get_step(); - p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); } else { - p_list->push_back(PropertyInfo(Variant::REAL, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); } } @@ -1289,11 +1289,11 @@ public: p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string)); } - p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "easing", PROPERTY_HINT_EXP_EASING)); } break; case Animation::TYPE_METHOD: { - p_list->push_back(PropertyInfo(Variant::STRING, "name")); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "name")); p_list->push_back(PropertyInfo(Variant::INT, "arg_count", PROPERTY_HINT_RANGE, "0,5,1")); Dictionary d = animation->track_get_key_value(first_track, first_key); @@ -1316,15 +1316,15 @@ public: } break; case Animation::TYPE_BEZIER: { - p_list->push_back(PropertyInfo(Variant::REAL, "value")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "value")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "in_handle")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "out_handle")); } break; case Animation::TYPE_AUDIO: { p_list->push_back(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream")); - p_list->push_back(PropertyInfo(Variant::REAL, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); - p_list->push_back(PropertyInfo(Variant::REAL, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "start_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "end_offset", PROPERTY_HINT_RANGE, "0,3600,0.01,or_greater")); } break; case Animation::TYPE_ANIMATION: { @@ -1354,7 +1354,7 @@ public: } animations += "[stop]"; - p_list->push_back(PropertyInfo(Variant::STRING, "animation", PROPERTY_HINT_ENUM, animations)); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "animation", PROPERTY_HINT_ENUM, animations)); } break; } } @@ -1697,7 +1697,7 @@ void AnimationTimelineEdit::set_undo_redo(UndoRedo *p_undo_redo) { void AnimationTimelineEdit::set_zoom(Range *p_zoom) { zoom = p_zoom; - zoom->connect("value_changed", this, "_zoom_changed"); + zoom->connect_compat("value_changed", this, "_zoom_changed"); } void AnimationTimelineEdit::set_play_position(float p_pos) { @@ -1854,9 +1854,9 @@ void AnimationTimelineEdit::_bind_methods() { ADD_SIGNAL(MethodInfo("zoom_changed")); ADD_SIGNAL(MethodInfo("name_limit_changed")); - ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag"))); + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"))); ADD_SIGNAL(MethodInfo("track_added", PropertyInfo(Variant::INT, "track"))); - ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::REAL, "size"))); + ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::FLOAT, "size"))); } AnimationTimelineEdit::AnimationTimelineEdit() { @@ -1871,7 +1871,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() { play_position->set_mouse_filter(MOUSE_FILTER_PASS); add_child(play_position); play_position->set_anchors_and_margins_preset(PRESET_WIDE); - play_position->connect("draw", this, "_play_position_draw"); + play_position->connect_compat("draw", this, "_play_position_draw"); add_track = memnew(MenuButton); add_track->set_position(Vector2(0, 0)); @@ -1895,17 +1895,17 @@ AnimationTimelineEdit::AnimationTimelineEdit() { length->set_custom_minimum_size(Vector2(70 * EDSCALE, 0)); length->set_hide_slider(true); length->set_tooltip(TTR("Animation length (seconds)")); - length->connect("value_changed", this, "_anim_length_changed"); + length->connect_compat("value_changed", this, "_anim_length_changed"); len_hb->add_child(length); loop = memnew(ToolButton); loop->set_tooltip(TTR("Animation Looping")); - loop->connect("pressed", this, "_anim_loop_pressed"); + loop->connect_compat("pressed", this, "_anim_loop_pressed"); loop->set_toggle_mode(true); len_hb->add_child(loop); add_child(len_hb); add_track->hide(); - add_track->get_popup()->connect("index_pressed", this, "_track_added"); + add_track->get_popup()->connect_compat("index_pressed", this, "_track_added"); len_hb->hide(); panning_timeline = false; @@ -2429,8 +2429,8 @@ void AnimationTrackEdit::set_undo_redo(UndoRedo *p_undo_redo) { void AnimationTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) { timeline = p_timeline; - timeline->connect("zoom_changed", this, "_zoom_changed"); - timeline->connect("name_limit_changed", this, "_zoom_changed"); + timeline->connect_compat("zoom_changed", this, "_zoom_changed"); + timeline->connect_compat("name_limit_changed", this, "_zoom_changed"); } void AnimationTrackEdit::set_editor(AnimationTrackEditor *p_editor) { editor = p_editor; @@ -2480,6 +2480,9 @@ void AnimationTrackEdit::_path_entered(const String &p_text) { bool AnimationTrackEdit::_is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const { + if (root == nullptr) + return false; + RES res; Vector<StringName> leftover_path; Node *node = root->get_node_and_resource(animation->track_get_path(track), res, leftover_path); @@ -2688,7 +2691,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (!menu) { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_menu_selected"); + menu->connect_compat("id_pressed", this, "_menu_selected"); } menu->clear(); menu->add_icon_item(get_icon("TrackContinuous", "EditorIcons"), TTR("Continuous"), MENU_CALL_MODE_CONTINUOUS); @@ -2707,7 +2710,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (!menu) { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_menu_selected"); + menu->connect_compat("id_pressed", this, "_menu_selected"); } menu->clear(); menu->add_icon_item(get_icon("InterpRaw", "EditorIcons"), TTR("Nearest"), MENU_INTERPOLATION_NEAREST); @@ -2725,7 +2728,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (!menu) { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_menu_selected"); + menu->connect_compat("id_pressed", this, "_menu_selected"); } menu->clear(); menu->add_icon_item(get_icon("InterpWrapClamp", "EditorIcons"), TTR("Clamp Loop Interp"), MENU_LOOP_CLAMP); @@ -2820,7 +2823,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (!menu) { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_menu_selected"); + menu->connect_compat("id_pressed", this, "_menu_selected"); } menu->clear(); @@ -2848,7 +2851,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { path = memnew(LineEdit); add_child(path); path->set_as_toplevel(true); - path->connect("text_entered", this, "_path_entered"); + path->connect_compat("text_entered", this, "_path_entered"); } path->set_text(animation->track_get_path(track)); @@ -3073,16 +3076,16 @@ void AnimationTrackEdit::_bind_methods() { ClassDB::bind_method("_path_entered", &AnimationTrackEdit::_path_entered); ClassDB::bind_method("_play_position_draw", &AnimationTrackEdit::_play_position_draw); - ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag"))); + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"))); ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track"))); ADD_SIGNAL(MethodInfo("dropped", PropertyInfo(Variant::INT, "from_track"), PropertyInfo(Variant::INT, "to_track"))); - ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::REAL, "ofs"))); + ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::FLOAT, "ofs"))); ADD_SIGNAL(MethodInfo("select_key", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "single"))); ADD_SIGNAL(MethodInfo("deselect_key", PropertyInfo(Variant::INT, "index"))); ADD_SIGNAL(MethodInfo("bezier_edit")); ADD_SIGNAL(MethodInfo("move_selection_begin")); - ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::REAL, "ofs"))); + ADD_SIGNAL(MethodInfo("move_selection", PropertyInfo(Variant::FLOAT, "ofs"))); ADD_SIGNAL(MethodInfo("move_selection_commit")); ADD_SIGNAL(MethodInfo("move_selection_cancel")); @@ -3111,7 +3114,7 @@ AnimationTrackEdit::AnimationTrackEdit() { play_position->set_mouse_filter(MOUSE_FILTER_PASS); add_child(play_position); play_position->set_anchors_and_margins_preset(PRESET_WIDE); - play_position->connect("draw", this, "_play_position_draw"); + play_position->connect_compat("draw", this, "_play_position_draw"); set_focus_mode(FOCUS_CLICK); set_mouse_filter(MOUSE_FILTER_PASS); //scroll has to work too for selection } @@ -3138,7 +3141,7 @@ AnimationTrackEdit *AnimationTrackEditPlugin::create_value_track_edit(Object *p_ &args[5] }; - Variant::CallError ce; + Callable::CallError ce; return Object::cast_to<AnimationTrackEdit>(get_script_instance()->call("create_value_track_edit", (const Variant **)&argptrs, 6, ce).operator Object *()); } return NULL; @@ -3217,8 +3220,8 @@ Size2 AnimationTrackEditGroup::get_minimum_size() const { void AnimationTrackEditGroup::set_timeline(AnimationTimelineEdit *p_timeline) { timeline = p_timeline; - timeline->connect("zoom_changed", this, "_zoom_changed"); - timeline->connect("name_limit_changed", this, "_zoom_changed"); + timeline->connect_compat("zoom_changed", this, "_zoom_changed"); + timeline->connect_compat("name_limit_changed", this, "_zoom_changed"); } void AnimationTrackEditGroup::set_root(Node *p_root) { @@ -3258,7 +3261,7 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim) { track_edits[_get_track_selected()]->release_focus(); } if (animation.is_valid()) { - animation->disconnect("changed", this, "_animation_changed"); + animation->disconnect_compat("changed", this, "_animation_changed"); _clear_selection(); } animation = p_anim; @@ -3268,7 +3271,7 @@ void AnimationTrackEditor::set_animation(const Ref<Animation> &p_anim) { _update_tracks(); if (animation.is_valid()) { - animation->connect("changed", this, "_animation_changed"); + animation->connect_compat("changed", this, "_animation_changed"); hscroll->show(); edit->set_disabled(false); @@ -3311,13 +3314,13 @@ void AnimationTrackEditor::_root_removed(Node *p_root) { void AnimationTrackEditor::set_root(Node *p_root) { if (root) { - root->disconnect("tree_exiting", this, "_root_removed"); + root->disconnect_compat("tree_exiting", this, "_root_removed"); } root = p_root; if (root) { - root->connect("tree_exiting", this, "_root_removed", make_binds(), CONNECT_ONESHOT); + root->connect_compat("tree_exiting", this, "_root_removed", make_binds(), CONNECT_ONESHOT); } _update_tracks(); @@ -3482,7 +3485,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) { switch (insert_data[i].value.get_type()) { case Variant::INT: - case Variant::REAL: + case Variant::FLOAT: case Variant::VECTOR2: case Variant::VECTOR3: case Variant::QUAT: @@ -3913,7 +3916,7 @@ static Vector<String> _get_bezier_subindices_for_type(Variant::Type p_type, bool case Variant::INT: { subindices.push_back(""); } break; - case Variant::REAL: { + case Variant::FLOAT: { subindices.push_back(""); } break; case Variant::VECTOR2: { @@ -3991,7 +3994,7 @@ int AnimationTrackEditor::_confirm_insert(InsertData p_id, int p_last_track, boo PropertyInfo h = _find_hint_for_track(animation->get_track_count() - 1, np); animation->remove_track(animation->get_track_count() - 1); //hack - if (h.type == Variant::REAL || + if (h.type == Variant::FLOAT || h.type == Variant::VECTOR2 || h.type == Variant::RECT2 || h.type == Variant::VECTOR3 || @@ -4257,21 +4260,21 @@ void AnimationTrackEditor::_update_tracks() { track_edit->grab_focus(); } - track_edit->connect("timeline_changed", this, "_timeline_changed"); - track_edit->connect("remove_request", this, "_track_remove_request", varray(), CONNECT_DEFERRED); - track_edit->connect("dropped", this, "_dropped_track", varray(), CONNECT_DEFERRED); - track_edit->connect("insert_key", this, "_insert_key_from_track", varray(i), CONNECT_DEFERRED); - track_edit->connect("select_key", this, "_key_selected", varray(i), CONNECT_DEFERRED); - track_edit->connect("deselect_key", this, "_key_deselected", varray(i), CONNECT_DEFERRED); - track_edit->connect("bezier_edit", this, "_bezier_edit", varray(i), CONNECT_DEFERRED); - track_edit->connect("move_selection_begin", this, "_move_selection_begin"); - track_edit->connect("move_selection", this, "_move_selection"); - track_edit->connect("move_selection_commit", this, "_move_selection_commit"); - track_edit->connect("move_selection_cancel", this, "_move_selection_cancel"); + track_edit->connect_compat("timeline_changed", this, "_timeline_changed"); + track_edit->connect_compat("remove_request", this, "_track_remove_request", varray(), CONNECT_DEFERRED); + track_edit->connect_compat("dropped", this, "_dropped_track", varray(), CONNECT_DEFERRED); + track_edit->connect_compat("insert_key", this, "_insert_key_from_track", varray(i), CONNECT_DEFERRED); + track_edit->connect_compat("select_key", this, "_key_selected", varray(i), CONNECT_DEFERRED); + track_edit->connect_compat("deselect_key", this, "_key_deselected", varray(i), CONNECT_DEFERRED); + track_edit->connect_compat("bezier_edit", this, "_bezier_edit", varray(i), CONNECT_DEFERRED); + track_edit->connect_compat("move_selection_begin", this, "_move_selection_begin"); + track_edit->connect_compat("move_selection", this, "_move_selection"); + track_edit->connect_compat("move_selection_commit", this, "_move_selection_commit"); + track_edit->connect_compat("move_selection_cancel", this, "_move_selection_cancel"); - track_edit->connect("duplicate_request", this, "_edit_menu_pressed", varray(EDIT_DUPLICATE_SELECTION), CONNECT_DEFERRED); - track_edit->connect("duplicate_transpose_request", this, "_edit_menu_pressed", varray(EDIT_DUPLICATE_TRANSPOSED), CONNECT_DEFERRED); - track_edit->connect("delete_request", this, "_edit_menu_pressed", varray(EDIT_DELETE_SELECTION), CONNECT_DEFERRED); + track_edit->connect_compat("duplicate_request", this, "_edit_menu_pressed", varray(EDIT_DUPLICATE_SELECTION), CONNECT_DEFERRED); + track_edit->connect_compat("duplicate_transpose_request", this, "_edit_menu_pressed", varray(EDIT_DUPLICATE_TRANSPOSED), CONNECT_DEFERRED); + track_edit->connect_compat("delete_request", this, "_edit_menu_pressed", varray(EDIT_DELETE_SELECTION), CONNECT_DEFERRED); } } @@ -4384,7 +4387,7 @@ void AnimationTrackEditor::_notification(int p_what) { } if (p_what == NOTIFICATION_READY) { - EditorNode::get_singleton()->get_editor_selection()->connect("selection_changed", this, "_selection_changed"); + EditorNode::get_singleton()->get_editor_selection()->connect_compat("selection_changed", this, "_selection_changed"); } if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { @@ -4473,7 +4476,7 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) { Vector<Variant::Type> filter; filter.push_back(Variant::INT); - filter.push_back(Variant::REAL); + filter.push_back(Variant::FLOAT); filter.push_back(Variant::VECTOR2); filter.push_back(Variant::VECTOR3); filter.push_back(Variant::QUAT); @@ -4543,7 +4546,7 @@ void AnimationTrackEditor::_new_track_property_selected(String p_name) { animation->track_set_path(animation->get_track_count() - 1, full_path); PropertyInfo h = _find_hint_for_track(animation->get_track_count() - 1, np); animation->remove_track(animation->get_track_count() - 1); //hack - if (h.type == Variant::REAL || + if (h.type == Variant::FLOAT || h.type == Variant::VECTOR2 || h.type == Variant::RECT2 || h.type == Variant::VECTOR3 || @@ -4753,7 +4756,7 @@ void AnimationTrackEditor::_add_method_key(const String &p_method) { Variant arg = E->get().default_arguments[i - first_defarg]; params.push_back(arg); } else { - Variant::CallError ce; + Callable::CallError ce; Variant arg = Variant::construct(E->get().arguments[i].type, NULL, 0, ce); params.push_back(arg); } @@ -5707,7 +5710,7 @@ float AnimationTrackEditor::snap_time(float p_value, bool p_relative) { return p_value; } -void AnimationTrackEditor::_show_imported_anim_warning() const { +void AnimationTrackEditor::_show_imported_anim_warning() { // It looks terrible on a single line but the TTR extractor doesn't support line breaks yet. EditorNode::get_singleton()->show_warning(TTR("This animation belongs to an imported scene, so changes to imported tracks will not be saved.\n\nTo enable the ability to add custom tracks, navigate to the scene's import settings and set\n\"Animation > Storage\" to \"Files\", enable \"Animation > Keep Custom Tracks\", then re-import.\nAlternatively, use an import preset that imports animations to separate files."), @@ -5777,10 +5780,10 @@ void AnimationTrackEditor::_bind_methods() { ClassDB::bind_method("_show_imported_anim_warning", &AnimationTrackEditor::_show_imported_anim_warning); ClassDB::bind_method("_select_all_tracks_for_copy", &AnimationTrackEditor::_select_all_tracks_for_copy); - ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag"))); + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"))); ADD_SIGNAL(MethodInfo("keying_changed")); - ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::REAL, "len"))); - ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::REAL, "step"))); + ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::FLOAT, "len"))); + ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::FLOAT, "step"))); } AnimationTrackEditor::AnimationTrackEditor() { @@ -5813,11 +5816,11 @@ AnimationTrackEditor::AnimationTrackEditor() { timeline = memnew(AnimationTimelineEdit); timeline->set_undo_redo(undo_redo); timeline_vbox->add_child(timeline); - timeline->connect("timeline_changed", this, "_timeline_changed"); - timeline->connect("name_limit_changed", this, "_name_limit_changed"); - timeline->connect("track_added", this, "_add_track"); - timeline->connect("value_changed", this, "_timeline_value_changed"); - timeline->connect("length_changed", this, "_update_length"); + timeline->connect_compat("timeline_changed", this, "_timeline_changed"); + timeline->connect_compat("name_limit_changed", this, "_name_limit_changed"); + timeline->connect_compat("track_added", this, "_add_track"); + timeline->connect_compat("value_changed", this, "_timeline_value_changed"); + timeline->connect_compat("length_changed", this, "_update_length"); scroll = memnew(ScrollContainer); timeline_vbox->add_child(scroll); @@ -5825,7 +5828,7 @@ AnimationTrackEditor::AnimationTrackEditor() { VScrollBar *sb = scroll->get_v_scrollbar(); scroll->remove_child(sb); timeline_scroll->add_child(sb); //move here so timeline and tracks are always aligned - scroll->connect("gui_input", this, "_scroll_input"); + scroll->connect_compat("gui_input", this, "_scroll_input"); bezier_edit = memnew(AnimationBezierTrackEdit); timeline_vbox->add_child(bezier_edit); @@ -5834,14 +5837,14 @@ AnimationTrackEditor::AnimationTrackEditor() { bezier_edit->set_timeline(timeline); bezier_edit->hide(); bezier_edit->set_v_size_flags(SIZE_EXPAND_FILL); - bezier_edit->connect("close_request", this, "_cancel_bezier_edit"); + bezier_edit->connect_compat("close_request", this, "_cancel_bezier_edit"); timeline_vbox->set_custom_minimum_size(Size2(0, 150) * EDSCALE); hscroll = memnew(HScrollBar); hscroll->share(timeline); hscroll->hide(); - hscroll->connect("value_changed", this, "_update_scroll"); + hscroll->connect_compat("value_changed", this, "_update_scroll"); timeline_vbox->add_child(hscroll); timeline->set_hscroll(hscroll); @@ -5858,20 +5861,20 @@ AnimationTrackEditor::AnimationTrackEditor() { imported_anim_warning = memnew(Button); imported_anim_warning->hide(); imported_anim_warning->set_tooltip(TTR("Warning: Editing imported animation")); - imported_anim_warning->connect("pressed", this, "_show_imported_anim_warning"); + imported_anim_warning->connect_compat("pressed", this, "_show_imported_anim_warning"); bottom_hb->add_child(imported_anim_warning); bottom_hb->add_spacer(); selected_filter = memnew(ToolButton); - selected_filter->connect("pressed", this, "_view_group_toggle"); //same function works the same + selected_filter->connect_compat("pressed", this, "_view_group_toggle"); //same function works the same selected_filter->set_toggle_mode(true); selected_filter->set_tooltip(TTR("Only show tracks from nodes selected in tree.")); bottom_hb->add_child(selected_filter); view_group = memnew(ToolButton); - view_group->connect("pressed", this, "_view_group_toggle"); + view_group->connect_compat("pressed", this, "_view_group_toggle"); view_group->set_toggle_mode(true); view_group->set_tooltip(TTR("Group tracks by node or display them as plain list.")); @@ -5893,14 +5896,14 @@ AnimationTrackEditor::AnimationTrackEditor() { step->set_custom_minimum_size(Size2(100, 0) * EDSCALE); step->set_tooltip(TTR("Animation step value.")); bottom_hb->add_child(step); - step->connect("value_changed", this, "_update_step"); + step->connect_compat("value_changed", this, "_update_step"); step->set_read_only(true); snap_mode = memnew(OptionButton); snap_mode->add_item(TTR("Seconds")); snap_mode->add_item(TTR("FPS")); bottom_hb->add_child(snap_mode); - snap_mode->connect("item_selected", this, "_snap_mode_changed"); + snap_mode->connect_compat("item_selected", this, "_snap_mode_changed"); snap_mode->set_disabled(true); bottom_hb->add_child(memnew(VSeparator)); @@ -5945,19 +5948,19 @@ AnimationTrackEditor::AnimationTrackEditor() { edit->get_popup()->add_item(TTR("Optimize Animation"), EDIT_OPTIMIZE_ANIMATION); edit->get_popup()->add_item(TTR("Clean-Up Animation"), EDIT_CLEAN_UP_ANIMATION); - edit->get_popup()->connect("id_pressed", this, "_edit_menu_pressed"); + edit->get_popup()->connect_compat("id_pressed", this, "_edit_menu_pressed"); pick_track = memnew(SceneTreeDialog); add_child(pick_track); pick_track->set_title(TTR("Pick the node that will be animated:")); - pick_track->connect("selected", this, "_new_track_node_selected"); + pick_track->connect_compat("selected", this, "_new_track_node_selected"); prop_selector = memnew(PropertySelector); add_child(prop_selector); - prop_selector->connect("selected", this, "_new_track_property_selected"); + prop_selector->connect_compat("selected", this, "_new_track_property_selected"); method_selector = memnew(PropertySelector); add_child(method_selector); - method_selector->connect("selected", this, "_add_method_key"); + method_selector->connect_compat("selected", this, "_add_method_key"); inserting = false; insert_query = false; @@ -5966,7 +5969,7 @@ AnimationTrackEditor::AnimationTrackEditor() { insert_confirm = memnew(ConfirmationDialog); add_child(insert_confirm); - insert_confirm->connect("confirmed", this, "_confirm_insert_list"); + insert_confirm->connect_compat("confirmed", this, "_confirm_insert_list"); VBoxContainer *icvb = memnew(VBoxContainer); insert_confirm->add_child(icvb); insert_confirm_text = memnew(Label); @@ -5984,7 +5987,7 @@ AnimationTrackEditor::AnimationTrackEditor() { box_selection->set_as_toplevel(true); box_selection->set_mouse_filter(MOUSE_FILTER_IGNORE); box_selection->hide(); - box_selection->connect("draw", this, "_box_selection_draw"); + box_selection->connect_compat("draw", this, "_box_selection_draw"); box_selecting = false; //default plugins @@ -6022,7 +6025,7 @@ AnimationTrackEditor::AnimationTrackEditor() { optimize_max_angle->set_value(22); optimize_dialog->get_ok()->set_text(TTR("Optimize")); - optimize_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); + optimize_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); // @@ -6048,7 +6051,7 @@ AnimationTrackEditor::AnimationTrackEditor() { cleanup_dialog->set_title(TTR("Clean-Up Animation(s) (NO UNDO!)")); cleanup_dialog->get_ok()->set_text(TTR("Clean-Up")); - cleanup_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); + cleanup_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_CLEAN_UP_ANIMATION_CONFIRM)); // scale_dialog = memnew(ConfirmationDialog); @@ -6060,7 +6063,7 @@ AnimationTrackEditor::AnimationTrackEditor() { scale->set_max(99999); scale->set_step(0.001); vbc->add_margin_child(TTR("Scale Ratio:"), scale); - scale_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_SCALE_CONFIRM)); + scale_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_SCALE_CONFIRM)); add_child(scale_dialog); track_copy_dialog = memnew(ConfirmationDialog); @@ -6073,7 +6076,7 @@ AnimationTrackEditor::AnimationTrackEditor() { Button *select_all_button = memnew(Button); select_all_button->set_text(TTR("Select All/None")); - select_all_button->connect("pressed", this, "_select_all_tracks_for_copy"); + select_all_button->connect_compat("pressed", this, "_select_all_tracks_for_copy"); track_vbox->add_child(select_all_button); track_copy_select = memnew(Tree); @@ -6081,7 +6084,7 @@ AnimationTrackEditor::AnimationTrackEditor() { track_copy_select->set_v_size_flags(SIZE_EXPAND_FILL); track_copy_select->set_hide_root(true); track_vbox->add_child(track_copy_select); - track_copy_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_COPY_TRACKS_CONFIRM)); + track_copy_dialog->connect_compat("confirmed", this, "_edit_menu_pressed", varray(EDIT_COPY_TRACKS_CONFIRM)); animation_changing_awaiting_update = false; } diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index c2660652d6..26f9c15f6c 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -314,7 +314,7 @@ class AnimationTrackEditor : public VBoxContainer { OptionButton *snap_mode; Button *imported_anim_warning; - void _show_imported_anim_warning() const; + void _show_imported_anim_warning(); void _snap_mode_changed(int p_mode); Vector<AnimationTrackEdit *> track_edits; diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index bcdd09987f..b94d1645db 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -334,7 +334,7 @@ void AnimationTrackEditAudio::_bind_methods() { } AnimationTrackEditAudio::AnimationTrackEditAudio() { - AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", this, "_preview_changed"); + AudioStreamPreviewGenerator::get_singleton()->connect_compat("preview_updated", this, "_preview_changed"); } /// SPRITE FRAME / FRAME_COORDS /// @@ -949,7 +949,7 @@ void AnimationTrackEditTypeAudio::_bind_methods() { } AnimationTrackEditTypeAudio::AnimationTrackEditTypeAudio() { - AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", this, "_preview_changed"); + AudioStreamPreviewGenerator::get_singleton()->connect_compat("preview_updated", this, "_preview_changed"); len_resizing = false; } diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index 8cbc6a8dff..f14b12b132 100644 --- a/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -42,7 +42,7 @@ Variant ArrayPropertyEdit::get_array() const { return Array(); Variant arr = o->get(property); if (!arr.is_array()) { - Variant::CallError ce; + Callable::CallError ce; arr = Variant::construct(default_type, NULL, 0, ce); } return arr; @@ -104,7 +104,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { } else if (newsize > size) { Variant init; - Variant::CallError ce; + Callable::CallError ce; Variant::Type new_type = subtype; if (new_type == Variant::NIL && size) { new_type = arr.get(size - 1).get_type(); @@ -139,7 +139,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { Variant value = arr.get(idx); if (value.get_type() != type && type >= 0 && type < Variant::VARIANT_MAX) { - Variant::CallError ce; + Callable::CallError ce; Variant new_value = Variant::construct(Variant::Type(type), NULL, 0, ce); UndoRedo *ur = EditorNode::get_undo_redo(); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index ca0ac70ff7..86631def9d 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -200,7 +200,7 @@ void FindReplaceBar::_replace() { void FindReplaceBar::_replace_all() { - text_edit->disconnect("text_changed", this, "_editor_text_changed"); + text_edit->disconnect_compat("text_changed", this, "_editor_text_changed"); // Line as x so it gets priority in comparison, column as y. Point2i orig_cursor(text_edit->cursor_get_line(), text_edit->cursor_get_column()); Point2i prev_match = Point2(-1, -1); @@ -280,7 +280,7 @@ void FindReplaceBar::_replace_all() { matches_label->add_color_override("font_color", rc > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor")); matches_label->set_text(vformat(TTR("%d replaced."), rc)); - text_edit->call_deferred("connect", "text_changed", this, "_editor_text_changed"); + text_edit->call_deferred("connect", "text_changed", Callable(this, "_editor_text_changed")); results_count = -1; } @@ -559,7 +559,7 @@ void FindReplaceBar::set_text_edit(TextEdit *p_text_edit) { results_count = -1; text_edit = p_text_edit; - text_edit->connect("text_changed", this, "_editor_text_changed"); + text_edit->connect_compat("text_changed", this, "_editor_text_changed"); } void FindReplaceBar::_bind_methods() { @@ -613,8 +613,8 @@ FindReplaceBar::FindReplaceBar() { search_text = memnew(LineEdit); vbc_lineedit->add_child(search_text); search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - search_text->connect("text_changed", this, "_search_text_changed"); - search_text->connect("text_entered", this, "_search_text_entered"); + search_text->connect_compat("text_changed", this, "_search_text_changed"); + search_text->connect_compat("text_entered", this, "_search_text_entered"); matches_label = memnew(Label); hbc_button_search->add_child(matches_label); @@ -623,51 +623,51 @@ FindReplaceBar::FindReplaceBar() { find_prev = memnew(ToolButton); hbc_button_search->add_child(find_prev); find_prev->set_focus_mode(FOCUS_NONE); - find_prev->connect("pressed", this, "_search_prev"); + find_prev->connect_compat("pressed", this, "_search_prev"); find_next = memnew(ToolButton); hbc_button_search->add_child(find_next); find_next->set_focus_mode(FOCUS_NONE); - find_next->connect("pressed", this, "_search_next"); + find_next->connect_compat("pressed", this, "_search_next"); case_sensitive = memnew(CheckBox); hbc_option_search->add_child(case_sensitive); case_sensitive->set_text(TTR("Match Case")); case_sensitive->set_focus_mode(FOCUS_NONE); - case_sensitive->connect("toggled", this, "_search_options_changed"); + case_sensitive->connect_compat("toggled", this, "_search_options_changed"); whole_words = memnew(CheckBox); hbc_option_search->add_child(whole_words); whole_words->set_text(TTR("Whole Words")); whole_words->set_focus_mode(FOCUS_NONE); - whole_words->connect("toggled", this, "_search_options_changed"); + whole_words->connect_compat("toggled", this, "_search_options_changed"); // replace toolbar replace_text = memnew(LineEdit); vbc_lineedit->add_child(replace_text); replace_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - replace_text->connect("text_entered", this, "_replace_text_entered"); + replace_text->connect_compat("text_entered", this, "_replace_text_entered"); replace = memnew(Button); hbc_button_replace->add_child(replace); replace->set_text(TTR("Replace")); - replace->connect("pressed", this, "_replace_pressed"); + replace->connect_compat("pressed", this, "_replace_pressed"); replace_all = memnew(Button); hbc_button_replace->add_child(replace_all); replace_all->set_text(TTR("Replace All")); - replace_all->connect("pressed", this, "_replace_all_pressed"); + replace_all->connect_compat("pressed", this, "_replace_all_pressed"); selection_only = memnew(CheckBox); hbc_option_replace->add_child(selection_only); selection_only->set_text(TTR("Selection Only")); selection_only->set_focus_mode(FOCUS_NONE); - selection_only->connect("toggled", this, "_search_options_changed"); + selection_only->connect_compat("toggled", this, "_search_options_changed"); hide_button = memnew(TextureButton); add_child(hide_button); hide_button->set_focus_mode(FOCUS_NONE); - hide_button->connect("pressed", this, "_hide_pressed"); + hide_button->connect_compat("pressed", this, "_hide_pressed"); hide_button->set_v_size_flags(SIZE_SHRINK_CENTER); } @@ -1717,7 +1717,7 @@ CodeTextEditor::CodeTextEditor() { error_column = 0; toggle_scripts_button = memnew(ToolButton); - toggle_scripts_button->connect("pressed", this, "_toggle_scripts_pressed"); + toggle_scripts_button->connect_compat("pressed", this, "_toggle_scripts_pressed"); status_bar->add_child(toggle_scripts_button); toggle_scripts_button->hide(); @@ -1732,15 +1732,15 @@ CodeTextEditor::CodeTextEditor() { scroll->add_child(error); error->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER); error->set_mouse_filter(MOUSE_FILTER_STOP); - error->connect("gui_input", this, "_error_pressed"); - find_replace_bar->connect("error", error, "set_text"); + error->connect_compat("gui_input", this, "_error_pressed"); + find_replace_bar->connect_compat("error", error, "set_text"); // Warnings warning_button = memnew(ToolButton); status_bar->add_child(warning_button); warning_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER); warning_button->set_default_cursor_shape(CURSOR_POINTING_HAND); - warning_button->connect("pressed", this, "_warning_button_pressed"); + warning_button->connect_compat("pressed", this, "_warning_button_pressed"); warning_button->set_tooltip(TTR("Warnings")); warning_count_label = memnew(Label); @@ -1752,7 +1752,7 @@ CodeTextEditor::CodeTextEditor() { warning_count_label->set_tooltip(TTR("Warnings")); warning_count_label->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("warning_color", "Editor")); warning_count_label->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); - warning_count_label->connect("gui_input", this, "_warning_label_gui_input"); + warning_count_label->connect_compat("gui_input", this, "_warning_label_gui_input"); is_warnings_panel_opened = false; set_warning_nb(0); @@ -1765,10 +1765,10 @@ CodeTextEditor::CodeTextEditor() { line_and_col_txt->set_tooltip(TTR("Line and column numbers.")); line_and_col_txt->set_mouse_filter(MOUSE_FILTER_STOP); - text_editor->connect("gui_input", this, "_text_editor_gui_input"); - text_editor->connect("cursor_changed", this, "_line_col_changed"); - text_editor->connect("text_changed", this, "_text_changed"); - text_editor->connect("request_completion", this, "_complete_request"); + text_editor->connect_compat("gui_input", this, "_text_editor_gui_input"); + text_editor->connect_compat("cursor_changed", this, "_line_col_changed"); + text_editor->connect_compat("text_changed", this, "_text_changed"); + text_editor->connect_compat("request_completion", this, "_complete_request"); Vector<String> cs; cs.push_back("."); cs.push_back(","); @@ -1776,9 +1776,9 @@ CodeTextEditor::CodeTextEditor() { cs.push_back("="); cs.push_back("$"); text_editor->set_completion(true, cs); - idle->connect("timeout", this, "_text_changed_idle_timeout"); + idle->connect_compat("timeout", this, "_text_changed_idle_timeout"); - code_complete_timer->connect("timeout", this, "_code_complete_timer_timeout"); + code_complete_timer->connect_compat("timeout", this, "_code_complete_timer_timeout"); font_resize_val = 0; font_size = EditorSettings::get_singleton()->get("interface/editor/code_font_size"); @@ -1786,7 +1786,7 @@ CodeTextEditor::CodeTextEditor() { add_child(font_resize_timer); font_resize_timer->set_one_shot(true); font_resize_timer->set_wait_time(0.07); - font_resize_timer->connect("timeout", this, "_font_resize_timeout"); + font_resize_timer->connect_compat("timeout", this, "_font_resize_timeout"); - EditorSettings::get_singleton()->connect("settings_changed", this, "_on_settings_change"); + EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_on_settings_change"); } diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index c2c9a88bf0..f78867e493 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -166,8 +166,9 @@ void ConnectDialog::_add_bind() { switch (vt) { case Variant::BOOL: value = false; break; case Variant::INT: value = 0; break; - case Variant::REAL: value = 0.0; break; + case Variant::FLOAT: value = 0.0; break; case Variant::STRING: value = ""; break; + case Variant::STRING_NAME: value = ""; break; case Variant::VECTOR2: value = Vector2(); break; case Variant::RECT2: value = Rect2(); break; case Variant::VECTOR3: value = Vector3(); break; @@ -304,7 +305,7 @@ bool ConnectDialog::is_editing() const { * If creating a connection from scratch, sensible defaults are used. * If editing an existing connection, previous data is retained. */ -void ConnectDialog::init(Connection c, bool bEdit) { +void ConnectDialog::init(ConnectionData c, bool bEdit) { set_hide_on_ok(false); @@ -389,8 +390,8 @@ ConnectDialog::ConnectDialog() { tree = memnew(SceneTreeEditor(false)); tree->set_connecting_signal(true); - tree->get_scene_tree()->connect("item_activated", this, "_ok"); - tree->connect("node_selected", this, "_tree_node_selected"); + tree->get_scene_tree()->connect_compat("item_activated", this, "_ok"); + tree->connect_compat("node_selected", this, "_tree_node_selected"); tree->set_connect_to_script_mode(true); Node *mc = vbc_left->add_margin_child(TTR("Connect to Script:"), tree, true); @@ -413,8 +414,9 @@ ConnectDialog::ConnectDialog() { add_bind_hb->add_child(type_list); type_list->add_item("bool", Variant::BOOL); type_list->add_item("int", Variant::INT); - type_list->add_item("real", Variant::REAL); + type_list->add_item("real", Variant::FLOAT); type_list->add_item("String", Variant::STRING); + type_list->add_item("StringName", Variant::STRING_NAME); type_list->add_item("Vector2", Variant::VECTOR2); type_list->add_item("Rect2", Variant::RECT2); type_list->add_item("Vector3", Variant::VECTOR3); @@ -429,12 +431,12 @@ ConnectDialog::ConnectDialog() { Button *add_bind = memnew(Button); add_bind->set_text(TTR("Add")); add_bind_hb->add_child(add_bind); - add_bind->connect("pressed", this, "_add_bind"); + add_bind->connect_compat("pressed", this, "_add_bind"); Button *del_bind = memnew(Button); del_bind->set_text(TTR("Remove")); add_bind_hb->add_child(del_bind); - del_bind->connect("pressed", this, "_remove_bind"); + del_bind->connect_compat("pressed", this, "_remove_bind"); vbc_right->add_margin_child(TTR("Add Extra Call Argument:"), add_bind_hb); @@ -447,13 +449,13 @@ ConnectDialog::ConnectDialog() { dst_method = memnew(LineEdit); dst_method->set_h_size_flags(SIZE_EXPAND_FILL); - dst_method->connect("text_entered", this, "_builtin_text_entered"); + dst_method->connect_compat("text_entered", this, "_builtin_text_entered"); dstm_hb->add_child(dst_method); advanced = memnew(CheckButton); dstm_hb->add_child(advanced); advanced->set_text(TTR("Advanced")); - advanced->connect("pressed", this, "_advanced_pressed"); + advanced->connect_compat("pressed", this, "_advanced_pressed"); // Add spacing so the tree and inspector are the same size. Control *spacing = memnew(Control); @@ -500,7 +502,6 @@ Control *ConnectionsDockTree::make_custom_tooltip(const String &p_text) const { String text = TTR("Signal:") + " [u][b]" + p_text.get_slice("::", 0) + "[/b][/u]"; text += p_text.get_slice("::", 1).strip_edges() + "\n"; text += p_text.get_slice("::", 2).strip_edges(); - help_bit->set_text(text); help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene return help_bit; } @@ -525,7 +526,7 @@ void ConnectionsDock::_make_or_edit_connection() { Node *target = selectedNode->get_node(dst_path); ERR_FAIL_COND(!target); - Connection cToMake; + ConnectDialog::ConnectionData cToMake; cToMake.source = connect_dialog->get_source(); cToMake.target = target; cToMake.signal = connect_dialog->get_signal_name(); @@ -585,7 +586,7 @@ void ConnectionsDock::_make_or_edit_connection() { /* * Creates single connection w/ undo-redo functionality. */ -void ConnectionsDock::_connect(Connection cToMake) { +void ConnectionsDock::_connect(ConnectDialog::ConnectionData cToMake) { Node *source = static_cast<Node *>(cToMake.source); Node *target = static_cast<Node *>(cToMake.target); @@ -595,8 +596,10 @@ void ConnectionsDock::_connect(Connection cToMake) { undo_redo->create_action(vformat(TTR("Connect '%s' to '%s'"), String(cToMake.signal), String(cToMake.method))); - undo_redo->add_do_method(source, "connect", cToMake.signal, target, cToMake.method, cToMake.binds, cToMake.flags); - undo_redo->add_undo_method(source, "disconnect", cToMake.signal, target, cToMake.method); + Callable c(target, cToMake.method); + + undo_redo->add_do_method(source, "connect", cToMake.signal, c, cToMake.binds, cToMake.flags); + undo_redo->add_undo_method(source, "disconnect", cToMake.signal, c); undo_redo->add_do_method(this, "update_tree"); undo_redo->add_undo_method(this, "update_tree"); undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); //to force redraw of scene tree @@ -610,13 +613,15 @@ void ConnectionsDock::_connect(Connection cToMake) { */ void ConnectionsDock::_disconnect(TreeItem &item) { - Connection c = item.get_metadata(0); + Connection cd = item.get_metadata(0); + ConnectDialog::ConnectionData c = cd; + ERR_FAIL_COND(c.source != selectedNode); // Shouldn't happen but... Bugcheck. undo_redo->create_action(vformat(TTR("Disconnect '%s' from '%s'"), c.signal, c.method)); - undo_redo->add_do_method(selectedNode, "disconnect", c.signal, c.target, c.method); - undo_redo->add_undo_method(selectedNode, "connect", c.signal, c.target, c.method, c.binds, c.flags); + undo_redo->add_do_method(selectedNode, "disconnect", c.signal, Callable(c.target, c.method)); + undo_redo->add_undo_method(selectedNode, "connect", c.signal, Callable(c.target, c.method), c.binds, c.flags); undo_redo->add_do_method(this, "update_tree"); undo_redo->add_undo_method(this, "update_tree"); undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); // To force redraw of scene tree. @@ -641,9 +646,10 @@ void ConnectionsDock::_disconnect_all() { undo_redo->create_action(vformat(TTR("Disconnect all from signal: '%s'"), signalName)); while (child) { - Connection c = child->get_metadata(0); - undo_redo->add_do_method(selectedNode, "disconnect", c.signal, c.target, c.method); - undo_redo->add_undo_method(selectedNode, "connect", c.signal, c.target, c.method, c.binds, c.flags); + Connection cd = child->get_metadata(0); + ConnectDialog::ConnectionData c = cd; + undo_redo->add_do_method(selectedNode, "disconnect", c.signal, Callable(c.target, c.method)); + undo_redo->add_undo_method(selectedNode, "connect", c.signal, Callable(c.target, c.method), c.binds, c.flags); child = child->get_next(); } @@ -720,7 +726,7 @@ void ConnectionsDock::_open_connection_dialog(TreeItem &item) { StringName dst_method = "_on_" + midname + "_" + signal; - Connection c; + ConnectDialog::ConnectionData c; c.source = selectedNode; c.signal = StringName(signalname); c.target = dst_node; @@ -733,7 +739,7 @@ void ConnectionsDock::_open_connection_dialog(TreeItem &item) { /* * Open connection dialog with Connection data to EDIT an existing connection. */ -void ConnectionsDock::_open_connection_dialog(Connection cToEdit) { +void ConnectionsDock::_open_connection_dialog(ConnectDialog::ConnectionData cToEdit) { Node *src = static_cast<Node *>(cToEdit.source); Node *dst = static_cast<Node *>(cToEdit.target); @@ -753,7 +759,8 @@ void ConnectionsDock::_go_to_script(TreeItem &item) { if (_is_item_signal(item)) return; - Connection c = item.get_metadata(0); + Connection cd = item.get_metadata(0); + ConnectDialog::ConnectionData c = cd; ERR_FAIL_COND(c.source != selectedNode); //shouldn't happen but...bugcheck if (!c.target) @@ -1014,7 +1021,7 @@ void ConnectionsDock::update_tree() { for (List<Object::Connection>::Element *F = connections.front(); F; F = F->next()) { - Object::Connection &c = F->get(); + ConnectDialog::ConnectionData c = F->get(); if (!(c.flags & CONNECT_PERSIST)) continue; @@ -1041,7 +1048,8 @@ void ConnectionsDock::update_tree() { TreeItem *item2 = tree->create_item(item); item2->set_text(0, path); - item2->set_metadata(0, c); + Connection cd = c; + item2->set_metadata(0, cd); item2->set_icon(0, get_icon("Slot", "EditorIcons")); } } @@ -1077,7 +1085,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { vbc->add_child(hb); hb->add_spacer(); hb->add_child(connect_button); - connect_button->connect("pressed", this, "_connect_pressed"); + connect_button->connect_compat("pressed", this, "_connect_pressed"); connect_dialog = memnew(ConnectDialog); connect_dialog->set_as_toplevel(true); @@ -1086,26 +1094,26 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { disconnect_all_dialog = memnew(ConfirmationDialog); disconnect_all_dialog->set_as_toplevel(true); add_child(disconnect_all_dialog); - disconnect_all_dialog->connect("confirmed", this, "_disconnect_all"); + disconnect_all_dialog->connect_compat("confirmed", this, "_disconnect_all"); disconnect_all_dialog->set_text(TTR("Are you sure you want to remove all connections from this signal?")); signal_menu = memnew(PopupMenu); add_child(signal_menu); - signal_menu->connect("id_pressed", this, "_handle_signal_menu_option"); + signal_menu->connect_compat("id_pressed", this, "_handle_signal_menu_option"); signal_menu->add_item(TTR("Connect..."), CONNECT); signal_menu->add_item(TTR("Disconnect All"), DISCONNECT_ALL); slot_menu = memnew(PopupMenu); add_child(slot_menu); - slot_menu->connect("id_pressed", this, "_handle_slot_menu_option"); + slot_menu->connect_compat("id_pressed", this, "_handle_slot_menu_option"); slot_menu->add_item(TTR("Edit..."), EDIT); slot_menu->add_item(TTR("Go To Method"), GO_TO_SCRIPT); slot_menu->add_item(TTR("Disconnect"), DISCONNECT); - connect_dialog->connect("connected", this, "_make_or_edit_connection"); - tree->connect("item_selected", this, "_tree_item_selected"); - tree->connect("item_activated", this, "_tree_item_activated"); - tree->connect("item_rmb_selected", this, "_rmb_pressed"); + connect_dialog->connect_compat("connected", this, "_make_or_edit_connection"); + tree->connect_compat("item_selected", this, "_tree_item_selected"); + tree->connect_compat("item_activated", this, "_tree_item_activated"); + tree->connect_compat("item_rmb_selected", this, "_rmb_pressed"); add_constant_override("separation", 3 * EDSCALE); } diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index 7e39d7d904..a4ed68b44e 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -53,6 +53,36 @@ class ConnectDialog : public ConfirmationDialog { GDCLASS(ConnectDialog, ConfirmationDialog); +public: + struct ConnectionData { + Node *source = nullptr; + Node *target = nullptr; + StringName signal; + StringName method; + uint32_t flags = 0; + Vector<Variant> binds; + + ConnectionData() { + } + ConnectionData(const Connection &p_connection) { + source = Object::cast_to<Node>(p_connection.signal.get_object()); + signal = p_connection.signal.get_name(); + target = Object::cast_to<Node>(p_connection.callable.get_object()); + method = p_connection.callable.get_method(); + flags = p_connection.flags; + binds = p_connection.binds; + } + operator Connection() { + Connection c; + c.signal = ::Signal(source, signal); + c.callable = Callable(target, method); + c.flags = flags; + c.binds = binds; + return c; + } + }; + +private: Label *connect_to_label; LineEdit *from_signal; Node *source; @@ -98,7 +128,7 @@ public: bool get_oneshot() const; bool is_editing() const; - void init(Connection c, bool bEdit = false); + void init(ConnectionData c, bool bEdit = false); void popup_dialog(const String &p_for_signal); ConnectDialog(); @@ -144,7 +174,7 @@ class ConnectionsDock : public VBoxContainer { Map<StringName, Map<StringName, String> > descr_cache; void _make_or_edit_connection(); - void _connect(Connection cToMake); + void _connect(ConnectDialog::ConnectionData cToMake); void _disconnect(TreeItem &item); void _disconnect_all(); @@ -153,7 +183,7 @@ class ConnectionsDock : public VBoxContainer { bool _is_item_signal(TreeItem &item); void _open_connection_dialog(TreeItem &item); - void _open_connection_dialog(Connection cToEdit); + void _open_connection_dialog(ConnectDialog::ConnectionData cToEdit); void _go_to_script(TreeItem &item); void _handle_signal_menu_option(int option); diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 4adb3844bc..9584443c75 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -459,13 +459,13 @@ void CreateDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_confirmed"); + connect_compat("confirmed", this, "_confirmed"); search_box->set_right_icon(get_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); favorite->set_icon(get_icon("Favorites", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", this, "_confirmed"); + disconnect_compat("confirmed", this, "_confirmed"); } break; case NOTIFICATION_VISIBILITY_CHANGED: { if (is_visible_in_tree()) { @@ -766,8 +766,8 @@ CreateDialog::CreateDialog() { favorites->set_hide_root(true); favorites->set_hide_folding(true); favorites->set_allow_reselect(true); - favorites->connect("cell_selected", this, "_favorite_selected"); - favorites->connect("item_activated", this, "_favorite_activated"); + favorites->connect_compat("cell_selected", this, "_favorite_selected"); + favorites->connect_compat("item_activated", this, "_favorite_activated"); favorites->set_drag_forwarding(this); favorites->add_constant_override("draw_guides", 1); @@ -781,8 +781,8 @@ CreateDialog::CreateDialog() { recent->set_hide_root(true); recent->set_hide_folding(true); recent->set_allow_reselect(true); - recent->connect("cell_selected", this, "_history_selected"); - recent->connect("item_activated", this, "_history_activated"); + recent->connect_compat("cell_selected", this, "_history_selected"); + recent->connect_compat("item_activated", this, "_history_activated"); recent->add_constant_override("draw_guides", 1); VBoxContainer *vbc = memnew(VBoxContainer); @@ -797,23 +797,23 @@ CreateDialog::CreateDialog() { favorite->set_flat(true); favorite->set_toggle_mode(true); search_hb->add_child(favorite); - favorite->connect("pressed", this, "_favorite_toggled"); + favorite->connect_compat("pressed", this, "_favorite_toggled"); vbc->add_margin_child(TTR("Search:"), search_hb); - search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("gui_input", this, "_sbox_input"); + search_box->connect_compat("text_changed", this, "_text_changed"); + search_box->connect_compat("gui_input", this, "_sbox_input"); search_options = memnew(Tree); vbc->add_margin_child(TTR("Matches:"), search_options, true); get_ok()->set_disabled(true); register_text_enter(search_box); set_hide_on_ok(false); - search_options->connect("item_activated", this, "_confirmed"); - search_options->connect("cell_selected", this, "_item_selected"); + search_options->connect_compat("item_activated", this, "_confirmed"); + search_options->connect_compat("cell_selected", this, "_item_selected"); base_type = "Object"; preferred_search_result_type = ""; help_bit = memnew(EditorHelpBit); vbc->add_margin_child(TTR("Description:"), help_bit); - help_bit->connect("request_hide", this, "_closed"); + help_bit->connect_compat("request_hide", this, "_closed"); type_blacklist.insert("PluginScript"); // PluginScript must be initialized before use, which is not possible here type_blacklist.insert("ScriptCreateDialog"); // This is an exposed editor Node that doesn't have an Editor prefix. diff --git a/editor/debugger/SCsub b/editor/debugger/SCsub new file mode 100644 index 0000000000..2b1e889fb0 --- /dev/null +++ b/editor/debugger/SCsub @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +Import('env') + +env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/debugger/editor_debugger_inspector.cpp b/editor/debugger/editor_debugger_inspector.cpp new file mode 100644 index 0000000000..35d7dda3f4 --- /dev/null +++ b/editor/debugger/editor_debugger_inspector.cpp @@ -0,0 +1,277 @@ +/*************************************************************************/ +/* editor_debugger_inspector.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "editor_debugger_inspector.h" + +#include "core/io/marshalls.h" +#include "core/script_debugger_remote.h" +#include "editor/editor_node.h" +#include "scene/debugger/scene_debugger.h" + +bool EditorDebuggerRemoteObject::_set(const StringName &p_name, const Variant &p_value) { + + if (!editable || !prop_values.has(p_name) || String(p_name).begins_with("Constants/")) + return false; + + prop_values[p_name] = p_value; + emit_signal("value_edited", remote_object_id, p_name, p_value); + return true; +} + +bool EditorDebuggerRemoteObject::_get(const StringName &p_name, Variant &r_ret) const { + + if (!prop_values.has(p_name)) + return false; + + r_ret = prop_values[p_name]; + return true; +} + +void EditorDebuggerRemoteObject::_get_property_list(List<PropertyInfo> *p_list) const { + + p_list->clear(); //sorry, no want category + for (const List<PropertyInfo>::Element *E = prop_list.front(); E; E = E->next()) { + p_list->push_back(E->get()); + } +} + +String EditorDebuggerRemoteObject::get_title() { + if (remote_object_id.is_valid()) + return TTR("Remote ") + String(type_name) + ": " + itos(remote_object_id); + else + return "<null>"; +} + +Variant EditorDebuggerRemoteObject::get_variant(const StringName &p_name) { + Variant var; + _get(p_name, var); + return var; +} + +void EditorDebuggerRemoteObject::_bind_methods() { + + ClassDB::bind_method(D_METHOD("get_title"), &EditorDebuggerRemoteObject::get_title); + ClassDB::bind_method(D_METHOD("get_variant"), &EditorDebuggerRemoteObject::get_variant); + ClassDB::bind_method(D_METHOD("clear"), &EditorDebuggerRemoteObject::clear); + ClassDB::bind_method(D_METHOD("get_remote_object_id"), &EditorDebuggerRemoteObject::get_remote_object_id); + + ADD_SIGNAL(MethodInfo("value_edited", PropertyInfo(Variant::INT, "object_id"), PropertyInfo(Variant::STRING, "property"), PropertyInfo("value"))); +} + +EditorDebuggerInspector::EditorDebuggerInspector() { + variables = memnew(EditorDebuggerRemoteObject); + variables->editable = false; +} + +EditorDebuggerInspector::~EditorDebuggerInspector() { + memdelete(variables); +} + +void EditorDebuggerInspector::_bind_methods() { + ClassDB::bind_method(D_METHOD("_object_edited", "name", "value"), &EditorDebuggerInspector::_object_edited); + ClassDB::bind_method(D_METHOD("_object_selected", "id"), &EditorDebuggerInspector::_object_selected); + ADD_SIGNAL(MethodInfo("object_selected", PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("object_edited", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::STRING, "property"), PropertyInfo("value"))); + ADD_SIGNAL(MethodInfo("object_property_updated", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::STRING, "property"))); +} + +void EditorDebuggerInspector::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_POSTINITIALIZE: + connect_compat("object_id_selected", this, "_object_selected"); + break; + case NOTIFICATION_ENTER_TREE: + edit(variables); + break; + default: + break; + } +} + +void EditorDebuggerInspector::_object_edited(ObjectID p_id, const String &p_prop, const Variant &p_value) { + + emit_signal("object_edited", p_id, p_prop, p_value); +} + +void EditorDebuggerInspector::_object_selected(ObjectID p_object) { + + emit_signal("object_selected", p_object); +} + +ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) { + EditorDebuggerRemoteObject *debugObj = NULL; + + SceneDebuggerObject obj; + obj.deserialize(p_arr); + ERR_FAIL_COND_V(obj.id.is_null(), ObjectID()); + + if (remote_objects.has(obj.id)) { + debugObj = remote_objects[obj.id]; + } else { + debugObj = memnew(EditorDebuggerRemoteObject); + debugObj->remote_object_id = obj.id; + debugObj->type_name = obj.class_name; + remote_objects[obj.id] = debugObj; + debugObj->connect_compat("value_edited", this, "_object_edited"); + } + + int old_prop_size = debugObj->prop_list.size(); + + debugObj->prop_list.clear(); + int new_props_added = 0; + Set<String> changed; + for (int i = 0; i < obj.properties.size(); i++) { + + PropertyInfo &pinfo = obj.properties[i].first; + Variant &var = obj.properties[i].second; + + if (pinfo.type == Variant::OBJECT) { + if (var.get_type() == Variant::STRING) { + String path = var; + if (path.find("::") != -1) { + // built-in resource + String base_path = path.get_slice("::", 0); + if (ResourceLoader::get_resource_type(base_path) == "PackedScene") { + if (!EditorNode::get_singleton()->is_scene_open(base_path)) { + EditorNode::get_singleton()->load_scene(base_path); + } + } else { + EditorNode::get_singleton()->load_resource(base_path); + } + } + var = ResourceLoader::load(path); + + if (pinfo.hint_string == "Script") { + if (debugObj->get_script() != var) { + debugObj->set_script(REF()); + Ref<Script> script(var); + if (!script.is_null()) { + ScriptInstance *script_instance = script->placeholder_instance_create(debugObj); + debugObj->set_script_and_instance(var, script_instance); + } + } + } + } + } + + //always add the property, since props may have been added or removed + debugObj->prop_list.push_back(pinfo); + + if (!debugObj->prop_values.has(pinfo.name)) { + new_props_added++; + debugObj->prop_values[pinfo.name] = var; + } else { + + if (bool(Variant::evaluate(Variant::OP_NOT_EQUAL, debugObj->prop_values[pinfo.name], var))) { + debugObj->prop_values[pinfo.name] = var; + changed.insert(pinfo.name); + } + } + } + + if (old_prop_size == debugObj->prop_list.size() && new_props_added == 0) { + //only some may have changed, if so, then update those, if exist + for (Set<String>::Element *E = changed.front(); E; E = E->next()) { + emit_signal("object_property_updated", debugObj->remote_object_id, E->get()); + } + } else { + //full update, because props were added or removed + debugObj->update(); + } + return obj.id; +} + +void EditorDebuggerInspector::clear_cache() { + for (Map<ObjectID, EditorDebuggerRemoteObject *>::Element *E = remote_objects.front(); E; E = E->next()) { + EditorNode *editor = EditorNode::get_singleton(); + if (editor->get_editor_history()->get_current() == E->value()->get_instance_id()) { + editor->push_item(NULL); + } + memdelete(E->value()); + } + remote_objects.clear(); +} + +Object *EditorDebuggerInspector::get_object(ObjectID p_id) { + if (remote_objects.has(p_id)) + return remote_objects[p_id]; + return NULL; +} + +void EditorDebuggerInspector::add_stack_variable(const Array &p_array) { + + ScriptDebuggerRemote::ScriptStackVariable var; + var.deserialize(p_array); + String n = var.name; + Variant v = var.value; + + PropertyHint h = PROPERTY_HINT_NONE; + String hs = String(); + + if (v.get_type() == Variant::OBJECT) { + v = Object::cast_to<EncodedObjectAsID>(v)->get_object_id(); + h = PROPERTY_HINT_OBJECT_ID; + hs = "Object"; + } + String type; + switch (var.type) { + case 0: + type = "Locals/"; + break; + case 1: + type = "Members/"; + break; + case 2: + type = "Globals/"; + break; + default: + type = "Unknown/"; + } + + PropertyInfo pinfo; + pinfo.name = type + n; + pinfo.type = v.get_type(); + pinfo.hint = h; + pinfo.hint_string = hs; + + variables->prop_list.push_back(pinfo); + variables->prop_values[type + n] = v; + variables->update(); + edit(variables); +} + +void EditorDebuggerInspector::clear_stack_variables() { + variables->clear(); + variables->update(); +} + +String EditorDebuggerInspector::get_stack_variable(const String &p_var) { + return variables->get_variant(p_var); +} diff --git a/editor/debugger/editor_debugger_inspector.h b/editor/debugger/editor_debugger_inspector.h new file mode 100644 index 0000000000..e1dfbefcf3 --- /dev/null +++ b/editor/debugger/editor_debugger_inspector.h @@ -0,0 +1,98 @@ +/*************************************************************************/ +/* editor_debugger_inspector.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef EDITOR_DEBUGGER_INSPECTOR_H +#define EDITOR_DEBUGGER_INSPECTOR_H +#include "editor/editor_inspector.h" + +class EditorDebuggerRemoteObject : public Object { + + GDCLASS(EditorDebuggerRemoteObject, Object); + +protected: + bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_name, Variant &r_ret) const; + void _get_property_list(List<PropertyInfo> *p_list) const; + static void _bind_methods(); + +public: + bool editable = false; + ObjectID remote_object_id; + String type_name; + List<PropertyInfo> prop_list; + Map<StringName, Variant> prop_values; + + ObjectID get_remote_object_id() { return remote_object_id; }; + String get_title(); + + Variant get_variant(const StringName &p_name); + + void clear() { + prop_list.clear(); + prop_values.clear(); + } + + void update() { _change_notify(); } + + EditorDebuggerRemoteObject(){}; +}; + +class EditorDebuggerInspector : public EditorInspector { + + GDCLASS(EditorDebuggerInspector, EditorInspector); + +private: + ObjectID inspected_object_id; + Map<ObjectID, EditorDebuggerRemoteObject *> remote_objects; + EditorDebuggerRemoteObject *variables; + + void _object_selected(ObjectID p_object); + void _object_edited(ObjectID p_id, const String &p_prop, const Variant &p_value); + +protected: + void _notification(int p_what); + static void _bind_methods(); + +public: + EditorDebuggerInspector(); + ~EditorDebuggerInspector(); + + // Remote Object cache + ObjectID add_object(const Array &p_arr); + Object *get_object(ObjectID p_id); + void clear_cache(); + + // Stack Dump variables + String get_stack_variable(const String &p_var); + void add_stack_variable(const Array &p_arr); + void clear_stack_variables(); +}; + +#endif // EDITOR_DEBUGGER_INSPECTOR_H diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp new file mode 100644 index 0000000000..54708fd908 --- /dev/null +++ b/editor/debugger/editor_debugger_node.cpp @@ -0,0 +1,591 @@ +/*************************************************************************/ +/* editor_debugger_node.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "editor_debugger_node.h" + +#include "editor/debugger/editor_debugger_tree.h" +#include "editor/editor_log.h" +#include "editor/editor_node.h" +#include "editor/plugins/script_editor_plugin.h" + +template <typename Func> +void _for_all(TabContainer *p_node, const Func &p_func) { + for (int i = 0; i < p_node->get_tab_count(); i++) { + ScriptEditorDebugger *dbg = Object::cast_to<ScriptEditorDebugger>(p_node->get_tab_control(i)); + ERR_FAIL_COND(!dbg); + p_func(dbg); + } +} + +EditorDebuggerNode *EditorDebuggerNode::singleton = NULL; + +EditorDebuggerNode::EditorDebuggerNode() { + if (!singleton) + singleton = this; + server.instance(); + + add_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); + add_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); + + tabs = memnew(TabContainer); + tabs->set_tab_align(TabContainer::ALIGN_LEFT); + tabs->set_tabs_visible(false); + tabs->connect_compat("tab_changed", this, "_debugger_changed"); + add_child(tabs); + + Ref<StyleBoxEmpty> empty; + empty.instance(); + tabs->add_style_override("panel", empty); + + auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false); + _add_debugger(); + + // Remote scene tree + remote_scene_tree = memnew(EditorDebuggerTree); + remote_scene_tree->connect_compat("object_selected", this, "_remote_object_requested"); + remote_scene_tree->connect_compat("save_node", this, "_save_node_requested"); + EditorNode::get_singleton()->get_scene_tree_dock()->add_remote_tree_editor(remote_scene_tree); + EditorNode::get_singleton()->get_scene_tree_dock()->connect_compat("remote_tree_selected", this, "request_remote_tree"); + + remote_scene_tree_timeout = EDITOR_DEF("debugger/remote_scene_tree_refresh_interval", 1.0); + inspect_edited_object_timeout = EDITOR_DEF("debugger/remote_inspect_refresh_interval", 0.2); + + EditorNode *editor = EditorNode::get_singleton(); + editor->get_undo_redo()->set_method_notify_callback(_method_changeds, this); + editor->get_undo_redo()->set_property_notify_callback(_property_changeds, this); + editor->get_pause_button()->connect_compat("pressed", this, "_paused"); +} + +ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() { + ScriptEditorDebugger *node = memnew(ScriptEditorDebugger(EditorNode::get_singleton())); + + int id = tabs->get_tab_count(); + node->connect_compat("stop_requested", this, "_debugger_wants_stop", varray(id)); + node->connect_compat("stopped", this, "_debugger_stopped", varray(id)); + node->connect_compat("stack_frame_selected", this, "_stack_frame_selected", varray(id)); + node->connect_compat("error_selected", this, "_error_selected", varray(id)); + node->connect_compat("clear_execution", this, "_clear_execution"); + node->connect_compat("breaked", this, "_breaked", varray(id)); + node->connect_compat("remote_tree_updated", this, "_remote_tree_updated", varray(id)); + node->connect_compat("remote_object_updated", this, "_remote_object_updated", varray(id)); + node->connect_compat("remote_object_property_updated", this, "_remote_object_property_updated", varray(id)); + node->connect_compat("remote_object_requested", this, "_remote_object_requested", varray(id)); + + if (tabs->get_tab_count() > 0) { + get_debugger(0)->clear_style(); + } + + tabs->add_child(node); + + node->set_name("Session " + itos(tabs->get_tab_count())); + if (tabs->get_tab_count() > 1) { + node->clear_style(); + tabs->set_tabs_visible(true); + tabs->add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); + } + + return node; +} + +void EditorDebuggerNode::_stack_frame_selected(int p_debugger) { + const ScriptEditorDebugger *dbg = get_debugger(p_debugger); + ERR_FAIL_COND(!dbg); + if (dbg != get_current_debugger()) + return; + _text_editor_stack_goto(dbg); +} + +void EditorDebuggerNode::_error_selected(const String &p_file, int p_line, int p_debugger) { + Ref<Script> s = ResourceLoader::load(p_file); + emit_signal("goto_script_line", s, p_line - 1); +} + +void EditorDebuggerNode::_text_editor_stack_goto(const ScriptEditorDebugger *p_debugger) { + const String file = p_debugger->get_stack_script_file(); + if (file.empty()) + return; + stack_script = ResourceLoader::load(file); + const int line = p_debugger->get_stack_script_line() - 1; + emit_signal("goto_script_line", stack_script, line); + emit_signal("set_execution", stack_script, line); + stack_script.unref(); // Why?!? +} + +void EditorDebuggerNode::_bind_methods() { + ClassDB::bind_method("_menu_option", &EditorDebuggerNode::_menu_option); + ClassDB::bind_method("_debugger_stopped", &EditorDebuggerNode::_debugger_stopped); + ClassDB::bind_method("_debugger_wants_stop", &EditorDebuggerNode::_debugger_wants_stop); + ClassDB::bind_method("_debugger_changed", &EditorDebuggerNode::_debugger_changed); + ClassDB::bind_method("_stack_frame_selected", &EditorDebuggerNode::_stack_frame_selected); + ClassDB::bind_method("_error_selected", &EditorDebuggerNode::_error_selected); + ClassDB::bind_method("_clear_execution", &EditorDebuggerNode::_clear_execution); + ClassDB::bind_method("_breaked", &EditorDebuggerNode::_breaked); + ClassDB::bind_method("start", &EditorDebuggerNode::start); + ClassDB::bind_method("stop", &EditorDebuggerNode::stop); + ClassDB::bind_method("_paused", &EditorDebuggerNode::_paused); + ClassDB::bind_method("request_remote_tree", &EditorDebuggerNode::request_remote_tree); + ClassDB::bind_method("_remote_tree_updated", &EditorDebuggerNode::_remote_tree_updated); + ClassDB::bind_method("_remote_object_updated", &EditorDebuggerNode::_remote_object_updated); + ClassDB::bind_method("_remote_object_property_updated", &EditorDebuggerNode::_remote_object_property_updated); + ClassDB::bind_method("_remote_object_requested", &EditorDebuggerNode::_remote_object_requested); + ClassDB::bind_method("_save_node_requested", &EditorDebuggerNode::_save_node_requested); + + // LiveDebug. + ClassDB::bind_method("live_debug_create_node", &EditorDebuggerNode::live_debug_create_node); + ClassDB::bind_method("live_debug_instance_node", &EditorDebuggerNode::live_debug_instance_node); + ClassDB::bind_method("live_debug_remove_node", &EditorDebuggerNode::live_debug_remove_node); + ClassDB::bind_method("live_debug_remove_and_keep_node", &EditorDebuggerNode::live_debug_remove_and_keep_node); + ClassDB::bind_method("live_debug_restore_node", &EditorDebuggerNode::live_debug_restore_node); + ClassDB::bind_method("live_debug_duplicate_node", &EditorDebuggerNode::live_debug_duplicate_node); + ClassDB::bind_method("live_debug_reparent_node", &EditorDebuggerNode::live_debug_reparent_node); + + ADD_SIGNAL(MethodInfo("goto_script_line")); + ADD_SIGNAL(MethodInfo("set_execution", PropertyInfo("script"), PropertyInfo(Variant::INT, "line"))); + ADD_SIGNAL(MethodInfo("clear_execution", PropertyInfo("script"))); + ADD_SIGNAL(MethodInfo("breaked", PropertyInfo(Variant::BOOL, "reallydid"), PropertyInfo(Variant::BOOL, "can_debug"))); +} + +EditorDebuggerRemoteObject *EditorDebuggerNode::get_inspected_remote_object() { + return Object::cast_to<EditorDebuggerRemoteObject>(ObjectDB::get_instance(EditorNode::get_singleton()->get_editor_history()->get_current())); +} + +ScriptEditorDebugger *EditorDebuggerNode::get_debugger(int p_id) const { + return Object::cast_to<ScriptEditorDebugger>(tabs->get_tab_control(p_id)); +} + +ScriptEditorDebugger *EditorDebuggerNode::get_current_debugger() const { + return Object::cast_to<ScriptEditorDebugger>(tabs->get_tab_control(tabs->get_current_tab())); +} + +ScriptEditorDebugger *EditorDebuggerNode::get_default_debugger() const { + return Object::cast_to<ScriptEditorDebugger>(tabs->get_tab_control(0)); +} + +Error EditorDebuggerNode::start() { + stop(); + if (EDITOR_GET("run/output/always_open_output_on_play")) { + EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log()); + } else { + EditorNode::get_singleton()->make_bottom_panel_item_visible(this); + } + + int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port"); + const Error err = server->listen(remote_port); + if (err != OK) { + EditorNode::get_log()->add_message(String("Error listening on port ") + itos(remote_port), EditorLog::MSG_TYPE_ERROR); + return err; + } + set_process(true); + EditorNode::get_log()->add_message("--- Debugging process started ---", EditorLog::MSG_TYPE_EDITOR); + return OK; +} + +void EditorDebuggerNode::stop() { + if (server->is_listening()) { + server->stop(); + EditorNode::get_log()->add_message("--- Debugging process stopped ---", EditorLog::MSG_TYPE_EDITOR); + } + // Also close all debugging sessions. + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + if (dbg->is_session_active()) + dbg->stop(); + }); + _break_state_changed(); + if (hide_on_stop) { + if (is_visible_in_tree()) + EditorNode::get_singleton()->hide_bottom_panel(); + } + breakpoints.clear(); + set_process(false); +} + +void EditorDebuggerNode::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { + EditorNode::get_singleton()->connect_compat("play_pressed", this, "start"); + EditorNode::get_singleton()->connect_compat("stop_pressed", this, "stop"); + } break; + case NOTIFICATION_EXIT_TREE: { + EditorNode::get_singleton()->disconnect_compat("play_pressed", this, "start"); + EditorNode::get_singleton()->disconnect_compat("stop_pressed", this, "stop"); + } break; + case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { + if (tabs->get_tab_count() > 1) { + add_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); + add_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); + + tabs->add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); + } + } break; + default: + break; + } + + if (p_what != NOTIFICATION_PROCESS || !server->is_listening()) + return; + + // Errors and warnings + int error_count = 0; + int warning_count = 0; + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + error_count += dbg->get_error_count(); + warning_count += dbg->get_warning_count(); + }); + + if (error_count != last_error_count || warning_count != last_warning_count) { + + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->update_tabs(); + }); + + if (error_count == 0 && warning_count == 0) { + debugger_button->set_text(TTR("Debugger")); + debugger_button->set_icon(Ref<Texture2D>()); + } else { + debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); + if (error_count == 0) { + debugger_button->set_icon(get_icon("Warning", "EditorIcons")); + } else { + debugger_button->set_icon(get_icon("Error", "EditorIcons")); + } + } + last_error_count = error_count; + last_warning_count = warning_count; + } + + // Remote scene tree update + remote_scene_tree_timeout -= get_process_delta_time(); + if (remote_scene_tree_timeout < 0) { + remote_scene_tree_timeout = EditorSettings::get_singleton()->get("debugger/remote_scene_tree_refresh_interval"); + if (remote_scene_tree->is_visible_in_tree()) { + get_current_debugger()->request_remote_tree(); + } + } + + // Remote inspector update + inspect_edited_object_timeout -= get_process_delta_time(); + if (inspect_edited_object_timeout < 0) { + inspect_edited_object_timeout = EditorSettings::get_singleton()->get("debugger/remote_inspect_refresh_interval"); + if (EditorDebuggerRemoteObject *obj = get_inspected_remote_object()) { + get_current_debugger()->request_remote_object(obj->remote_object_id); + } + } + + // Take connections. + if (server->is_connection_available()) { + ScriptEditorDebugger *debugger = NULL; + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + if (debugger || dbg->is_session_active()) + return; + debugger = dbg; + }); + if (debugger == NULL) { + if (tabs->get_tab_count() <= 4) { // Max 4 debugging sessions active. + debugger = _add_debugger(); + } else { + // We already have too many sessions, disconnecting new clients to prevent it from hanging. + // (Not keeping a reference to the connection will disconnect it) + server->take_connection(); + return; // Can't add, stop here. + } + } + + EditorNode::get_singleton()->get_pause_button()->set_disabled(false); + // Switch to remote tree view if so desired. + auto_switch_remote_scene_tree = (bool)EditorSettings::get_singleton()->get("debugger/auto_switch_to_remote_scene_tree"); + if (auto_switch_remote_scene_tree) { + EditorNode::get_singleton()->get_scene_tree_dock()->show_remote_tree(); + } + // Good to go. + EditorNode::get_singleton()->get_scene_tree_dock()->show_tab_buttons(); + debugger->set_editor_remote_tree(remote_scene_tree); + debugger->start(server->take_connection()); + // Send breakpoints. + for (Map<Breakpoint, bool>::Element *E = breakpoints.front(); E; E = E->next()) { + const Breakpoint &bp = E->key(); + debugger->set_breakpoint(bp.source, bp.line, E->get()); + } // Will arrive too late, how does the regular run work? + + debugger->update_live_edit_root(); + } +} + +void EditorDebuggerNode::_debugger_stopped(int p_id) { + ScriptEditorDebugger *dbg = get_debugger(p_id); + ERR_FAIL_COND(!dbg); + + bool found = false; + _for_all(tabs, [&](ScriptEditorDebugger *p_debugger) { + if (p_debugger->is_session_active()) + found = true; + }); + if (!found) { + EditorNode::get_singleton()->get_pause_button()->set_pressed(false); + EditorNode::get_singleton()->get_pause_button()->set_disabled(true); + EditorNode::get_singleton()->get_scene_tree_dock()->hide_remote_tree(); + EditorNode::get_singleton()->get_scene_tree_dock()->hide_tab_buttons(); + EditorNode::get_singleton()->notify_all_debug_sessions_exited(); + } +} + +void EditorDebuggerNode::_debugger_wants_stop(int p_id) { + // Ask editor to kill PID. + int pid = get_debugger(p_id)->get_remote_pid(); + if (pid) + EditorNode::get_singleton()->call_deferred("stop_child_process", pid); +} + +void EditorDebuggerNode::_debugger_changed(int p_tab) { + if (get_inspected_remote_object()) { + // Clear inspected object, you can only inspect objects in selected debugger. + // Hopefully, in the future, we will have one inspector per debugger. + EditorNode::get_singleton()->push_item(NULL); + } + if (remote_scene_tree->is_visible_in_tree()) { + get_current_debugger()->request_remote_tree(); + } + if (get_current_debugger()->is_breaked()) { + _text_editor_stack_goto(get_current_debugger()); + } +} + +void EditorDebuggerNode::set_script_debug_button(MenuButton *p_button) { + script_menu = p_button; + script_menu->set_text(TTR("Debug")); + script_menu->set_switch_on_hover(true); + PopupMenu *p = script_menu->get_popup(); + p->set_hide_on_window_lose_focus(true); + p->add_shortcut(ED_GET_SHORTCUT("debugger/step_into"), DEBUG_STEP); + p->add_shortcut(ED_GET_SHORTCUT("debugger/step_over"), DEBUG_NEXT); + p->add_separator(); + p->add_shortcut(ED_GET_SHORTCUT("debugger/break"), DEBUG_BREAK); + p->add_shortcut(ED_GET_SHORTCUT("debugger/continue"), DEBUG_CONTINUE); + p->add_separator(); + p->add_check_shortcut(ED_GET_SHORTCUT("debugger/keep_debugger_open"), DEBUG_SHOW_KEEP_OPEN); + p->add_check_shortcut(ED_GET_SHORTCUT("debugger/debug_with_external_editor"), DEBUG_WITH_EXTERNAL_EDITOR); + p->connect_compat("id_pressed", this, "_menu_option"); + + _break_state_changed(); + script_menu->show(); +} + +void EditorDebuggerNode::_break_state_changed() { + const bool breaked = get_current_debugger()->is_breaked(); + const bool can_debug = get_current_debugger()->is_debuggable(); + if (breaked) // Show debugger. + EditorNode::get_singleton()->make_bottom_panel_item_visible(this); + + // Update script menu. + if (!script_menu) + return; + PopupMenu *p = script_menu->get_popup(); + p->set_item_disabled(p->get_item_index(DEBUG_NEXT), !(breaked && can_debug)); + p->set_item_disabled(p->get_item_index(DEBUG_STEP), !(breaked && can_debug)); + p->set_item_disabled(p->get_item_index(DEBUG_BREAK), breaked); + p->set_item_disabled(p->get_item_index(DEBUG_CONTINUE), !breaked); +} + +void EditorDebuggerNode::_menu_option(int p_id) { + switch (p_id) { + case DEBUG_NEXT: { + debug_next(); + } break; + case DEBUG_STEP: { + debug_step(); + } break; + case DEBUG_BREAK: { + debug_break(); + } break; + case DEBUG_CONTINUE: { + debug_continue(); + } break; + + case DEBUG_SHOW_KEEP_OPEN: { + bool visible = script_menu->get_popup()->is_item_checked(script_menu->get_popup()->get_item_index(DEBUG_SHOW_KEEP_OPEN)); + hide_on_stop = visible; + script_menu->get_popup()->set_item_checked(script_menu->get_popup()->get_item_index(DEBUG_SHOW_KEEP_OPEN), !visible); + } break; + case DEBUG_WITH_EXTERNAL_EDITOR: { + bool checked = !script_menu->get_popup()->is_item_checked(script_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR)); + debug_with_external_editor = checked; + script_menu->get_popup()->set_item_checked(script_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR), checked); + } break; + } +} + +void EditorDebuggerNode::_paused() { + const bool paused = EditorNode::get_singleton()->get_pause_button()->is_pressed(); + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + if (paused && !dbg->is_breaked()) { + dbg->debug_break(); + } else if (!paused && dbg->is_breaked()) { + dbg->debug_continue(); + } + }); +} + +void EditorDebuggerNode::_breaked(bool p_breaked, bool p_can_debug, int p_debugger) { + if (get_current_debugger() != get_debugger(p_debugger)) { + if (!p_breaked) + return; + tabs->set_current_tab(p_debugger); + } + _break_state_changed(); + EditorNode::get_singleton()->get_pause_button()->set_pressed(p_breaked); + emit_signal("breaked", p_breaked, p_can_debug); +} + +bool EditorDebuggerNode::is_skip_breakpoints() const { + return get_default_debugger()->is_skip_breakpoints(); +} + +void EditorDebuggerNode::set_breakpoint(const String &p_path, int p_line, bool p_enabled) { + breakpoints[Breakpoint(p_path, p_line)] = p_enabled; + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->set_breakpoint(p_path, p_line, p_enabled); + }); +} + +void EditorDebuggerNode::reload_scripts() { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->reload_scripts(); + }); +} + +// LiveEdit/Inspector +void EditorDebuggerNode::request_remote_tree() { + get_current_debugger()->request_remote_tree(); +} + +void EditorDebuggerNode::_remote_tree_updated(int p_debugger) { + if (p_debugger != tabs->get_current_tab()) + return; + remote_scene_tree->clear(); + remote_scene_tree->update_scene_tree(get_current_debugger()->get_remote_tree(), p_debugger); +} + +void EditorDebuggerNode::_remote_object_updated(ObjectID p_id, int p_debugger) { + if (p_debugger != tabs->get_current_tab()) + return; + if (EditorDebuggerRemoteObject *obj = get_inspected_remote_object()) { + if (obj->remote_object_id == p_id) + return; // Already being edited + } + + EditorNode::get_singleton()->push_item(get_current_debugger()->get_remote_object(p_id)); +} + +void EditorDebuggerNode::_remote_object_property_updated(ObjectID p_id, const String &p_property, int p_debugger) { + if (p_debugger != tabs->get_current_tab()) + return; + if (EditorDebuggerRemoteObject *obj = get_inspected_remote_object()) { + if (obj->remote_object_id != p_id) + return; + EditorNode::get_singleton()->get_inspector()->update_property(p_property); + } +} + +void EditorDebuggerNode::_remote_object_requested(ObjectID p_id, int p_debugger) { + if (p_debugger != tabs->get_current_tab()) + return; + inspect_edited_object_timeout = 0.7; // Temporarily disable timeout to avoid multiple requests. + get_current_debugger()->request_remote_object(p_id); +} + +void EditorDebuggerNode::_save_node_requested(ObjectID p_id, const String &p_file, int p_debugger) { + if (p_debugger != tabs->get_current_tab()) + return; + get_current_debugger()->save_node(p_id, p_file); +} + +// Remote inspector/edit. +void EditorDebuggerNode::_method_changeds(void *p_ud, Object *p_base, const StringName &p_name, VARIANT_ARG_DECLARE) { + if (!singleton) + return; + _for_all(singleton->tabs, [&](ScriptEditorDebugger *dbg) { + dbg->_method_changed(p_base, p_name, VARIANT_ARG_PASS); + }); +} + +void EditorDebuggerNode::_property_changeds(void *p_ud, Object *p_base, const StringName &p_property, const Variant &p_value) { + if (!singleton) + return; + _for_all(singleton->tabs, [&](ScriptEditorDebugger *dbg) { + dbg->_property_changed(p_base, p_property, p_value); + }); +} + +// LiveDebug +void EditorDebuggerNode::set_live_debugging(bool p_enabled) { + + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->set_live_debugging(p_enabled); + }); +} +void EditorDebuggerNode::update_live_edit_root() { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->update_live_edit_root(); + }); +} +void EditorDebuggerNode::live_debug_create_node(const NodePath &p_parent, const String &p_type, const String &p_name) { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->live_debug_create_node(p_parent, p_type, p_name); + }); +} +void EditorDebuggerNode::live_debug_instance_node(const NodePath &p_parent, const String &p_path, const String &p_name) { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->live_debug_instance_node(p_parent, p_path, p_name); + }); +} +void EditorDebuggerNode::live_debug_remove_node(const NodePath &p_at) { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->live_debug_remove_node(p_at); + }); +} +void EditorDebuggerNode::live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id) { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->live_debug_remove_and_keep_node(p_at, p_keep_id); + }); +} +void EditorDebuggerNode::live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos) { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->live_debug_restore_node(p_id, p_at, p_at_pos); + }); +} +void EditorDebuggerNode::live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name) { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->live_debug_duplicate_node(p_at, p_new_name); + }); +} +void EditorDebuggerNode::live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) { + _for_all(tabs, [&](ScriptEditorDebugger *dbg) { + dbg->live_debug_reparent_node(p_at, p_new_place, p_new_name, p_at_pos); + }); +} diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h new file mode 100644 index 0000000000..13a1d6dcb3 --- /dev/null +++ b/editor/debugger/editor_debugger_node.h @@ -0,0 +1,177 @@ +/*************************************************************************/ +/* editor_debugger_node.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef EDITOR_DEBUGGER_NODE_H +#define EDITOR_DEBUGGER_NODE_H + +#include "core/io/tcp_server.h" +#include "editor/debugger/script_editor_debugger.h" +#include "scene/gui/button.h" +#include "scene/gui/tab_container.h" + +class EditorDebuggerTree; + +class EditorDebuggerNode : public MarginContainer { + + GDCLASS(EditorDebuggerNode, MarginContainer); + +private: + enum Options { + DEBUG_NEXT, + DEBUG_STEP, + DEBUG_BREAK, + DEBUG_CONTINUE, + DEBUG_SHOW_KEEP_OPEN, + DEBUG_WITH_EXTERNAL_EDITOR, + }; + + class Breakpoint { + public: + String source; + int line = 0; + + bool operator<(const Breakpoint &p_b) const { + if (line == p_b.line) + return source < p_b.source; + return line < p_b.line; + } + + Breakpoint(){}; + + Breakpoint(const String &p_source, int p_line) { + line = p_line; + source = p_source; + } + }; + + Ref<TCP_Server> server = NULL; + TabContainer *tabs = NULL; + Button *debugger_button = NULL; + MenuButton *script_menu = NULL; + + Ref<Script> stack_script; // Why?!? + + int last_error_count = 0; + int last_warning_count = 0; + + float inspect_edited_object_timeout = 0; + EditorDebuggerTree *remote_scene_tree = NULL; + float remote_scene_tree_timeout = 0.0; + bool auto_switch_remote_scene_tree = false; + bool debug_with_external_editor = false; + bool hide_on_stop = true; + ScriptEditorDebugger::CameraOverride camera_override = ScriptEditorDebugger::OVERRIDE_NONE; + Map<Breakpoint, bool> breakpoints; + + ScriptEditorDebugger *_add_debugger(); + EditorDebuggerRemoteObject *get_inspected_remote_object(); + + friend class DebuggerEditorPlugin; + static EditorDebuggerNode *singleton; + EditorDebuggerNode(); + +protected: + void _debugger_stopped(int p_id); + void _debugger_wants_stop(int p_id); + void _debugger_changed(int p_tab); + void _remote_tree_updated(int p_debugger); + void _remote_object_updated(ObjectID p_id, int p_debugger); + void _remote_object_property_updated(ObjectID p_id, const String &p_property, int p_debugger); + void _remote_object_requested(ObjectID p_id, int p_debugger); + void _save_node_requested(ObjectID p_id, const String &p_file, int p_debugger); + + void _clear_execution(REF p_script) { + emit_signal("clear_execution", p_script); + } + + void _text_editor_stack_goto(const ScriptEditorDebugger *p_debugger); + void _stack_frame_selected(int p_debugger); + void _error_selected(const String &p_file, int p_line, int p_debugger); + void _breaked(bool p_breaked, bool p_can_debug, int p_debugger); + void _paused(); + void _break_state_changed(); + void _menu_option(int p_id); + +protected: + void _notification(int p_what); + static void _bind_methods(); + +public: + static EditorDebuggerNode *get_singleton() { return singleton; } + + ScriptEditorDebugger *get_current_debugger() const; + ScriptEditorDebugger *get_default_debugger() const; + ScriptEditorDebugger *get_debugger(int p_debugger) const; + + void debug_next() { get_default_debugger()->debug_next(); } + void debug_step() { get_default_debugger()->debug_step(); } + void debug_break() { get_default_debugger()->debug_break(); } + void debug_continue() { get_default_debugger()->debug_continue(); } + + void set_script_debug_button(MenuButton *p_button); + + void set_tool_button(Button *p_button) { + debugger_button = p_button; + } + + String get_var_value(const String &p_var) const { return get_default_debugger()->get_var_value(p_var); } + Ref<Script> get_dump_stack_script() const { return stack_script; } // Why do we need this? + + bool get_debug_with_external_editor() { return debug_with_external_editor; } + + bool is_skip_breakpoints() const; + void set_breakpoint(const String &p_path, int p_line, bool p_enabled); + void reload_scripts(); + + // Remote inspector/edit. + void request_remote_tree(); + static void _method_changeds(void *p_ud, Object *p_base, const StringName &p_name, VARIANT_ARG_DECLARE); + static void _property_changeds(void *p_ud, Object *p_base, const StringName &p_property, const Variant &p_value); + + // LiveDebug + void set_live_debugging(bool p_enabled); + void update_live_edit_root(); + void live_debug_create_node(const NodePath &p_parent, const String &p_type, const String &p_name); + void live_debug_instance_node(const NodePath &p_parent, const String &p_path, const String &p_name); + void live_debug_remove_node(const NodePath &p_at); + void live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id); + void live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos); + void live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name); + void live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos); + + // Camera + void set_camera_override(ScriptEditorDebugger::CameraOverride p_override) { camera_override = p_override; } + ScriptEditorDebugger::CameraOverride get_camera_override() { return camera_override; } + + Error start(); + + void stop(); +}; +#endif // EDITOR_DEBUGGER_NODE_H diff --git a/editor/debugger/editor_debugger_tree.cpp b/editor/debugger/editor_debugger_tree.cpp new file mode 100644 index 0000000000..9ba5d0cbe1 --- /dev/null +++ b/editor/debugger/editor_debugger_tree.cpp @@ -0,0 +1,274 @@ +/*************************************************************************/ +/* editor_debugger_tree.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "editor_debugger_tree.h" + +#include "editor/editor_node.h" +#include "scene/debugger/scene_debugger.h" +#include "scene/resources/packed_scene.h" + +EditorDebuggerTree::EditorDebuggerTree() { + set_v_size_flags(SIZE_EXPAND_FILL); + set_allow_rmb_select(true); + + // Popup + item_menu = memnew(PopupMenu); + item_menu->connect_compat("id_pressed", this, "_item_menu_id_pressed"); + add_child(item_menu); + + // File Dialog + file_dialog = memnew(EditorFileDialog); + file_dialog->connect_compat("file_selected", this, "_file_selected"); + add_child(file_dialog); +} + +void EditorDebuggerTree::_notification(int p_what) { + if (p_what == NOTIFICATION_POSTINITIALIZE) { + connect_compat("cell_selected", this, "_scene_tree_selected"); + connect_compat("item_collapsed", this, "_scene_tree_folded"); + connect_compat("item_rmb_selected", this, "_scene_tree_rmb_selected"); + } +} + +void EditorDebuggerTree::_bind_methods() { + ClassDB::bind_method(D_METHOD("_scene_tree_selected"), &EditorDebuggerTree::_scene_tree_selected); + ClassDB::bind_method(D_METHOD("_scene_tree_folded"), &EditorDebuggerTree::_scene_tree_folded); + ClassDB::bind_method(D_METHOD("_scene_tree_rmb_selected"), &EditorDebuggerTree::_scene_tree_rmb_selected); + ClassDB::bind_method(D_METHOD("_item_menu_id_pressed"), &EditorDebuggerTree::_item_menu_id_pressed); + ClassDB::bind_method(D_METHOD("_file_selected"), &EditorDebuggerTree::_file_selected); + ADD_SIGNAL(MethodInfo("object_selected", PropertyInfo(Variant::INT, "object_id"), PropertyInfo(Variant::INT, "debugger"))); + ADD_SIGNAL(MethodInfo("save_node", PropertyInfo(Variant::INT, "object_id"), PropertyInfo(Variant::STRING, "filename"), PropertyInfo(Variant::INT, "debugger"))); +} + +void EditorDebuggerTree::_scene_tree_selected() { + + if (updating_scene_tree) { + return; + } + + TreeItem *item = get_selected(); + if (!item) { + return; + } + + inspected_object_id = uint64_t(item->get_metadata(0)); + + emit_signal("object_selected", inspected_object_id, debugger_id); +} + +void EditorDebuggerTree::_scene_tree_folded(Object *p_obj) { + + if (updating_scene_tree) { + + return; + } + TreeItem *item = Object::cast_to<TreeItem>(p_obj); + + if (!item) + return; + + ObjectID id = ObjectID(uint64_t(item->get_metadata(0))); + if (unfold_cache.has(id)) { + unfold_cache.erase(id); + } else { + unfold_cache.insert(id); + } +} + +void EditorDebuggerTree::_scene_tree_rmb_selected(const Vector2 &p_position) { + + TreeItem *item = get_item_at_position(p_position); + if (!item) + return; + + item->select(0); + + item_menu->clear(); + item_menu->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE); + item_menu->add_icon_item(get_icon("CopyNodePath", "EditorIcons"), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH); + item_menu->set_global_position(get_global_mouse_position()); + item_menu->popup(); +} + +/// Populates inspect_scene_tree given data in nodes as a flat list, encoded depth first. +/// +/// Given a nodes array like [R,A,B,C,D,E] the following Tree will be generated, assuming +/// filter is an empty String, R and A child count are 2, B is 1 and C, D and E are 0. +/// +/// R +/// |-A +/// | |-B +/// | | |-C +/// | | +/// | |-D +/// | +/// |-E +/// +void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int p_debugger) { + updating_scene_tree = true; + const String last_path = get_selected_path(); + const String filter = EditorNode::get_singleton()->get_scene_tree_dock()->get_filter(); + + // Nodes are in a flatten list, depth first. Use a stack of parents, avoid recursion. + List<Pair<TreeItem *, int> > parents; + for (int i = 0; i < p_tree->nodes.size(); i++) { + TreeItem *parent = NULL; + if (parents.size()) { // Find last parent. + Pair<TreeItem *, int> &p = parents[0]; + parent = p.first; + if (!(--p.second)) { // If no child left, remove it. + parents.pop_front(); + } + } + // Add this node. + const SceneDebuggerTree::RemoteNode &node = p_tree->nodes[i]; + TreeItem *item = create_item(parent); + item->set_text(0, node.name); + item->set_tooltip(0, TTR("Type:") + " " + node.type_name); + Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(node.type_name, ""); + if (icon.is_valid()) { + item->set_icon(0, icon); + } + item->set_metadata(0, node.id); + + // Set current item as collapsed if necessary (root is never collapsed) + if (parent) { + if (!unfold_cache.has(node.id)) { + item->set_collapsed(true); + } + } + // Select previously selected node. + if (debugger_id == p_debugger) { // Can use remote id. + if (node.id == inspected_object_id) { + item->select(0); + } + } else { // Must use path + if (last_path == _get_path(item)) { + updating_scene_tree = false; // Force emission of new selection + item->select(0); + updating_scene_tree = true; + } + } + + // Add in front of the parents stack if children are expected. + if (node.child_count) { + parents.push_front(Pair<TreeItem *, int>(item, node.child_count)); + } else { + // Apply filters. + while (parent) { + const bool had_siblings = item->get_prev() || item->get_next(); + if (filter.is_subsequence_ofi(item->get_text(0))) + break; // Filter matches, must survive. + parent->remove_child(item); + memdelete(item); + if (had_siblings) + break; // Parent must survive. + item = parent; + parent = item->get_parent(); + // Check if parent expects more children. + for (int j = 0; j < parents.size(); j++) { + if (parents[j].first == item) { + parent = NULL; + break; // Might have more children. + } + } + } + } + } + debugger_id = p_debugger; // Needed by hook, could be avoided if every debugger had its own tree + updating_scene_tree = false; +} + +String EditorDebuggerTree::get_selected_path() { + if (!get_selected()) + return ""; + return _get_path(get_selected()); +} + +String EditorDebuggerTree::_get_path(TreeItem *p_item) { + ERR_FAIL_COND_V(!p_item, ""); + + if (p_item->get_parent() == NULL) { + return "/root"; + } + String text = p_item->get_text(0); + TreeItem *cur = p_item->get_parent(); + while (cur) { + text = cur->get_text(0) + "/" + text; + cur = cur->get_parent(); + } + return "/" + text; +} + +void EditorDebuggerTree::_item_menu_id_pressed(int p_option) { + + switch (p_option) { + + case ITEM_MENU_SAVE_REMOTE_NODE: { + + file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES); + file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + + List<String> extensions; + Ref<PackedScene> sd = memnew(PackedScene); + ResourceSaver::get_recognized_extensions(sd, &extensions); + file_dialog->clear_filters(); + for (int i = 0; i < extensions.size(); i++) { + file_dialog->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper()); + } + + file_dialog->popup_centered_ratio(); + } break; + case ITEM_MENU_COPY_NODE_PATH: { + + String text = get_selected_path(); + if (text.empty()) { + return; + } else if (text == "/root") { + text = "."; + } else { + text = text.replace("/root/", ""); + int slash = text.find("/"); + if (slash < 0) { + text = "."; + } else { + text = text.substr(slash + 1); + } + } + OS::get_singleton()->set_clipboard(text); + } break; + } +} + +void EditorDebuggerTree::_file_selected(const String &p_file) { + if (inspected_object_id.is_null()) + return; + emit_signal("save_node", inspected_object_id, p_file, debugger_id); +} diff --git a/editor/debugger/editor_debugger_tree.h b/editor/debugger/editor_debugger_tree.h new file mode 100644 index 0000000000..d9084bc596 --- /dev/null +++ b/editor/debugger/editor_debugger_tree.h @@ -0,0 +1,74 @@ +/*************************************************************************/ +/* editor_debugger_tree.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "scene/gui/tree.h" + +#ifndef EDITOR_DEBUGGER_TREE_H +#define EDITOR_DEBUGGER_TREE_H + +class SceneDebuggerTree; +class EditorFileDialog; + +class EditorDebuggerTree : public Tree { + + GDCLASS(EditorDebuggerTree, Tree); + +private: + enum ItemMenu { + ITEM_MENU_SAVE_REMOTE_NODE, + ITEM_MENU_COPY_NODE_PATH, + }; + + ObjectID inspected_object_id; + int debugger_id = 0; + bool updating_scene_tree = false; + Set<ObjectID> unfold_cache; + PopupMenu *item_menu = NULL; + EditorFileDialog *file_dialog = NULL; + + String _get_path(TreeItem *p_item); + void _scene_tree_folded(Object *p_obj); + void _scene_tree_selected(); + void _scene_tree_rmb_selected(const Vector2 &p_position); + void _item_menu_id_pressed(int p_option); + void _file_selected(const String &p_file); + +protected: + static void _bind_methods(); + void _notification(int p_what); + +public: + String get_selected_path(); + ObjectID get_selected_object(); + int get_current_debugger(); // Would love to have one tree for every debugger. + void update_scene_tree(const SceneDebuggerTree *p_tree, int p_debugger); + EditorDebuggerTree(); +}; +#endif // EDITOR_DEBUGGER_TREE_H diff --git a/editor/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index af740d9b4f..45af70f191 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -32,18 +32,20 @@ #include "core/io/marshalls.h" #include "core/project_settings.h" +#include "core/script_debugger_remote.h" #include "core/ustring.h" #include "editor/editor_log.h" #include "editor/editor_network_profiler.h" +#include "editor/editor_node.h" +#include "editor/editor_profiler.h" +#include "editor/editor_scale.h" +#include "editor/editor_settings.h" #include "editor/editor_visual_profiler.h" #include "editor/plugins/canvas_item_editor_plugin.h" #include "editor/plugins/spatial_editor_plugin.h" -#include "editor_node.h" -#include "editor_profiler.h" -#include "editor_scale.h" -#include "editor_settings.h" +#include "editor/property_editor.h" #include "main/performance.h" -#include "property_editor.h" +#include "scene/debugger/scene_debugger.h" #include "scene/gui/dialogs.h" #include "scene/gui/label.h" #include "scene/gui/line_edit.h" @@ -56,149 +58,14 @@ #include "scene/gui/tree.h" #include "scene/resources/packed_scene.h" -class ScriptEditorDebuggerVariables : public Object { - - GDCLASS(ScriptEditorDebuggerVariables, Object); - - List<PropertyInfo> props; - Map<StringName, Variant> values; - -protected: - bool _set(const StringName &p_name, const Variant &p_value) { - - return false; - } - - bool _get(const StringName &p_name, Variant &r_ret) const { - - if (!values.has(p_name)) - return false; - r_ret = values[p_name]; - return true; - } - void _get_property_list(List<PropertyInfo> *p_list) const { - - for (const List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) - p_list->push_back(E->get()); - } - -public: - void clear() { - - props.clear(); - values.clear(); - } - - String get_var_value(const String &p_var) const { - - for (Map<StringName, Variant>::Element *E = values.front(); E; E = E->next()) { - String v = E->key().operator String().get_slice("/", 1); - if (v == p_var) - return E->get(); - } - - return ""; - } - - void add_property(const String &p_name, const Variant &p_value, const PropertyHint &p_hint, const String p_hint_string) { - - PropertyInfo pinfo; - pinfo.name = p_name; - pinfo.type = p_value.get_type(); - pinfo.hint = p_hint; - pinfo.hint_string = p_hint_string; - props.push_back(pinfo); - values[p_name] = p_value; - } - - void update() { - _change_notify(); - } - - ScriptEditorDebuggerVariables() { - } -}; - -class ScriptEditorDebuggerInspectedObject : public Object { - - GDCLASS(ScriptEditorDebuggerInspectedObject, Object); - -protected: - bool _set(const StringName &p_name, const Variant &p_value) { - - if (!prop_values.has(p_name) || String(p_name).begins_with("Constants/")) - return false; - - prop_values[p_name] = p_value; - emit_signal("value_edited", p_name, p_value); - return true; - } - - bool _get(const StringName &p_name, Variant &r_ret) const { - - if (!prop_values.has(p_name)) - return false; - - r_ret = prop_values[p_name]; - return true; - } - - void _get_property_list(List<PropertyInfo> *p_list) const { - - p_list->clear(); //sorry, no want category - for (const List<PropertyInfo>::Element *E = prop_list.front(); E; E = E->next()) { - p_list->push_back(E->get()); - } - } - - static void _bind_methods() { - - ClassDB::bind_method(D_METHOD("get_title"), &ScriptEditorDebuggerInspectedObject::get_title); - ClassDB::bind_method(D_METHOD("get_variant"), &ScriptEditorDebuggerInspectedObject::get_variant); - ClassDB::bind_method(D_METHOD("clear"), &ScriptEditorDebuggerInspectedObject::clear); - ClassDB::bind_method(D_METHOD("get_remote_object_id"), &ScriptEditorDebuggerInspectedObject::get_remote_object_id); - - ADD_SIGNAL(MethodInfo("value_edited")); - } - -public: - String type_name; - ObjectID remote_object_id; - List<PropertyInfo> prop_list; - Map<StringName, Variant> prop_values; - - ObjectID get_remote_object_id() { - return remote_object_id; - } - - String get_title() { - if (remote_object_id.is_valid()) - return TTR("Remote ") + String(type_name) + ": " + itos(remote_object_id); - else - return "<null>"; - } - Variant get_variant(const StringName &p_name) { - - Variant var; - _get(p_name, var); - return var; - } - - void clear() { - - prop_list.clear(); - prop_values.clear(); - } - void update() { - _change_notify(); - } - void update_single(const char *p_prop) { - _change_notify(p_prop); - } - - ScriptEditorDebuggerInspectedObject() { +void ScriptEditorDebugger::_put_msg(String p_message, Array p_data) { + if (is_session_active()) { + Array msg; + msg.push_back(p_message); + msg.push_back(p_data); + ppeer->put_var(msg); } -}; +} void ScriptEditorDebugger::debug_copy() { String msg = reason->get_text(); @@ -213,285 +80,153 @@ void ScriptEditorDebugger::debug_skip_breakpoints() { else skip_breakpoints->set_icon(get_icon("DebugSkipBreakpointsOff", "EditorIcons")); - if (connection.is_valid()) { - Array msg; - msg.push_back("set_skip_breakpoints"); - msg.push_back(skip_breakpoints_value); - ppeer->put_var(msg); - } + Array msg; + msg.push_back(skip_breakpoints_value); + _put_msg("set_skip_breakpoints", msg); } void ScriptEditorDebugger::debug_next() { ERR_FAIL_COND(!breaked); - ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected_to_host()); - Array msg; - msg.push_back("next"); - ppeer->put_var(msg); + + _put_msg("next", Array()); _clear_execution(); - stack_dump->clear(); } void ScriptEditorDebugger::debug_step() { ERR_FAIL_COND(!breaked); - ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected_to_host()); - Array msg; - msg.push_back("step"); - ppeer->put_var(msg); + _put_msg("step", Array()); _clear_execution(); - stack_dump->clear(); } void ScriptEditorDebugger::debug_break() { ERR_FAIL_COND(breaked); - ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected_to_host()); - Array msg; - msg.push_back("break"); - ppeer->put_var(msg); + _put_msg("break", Array()); } void ScriptEditorDebugger::debug_continue() { ERR_FAIL_COND(!breaked); - ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected_to_host()); - OS::get_singleton()->enable_for_stealing_focus(EditorNode::get_singleton()->get_child_process_id()); + // Allow focus stealing only if we actually run this client for security. + if (remote_pid && EditorNode::get_singleton()->has_child_process(remote_pid)) + OS::get_singleton()->enable_for_stealing_focus(remote_pid); - Array msg; _clear_execution(); - msg.push_back("continue"); - ppeer->put_var(msg); + _put_msg("continue", Array()); } -void ScriptEditorDebugger::_scene_tree_folded(Object *obj) { - - if (updating_scene_tree) { - - return; - } - TreeItem *item = Object::cast_to<TreeItem>(obj); - - if (!item) - return; - - ObjectID id = item->get_metadata(0); - if (unfold_cache.has(id)) { - unfold_cache.erase(id); +void ScriptEditorDebugger::update_tabs() { + if (error_count == 0 && warning_count == 0) { + errors_tab->set_name(TTR("Errors")); + tabs->set_tab_icon(errors_tab->get_index(), Ref<Texture2D>()); } else { - unfold_cache.insert(id); + errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")"); + if (error_count == 0) { + tabs->set_tab_icon(errors_tab->get_index(), get_icon("Warning", "EditorIcons")); + } else { + tabs->set_tab_icon(errors_tab->get_index(), get_icon("Error", "EditorIcons")); + } } } -void ScriptEditorDebugger::_scene_tree_selected() { - - if (updating_scene_tree) { - - return; - } - TreeItem *item = inspect_scene_tree->get_selected(); - if (!item) { - - return; - } - - inspected_object_id = item->get_metadata(0).operator ObjectID(); +void ScriptEditorDebugger::clear_style() { + tabs->add_style_override("panel", NULL); +} +void ScriptEditorDebugger::save_node(ObjectID p_id, const String &p_file) { Array msg; - msg.push_back("inspect_object"); - msg.push_back(inspected_object_id); - ppeer->put_var(msg); + msg.push_back(p_id); + msg.push_back(p_file); + _put_msg("save_node", msg); } -void ScriptEditorDebugger::_scene_tree_rmb_selected(const Vector2 &p_position) { +void ScriptEditorDebugger::_file_selected(const String &p_file) { + Error err; + FileAccessRef file = FileAccess::open(p_file, FileAccess::WRITE, &err); - TreeItem *item = inspect_scene_tree->get_item_at_position(p_position); - if (!item) + if (err != OK) { + ERR_PRINT("Failed to open " + p_file); return; + } + Vector<String> line; + line.resize(Performance::MONITOR_MAX); - item->select(0); - - item_menu->clear(); - item_menu->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE); - item_menu->add_icon_item(get_icon("CopyNodePath", "EditorIcons"), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH); - item_menu->set_global_position(get_global_mouse_position()); - item_menu->popup(); -} + // signatures + for (int i = 0; i < Performance::MONITOR_MAX; i++) { + line.write[i] = Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)); + } + file->store_csv_line(line); -void ScriptEditorDebugger::_file_selected(const String &p_file) { - switch (file_dialog_mode) { - case SAVE_NODE: { - Array msg; - msg.push_back("save_node"); - msg.push_back(inspected_object_id); - msg.push_back(p_file); - ppeer->put_var(msg); - } break; - case SAVE_CSV: { - Error err; - FileAccessRef file = FileAccess::open(p_file, FileAccess::WRITE, &err); + // values + List<Vector<float> >::Element *E = perf_history.back(); + while (E) { - if (err != OK) { - ERR_PRINT("Failed to open " + p_file); - return; - } - Vector<String> line; - line.resize(Performance::MONITOR_MAX); + Vector<float> &perf_data = E->get(); + for (int i = 0; i < perf_data.size(); i++) { - // signatures - for (int i = 0; i < Performance::MONITOR_MAX; i++) { - line.write[i] = Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)); - } - file->store_csv_line(line); - - // values - List<Vector<float> >::Element *E = perf_history.back(); - while (E) { + line.write[i] = String::num_real(perf_data[i]); + } + file->store_csv_line(line); + E = E->prev(); + } + file->store_string("\n"); - Vector<float> &perf_data = E->get(); - for (int i = 0; i < perf_data.size(); i++) { + Vector<Vector<String> > profiler_data = profiler->get_data_as_csv(); + for (int i = 0; i < profiler_data.size(); i++) { + file->store_csv_line(profiler_data[i]); + } +} - line.write[i] = String::num_real(perf_data[i]); - } - file->store_csv_line(line); - E = E->prev(); - } - file->store_string("\n"); +void ScriptEditorDebugger::request_remote_tree() { - Vector<Vector<String> > profiler_data = profiler->get_data_as_csv(); - for (int i = 0; i < profiler_data.size(); i++) { - file->store_csv_line(profiler_data[i]); - } + _put_msg("request_scene_tree", Array()); +} - } break; - } +const SceneDebuggerTree *ScriptEditorDebugger::get_remote_tree() { + return scene_tree; } -void ScriptEditorDebugger::_scene_tree_property_value_edited(const String &p_prop, const Variant &p_value) { +void ScriptEditorDebugger::update_remote_object(ObjectID p_obj_id, const String &p_prop, const Variant &p_value) { Array msg; - msg.push_back("set_object_property"); - msg.push_back(inspected_object_id); + msg.push_back(p_obj_id); msg.push_back(p_prop); msg.push_back(p_value); - ppeer->put_var(msg); - inspect_edited_object_timeout = 0.7; //avoid annoyance, don't request soon after editing + _put_msg("set_object_property", msg); } -void ScriptEditorDebugger::_scene_tree_property_select_object(ObjectID p_object) { +void ScriptEditorDebugger::request_remote_object(ObjectID p_obj_id) { - inspected_object_id = p_object; + ERR_FAIL_COND(p_obj_id.is_null()); Array msg; - msg.push_back("inspect_object"); - msg.push_back(inspected_object_id); - ppeer->put_var(msg); + msg.push_back(p_obj_id); + _put_msg("inspect_object", msg); } -void ScriptEditorDebugger::_scene_tree_request() { - - ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected_to_host()); - - Array msg; - msg.push_back("request_scene_tree"); - ppeer->put_var(msg); -} - -/// Populates inspect_scene_tree recursively given data in nodes. -/// Nodes is an array containing 4 elements for each node, it follows this pattern: -/// nodes[i] == number of direct children of this node -/// nodes[i + 1] == node name -/// nodes[i + 2] == node class -/// nodes[i + 3] == node instance id -/// -/// Returns the number of items parsed in nodes from current_index. -/// -/// Given a nodes array like [R,A,B,C,D,E] the following Tree will be generated, assuming -/// filter is an empty String, R and A child count are 2, B is 1 and C, D and E are 0. -/// -/// R -/// |-A -/// | |-B -/// | | |-C -/// | | -/// | |-D -/// | -/// |-E -/// -int ScriptEditorDebugger::_update_scene_tree(TreeItem *parent, const Array &nodes, int current_index) { - String filter = EditorNode::get_singleton()->get_scene_tree_dock()->get_filter(); - String item_text = nodes[current_index + 1]; - String item_type = nodes[current_index + 2]; - bool keep = filter.is_subsequence_ofi(item_text); - - TreeItem *item = inspect_scene_tree->create_item(parent); - item->set_text(0, item_text); - item->set_tooltip(0, TTR("Type:") + " " + item_type); - ObjectID id = nodes[current_index + 3].operator ObjectID(); - Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(nodes[current_index + 2], ""); - if (icon.is_valid()) { - item->set_icon(0, icon); - } - item->set_metadata(0, id); - - if (id == inspected_object_id) { - TreeItem *cti = item->get_parent(); - while (cti) { - cti->set_collapsed(false); - cti = cti->get_parent(); - } - item->select(0); - } - - // Set current item as collapsed if necessary - if (parent) { - if (!unfold_cache.has(id)) { - item->set_collapsed(true); - } - } +Object *ScriptEditorDebugger::get_remote_object(ObjectID p_id) { + return inspector->get_object(p_id); +} - int children_count = nodes[current_index]; - // Tracks the total number of items parsed in nodes, this is used to skips nodes that - // are not direct children of the current node since we can't know in advance the total - // number of children, direct and not, of a node without traversing the nodes array previously. - // Keeping track of this allows us to build our remote scene tree by traversing the node - // array just once. - int items_count = 1; - for (int i = 0; i < children_count; i++) { - // Called for each direct child of item. - // Direct children of current item might not be adjacent so items_count must - // be incremented by the number of items parsed until now, otherwise we would not - // be able to access the next child of the current item. - // items_count is multiplied by 4 since that's the number of elements in the nodes - // array needed to represent a single node. - items_count += _update_scene_tree(item, nodes, current_index + items_count * 4); - } +void ScriptEditorDebugger::_remote_object_selected(ObjectID p_id) { + emit_signal("remote_object_requested", p_id); +} - // If item has not children and should not be kept delete it - if (!keep && !item->get_children() && parent) { - parent->remove_child(item); - memdelete(item); - } +void ScriptEditorDebugger::_remote_object_edited(ObjectID p_id, const String &p_prop, const Variant &p_value) { + update_remote_object(p_id, p_prop, p_value); + request_remote_object(p_id); +} - return items_count; +void ScriptEditorDebugger::_remote_object_property_updated(ObjectID p_id, const String &p_property) { + emit_signal("remote_object_property_updated", p_id, p_property); } void ScriptEditorDebugger::_video_mem_request() { - if (connection.is_null() || !connection->is_connected_to_host()) { - // Video RAM usage is only available while a project is being debugged. - return; - } - - Array msg; - msg.push_back("request_video_mem"); - ppeer->put_var(msg); + _put_msg("request_video_mem", Array()); } Size2 ScriptEditorDebugger::get_minimum_size() const { @@ -504,184 +239,72 @@ Size2 ScriptEditorDebugger::get_minimum_size() const { void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_data) { if (p_msg == "debug_enter") { - Array msg; - msg.push_back("get_stack_dump"); - ppeer->put_var(msg); + + _put_msg("get_stack_dump", Array()); + ERR_FAIL_COND(p_data.size() != 2); bool can_continue = p_data[0]; String error = p_data[1]; - step->set_disabled(!can_continue); - next->set_disabled(!can_continue); - _set_reason_text(error, MESSAGE_ERROR); - copy->set_disabled(false); breaked = true; - dobreak->set_disabled(true); - docontinue->set_disabled(false); + can_debug = can_continue; + _update_buttons_state(); + _set_reason_text(error, MESSAGE_ERROR); emit_signal("breaked", true, can_continue); OS::get_singleton()->move_window_to_foreground(); if (error != "") { tabs->set_current_tab(0); } profiler->set_enabled(false); - EditorNode::get_singleton()->get_pause_button()->set_pressed(true); - EditorNode::get_singleton()->make_bottom_panel_item_visible(this); - _clear_remote_objects(); + inspector->clear_cache(); // Take a chance to force remote objects update. } else if (p_msg == "debug_exit") { breaked = false; + can_debug = false; _clear_execution(); - copy->set_disabled(true); - step->set_disabled(true); - next->set_disabled(true); - reason->set_text(""); - reason->set_tooltip(""); - back->set_disabled(true); - forward->set_disabled(true); - dobreak->set_disabled(false); - docontinue->set_disabled(true); - emit_signal("breaked", false, false, Variant()); + _update_buttons_state(); + _set_reason_text(TTR("Execution resumed."), MESSAGE_SUCCESS); + emit_signal("breaked", false, false); profiler->set_enabled(true); profiler->disable_seeking(); - EditorNode::get_singleton()->get_pause_button()->set_pressed(false); + } else if (p_msg == "message:set_pid") { + + ERR_FAIL_COND(p_data.size() < 1); + remote_pid = p_data[0]; } else if (p_msg == "message:click_ctrl") { + ERR_FAIL_COND(p_data.size() < 2); clicked_ctrl->set_text(p_data[0]); clicked_ctrl_type->set_text(p_data[1]); - } else if (p_msg == "message:scene_tree") { - inspect_scene_tree->clear(); - Map<int, TreeItem *> lv; - - updating_scene_tree = true; - - _update_scene_tree(NULL, p_data, 0); - - updating_scene_tree = false; - - le_clear->set_disabled(false); - le_set->set_disabled(false); + scene_tree->nodes.clear(); + scene_tree->deserialize(p_data); + emit_signal("remote_tree_updated"); + _update_buttons_state(); } else if (p_msg == "message:inspect_object") { - ScriptEditorDebuggerInspectedObject *debugObj = NULL; - - ObjectID id = p_data[0]; - String type = p_data[1]; - Array properties = p_data[2]; - - if (remote_objects.has(id)) { - debugObj = remote_objects[id]; - } else { - debugObj = memnew(ScriptEditorDebuggerInspectedObject); - debugObj->remote_object_id = id; - debugObj->type_name = type; - remote_objects[id] = debugObj; - debugObj->connect("value_edited", this, "_scene_tree_property_value_edited"); - } - - int old_prop_size = debugObj->prop_list.size(); - - debugObj->prop_list.clear(); - int new_props_added = 0; - Set<String> changed; - for (int i = 0; i < properties.size(); i++) { - - Array prop = properties[i]; - if (prop.size() != 6) - continue; - - PropertyInfo pinfo; - pinfo.name = prop[0]; - pinfo.type = Variant::Type(int(prop[1])); - pinfo.hint = PropertyHint(int(prop[2])); - pinfo.hint_string = prop[3]; - pinfo.usage = PropertyUsageFlags(int(prop[4])); - Variant var = prop[5]; - - if (pinfo.type == Variant::OBJECT) { - if (var.is_zero()) { - var = RES(); - } else if (var.get_type() == Variant::STRING) { - String path = var; - if (path.find("::") != -1) { - // built-in resource - String base_path = path.get_slice("::", 0); - if (ResourceLoader::get_resource_type(base_path) == "PackedScene") { - if (!EditorNode::get_singleton()->is_scene_open(base_path)) { - EditorNode::get_singleton()->load_scene(base_path); - } - } else { - EditorNode::get_singleton()->load_resource(base_path); - } - } - var = ResourceLoader::load(path); - - if (pinfo.hint_string == "Script") { - if (debugObj->get_script() != var) { - debugObj->set_script(REF()); - Ref<Script> script(var); - if (!script.is_null()) { - ScriptInstance *script_instance = script->placeholder_instance_create(debugObj); - debugObj->set_script_and_instance(var, script_instance); - } - } - } - } else if (var.get_type() == Variant::OBJECT) { - if (((Object *)var)->is_class("EncodedObjectAsID")) { - var = Object::cast_to<EncodedObjectAsID>(var)->get_object_id(); - pinfo.type = var.get_type(); - pinfo.hint = PROPERTY_HINT_OBJECT_ID; - pinfo.hint_string = "Object"; - } - } - } - - //always add the property, since props may have been added or removed - debugObj->prop_list.push_back(pinfo); - - if (!debugObj->prop_values.has(pinfo.name)) { - new_props_added++; - debugObj->prop_values[pinfo.name] = var; - } else { - - if (bool(Variant::evaluate(Variant::OP_NOT_EQUAL, debugObj->prop_values[pinfo.name], var))) { - debugObj->prop_values[pinfo.name] = var; - changed.insert(pinfo.name); - } - } - } - - if (editor->get_editor_history()->get_current() != debugObj->get_instance_id()) { - editor->push_item(debugObj, ""); - } else { - - if (old_prop_size == debugObj->prop_list.size() && new_props_added == 0) { - //only some may have changed, if so, then update those, if exist - for (Set<String>::Element *E = changed.front(); E; E = E->next()) { - EditorNode::get_singleton()->get_inspector()->update_property(E->get()); - } - } else { - //full update, because props were added or removed - debugObj->update(); - } - } + ObjectID id = inspector->add_object(p_data); + if (id.is_valid()) + emit_signal("remote_object_updated", id); } else if (p_msg == "message:video_mem") { vmem_tree->clear(); TreeItem *root = vmem_tree->create_item(); + ScriptDebuggerRemote::ResourceUsage usage; + usage.deserialize(p_data); int total = 0; - for (int i = 0; i < p_data.size(); i += 4) { + for (List<ScriptDebuggerRemote::ResourceInfo>::Element *E = usage.infos.front(); E; E = E->next()) { TreeItem *it = vmem_tree->create_item(root); - String type = p_data[i + 1]; - int bytes = p_data[i + 3].operator int(); - it->set_text(0, p_data[i + 0]); //path - it->set_text(1, type); //type - it->set_text(2, p_data[i + 2]); //type - it->set_text(3, String::humanize_size(bytes)); //type + String type = E->get().type; + int bytes = E->get().vram; + it->set_text(0, E->get().path); + it->set_text(1, type); + it->set_text(2, E->get().format); + it->set_text(3, String::humanize_size(bytes)); total += bytes; if (has_icon(type, "EditorIcons")) @@ -693,18 +316,21 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da } else if (p_msg == "stack_dump") { + ScriptDebuggerRemote::ScriptStackDump stack; + stack.deserialize(p_data); + stack_dump->clear(); + inspector->clear_stack_variables(); TreeItem *r = stack_dump->create_item(); - for (int i = 0; i < p_data.size(); i++) { + for (int i = 0; i < stack.frames.size(); i++) { - Dictionary d = p_data[i]; - ERR_CONTINUE(!d.has("function")); - ERR_CONTINUE(!d.has("file")); - ERR_CONTINUE(!d.has("line")); - ERR_CONTINUE(!d.has("id")); TreeItem *s = stack_dump->create_item(r); + Dictionary d; d["frame"] = i; + d["file"] = stack.frames[i].file; + d["function"] = stack.frames[i].func; + d["line"] = stack.frames[i].line; s->set_metadata(0, d); String line = itos(i) + " - " + String(d["file"]) + ":" + itos(d["line"]) + " - at function: " + d["function"]; @@ -715,97 +341,22 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da } } else if (p_msg == "stack_frame_vars") { - variables->clear(); - - int ofs = 0; - int mcount = p_data[ofs]; - ofs++; - for (int i = 0; i < mcount; i++) { + inspector->clear_stack_variables(); - String n = p_data[ofs + i * 2 + 0]; - Variant v = p_data[ofs + i * 2 + 1]; + } else if (p_msg == "stack_frame_var") { - PropertyHint h = PROPERTY_HINT_NONE; - String hs = String(); - - if (v.get_type() == Variant::OBJECT) { - v = Object::cast_to<EncodedObjectAsID>(v)->get_object_id(); - h = PROPERTY_HINT_OBJECT_ID; - hs = "Object"; - } - - variables->add_property("Locals/" + n, v, h, hs); - } - - ofs += mcount * 2; - mcount = p_data[ofs]; - ofs++; - for (int i = 0; i < mcount; i++) { - - String n = p_data[ofs + i * 2 + 0]; - Variant v = p_data[ofs + i * 2 + 1]; - PropertyHint h = PROPERTY_HINT_NONE; - String hs = String(); - - if (v.get_type() == Variant::OBJECT) { - v = Object::cast_to<EncodedObjectAsID>(v)->get_object_id(); - h = PROPERTY_HINT_OBJECT_ID; - hs = "Object"; - } - - variables->add_property("Members/" + n, v, h, hs); - - if (n == "self") { - _scene_tree_property_select_object(v); - } - } - - ofs += mcount * 2; - mcount = p_data[ofs]; - ofs++; - for (int i = 0; i < mcount; i++) { - - String n = p_data[ofs + i * 2 + 0]; - Variant v = p_data[ofs + i * 2 + 1]; - PropertyHint h = PROPERTY_HINT_NONE; - String hs = String(); - - if (v.get_type() == Variant::OBJECT) { - v = Object::cast_to<EncodedObjectAsID>(v)->get_object_id(); - h = PROPERTY_HINT_OBJECT_ID; - hs = "Object"; - } - - variables->add_property("Globals/" + n, v, h, hs); - } - - variables->update(); - inspector->edit(variables); + inspector->add_stack_variable(p_data); } else if (p_msg == "output") { - - //OUT - for (int i = 0; i < p_data.size(); i++) { - - String t = p_data[i]; - //LOG - - if (!EditorNode::get_log()->is_visible()) { - if (EditorNode::get_singleton()->are_bottom_panels_hidden()) { - if (EDITOR_GET("run/output/always_open_output_on_play")) { - EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log()); - } - } - } - EditorNode::get_log()->add_message(t); - } + ERR_FAIL_COND(p_data.size() < 1); + String t = p_data[0]; + EditorNode::get_log()->add_message(t); } else if (p_msg == "performance") { - Array arr = p_data[0]; Vector<float> p; - p.resize(arr.size()); - for (int i = 0; i < arr.size(); i++) { - p.write[i] = arr[i]; + p.resize(p_data.size()); + for (int i = 0; i < p_data.size(); i++) { + p.write[i] = p_data[i]; if (i < perf_items.size()) { const float value = p[i]; @@ -833,7 +384,9 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da } perf_history.push_front(p); perf_draw->update(); + } else if (p_msg == "visual_profile") { + // TODO check me. uint64_t frame = p_data[0]; Vector<String> names = p_data[1]; Vector<real_t> values = p_data[2]; @@ -857,42 +410,29 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da areas_ptr[i].gpu_time = rr[i * 2 + 1]; } } - visual_profiler->add_frame_metric(metric); } else if (p_msg == "error") { - // Should have at least two elements, error array and stack items count. - ERR_FAIL_COND_MSG(p_data.size() < 2, "Malformed error message from script debugger."); - - // Error or warning data. - Array err = p_data[0]; - ERR_FAIL_COND_MSG(err.size() < 10, "Malformed error message from script debugger."); + ScriptDebuggerRemote::OutputError oe; + ERR_FAIL_COND_MSG(oe.deserialize(p_data) == false, "Failed to deserialize error message"); // Format time. Array time_vals; - time_vals.push_back(err[0]); - time_vals.push_back(err[1]); - time_vals.push_back(err[2]); - time_vals.push_back(err[3]); + time_vals.push_back(oe.hr); + time_vals.push_back(oe.min); + time_vals.push_back(oe.sec); + time_vals.push_back(oe.msec); bool e; - String time = String("%d:%02d:%02d.%03d").sprintf(time_vals, &e); + String time = String("%d:%02d:%02d:%04d").sprintf(time_vals, &e); // Rest of the error data. - String method = err[4]; - String source_file = err[5]; - String source_line = err[6]; - String error_cond = err[7]; - String error_msg = err[8]; - bool is_warning = err[9]; - bool has_method = !method.empty(); - bool has_error_msg = !error_msg.empty(); - bool source_is_project_file = source_file.begins_with("res://"); + bool source_is_project_file = oe.source_file.begins_with("res://"); // Metadata to highlight error line in scripts. Array source_meta; - source_meta.push_back(source_file); - source_meta.push_back(source_line); + source_meta.push_back(oe.source_file); + source_meta.push_back(oe.source_line); // Create error tree to display above error or warning details. TreeItem *r = error_tree->get_root(); @@ -902,40 +442,42 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da // Also provide the relevant details as tooltip to quickly check without // uncollapsing the tree. - String tooltip = is_warning ? TTR("Warning:") : TTR("Error:"); + String tooltip = oe.warning ? TTR("Warning:") : TTR("Error:"); TreeItem *error = error_tree->create_item(r); error->set_collapsed(true); - error->set_icon(0, get_icon(is_warning ? "Warning" : "Error", "EditorIcons")); + error->set_icon(0, get_icon(oe.warning ? "Warning" : "Error", "EditorIcons")); error->set_text(0, time); error->set_text_align(0, TreeItem::ALIGN_LEFT); String error_title; // Include method name, when given, in error title. - if (has_method) - error_title += method + ": "; + if (!oe.source_func.empty()) + error_title += oe.source_func + ": "; // If we have a (custom) error message, use it as title, and add a C++ Error // item with the original error condition. - error_title += error_msg.empty() ? error_cond : error_msg; + error_title += oe.error_descr.empty() ? oe.error : oe.error_descr; error->set_text(1, error_title); tooltip += " " + error_title + "\n"; - if (has_error_msg) { + if (!oe.error_descr.empty()) { // Add item for C++ error condition. TreeItem *cpp_cond = error_tree->create_item(error); cpp_cond->set_text(0, "<" + TTR("C++ Error") + ">"); - cpp_cond->set_text(1, error_cond); + cpp_cond->set_text(1, oe.error); cpp_cond->set_text_align(0, TreeItem::ALIGN_LEFT); - tooltip += TTR("C++ Error:") + " " + error_cond + "\n"; + tooltip += TTR("C++ Error:") + " " + oe.error + "\n"; if (source_is_project_file) cpp_cond->set_metadata(0, source_meta); } + Vector<uint8_t> v; + v.resize(100); // Source of the error. - String source_txt = (source_is_project_file ? source_file.get_file() : source_file) + ":" + source_line; - if (has_method) - source_txt += " @ " + method + "()"; + String source_txt = (source_is_project_file ? oe.source_file.get_file() : oe.source_file) + ":" + itos(oe.source_line); + if (!oe.source_func.empty()) + source_txt += " @ " + oe.source_func + "()"; TreeItem *cpp_source = error_tree->create_item(error); cpp_source->set_text(0, "<" + (source_is_project_file ? TTR("Source") : TTR("C++ Source")) + ">"); @@ -955,17 +497,14 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da // Format stack trace. // stack_items_count is the number of elements to parse, with 3 items per frame // of the stack trace (script, method, line). - int stack_items_count = p_data[1]; + const ScriptLanguage::StackInfo *infos = oe.callstack.ptr(); + for (unsigned int i = 0; i < (unsigned int)oe.callstack.size(); i++) { - for (int i = 0; i < stack_items_count; i += 3) { - String script = p_data[2 + i]; - String method2 = p_data[3 + i]; - int line = p_data[4 + i]; TreeItem *stack_trace = error_tree->create_item(error); Array meta; - meta.push_back(script); - meta.push_back(line); + meta.push_back(infos[i].file); + meta.push_back(infos[i].line); stack_trace->set_metadata(0, meta); if (i == 0) { @@ -973,29 +512,32 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da stack_trace->set_text_align(0, TreeItem::ALIGN_LEFT); error->set_metadata(0, meta); } - stack_trace->set_text(1, script.get_file() + ":" + itos(line) + " @ " + method2 + "()"); + stack_trace->set_text(1, infos[i].file.get_file() + ":" + itos(infos[i].line) + " @ " + infos[i].func + "()"); } - if (is_warning) + if (oe.warning) warning_count++; else error_count++; } else if (p_msg == "profile_sig") { - //cache a signature - profiler_signature[p_data[1]] = p_data[0]; + // Cache a profiler signature. + ScriptDebuggerRemote::ProfilerSignature sig; + sig.deserialize(p_data); + profiler_signature[sig.id] = sig.name; } else if (p_msg == "profile_frame" || p_msg == "profile_total") { - EditorProfiler::Metric metric; + ScriptDebuggerRemote::ProfilerFrame frame; + frame.deserialize(p_data); metric.valid = true; - metric.frame_number = p_data[0]; - metric.frame_time = p_data[1]; - metric.idle_time = p_data[2]; - metric.physics_time = p_data[3]; - metric.physics_frame_time = p_data[4]; - int frame_data_amount = p_data[6]; - int frame_function_amount = p_data[7]; + metric.frame_number = frame.frame_number; + metric.frame_time = frame.frame_time; + metric.idle_time = frame.idle_time; + metric.physics_time = frame.physics_time; + metric.physics_frame_time = frame.physics_frame_time; + int frame_data_amount = frame.frames_data.size(); + int frame_function_amount = frame.frame_functions.size(); if (frame_data_amount) { EditorProfiler::Metric::Category frame_time; @@ -1031,12 +573,11 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da metric.categories.push_back(frame_time); } - int idx = 8; for (int i = 0; i < frame_data_amount; i++) { EditorProfiler::Metric::Category c; - String name = p_data[idx++]; - Array values = p_data[idx++]; + String name = frame.frames_data[i].name; + Array values = frame.frames_data[i].data; c.name = name.capitalize(); c.items.resize(values.size() / 2); c.total_time = 0; @@ -1058,16 +599,16 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da } EditorProfiler::Metric::Category funcs; - funcs.total_time = p_data[5]; //script time + funcs.total_time = frame.script_time; funcs.items.resize(frame_function_amount); funcs.name = "Script Functions"; funcs.signature = "script_functions"; for (int i = 0; i < frame_function_amount; i++) { - int signature = p_data[idx++]; - int calls = p_data[idx++]; - float total = p_data[idx++]; - float self = p_data[idx++]; + int signature = frame.frame_functions[i].sig_id; + int calls = frame.frame_functions[i].call_count; + float total = frame.frame_functions[i].total_time; + float self = frame.frame_functions[i].self_time; EditorProfiler::Metric::Category::Item item; if (profiler_signature.has(signature)) { @@ -1102,23 +643,20 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da profiler->add_frame_metric(metric, false); else profiler->add_frame_metric(metric, true); + } else if (p_msg == "network_profile") { - int frame_size = 6; - for (int i = 0; i < p_data.size(); i += frame_size) { - MultiplayerAPI::ProfilingInfo pi; - pi.node = p_data[i + 0].operator ObjectID(); - pi.node_path = p_data[i + 1]; - pi.incoming_rpc = p_data[i + 2]; - pi.incoming_rset = p_data[i + 3]; - pi.outgoing_rpc = p_data[i + 4]; - pi.outgoing_rset = p_data[i + 5]; - network_profiler->add_node_frame_data(pi); + ScriptDebuggerRemote::NetworkProfilerFrame frame; + frame.deserialize(p_data); + for (int i = 0; i < frame.infos.size(); i++) { + network_profiler->add_node_frame_data(frame.infos[i]); } } else if (p_msg == "network_bandwidth") { + ERR_FAIL_COND(p_data.size() < 2); network_profiler->set_bandwidth(p_data[0], p_data[1]); } else if (p_msg == "kill_me") { - editor->call_deferred("stop_child_process"); + emit_signal("stop_requested"); + _stop_and_notify(); } } @@ -1218,20 +756,17 @@ void ScriptEditorDebugger::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - inspector->edit(variables); skip_breakpoints->set_icon(get_icon("DebugSkipBreakpointsOff", "EditorIcons")); copy->set_icon(get_icon("ActionCopy", "EditorIcons")); step->set_icon(get_icon("DebugStep", "EditorIcons")); next->set_icon(get_icon("DebugNext", "EditorIcons")); - back->set_icon(get_icon("Back", "EditorIcons")); - forward->set_icon(get_icon("Forward", "EditorIcons")); dobreak->set_icon(get_icon("Pause", "EditorIcons")); docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); - le_set->connect("pressed", this, "_live_edit_set"); - le_clear->connect("pressed", this, "_live_edit_clear"); - error_tree->connect("item_selected", this, "_error_selected"); - error_tree->connect("item_activated", this, "_error_activated"); + le_set->connect_compat("pressed", this, "_live_edit_set"); + le_clear->connect_compat("pressed", this, "_live_edit_clear"); + error_tree->connect_compat("item_selected", this, "_error_selected"); + error_tree->connect_compat("item_activated", this, "_error_activated"); vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); reason->add_color_override("font_color", get_color("error_color", "Editor")); @@ -1239,31 +774,7 @@ void ScriptEditorDebugger::_notification(int p_what) { } break; case NOTIFICATION_PROCESS: { - if (connection.is_valid()) { - - inspect_scene_tree_timeout -= get_process_delta_time(); - if (inspect_scene_tree_timeout < 0) { - inspect_scene_tree_timeout = EditorSettings::get_singleton()->get("debugger/remote_scene_tree_refresh_interval"); - if (inspect_scene_tree->is_visible_in_tree()) { - _scene_tree_request(); - } - } - - inspect_edited_object_timeout -= get_process_delta_time(); - if (inspect_edited_object_timeout < 0) { - inspect_edited_object_timeout = EditorSettings::get_singleton()->get("debugger/remote_inspect_refresh_interval"); - if (inspected_object_id.is_valid()) { - if (ScriptEditorDebuggerInspectedObject *obj = Object::cast_to<ScriptEditorDebuggerInspectedObject>(ObjectDB::get_instance(editor->get_editor_history()->get_current()))) { - if (obj->remote_object_id == inspected_object_id) { - //take the chance and re-inspect selected object - Array msg; - msg.push_back("inspect_object"); - msg.push_back(inspected_object_id); - ppeer->put_var(msg); - } - } - } - } + if (is_session_active()) { if (camera_override == OVERRIDE_2D) { CanvasItemEditor *editor = CanvasItemEditor::get_singleton(); @@ -1277,9 +788,8 @@ void ScriptEditorDebugger::_notification(int p_what) { transform.elements[2] = -offset * zoom; Array msg; - msg.push_back("override_camera_2D:transform"); msg.push_back(transform); - ppeer->put_var(msg); + _put_msg("override_camera_2D:transform", msg); } else if (camera_override >= OVERRIDE_3D_1) { int viewport_idx = camera_override - OVERRIDE_3D_1; @@ -1287,7 +797,6 @@ void ScriptEditorDebugger::_notification(int p_what) { Camera *const cam = viewport->get_camera(); Array msg; - msg.push_back("override_camera_3D:transform"); msg.push_back(cam->get_camera_transform()); if (cam->get_projection() == Camera::PROJECTION_ORTHOGONAL) { msg.push_back(false); @@ -1298,86 +807,12 @@ void ScriptEditorDebugger::_notification(int p_what) { } msg.push_back(cam->get_znear()); msg.push_back(cam->get_zfar()); - ppeer->put_var(msg); - } - } - - if (error_count != last_error_count || warning_count != last_warning_count) { - - if (error_count == 0 && warning_count == 0) { - errors_tab->set_name(TTR("Errors")); - debugger_button->set_text(TTR("Debugger")); - debugger_button->set_icon(Ref<Texture2D>()); - tabs->set_tab_icon(errors_tab->get_index(), Ref<Texture2D>()); - } else { - errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")"); - debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); - if (error_count == 0) { - debugger_button->set_icon(get_icon("Warning", "EditorIcons")); - tabs->set_tab_icon(errors_tab->get_index(), get_icon("Warning", "EditorIcons")); - } else { - debugger_button->set_icon(get_icon("Error", "EditorIcons")); - tabs->set_tab_icon(errors_tab->get_index(), get_icon("Error", "EditorIcons")); - } - } - last_error_count = error_count; - last_warning_count = warning_count; - } - - if (server->is_connection_available()) { - if (connection.is_valid()) { - // We already have a valid connection. Disconnecting any new connecting client to prevent it from hanging. - // (If we don't keep a reference to the connection it will be destroyed and disconnect_from_host will be called internally) - server->take_connection(); - } else { - // We just got the first connection. - connection = server->take_connection(); - if (connection.is_null()) - break; - - EditorNode::get_log()->add_message("--- Debugging process started ---", EditorLog::MSG_TYPE_EDITOR); - - ppeer->set_stream_peer(connection); - - //EditorNode::get_singleton()->make_bottom_panel_item_visible(this); - //emit_signal("show_debugger",true); - - dobreak->set_disabled(false); - tabs->set_current_tab(0); - - _set_reason_text(TTR("Child process connected."), MESSAGE_SUCCESS); - profiler->clear(); - - inspect_scene_tree->clear(); - le_set->set_disabled(true); - le_clear->set_disabled(false); - vmem_refresh->set_disabled(false); - error_tree->clear(); - error_count = 0; - warning_count = 0; - profiler_signature.clear(); - //live_edit_root->set_text("/root"); - - EditorNode::get_singleton()->get_pause_button()->set_pressed(false); - EditorNode::get_singleton()->get_pause_button()->set_disabled(false); - - update_live_edit_root(); - if (profiler->is_profiling()) { - _profiler_activate(true); - } - - if (network_profiler->is_profiling()) { - _network_profiler_activate(true); - } + _put_msg("override_camera_3D:transform", msg); } } - if (connection.is_null()) - break; - - if (!connection->is_connected_to_host()) { - stop(); - editor->notify_child_process_exited(); //somehow, exited + if (!is_session_active()) { + _stop_and_notify(); break; }; @@ -1389,67 +824,22 @@ void ScriptEditorDebugger::_notification(int p_what) { while (ppeer->get_available_packet_count() > 0) { - if (pending_in_queue) { - - int todo = MIN(ppeer->get_available_packet_count(), pending_in_queue); - - for (int i = 0; i < todo; i++) { - - Variant cmd; - Error ret = ppeer->get_var(cmd); - if (ret != OK) { - stop(); - ERR_FAIL_COND(ret != OK); - } - - message.push_back(cmd); - pending_in_queue--; - } - - if (pending_in_queue == 0) { - _parse_message(message_type, message); - message.clear(); - } - - } else { - - if (ppeer->get_available_packet_count() >= 2) { - - Variant cmd; - Error ret = ppeer->get_var(cmd); - if (ret != OK) { - stop(); - ERR_FAIL_COND(ret != OK); - } - if (cmd.get_type() != Variant::STRING) { - stop(); - ERR_FAIL_COND(cmd.get_type() != Variant::STRING); - } - - message_type = cmd; - - ret = ppeer->get_var(cmd); - if (ret != OK) { - stop(); - ERR_FAIL_COND(ret != OK); - } - if (cmd.get_type() != Variant::INT) { - stop(); - ERR_FAIL_COND(cmd.get_type() != Variant::INT); - } - - pending_in_queue = cmd; - - if (pending_in_queue == 0) { - _parse_message(message_type, Array()); - message.clear(); - } - - } else { - - break; - } + Variant cmd; + Error ret = ppeer->get_var(cmd); + if (ret != OK) { + _stop_and_notify(); + ERR_FAIL_MSG("Error decoding variant from peer"); + } + if (cmd.get_type() != Variant::ARRAY) { + _stop_and_notify(); + ERR_FAIL_MSG("Invalid message format received from peer"); } + Array arr = cmd; + if (arr.size() != 2 || arr[0].get_type() != Variant::STRING || arr[1].get_type() != Variant::ARRAY) { + _stop_and_notify(); + ERR_FAIL_MSG("Invalid message format received from peer"); + } + _parse_message(arr[0], arr[1]); if (OS::get_singleton()->get_ticks_msec() > until) break; @@ -1457,18 +847,13 @@ void ScriptEditorDebugger::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - add_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); - add_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); - - tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); - tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles")); - tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles")); + if (tabs->has_stylebox_override("panel")) { + tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); + } copy->set_icon(get_icon("ActionCopy", "EditorIcons")); step->set_icon(get_icon("DebugStep", "EditorIcons")); next->set_icon(get_icon("DebugNext", "EditorIcons")); - back->set_icon(get_icon("Back", "EditorIcons")); - forward->set_icon(get_icon("Forward", "EditorIcons")); dobreak->set_icon(get_icon("Pause", "EditorIcons")); docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); @@ -1486,15 +871,18 @@ void ScriptEditorDebugger::_clear_execution() { stack_script = ResourceLoader::load(d["file"]); emit_signal("clear_execution", stack_script); stack_script.unref(); + stack_dump->clear(); + inspector->clear_stack_variables(); } -void ScriptEditorDebugger::start() { +void ScriptEditorDebugger::start(Ref<StreamPeerTCP> p_connection) { + error_count = 0; + warning_count = 0; stop(); - if (is_visible_in_tree()) { - EditorNode::get_singleton()->make_bottom_panel_item_visible(this); - } + connection = p_connection; + ppeer->set_stream_peer(connection); perf_history.clear(); for (int i = 0; i < Performance::MONITOR_MAX; i++) { @@ -1502,91 +890,81 @@ void ScriptEditorDebugger::start() { perf_max.write[i] = 0; } - int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port"); - if (server->listen(remote_port) != OK) { - EditorNode::get_log()->add_message(String("Error listening on port ") + itos(remote_port), EditorLog::MSG_TYPE_ERROR); - return; - } - - EditorNode::get_singleton()->get_scene_tree_dock()->show_tab_buttons(); - auto_switch_remote_scene_tree = (bool)EditorSettings::get_singleton()->get("debugger/auto_switch_to_remote_scene_tree"); - if (auto_switch_remote_scene_tree) { - EditorNode::get_singleton()->get_scene_tree_dock()->show_remote_tree(); - } - set_process(true); breaked = false; + can_debug = true; camera_override = OVERRIDE_NONE; + + tabs->set_current_tab(0); + _set_reason_text(TTR("Debug session started."), MESSAGE_SUCCESS); + _update_buttons_state(); + + if (profiler->is_profiling()) { + _profiler_activate(true); + } + + if (network_profiler->is_profiling()) { + _network_profiler_activate(true); + } } -void ScriptEditorDebugger::pause() { +void ScriptEditorDebugger::_update_buttons_state() { + const bool active = is_session_active(); + const bool has_editor_tree = active && editor_remote_tree && editor_remote_tree->get_selected(); + vmem_refresh->set_disabled(!active); + step->set_disabled(!active || !breaked || !can_debug); + next->set_disabled(!active || !breaked || !can_debug); + copy->set_disabled(!active || !breaked); + docontinue->set_disabled(!active || !breaked); + dobreak->set_disabled(!active || breaked); + le_clear->set_disabled(!active); + le_set->set_disabled(!has_editor_tree); } -void ScriptEditorDebugger::unpause() { +void ScriptEditorDebugger::_stop_and_notify() { + stop(); + emit_signal("stopped"); + _set_reason_text(TTR("Debug session closed."), MESSAGE_WARNING); } void ScriptEditorDebugger::stop() { set_process(false); breaked = false; + can_debug = false; + remote_pid = 0; _clear_execution(); - server->stop(); - _clear_remote_objects(); + inspector->clear_cache(); ppeer->set_stream_peer(Ref<StreamPeer>()); if (connection.is_valid()) { - EditorNode::get_log()->add_message("--- Debugging process stopped ---", EditorLog::MSG_TYPE_EDITOR); connection.unref(); - reason->set_text(""); reason->set_tooltip(""); } - pending_in_queue = 0; - message.clear(); - node_path_cache.clear(); res_path_cache.clear(); profiler_signature.clear(); - le_clear->set_disabled(false); - le_set->set_disabled(true); - profiler->set_enabled(true); - vmem_refresh->set_disabled(true); - inspect_scene_tree->clear(); inspector->edit(NULL); - EditorNode::get_singleton()->get_pause_button()->set_pressed(false); - EditorNode::get_singleton()->get_pause_button()->set_disabled(true); - EditorNode::get_singleton()->get_scene_tree_dock()->hide_remote_tree(); - EditorNode::get_singleton()->get_scene_tree_dock()->hide_tab_buttons(); - - if (hide_on_stop) { - if (is_visible_in_tree()) - EditorNode::get_singleton()->hide_bottom_panel(); - emit_signal("show_debugger", false); - } + _update_buttons_state(); } void ScriptEditorDebugger::_profiler_activate(bool p_enable) { - if (!connection.is_valid()) - return; - if (p_enable) { profiler_signature.clear(); Array msg; - msg.push_back("start_profiling"); int max_funcs = EditorSettings::get_singleton()->get("debugger/profiler_frame_max_functions"); max_funcs = CLAMP(max_funcs, 16, 512); msg.push_back(max_funcs); - ppeer->put_var(msg); + _put_msg("start_profiling", msg); print_verbose("Starting profiling."); } else { - Array msg; - msg.push_back("stop_profiling"); - ppeer->put_var(msg); + _put_msg("stop_profiling", Array()); print_verbose("Ending profiling."); } } @@ -1598,44 +976,30 @@ void ScriptEditorDebugger::_visual_profiler_activate(bool p_enable) { if (p_enable) { profiler_signature.clear(); - Array msg; - msg.push_back("start_visual_profiling"); - ppeer->put_var(msg); + _put_msg("start_visual_profiling", Array()); print_verbose("Starting visual profiling."); } else { - Array msg; - msg.push_back("stop_visual_profiling"); - ppeer->put_var(msg); + _put_msg("stop_visual_profiling", Array()); print_verbose("Ending visual profiling."); } } void ScriptEditorDebugger::_network_profiler_activate(bool p_enable) { - if (!connection.is_valid()) - return; - if (p_enable) { profiler_signature.clear(); - Array msg; - msg.push_back("start_network_profiling"); - ppeer->put_var(msg); + _put_msg("start_network_profiling", Array()); print_verbose("Starting network profiling."); } else { - Array msg; - msg.push_back("stop_network_profiling"); - ppeer->put_var(msg); + _put_msg("stop_network_profiling", Array()); print_verbose("Ending network profiling."); } } void ScriptEditorDebugger::_profiler_seeked() { - if (!connection.is_valid() || !connection->is_connected_to_host()) - return; - if (breaked) return; debug_break(); @@ -1643,45 +1007,30 @@ void ScriptEditorDebugger::_profiler_seeked() { void ScriptEditorDebugger::_stack_dump_frame_selected() { - TreeItem *ti = stack_dump->get_selected(); - if (!ti) - return; + emit_signal("stack_frame_selected"); - Dictionary d = ti->get_metadata(0); + int frame = get_stack_script_frame(); - stack_script = ResourceLoader::load(d["file"]); - emit_signal("goto_script_line", stack_script, int(d["line"]) - 1); - emit_signal("set_execution", stack_script, int(d["line"]) - 1); - stack_script.unref(); - - if (connection.is_valid() && connection->is_connected_to_host()) { + if (is_session_active() && frame >= 0) { Array msg; - msg.push_back("get_stack_frame_vars"); - msg.push_back(d["frame"]); - ppeer->put_var(msg); + msg.push_back(frame); + _put_msg("get_stack_frame_vars", msg); } else { inspector->edit(NULL); } } -void ScriptEditorDebugger::_output_clear() { - - //output->clear(); - //output->push_color(Color(0,0,0)); -} - void ScriptEditorDebugger::_export_csv() { file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file_dialog_mode = SAVE_CSV; file_dialog->popup_centered_ratio(); } String ScriptEditorDebugger::get_var_value(const String &p_var) const { if (!breaked) return String(); - return variables->get_var_value(p_var); + return inspector->get_stack_variable(p_var); } int ScriptEditorDebugger::_get_node_path_cache(const NodePath &p_path) { @@ -1694,10 +1043,9 @@ int ScriptEditorDebugger::_get_node_path_cache(const NodePath &p_path) { node_path_cache[p_path] = last_path_id; Array msg; - msg.push_back("live_node_path"); msg.push_back(p_path); msg.push_back(last_path_id); - ppeer->put_var(msg); + _put_msg("live_node_path", msg); return last_path_id; } @@ -1713,17 +1061,16 @@ int ScriptEditorDebugger::_get_res_path_cache(const String &p_path) { res_path_cache[p_path] = last_path_id; Array msg; - msg.push_back("live_res_path"); msg.push_back(p_path); msg.push_back(last_path_id); - ppeer->put_var(msg); + _put_msg("live_res_path", msg); return last_path_id; } void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_name, VARIANT_ARG_DECLARE) { - if (!p_base || !live_debug || !connection.is_valid() || !editor->get_edited_scene()) + if (!p_base || !live_debug || !is_session_active() || !editor->get_edited_scene()) return; Node *node = Object::cast_to<Node>(p_base); @@ -1742,14 +1089,13 @@ void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_n int pathid = _get_node_path_cache(path); Array msg; - msg.push_back("live_node_call"); msg.push_back(pathid); msg.push_back(p_name); for (int i = 0; i < VARIANT_ARG_MAX; i++) { //no pointers, sorry msg.push_back(*argptr[i]); } - ppeer->put_var(msg); + _put_msg("live_node_call", msg); return; } @@ -1762,14 +1108,13 @@ void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_n int pathid = _get_res_path_cache(respath); Array msg; - msg.push_back("live_res_call"); msg.push_back(pathid); msg.push_back(p_name); for (int i = 0; i < VARIANT_ARG_MAX; i++) { //no pointers, sorry msg.push_back(*argptr[i]); } - ppeer->put_var(msg); + _put_msg("live_res_call", msg); return; } @@ -1777,7 +1122,7 @@ void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_n void ScriptEditorDebugger::_property_changed(Object *p_base, const StringName &p_property, const Variant &p_value) { - if (!p_base || !live_debug || !connection.is_valid() || !editor->get_edited_scene()) + if (!p_base || !live_debug || !editor->get_edited_scene()) return; Node *node = Object::cast_to<Node>(p_base); @@ -1792,20 +1137,18 @@ void ScriptEditorDebugger::_property_changed(Object *p_base, const StringName &p if (res.is_valid() && res->get_path() != String()) { Array msg; - msg.push_back("live_node_prop_res"); msg.push_back(pathid); msg.push_back(p_property); msg.push_back(res->get_path()); - ppeer->put_var(msg); + _put_msg("live_node_prop_res", msg); } } else { Array msg; - msg.push_back("live_node_prop"); msg.push_back(pathid); msg.push_back(p_property); msg.push_back(p_value); - ppeer->put_var(msg); + _put_msg("live_node_prop", msg); } return; @@ -1823,36 +1166,46 @@ void ScriptEditorDebugger::_property_changed(Object *p_base, const StringName &p if (res2.is_valid() && res2->get_path() != String()) { Array msg; - msg.push_back("live_res_prop_res"); msg.push_back(pathid); msg.push_back(p_property); msg.push_back(res2->get_path()); - ppeer->put_var(msg); + _put_msg("live_res_prop_res", msg); } } else { Array msg; - msg.push_back("live_res_prop"); msg.push_back(pathid); msg.push_back(p_property); msg.push_back(p_value); - ppeer->put_var(msg); + _put_msg("live_res_prop", msg); } return; } } -void ScriptEditorDebugger::_method_changeds(void *p_ud, Object *p_base, const StringName &p_name, VARIANT_ARG_DECLARE) { - - ScriptEditorDebugger *sed = (ScriptEditorDebugger *)p_ud; - sed->_method_changed(p_base, p_name, VARIANT_ARG_PASS); +String ScriptEditorDebugger::get_stack_script_file() const { + TreeItem *ti = stack_dump->get_selected(); + if (!ti) + return ""; + Dictionary d = ti->get_metadata(0); + return d["file"]; } -void ScriptEditorDebugger::_property_changeds(void *p_ud, Object *p_base, const StringName &p_property, const Variant &p_value) { +int ScriptEditorDebugger::get_stack_script_line() const { + TreeItem *ti = stack_dump->get_selected(); + if (!ti) + return -1; + Dictionary d = ti->get_metadata(0); + return d["line"]; +} - ScriptEditorDebugger *sed = (ScriptEditorDebugger *)p_ud; - sed->_property_changed(p_base, p_property, p_value); +int ScriptEditorDebugger::get_stack_script_frame() const { + TreeItem *ti = stack_dump->get_selected(); + if (!ti) + return -1; + Dictionary d = ti->get_metadata(0); + return d["frame"]; } void ScriptEditorDebugger::set_live_debugging(bool p_enable) { @@ -1862,12 +1215,13 @@ void ScriptEditorDebugger::set_live_debugging(bool p_enable) { void ScriptEditorDebugger::_live_edit_set() { - if (!connection.is_valid()) + if (!is_session_active() || !editor_remote_tree) return; - TreeItem *ti = inspect_scene_tree->get_selected(); + TreeItem *ti = editor_remote_tree->get_selected(); if (!ti) return; + String path; while (ti) { @@ -1895,92 +1249,82 @@ void ScriptEditorDebugger::update_live_edit_root() { NodePath np = editor->get_editor_data().get_edited_scene_live_edit_root(); - if (connection.is_valid()) { - Array msg; - msg.push_back("live_set_root"); - msg.push_back(np); - if (editor->get_edited_scene()) - msg.push_back(editor->get_edited_scene()->get_filename()); - else - msg.push_back(""); - ppeer->put_var(msg); - } + Array msg; + msg.push_back(np); + if (editor->get_edited_scene()) + msg.push_back(editor->get_edited_scene()->get_filename()); + else + msg.push_back(""); + _put_msg("live_set_root", msg); live_edit_root->set_text(np); } void ScriptEditorDebugger::live_debug_create_node(const NodePath &p_parent, const String &p_type, const String &p_name) { - if (live_debug && connection.is_valid()) { + if (live_debug) { Array msg; - msg.push_back("live_create_node"); msg.push_back(p_parent); msg.push_back(p_type); msg.push_back(p_name); - ppeer->put_var(msg); + _put_msg("live_create_node", msg); } } void ScriptEditorDebugger::live_debug_instance_node(const NodePath &p_parent, const String &p_path, const String &p_name) { - if (live_debug && connection.is_valid()) { + if (live_debug) { Array msg; - msg.push_back("live_instance_node"); msg.push_back(p_parent); msg.push_back(p_path); msg.push_back(p_name); - ppeer->put_var(msg); + _put_msg("live_instance_node", msg); } } void ScriptEditorDebugger::live_debug_remove_node(const NodePath &p_at) { - if (live_debug && connection.is_valid()) { + if (live_debug) { Array msg; - msg.push_back("live_remove_node"); msg.push_back(p_at); - ppeer->put_var(msg); + _put_msg("live_remove_node", msg); } } void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id) { - if (live_debug && connection.is_valid()) { + if (live_debug) { Array msg; - msg.push_back("live_remove_and_keep_node"); msg.push_back(p_at); msg.push_back(p_keep_id); - ppeer->put_var(msg); + _put_msg("live_remove_and_keep_node", msg); } } void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos) { - if (live_debug && connection.is_valid()) { + if (live_debug) { Array msg; - msg.push_back("live_restore_node"); msg.push_back(p_id); msg.push_back(p_at); msg.push_back(p_at_pos); - ppeer->put_var(msg); + _put_msg("live_restore_node", msg); } } void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name) { - if (live_debug && connection.is_valid()) { + if (live_debug) { Array msg; - msg.push_back("live_duplicate_node"); msg.push_back(p_at); msg.push_back(p_new_name); - ppeer->put_var(msg); + _put_msg("live_duplicate_node", msg); } } void ScriptEditorDebugger::live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) { - if (live_debug && connection.is_valid()) { + if (live_debug) { Array msg; - msg.push_back("live_reparent_node"); msg.push_back(p_at); msg.push_back(p_new_place); msg.push_back(p_new_name); msg.push_back(p_at_pos); - ppeer->put_var(msg); + _put_msg("live_reparent_node", msg); } } @@ -1991,33 +1335,21 @@ ScriptEditorDebugger::CameraOverride ScriptEditorDebugger::get_camera_override() void ScriptEditorDebugger::set_camera_override(CameraOverride p_override) { if (p_override == OVERRIDE_2D && camera_override != OVERRIDE_2D) { - if (connection.is_valid()) { - Array msg; - msg.push_back("override_camera_2D:set"); - msg.push_back(true); - ppeer->put_var(msg); - } + Array msg; + msg.push_back(true); + _put_msg("override_camera_2D:set", msg); } else if (p_override != OVERRIDE_2D && camera_override == OVERRIDE_2D) { - if (connection.is_valid()) { - Array msg; - msg.push_back("override_camera_2D:set"); - msg.push_back(false); - ppeer->put_var(msg); - } + Array msg; + msg.push_back(false); + _put_msg("override_camera_2D:set", msg); } else if (p_override >= OVERRIDE_3D_1 && camera_override < OVERRIDE_3D_1) { - if (connection.is_valid()) { - Array msg; - msg.push_back("override_camera_3D:set"); - msg.push_back(true); - ppeer->put_var(msg); - } + Array msg; + msg.push_back(true); + _put_msg("override_camera_3D:set", msg); } else if (p_override < OVERRIDE_3D_1 && camera_override >= OVERRIDE_3D_1) { - if (connection.is_valid()) { - Array msg; - msg.push_back("override_camera_3D:set"); - msg.push_back(false); - ppeer->put_var(msg); - } + Array msg; + msg.push_back(false); + _put_msg("override_camera_3D:set", msg); } camera_override = p_override; @@ -2025,23 +1357,16 @@ void ScriptEditorDebugger::set_camera_override(CameraOverride p_override) { void ScriptEditorDebugger::set_breakpoint(const String &p_path, int p_line, bool p_enabled) { - if (connection.is_valid()) { - Array msg; - msg.push_back("breakpoint"); - msg.push_back(p_path); - msg.push_back(p_line); - msg.push_back(p_enabled); - ppeer->put_var(msg); - } + Array msg; + msg.push_back(p_path); + msg.push_back(p_line); + msg.push_back(p_enabled); + _put_msg("breakpoint", msg); } void ScriptEditorDebugger::reload_scripts() { - if (connection.is_valid()) { - Array msg; - msg.push_back("reload_scripts"); - ppeer->put_var(msg); - } + _put_msg("reload_scripts", Array()); } bool ScriptEditorDebugger::is_skip_breakpoints() { @@ -2059,15 +1384,12 @@ void ScriptEditorDebugger::_error_activated() { void ScriptEditorDebugger::_error_selected() { TreeItem *selected = error_tree->get_selected(); - Array meta = selected->get_metadata(0); - if (meta.size() == 0) { return; } - Ref<Script> s = ResourceLoader::load(meta[0]); - emit_signal("goto_script_line", s, int(meta[1]) - 1); + emit_signal("error_selected", String(meta[0]), int(meta[1])); } void ScriptEditorDebugger::_expand_errors_list() { @@ -2096,58 +1418,6 @@ void ScriptEditorDebugger::_collapse_errors_list() { } } -void ScriptEditorDebugger::set_hide_on_stop(bool p_hide) { - - hide_on_stop = p_hide; -} - -bool ScriptEditorDebugger::get_debug_with_external_editor() const { - - return enable_external_editor; -} - -void ScriptEditorDebugger::set_debug_with_external_editor(bool p_enabled) { - - enable_external_editor = p_enabled; -} - -Ref<Script> ScriptEditorDebugger::get_dump_stack_script() const { - - return stack_script; -} - -void ScriptEditorDebugger::_paused() { - - ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected_to_host()); - - if (!breaked && EditorNode::get_singleton()->get_pause_button()->is_pressed()) { - debug_break(); - } - - if (breaked && !EditorNode::get_singleton()->get_pause_button()->is_pressed()) { - debug_continue(); - } -} - -void ScriptEditorDebugger::_set_remote_object(ObjectID p_id, ScriptEditorDebuggerInspectedObject *p_obj) { - - if (remote_objects.has(p_id)) - memdelete(remote_objects[p_id]); - remote_objects[p_id] = p_obj; -} - -void ScriptEditorDebugger::_clear_remote_objects() { - - for (Map<ObjectID, ScriptEditorDebuggerInspectedObject *>::Element *E = remote_objects.front(); E; E = E->next()) { - if (editor->get_editor_history()->get_current() == E->value()->get_instance_id()) { - editor->push_item(NULL); - } - memdelete(E->value()); - } - remote_objects.clear(); -} - void ScriptEditorDebugger::_clear_errors_list() { error_tree->clear(); @@ -2163,7 +1433,7 @@ void ScriptEditorDebugger::_error_tree_item_rmb_selected(const Vector2 &p_pos) { item_menu->set_size(Size2(1, 1)); if (error_tree->is_anything_selected()) { - item_menu->add_icon_item(get_icon("ActionCopy", "EditorIcons"), TTR("Copy Error"), ITEM_MENU_COPY_ERROR); + item_menu->add_icon_item(get_icon("ActionCopy", "EditorIcons"), TTR("Copy Error"), 0); } if (item_menu->get_item_count() > 0) { @@ -2173,70 +1443,29 @@ void ScriptEditorDebugger::_error_tree_item_rmb_selected(const Vector2 &p_pos) { } void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) { + TreeItem *ti = error_tree->get_selected(); + while (ti->get_parent() != error_tree->get_root()) + ti = ti->get_parent(); - switch (p_option) { - - case ITEM_MENU_COPY_ERROR: { - TreeItem *ti = error_tree->get_selected(); - while (ti->get_parent() != error_tree->get_root()) - ti = ti->get_parent(); - - String type; - - if (ti->get_icon(0) == get_icon("Warning", "EditorIcons")) { - type = "W "; - } else if (ti->get_icon(0) == get_icon("Error", "EditorIcons")) { - type = "E "; - } - - String text = ti->get_text(0) + " "; - int rpad_len = text.length(); - - text = type + text + ti->get_text(1) + "\n"; - TreeItem *ci = ti->get_children(); - while (ci) { - text += " " + ci->get_text(0).rpad(rpad_len) + ci->get_text(1) + "\n"; - ci = ci->get_next(); - } - - OS::get_singleton()->set_clipboard(text); - - } break; - case ITEM_MENU_SAVE_REMOTE_NODE: { - - file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES); - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); - file_dialog_mode = SAVE_NODE; - - List<String> extensions; - Ref<PackedScene> sd = memnew(PackedScene); - ResourceSaver::get_recognized_extensions(sd, &extensions); - file_dialog->clear_filters(); - for (int i = 0; i < extensions.size(); i++) { - file_dialog->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper()); - } - - file_dialog->popup_centered_ratio(); - } break; - case ITEM_MENU_COPY_NODE_PATH: { + String type; - TreeItem *ti = inspect_scene_tree->get_selected(); - String text = ti->get_text(0); + if (ti->get_icon(0) == get_icon("Warning", "EditorIcons")) { + type = "W "; + } else if (ti->get_icon(0) == get_icon("Error", "EditorIcons")) { + type = "E "; + } - if (ti->get_parent() == NULL) { - text = "."; - } else if (ti->get_parent()->get_parent() == NULL) { - text = "."; - } else { - while (ti->get_parent()->get_parent() != inspect_scene_tree->get_root()) { - ti = ti->get_parent(); - text = ti->get_text(0) + "/" + text; - } - } + String text = ti->get_text(0) + " "; + int rpad_len = text.length(); - OS::get_singleton()->set_clipboard(text); - } break; + text = type + text + ti->get_text(1) + "\n"; + TreeItem *ci = ti->get_children(); + while (ci) { + text += " " + ci->get_text(0).rpad(rpad_len) + ci->get_text(1) + "\n"; + ci = ci->get_next(); } + + OS::get_singleton()->set_clipboard(text); } void ScriptEditorDebugger::_tab_changed(int p_tab) { @@ -2257,11 +1486,9 @@ void ScriptEditorDebugger::_bind_methods() { ClassDB::bind_method(D_METHOD("debug_step"), &ScriptEditorDebugger::debug_step); ClassDB::bind_method(D_METHOD("debug_break"), &ScriptEditorDebugger::debug_break); ClassDB::bind_method(D_METHOD("debug_continue"), &ScriptEditorDebugger::debug_continue); - ClassDB::bind_method(D_METHOD("_output_clear"), &ScriptEditorDebugger::_output_clear); ClassDB::bind_method(D_METHOD("_export_csv"), &ScriptEditorDebugger::_export_csv); ClassDB::bind_method(D_METHOD("_performance_draw"), &ScriptEditorDebugger::_performance_draw); ClassDB::bind_method(D_METHOD("_performance_select"), &ScriptEditorDebugger::_performance_select); - ClassDB::bind_method(D_METHOD("_scene_tree_request"), &ScriptEditorDebugger::_scene_tree_request); ClassDB::bind_method(D_METHOD("_video_mem_request"), &ScriptEditorDebugger::_video_mem_request); ClassDB::bind_method(D_METHOD("_live_edit_set"), &ScriptEditorDebugger::_live_edit_set); ClassDB::bind_method(D_METHOD("_live_edit_clear"), &ScriptEditorDebugger::_live_edit_clear); @@ -2279,13 +1506,10 @@ void ScriptEditorDebugger::_bind_methods() { ClassDB::bind_method(D_METHOD("_error_tree_item_rmb_selected"), &ScriptEditorDebugger::_error_tree_item_rmb_selected); ClassDB::bind_method(D_METHOD("_item_menu_id_pressed"), &ScriptEditorDebugger::_item_menu_id_pressed); ClassDB::bind_method(D_METHOD("_tab_changed"), &ScriptEditorDebugger::_tab_changed); - - ClassDB::bind_method(D_METHOD("_paused"), &ScriptEditorDebugger::_paused); - - ClassDB::bind_method(D_METHOD("_scene_tree_selected"), &ScriptEditorDebugger::_scene_tree_selected); - ClassDB::bind_method(D_METHOD("_scene_tree_folded"), &ScriptEditorDebugger::_scene_tree_folded); - ClassDB::bind_method(D_METHOD("_scene_tree_rmb_selected"), &ScriptEditorDebugger::_scene_tree_rmb_selected); ClassDB::bind_method(D_METHOD("_file_selected"), &ScriptEditorDebugger::_file_selected); + ClassDB::bind_method(D_METHOD("_remote_object_selected", "id"), &ScriptEditorDebugger::_remote_object_selected); + ClassDB::bind_method(D_METHOD("_remote_object_edited", "id", "property", "value"), &ScriptEditorDebugger::_remote_object_edited); + ClassDB::bind_method(D_METHOD("_remote_object_property_updated", "id", "property"), &ScriptEditorDebugger::_remote_object_property_updated); ClassDB::bind_method(D_METHOD("live_debug_create_node"), &ScriptEditorDebugger::live_debug_create_node); ClassDB::bind_method(D_METHOD("live_debug_instance_node"), &ScriptEditorDebugger::live_debug_instance_node); @@ -2294,32 +1518,32 @@ void ScriptEditorDebugger::_bind_methods() { ClassDB::bind_method(D_METHOD("live_debug_restore_node"), &ScriptEditorDebugger::live_debug_restore_node); ClassDB::bind_method(D_METHOD("live_debug_duplicate_node"), &ScriptEditorDebugger::live_debug_duplicate_node); ClassDB::bind_method(D_METHOD("live_debug_reparent_node"), &ScriptEditorDebugger::live_debug_reparent_node); - ClassDB::bind_method(D_METHOD("_scene_tree_property_select_object"), &ScriptEditorDebugger::_scene_tree_property_select_object); - ClassDB::bind_method(D_METHOD("_scene_tree_property_value_edited"), &ScriptEditorDebugger::_scene_tree_property_value_edited); + ClassDB::bind_method(D_METHOD("request_remote_object", "id"), &ScriptEditorDebugger::request_remote_object); + ClassDB::bind_method(D_METHOD("update_remote_object", "id", "property", "value"), &ScriptEditorDebugger::update_remote_object); - ADD_SIGNAL(MethodInfo("goto_script_line")); + ADD_SIGNAL(MethodInfo("stopped")); + ADD_SIGNAL(MethodInfo("stop_requested")); + ADD_SIGNAL(MethodInfo("stack_frame_selected", PropertyInfo(Variant::INT, "frame"))); + ADD_SIGNAL(MethodInfo("error_selected", PropertyInfo(Variant::INT, "error"))); ADD_SIGNAL(MethodInfo("set_execution", PropertyInfo("script"), PropertyInfo(Variant::INT, "line"))); ADD_SIGNAL(MethodInfo("clear_execution", PropertyInfo("script"))); ADD_SIGNAL(MethodInfo("breaked", PropertyInfo(Variant::BOOL, "reallydid"), PropertyInfo(Variant::BOOL, "can_debug"))); - ADD_SIGNAL(MethodInfo("show_debugger", PropertyInfo(Variant::BOOL, "reallydid"))); + ADD_SIGNAL(MethodInfo("remote_object_requested", PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("remote_object_updated", PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("remote_object_property_updated", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::STRING, "property"))); + ADD_SIGNAL(MethodInfo("remote_tree_updated")); } ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { - add_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); - add_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); - ppeer = Ref<PacketPeerStream>(memnew(PacketPeerStream)); ppeer->set_input_buffer_max_size((1024 * 1024 * 8) - 4); // 8 MiB should be enough, minus 4 bytes for separator. editor = p_editor; - editor->get_inspector()->connect("object_id_selected", this, "_scene_tree_property_select_object"); tabs = memnew(TabContainer); tabs->set_tab_align(TabContainer::ALIGN_LEFT); tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); - tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles")); - tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles")); - tabs->connect("tab_changed", this, "_tab_changed"); + tabs->connect_compat("tab_changed", this, "_tab_changed"); add_child(tabs); @@ -2344,14 +1568,14 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { skip_breakpoints = memnew(ToolButton); hbc->add_child(skip_breakpoints); skip_breakpoints->set_tooltip(TTR("Skip Breakpoints")); - skip_breakpoints->connect("pressed", this, "debug_skip_breakpoints"); + skip_breakpoints->connect_compat("pressed", this, "debug_skip_breakpoints"); hbc->add_child(memnew(VSeparator)); copy = memnew(ToolButton); hbc->add_child(copy); copy->set_tooltip(TTR("Copy Error")); - copy->connect("pressed", this, "debug_copy"); + copy->connect_compat("pressed", this, "debug_copy"); hbc->add_child(memnew(VSeparator)); @@ -2359,13 +1583,13 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { hbc->add_child(step); step->set_tooltip(TTR("Step Into")); step->set_shortcut(ED_GET_SHORTCUT("debugger/step_into")); - step->connect("pressed", this, "debug_step"); + step->connect_compat("pressed", this, "debug_step"); next = memnew(ToolButton); hbc->add_child(next); next->set_tooltip(TTR("Step Over")); next->set_shortcut(ED_GET_SHORTCUT("debugger/step_over")); - next->connect("pressed", this, "debug_next"); + next->connect_compat("pressed", this, "debug_next"); hbc->add_child(memnew(VSeparator)); @@ -2373,23 +1597,13 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { hbc->add_child(dobreak); dobreak->set_tooltip(TTR("Break")); dobreak->set_shortcut(ED_GET_SHORTCUT("debugger/break")); - dobreak->connect("pressed", this, "debug_break"); + dobreak->connect_compat("pressed", this, "debug_break"); docontinue = memnew(ToolButton); hbc->add_child(docontinue); docontinue->set_tooltip(TTR("Continue")); docontinue->set_shortcut(ED_GET_SHORTCUT("debugger/continue")); - docontinue->connect("pressed", this, "debug_continue"); - - back = memnew(Button); - hbc->add_child(back); - back->set_tooltip(TTR("Inspect Previous Instance")); - back->hide(); - - forward = memnew(Button); - hbc->add_child(forward); - forward->set_tooltip(TTR("Inspect Next Instance")); - forward->hide(); + docontinue->connect_compat("pressed", this, "debug_continue"); HSplitContainer *sc = memnew(HSplitContainer); vbc->add_child(sc); @@ -2402,24 +1616,17 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { stack_dump->set_column_title(0, TTR("Stack Frames")); stack_dump->set_h_size_flags(SIZE_EXPAND_FILL); stack_dump->set_hide_root(true); - stack_dump->connect("cell_selected", this, "_stack_dump_frame_selected"); + stack_dump->connect_compat("cell_selected", this, "_stack_dump_frame_selected"); sc->add_child(stack_dump); - inspector = memnew(EditorInspector); + inspector = memnew(EditorDebuggerInspector); inspector->set_h_size_flags(SIZE_EXPAND_FILL); inspector->set_enable_capitalize_paths(false); inspector->set_read_only(true); - inspector->connect("object_id_selected", this, "_scene_tree_property_select_object"); + inspector->connect_compat("object_selected", this, "_remote_object_selected"); + inspector->connect_compat("object_edited", this, "_remote_object_edited"); + inspector->connect_compat("object_property_updated", this, "_remote_object_property_updated"); sc->add_child(inspector); - - server.instance(); - - pending_in_queue = 0; - - variables = memnew(ScriptEditorDebuggerVariables); - - breaked = false; - tabs->add_child(dbg); } @@ -2432,12 +1639,12 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { Button *expand_all = memnew(Button); expand_all->set_text(TTR("Expand All")); - expand_all->connect("pressed", this, "_expand_errors_list"); + expand_all->connect_compat("pressed", this, "_expand_errors_list"); errhb->add_child(expand_all); Button *collapse_all = memnew(Button); collapse_all->set_text(TTR("Collapse All")); - collapse_all->connect("pressed", this, "_collapse_errors_list"); + collapse_all->connect_compat("pressed", this, "_collapse_errors_list"); errhb->add_child(collapse_all); Control *space = memnew(Control); @@ -2447,7 +1654,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { clearbutton = memnew(Button); clearbutton->set_text(TTR("Clear")); clearbutton->set_h_size_flags(0); - clearbutton->connect("pressed", this, "_clear_errors_list"); + clearbutton->connect_compat("pressed", this, "_clear_errors_list"); errhb->add_child(clearbutton); error_tree = memnew(Tree); @@ -2462,36 +1669,19 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { error_tree->set_hide_root(true); error_tree->set_v_size_flags(SIZE_EXPAND_FILL); error_tree->set_allow_rmb_select(true); - error_tree->connect("item_rmb_selected", this, "_error_tree_item_rmb_selected"); + error_tree->connect_compat("item_rmb_selected", this, "_error_tree_item_rmb_selected"); errors_tab->add_child(error_tree); item_menu = memnew(PopupMenu); - item_menu->connect("id_pressed", this, "_item_menu_id_pressed"); + item_menu->connect_compat("id_pressed", this, "_item_menu_id_pressed"); error_tree->add_child(item_menu); tabs->add_child(errors_tab); } - { // remote scene tree - - inspect_scene_tree = memnew(Tree); - EditorNode::get_singleton()->get_scene_tree_dock()->add_remote_tree_editor(inspect_scene_tree); - EditorNode::get_singleton()->get_scene_tree_dock()->connect("remote_tree_selected", this, "_scene_tree_selected"); - inspect_scene_tree->set_v_size_flags(SIZE_EXPAND_FILL); - inspect_scene_tree->connect("cell_selected", this, "_scene_tree_selected"); - inspect_scene_tree->connect("item_collapsed", this, "_scene_tree_folded"); - inspect_scene_tree->set_allow_rmb_select(true); - inspect_scene_tree->connect("item_rmb_selected", this, "_scene_tree_rmb_selected"); - auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false); - inspect_scene_tree_timeout = EDITOR_DEF("debugger/remote_scene_tree_refresh_interval", 1.0); - inspect_edited_object_timeout = EDITOR_DEF("debugger/remote_inspect_refresh_interval", 0.2); - inspected_object_id = ObjectID(); - updating_scene_tree = false; - } - { // File dialog file_dialog = memnew(EditorFileDialog); - file_dialog->connect("file_selected", this, "_file_selected"); + file_dialog->connect_compat("file_selected", this, "_file_selected"); add_child(file_dialog); } @@ -2499,24 +1689,22 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { profiler = memnew(EditorProfiler); profiler->set_name(TTR("Profiler")); tabs->add_child(profiler); - profiler->connect("enable_profiling", this, "_profiler_activate"); - profiler->connect("break_request", this, "_profiler_seeked"); + profiler->connect_compat("enable_profiling", this, "_profiler_activate"); + profiler->connect_compat("break_request", this, "_profiler_seeked"); } { //frame profiler visual_profiler = memnew(EditorVisualProfiler); visual_profiler->set_name(TTR("Visual Profiler")); tabs->add_child(visual_profiler); - visual_profiler->connect("enable_profiling", this, "_visual_profiler_activate"); - visual_profiler->connect("break_request", this, "_profiler_seeked"); + visual_profiler->connect_compat("enable_profiling", this, "_visual_profiler_activate"); } { //network profiler network_profiler = memnew(EditorNetworkProfiler); network_profiler->set_name(TTR("Network Profiler")); tabs->add_child(network_profiler); - network_profiler->connect("enable_profiling", this, "_network_profiler_activate"); - network_profiler->connect("break_request", this, "_profiler_seeked"); + network_profiler->connect_compat("enable_profiling", this, "_network_profiler_activate"); } { //monitors @@ -2528,12 +1716,12 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { perf_monitors->set_column_title(0, TTR("Monitor")); perf_monitors->set_column_title(1, TTR("Value")); perf_monitors->set_column_titles_visible(true); - perf_monitors->connect("item_edited", this, "_performance_select"); + perf_monitors->connect_compat("item_edited", this, "_performance_select"); hsp->add_child(perf_monitors); perf_draw = memnew(Control); perf_draw->set_clip_contents(true); - perf_draw->connect("draw", this, "_performance_draw"); + perf_draw->connect_compat("draw", this, "_performance_draw"); hsp->add_child(perf_draw); hsp->set_name(TTR("Monitors")); @@ -2592,10 +1780,9 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { vmem_total->set_custom_minimum_size(Size2(100, 0) * EDSCALE); vmem_hb->add_child(vmem_total); vmem_refresh = memnew(ToolButton); - vmem_refresh->set_disabled(true); vmem_hb->add_child(vmem_refresh); vmem_vb->add_child(vmem_hb); - vmem_refresh->connect("pressed", this, "_video_mem_request"); + vmem_refresh->connect_compat("pressed", this, "_video_mem_request"); VBoxContainer *vmmc = memnew(VBoxContainer); vmem_tree = memnew(Tree); @@ -2640,6 +1827,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { info_left->add_child(memnew(Label(TTR("Clicked Control Type:")))); info_left->add_child(clicked_ctrl_type); + scene_tree = memnew(SceneDebuggerTree); live_edit_root = memnew(LineEdit); live_edit_root->set_h_size_flags(SIZE_EXPAND_FILL); @@ -2653,8 +1841,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { le_clear = memnew(Button(TTR("Clear"))); lehb->add_child(le_clear); info_left->add_child(lehb); - le_set->set_disabled(true); - le_clear->set_disabled(true); } misc->add_child(memnew(VSeparator)); @@ -2662,7 +1848,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { HBoxContainer *buttons = memnew(HBoxContainer); export_csv = memnew(Button(TTR("Export measures as CSV"))); - export_csv->connect("pressed", this, "_export_csv"); + export_csv->connect_compat("pressed", this, "_export_csv"); buttons->add_child(export_csv); misc->add_child(buttons); @@ -2671,27 +1857,18 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { msgdialog = memnew(AcceptDialog); add_child(msgdialog); - p_editor->get_undo_redo()->set_method_notify_callback(_method_changeds, this); - p_editor->get_undo_redo()->set_property_notify_callback(_property_changeds, this); live_debug = true; camera_override = OVERRIDE_NONE; last_path_id = false; error_count = 0; warning_count = 0; - hide_on_stop = true; - enable_external_editor = false; - last_error_count = 0; - last_warning_count = 0; - - EditorNode::get_singleton()->get_pause_button()->connect("pressed", this, "_paused"); + _update_buttons_state(); } ScriptEditorDebugger::~ScriptEditorDebugger() { - memdelete(variables); - ppeer->set_stream_peer(Ref<StreamPeer>()); - server->stop(); - _clear_remote_objects(); + inspector->clear_cache(); + memdelete(scene_tree); } diff --git a/editor/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h index 5a821a4a88..fd034ba983 100644 --- a/editor/script_editor_debugger.h +++ b/editor/debugger/script_editor_debugger.h @@ -32,7 +32,8 @@ #define SCRIPT_EDITOR_DEBUGGER_H #include "core/io/packet_peer.h" -#include "core/io/tcp_server.h" +#include "core/io/stream_peer_tcp.h" +#include "editor/debugger/editor_debugger_inspector.h" #include "editor/editor_inspector.h" #include "editor/property_editor.h" #include "scene/3d/camera.h" @@ -41,7 +42,6 @@ class Tree; class EditorNode; -class ScriptEditorDebuggerVariables; class LineEdit; class TabContainer; class RichTextLabel; @@ -53,13 +53,14 @@ class ItemList; class EditorProfiler; class EditorVisualProfiler; class EditorNetworkProfiler; - -class ScriptEditorDebuggerInspectedObject; +class SceneDebuggerTree; class ScriptEditorDebugger : public MarginContainer { GDCLASS(ScriptEditorDebugger, MarginContainer); + friend class EditorDebuggerNode; + public: enum CameraOverride { OVERRIDE_NONE, @@ -77,16 +78,8 @@ private: MESSAGE_SUCCESS, }; - enum ItemMenu { - ITEM_MENU_COPY_ERROR, - ITEM_MENU_SAVE_REMOTE_NODE, - ITEM_MENU_COPY_NODE_PATH, - }; - AcceptDialog *msgdialog; - Button *debugger_button; - LineEdit *clicked_ctrl; LineEdit *clicked_ctrl_type; LineEdit *live_edit_root; @@ -94,35 +87,15 @@ private: Button *le_clear; Button *export_csv; - bool updating_scene_tree; - float inspect_scene_tree_timeout; - float inspect_edited_object_timeout; - bool auto_switch_remote_scene_tree; - ObjectID inspected_object_id; - ScriptEditorDebuggerVariables *variables; - Map<ObjectID, ScriptEditorDebuggerInspectedObject *> remote_objects; - Set<ObjectID> unfold_cache; - VBoxContainer *errors_tab; Tree *error_tree; - Tree *inspect_scene_tree; Button *clearbutton; PopupMenu *item_menu; EditorFileDialog *file_dialog; - enum FileDialogMode { - SAVE_CSV, - SAVE_NODE, - }; - FileDialogMode file_dialog_mode; int error_count; int warning_count; - int last_error_count; - int last_warning_count; - - bool hide_on_stop; - bool enable_external_editor; bool skip_breakpoints_value = false; Ref<Script> stack_script; @@ -135,10 +108,11 @@ private: Button *copy; Button *step; Button *next; - Button *back; - Button *forward; Button *dobreak; Button *docontinue; + // Reference to "Remote" tab in scene tree. Needed by _live_edit_set and buttons state. + // Each debugger should have it's tree in the future I guess. + const Tree *editor_remote_tree = NULL; List<Vector<float> > perf_history; Vector<float> perf_max; @@ -155,16 +129,12 @@ private: LineEdit *vmem_total; Tree *stack_dump; - EditorInspector *inspector; + EditorDebuggerInspector *inspector; + SceneDebuggerTree *scene_tree; - Ref<TCP_Server> server; Ref<StreamPeerTCP> connection; Ref<PacketPeerStream> ppeer; - String message_type; - Array message; - int pending_in_queue; - HashMap<NodePath, int> node_path_cache; int last_path_id; Map<String, int> res_path_cache; @@ -175,7 +145,9 @@ private: EditorNode *editor; - bool breaked; + OS::ProcessID remote_pid = 0; + bool breaked = false; + bool can_debug = false; bool live_debug; @@ -184,18 +156,14 @@ private: void _performance_draw(); void _performance_select(); void _stack_dump_frame_selected(); - void _output_clear(); - void _scene_tree_folded(Object *obj); - void _scene_tree_selected(); - void _scene_tree_rmb_selected(const Vector2 &p_position); void _file_selected(const String &p_file); - void _scene_tree_request(); void _parse_message(const String &p_msg, const Array &p_data); void _set_reason_text(const String &p_reason, MessageType p_type); - void _scene_tree_property_select_object(ObjectID p_object); - void _scene_tree_property_value_edited(const String &p_prop, const Variant &p_value); - int _update_scene_tree(TreeItem *parent, const Array &nodes, int current_index); + void _update_buttons_state(); + void _remote_object_selected(ObjectID p_object); + void _remote_object_edited(ObjectID, const String &p_prop, const Variant &p_value); + void _remote_object_property_updated(ObjectID p_id, const String &p_property); void _video_mem_request(); @@ -221,28 +189,34 @@ private: void _network_profiler_activate(bool p_enable); - void _paused(); - - void _set_remote_object(ObjectID p_id, ScriptEditorDebuggerInspectedObject *p_obj); - void _clear_remote_objects(); void _clear_errors_list(); void _error_tree_item_rmb_selected(const Vector2 &p_pos); void _item_menu_id_pressed(int p_option); void _tab_changed(int p_tab); + void _put_msg(String p_message, Array p_data); void _export_csv(); void _clear_execution(); + void _stop_and_notify(); protected: void _notification(int p_what); static void _bind_methods(); public: - void start(); - void pause(); - void unpause(); + void request_remote_object(ObjectID p_obj_id); + void update_remote_object(ObjectID p_obj_id, const String &p_prop, const Variant &p_value); + Object *get_remote_object(ObjectID p_id); + + // Needed by _live_edit_set, buttons state. + void set_editor_remote_tree(const Tree *p_tree) { editor_remote_tree = p_tree; } + + void request_remote_tree(); + const SceneDebuggerTree *get_remote_tree(); + + void start(Ref<StreamPeerTCP> p_connection); void stop(); void debug_skip_breakpoints(); @@ -252,14 +226,24 @@ public: void debug_step(); void debug_break(); void debug_continue(); - + bool is_breaked() const { return breaked; } + bool is_debuggable() const { return can_debug; } + bool is_session_active() { return connection.is_valid() && connection->is_connected_to_host(); }; + int get_remote_pid() const { return remote_pid; } + + int get_error_count() const { return error_count; } + int get_warning_count() const { return warning_count; } + String get_stack_script_file() const; + int get_stack_script_line() const; + int get_stack_script_frame() const; + + void update_tabs(); + void clear_style(); String get_var_value(const String &p_var) const; + void save_node(ObjectID p_id, const String &p_file); void set_live_debugging(bool p_enable); - static void _method_changeds(void *p_ud, Object *p_base, const StringName &p_name, VARIANT_ARG_DECLARE); - static void _property_changeds(void *p_ud, Object *p_base, const StringName &p_property, const Variant &p_value); - void live_debug_create_node(const NodePath &p_parent, const String &p_type, const String &p_name); void live_debug_instance_node(const NodePath &p_parent, const String &p_path, const String &p_name); void live_debug_remove_node(const NodePath &p_at); @@ -275,15 +259,6 @@ public: void update_live_edit_root(); - void set_hide_on_stop(bool p_hide); - - bool get_debug_with_external_editor() const; - void set_debug_with_external_editor(bool p_enabled); - - Ref<Script> get_dump_stack_script() const; - - void set_tool_button(Button *p_tb) { debugger_button = p_tb; } - void reload_scripts(); bool is_skip_breakpoints(); diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 46f6815f77..e2a447cfcf 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -247,7 +247,7 @@ DependencyEditor::DependencyEditor() { tree->set_column_title(0, TTR("Resource")); tree->set_column_title(1, TTR("Path")); tree->set_hide_root(true); - tree->connect("button_pressed", this, "_load_pressed"); + tree->connect_compat("button_pressed", this, "_load_pressed"); HBoxContainer *hbc = memnew(HBoxContainer); Label *label = memnew(Label(TTR("Dependencies:"))); @@ -255,7 +255,7 @@ DependencyEditor::DependencyEditor() { hbc->add_spacer(); fixdeps = memnew(Button(TTR("Fix Broken"))); hbc->add_child(fixdeps); - fixdeps->connect("pressed", this, "_fix_all"); + fixdeps->connect_compat("pressed", this, "_fix_all"); vb->add_child(hbc); @@ -267,7 +267,7 @@ DependencyEditor::DependencyEditor() { set_title(TTR("Dependency Editor")); search = memnew(EditorFileDialog); - search->connect("file_selected", this, "_searched"); + search->connect_compat("file_selected", this, "_searched"); search->set_mode(EditorFileDialog::MODE_OPEN_FILE); search->set_title(TTR("Search Replacement Resource:")); add_child(search); @@ -360,12 +360,12 @@ DependencyEditorOwners::DependencyEditorOwners(EditorNode *p_editor) { file_options = memnew(PopupMenu); add_child(file_options); - file_options->connect("id_pressed", this, "_file_option"); + file_options->connect_compat("id_pressed", this, "_file_option"); owners = memnew(ItemList); owners->set_select_mode(ItemList::SELECT_SINGLE); - owners->connect("item_rmb_selected", this, "_list_rmb_select"); - owners->connect("item_activated", this, "_select_file"); + owners->connect_compat("item_rmb_selected", this, "_list_rmb_select"); + owners->connect_compat("item_activated", this, "_select_file"); owners->set_allow_rmb_select(true); add_child(owners); } @@ -800,7 +800,7 @@ OrphanResourcesDialog::OrphanResourcesDialog() { add_child(delete_confirm); dep_edit = memnew(DependencyEditor); add_child(dep_edit); - delete_confirm->connect("confirmed", this, "_delete_confirm"); + delete_confirm->connect_compat("confirmed", this, "_delete_confirm"); set_hide_on_ok(false); VBoxContainer *vbc = memnew(VBoxContainer); @@ -816,5 +816,5 @@ OrphanResourcesDialog::OrphanResourcesDialog() { files->set_column_title(1, TTR("Owns")); files->set_hide_root(true); vbc->add_margin_child(TTR("Resources Without Explicit Ownership:"), files, true); - files->connect("button_pressed", this, "_button_pressed"); + files->connect_compat("button_pressed", this, "_button_pressed"); } diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index de3d13cdac..3fd9e3182d 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -533,7 +533,7 @@ void DocData::generate(bool p_basic_types) { ClassDoc &c = class_list[cname]; c.name = cname; - Variant::CallError cerror; + Callable::CallError cerror; Variant v = Variant::construct(Variant::Type(i), NULL, 0, cerror); List<MethodInfo> method_list; @@ -562,11 +562,12 @@ void DocData::generate(bool p_basic_types) { method.arguments.push_back(ad); } - if (mi.return_val.type == Variant::NIL) { - if (mi.return_val.name != "") - method.return_type = "Variant"; - } else { - method.return_type = Variant::get_type_name(mi.return_val.type); + return_doc_from_retinfo(method, mi.return_val); + + if (mi.flags & METHOD_FLAG_VARARG) { + if (method.qualifiers != "") + method.qualifiers += " "; + method.qualifiers += "vararg"; } c.methods.push_back(method); diff --git a/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp index 4763091b8e..b0a89ff4b8 100644 --- a/editor/doc/doc_dump.cpp +++ b/editor/doc/doc_dump.cpp @@ -161,10 +161,13 @@ void DocDump::dump(const String &p_file) { default_arg_text = "false"; break; case Variant::INT: - case Variant::REAL: + case Variant::FLOAT: //keep it break; case Variant::STRING: + case Variant::STRING_NAME: + default_arg_text = "@\"" + default_arg_text + "\""; + break; case Variant::NODE_PATH: default_arg_text = "\"" + default_arg_text + "\""; break; @@ -185,15 +188,17 @@ void DocDump::dump(const String &p_file) { case Variant::BASIS: case Variant::COLOR: case Variant::PACKED_BYTE_ARRAY: - case Variant::PACKED_INT_ARRAY: - case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: case Variant::PACKED_STRING_ARRAY: case Variant::PACKED_VECTOR3_ARRAY: case Variant::PACKED_COLOR_ARRAY: default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")"; break; case Variant::OBJECT: - case Variant::DICTIONARY: // 20 + case Variant::DICTIONARY: case Variant::ARRAY: case Variant::_RID: diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index ba653017ef..37d653ed43 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -255,7 +255,7 @@ EditorAbout::EditorAbout() { _tpl_text->set_v_size_flags(Control::SIZE_EXPAND_FILL); tpl_hbc->add_child(_tpl_text); - _tpl_tree->connect("item_selected", this, "_license_tree_selected"); + _tpl_tree->connect_compat("item_selected", this, "_license_tree_selected"); tpl_ti_all->select(0); _tpl_text->set_text(tpl_ti_all->get_metadata(0)); } diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 783b996c4d..8a6fc4cd12 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -318,7 +318,7 @@ EditorAssetInstaller::EditorAssetInstaller() { tree = memnew(Tree); vb->add_margin_child(TTR("Package Contents:"), tree, true); - tree->connect("item_edited", this, "_item_edited"); + tree->connect_compat("item_edited", this, "_item_edited"); error = memnew(AcceptDialog); add_child(error); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 594322f00d..1a72b6e1ca 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -799,8 +799,8 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { set_v_size_flags(SIZE_EXPAND_FILL); track_name = memnew(LineEdit); - track_name->connect("text_entered", this, "_name_changed"); - track_name->connect("focus_exited", this, "_name_focus_exit"); + track_name->connect_compat("text_entered", this, "_name_changed"); + track_name->connect_compat("focus_exited", this, "_name_focus_exit"); vb->add_child(track_name); HBoxContainer *hbc = memnew(HBoxContainer); @@ -809,19 +809,19 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { solo->set_toggle_mode(true); solo->set_tooltip(TTR("Solo")); solo->set_focus_mode(FOCUS_NONE); - solo->connect("pressed", this, "_solo_toggled"); + solo->connect_compat("pressed", this, "_solo_toggled"); hbc->add_child(solo); mute = memnew(ToolButton); mute->set_toggle_mode(true); mute->set_tooltip(TTR("Mute")); mute->set_focus_mode(FOCUS_NONE); - mute->connect("pressed", this, "_mute_toggled"); + mute->connect_compat("pressed", this, "_mute_toggled"); hbc->add_child(mute); bypass = memnew(ToolButton); bypass->set_toggle_mode(true); bypass->set_tooltip(TTR("Bypass")); bypass->set_focus_mode(FOCUS_NONE); - bypass->connect("pressed", this, "_bypass_toggled"); + bypass->connect_compat("pressed", this, "_bypass_toggled"); hbc->add_child(bypass); hbc->add_spacer(); @@ -878,9 +878,9 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { preview_timer->set_one_shot(true); add_child(preview_timer); - slider->connect("value_changed", this, "_volume_changed"); - slider->connect("value_changed", this, "_show_value"); - preview_timer->connect("timeout", this, "_hide_value_preview"); + slider->connect_compat("value_changed", this, "_volume_changed"); + slider->connect_compat("value_changed", this, "_show_value"); + preview_timer->connect_compat("timeout", this, "_hide_value_preview"); hb->add_child(slider); cc = 0; @@ -918,24 +918,24 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { effects->set_hide_folding(true); effects->set_v_size_flags(SIZE_EXPAND_FILL); vb->add_child(effects); - effects->connect("item_edited", this, "_effect_edited"); - effects->connect("cell_selected", this, "_effect_selected"); + effects->connect_compat("item_edited", this, "_effect_edited"); + effects->connect_compat("cell_selected", this, "_effect_selected"); effects->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); effects->set_drag_forwarding(this); - effects->connect("item_rmb_selected", this, "_effect_rmb"); + effects->connect_compat("item_rmb_selected", this, "_effect_rmb"); effects->set_allow_rmb_select(true); effects->set_focus_mode(FOCUS_CLICK); effects->set_allow_reselect(true); send = memnew(OptionButton); send->set_clip_text(true); - send->connect("item_selected", this, "_send_selected"); + send->connect_compat("item_selected", this, "_send_selected"); vb->add_child(send); set_focus_mode(FOCUS_CLICK); effect_options = memnew(PopupMenu); - effect_options->connect("index_pressed", this, "_effect_add"); + effect_options->connect_compat("index_pressed", this, "_effect_add"); add_child(effect_options); List<StringName> effects; ClassDB::get_inheriters_from_class("AudioEffect", &effects); @@ -956,12 +956,12 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { bus_popup->add_item(TTR("Delete")); bus_popup->set_item_disabled(1, is_master); bus_popup->add_item(TTR("Reset Volume")); - bus_popup->connect("index_pressed", this, "_bus_popup_pressed"); + bus_popup->connect_compat("index_pressed", this, "_bus_popup_pressed"); delete_effect_popup = memnew(PopupMenu); delete_effect_popup->add_item(TTR("Delete Effect")); add_child(delete_effect_popup); - delete_effect_popup->connect("index_pressed", this, "_delete_effect_pressed"); + delete_effect_popup->connect_compat("index_pressed", this, "_delete_effect_pressed"); } void EditorAudioBusDrop::_notification(int p_what) { @@ -1029,11 +1029,11 @@ void EditorAudioBuses::_update_buses() { bool is_master = (i == 0); EditorAudioBus *audio_bus = memnew(EditorAudioBus(this, is_master)); bus_hb->add_child(audio_bus); - audio_bus->connect("delete_request", this, "_delete_bus", varray(audio_bus), CONNECT_DEFERRED); - audio_bus->connect("duplicate_request", this, "_duplicate_bus", varray(), CONNECT_DEFERRED); - audio_bus->connect("vol_reset_request", this, "_reset_bus_volume", varray(audio_bus), CONNECT_DEFERRED); - audio_bus->connect("drop_end_request", this, "_request_drop_end"); - audio_bus->connect("dropped", this, "_drop_at_index", varray(), CONNECT_DEFERRED); + audio_bus->connect_compat("delete_request", this, "_delete_bus", varray(audio_bus), CONNECT_DEFERRED); + audio_bus->connect_compat("duplicate_request", this, "_duplicate_bus", varray(), CONNECT_DEFERRED); + audio_bus->connect_compat("vol_reset_request", this, "_reset_bus_volume", varray(audio_bus), CONNECT_DEFERRED); + audio_bus->connect_compat("drop_end_request", this, "_request_drop_end"); + audio_bus->connect_compat("dropped", this, "_drop_at_index", varray(), CONNECT_DEFERRED); } } @@ -1187,7 +1187,7 @@ void EditorAudioBuses::_request_drop_end() { bus_hb->add_child(drop_end); drop_end->set_custom_minimum_size(Object::cast_to<Control>(bus_hb->get_child(0))->get_size()); - drop_end->connect("dropped", this, "_drop_at_index", varray(), CONNECT_DEFERRED); + drop_end->connect_compat("dropped", this, "_drop_at_index", varray(), CONNECT_DEFERRED); } } @@ -1339,7 +1339,7 @@ EditorAudioBuses::EditorAudioBuses() { top_hb->add_child(add); add->set_text(TTR("Add Bus")); add->set_tooltip(TTR("Add a new Audio Bus to this layout.")); - add->connect("pressed", this, "_add_bus"); + add->connect_compat("pressed", this, "_add_bus"); VSeparator *separator = memnew(VSeparator); top_hb->add_child(separator); @@ -1348,25 +1348,25 @@ EditorAudioBuses::EditorAudioBuses() { load->set_text(TTR("Load")); load->set_tooltip(TTR("Load an existing Bus Layout.")); top_hb->add_child(load); - load->connect("pressed", this, "_load_layout"); + load->connect_compat("pressed", this, "_load_layout"); save_as = memnew(Button); save_as->set_text(TTR("Save As")); save_as->set_tooltip(TTR("Save this Bus Layout to a file.")); top_hb->add_child(save_as); - save_as->connect("pressed", this, "_save_as_layout"); + save_as->connect_compat("pressed", this, "_save_as_layout"); _default = memnew(Button); _default->set_text(TTR("Load Default")); _default->set_tooltip(TTR("Load the default Bus Layout.")); top_hb->add_child(_default); - _default->connect("pressed", this, "_load_default_layout"); + _default->connect_compat("pressed", this, "_load_default_layout"); _new = memnew(Button); _new->set_text(TTR("Create")); _new->set_tooltip(TTR("Create a new Bus Layout.")); top_hb->add_child(_new); - _new->connect("pressed", this, "_new_layout"); + _new->connect_compat("pressed", this, "_new_layout"); bus_scroll = memnew(ScrollContainer); bus_scroll->set_v_size_flags(SIZE_EXPAND_FILL); @@ -1381,7 +1381,7 @@ EditorAudioBuses::EditorAudioBuses() { save_timer->set_wait_time(0.8); save_timer->set_one_shot(true); add_child(save_timer); - save_timer->connect("timeout", this, "_server_save"); + save_timer->connect_compat("timeout", this, "_server_save"); set_v_size_flags(SIZE_EXPAND_FILL); @@ -1394,7 +1394,7 @@ EditorAudioBuses::EditorAudioBuses() { file_dialog->add_filter("*." + E->get() + "; Audio Bus Layout"); } add_child(file_dialog); - file_dialog->connect("file_selected", this, "_file_dialog_callback"); + file_dialog->connect_compat("file_selected", this, "_file_dialog_callback"); set_process(true); } diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 77a23fb336..feb6dbd302 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -835,8 +835,8 @@ EditorAutoloadSettings::EditorAutoloadSettings() { autoload_add_path = memnew(EditorLineEditFileChooser); autoload_add_path->set_h_size_flags(SIZE_EXPAND_FILL); autoload_add_path->get_file_dialog()->set_mode(EditorFileDialog::MODE_OPEN_FILE); - autoload_add_path->get_file_dialog()->connect("file_selected", this, "_autoload_file_callback"); - autoload_add_path->get_line_edit()->connect("text_changed", this, "_autoload_path_text_changed"); + autoload_add_path->get_file_dialog()->connect_compat("file_selected", this, "_autoload_file_callback"); + autoload_add_path->get_line_edit()->connect_compat("text_changed", this, "_autoload_path_text_changed"); hbc->add_child(autoload_add_path); @@ -846,13 +846,13 @@ EditorAutoloadSettings::EditorAutoloadSettings() { autoload_add_name = memnew(LineEdit); autoload_add_name->set_h_size_flags(SIZE_EXPAND_FILL); - autoload_add_name->connect("text_entered", this, "_autoload_text_entered"); - autoload_add_name->connect("text_changed", this, "_autoload_text_changed"); + autoload_add_name->connect_compat("text_entered", this, "_autoload_text_entered"); + autoload_add_name->connect_compat("text_changed", this, "_autoload_text_changed"); hbc->add_child(autoload_add_name); add_autoload = memnew(Button); add_autoload->set_text(TTR("Add")); - add_autoload->connect("pressed", this, "_autoload_add"); + add_autoload->connect_compat("pressed", this, "_autoload_add"); // The button will be enabled once a valid name is entered (either automatically or manually). add_autoload->set_disabled(true); hbc->add_child(add_autoload); @@ -882,10 +882,10 @@ EditorAutoloadSettings::EditorAutoloadSettings() { tree->set_column_expand(3, false); tree->set_column_min_width(3, 120 * EDSCALE); - tree->connect("cell_selected", this, "_autoload_selected"); - tree->connect("item_edited", this, "_autoload_edited"); - tree->connect("button_pressed", this, "_autoload_button_pressed"); - tree->connect("item_activated", this, "_autoload_activated"); + tree->connect_compat("cell_selected", this, "_autoload_selected"); + tree->connect_compat("item_edited", this, "_autoload_edited"); + tree->connect_compat("button_pressed", this, "_autoload_button_pressed"); + tree->connect_compat("item_activated", this, "_autoload_activated"); tree->set_v_size_flags(SIZE_EXPAND_FILL); add_child(tree, true); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 1468b8fc35..c3592d3f06 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -1024,7 +1024,7 @@ void EditorSelection::add_node(Node *p_node) { } selection[p_node] = meta; - p_node->connect("tree_exiting", this, "_node_removed", varray(p_node), CONNECT_ONESHOT); + p_node->connect_compat("tree_exiting", this, "_node_removed", varray(p_node), CONNECT_ONESHOT); //emit_signal("selection_changed"); } @@ -1042,7 +1042,7 @@ void EditorSelection::remove_node(Node *p_node) { if (meta) memdelete(meta); selection.erase(p_node); - p_node->disconnect("tree_exiting", this, "_node_removed"); + p_node->disconnect_compat("tree_exiting", this, "_node_removed"); //emit_signal("selection_changed"); } bool EditorSelection::is_selected(Node *p_node) const { diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index 09e63f70b4..841ad250a4 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -82,21 +82,21 @@ void EditorDirDialog::reload(const String &p_path) { void EditorDirDialog::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "reload"); + EditorFileSystem::get_singleton()->connect_compat("filesystem_changed", this, "reload"); reload(); - if (!tree->is_connected("item_collapsed", this, "_item_collapsed")) { - tree->connect("item_collapsed", this, "_item_collapsed", varray(), CONNECT_DEFERRED); + if (!tree->is_connected_compat("item_collapsed", this, "_item_collapsed")) { + tree->connect_compat("item_collapsed", this, "_item_collapsed", varray(), CONNECT_DEFERRED); } - if (!EditorFileSystem::get_singleton()->is_connected("filesystem_changed", this, "reload")) { - EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "reload"); + if (!EditorFileSystem::get_singleton()->is_connected_compat("filesystem_changed", this, "reload")) { + EditorFileSystem::get_singleton()->connect_compat("filesystem_changed", this, "reload"); } } if (p_what == NOTIFICATION_EXIT_TREE) { - if (EditorFileSystem::get_singleton()->is_connected("filesystem_changed", this, "reload")) { - EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "reload"); + if (EditorFileSystem::get_singleton()->is_connected_compat("filesystem_changed", this, "reload")) { + EditorFileSystem::get_singleton()->disconnect_compat("filesystem_changed", this, "reload"); } } @@ -186,10 +186,10 @@ EditorDirDialog::EditorDirDialog() { tree = memnew(Tree); add_child(tree); - tree->connect("item_activated", this, "_ok"); + tree->connect_compat("item_activated", this, "_ok"); makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel(), "makedir"); - makedir->connect("pressed", this, "_make_dir"); + makedir->connect_compat("pressed", this, "_make_dir"); makedialog = memnew(ConfirmationDialog); makedialog->set_title(TTR("Create Folder")); @@ -202,7 +202,7 @@ EditorDirDialog::EditorDirDialog() { makedirname = memnew(LineEdit); makevb->add_margin_child(TTR("Name:"), makedirname); makedialog->register_text_enter(makedirname); - makedialog->connect("confirmed", this, "_make_dir_confirm"); + makedialog->connect_compat("confirmed", this, "_make_dir_confirm"); mkdirerr = memnew(AcceptDialog); mkdirerr->set_text(TTR("Could not create folder.")); diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 47ed6a15bb..827b9111f3 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1416,7 +1416,7 @@ EditorExport::EditorExport() { add_child(save_timer); save_timer->set_wait_time(0.8); save_timer->set_one_shot(true); - save_timer->connect("timeout", this, "_save"); + save_timer->connect_compat("timeout", this, "_save"); block_save = false; singleton = this; diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 559a0ef0ea..32fadfc60e 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -534,7 +534,7 @@ void EditorFeatureProfileManager::_class_list_item_selected() { } Variant md = item->get_metadata(0); - if (md.get_type() != Variant::STRING) { + if (md.get_type() != Variant::STRING && md.get_type() != Variant::STRING_NAME) { return; } @@ -598,7 +598,7 @@ void EditorFeatureProfileManager::_class_list_item_edited() { bool checked = item->is_checked(0); Variant md = item->get_metadata(0); - if (md.get_type() == Variant::STRING) { + if (md.get_type() == Variant::STRING || md.get_type() == Variant::STRING_NAME) { String class_selected = md; edited->set_disable_class(class_selected, !checked); _save_and_update(); @@ -620,7 +620,7 @@ void EditorFeatureProfileManager::_property_item_edited() { } Variant md = class_item->get_metadata(0); - if (md.get_type() != Variant::STRING) { + if (md.get_type() != Variant::STRING && md.get_type() != Variant::STRING_NAME) { return; } @@ -633,7 +633,7 @@ void EditorFeatureProfileManager::_property_item_edited() { bool checked = item->is_checked(0); md = item->get_metadata(0); - if (md.get_type() == Variant::STRING) { + if (md.get_type() == Variant::STRING || md.get_type() == Variant::STRING_NAME) { String property_selected = md; edited->set_disable_class_property(class_name, property_selected, !checked); _save_and_update(); @@ -657,7 +657,7 @@ void EditorFeatureProfileManager::_update_selected_profile() { if (class_list->get_selected()) { Variant md = class_list->get_selected()->get_metadata(0); - if (md.get_type() == Variant::STRING) { + if (md.get_type() == Variant::STRING || md.get_type() == Variant::STRING_NAME) { class_selected = md; } else if (md.get_type() == Variant::INT) { feature_selected = md; @@ -819,7 +819,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { profile_actions[PROFILE_CLEAR] = memnew(Button(TTR("Unset"))); name_hbc->add_child(profile_actions[PROFILE_CLEAR]); profile_actions[PROFILE_CLEAR]->set_disabled(true); - profile_actions[PROFILE_CLEAR]->connect("pressed", this, "_profile_action", varray(PROFILE_CLEAR)); + profile_actions[PROFILE_CLEAR]->connect_compat("pressed", this, "_profile_action", varray(PROFILE_CLEAR)); main_vbc->add_margin_child(TTR("Current Profile:"), name_hbc); @@ -827,34 +827,34 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { profile_list = memnew(OptionButton); profile_list->set_h_size_flags(SIZE_EXPAND_FILL); profiles_hbc->add_child(profile_list); - profile_list->connect("item_selected", this, "_profile_selected"); + profile_list->connect_compat("item_selected", this, "_profile_selected"); profile_actions[PROFILE_SET] = memnew(Button(TTR("Make Current"))); profiles_hbc->add_child(profile_actions[PROFILE_SET]); profile_actions[PROFILE_SET]->set_disabled(true); - profile_actions[PROFILE_SET]->connect("pressed", this, "_profile_action", varray(PROFILE_SET)); + profile_actions[PROFILE_SET]->connect_compat("pressed", this, "_profile_action", varray(PROFILE_SET)); profile_actions[PROFILE_ERASE] = memnew(Button(TTR("Remove"))); profiles_hbc->add_child(profile_actions[PROFILE_ERASE]); profile_actions[PROFILE_ERASE]->set_disabled(true); - profile_actions[PROFILE_ERASE]->connect("pressed", this, "_profile_action", varray(PROFILE_ERASE)); + profile_actions[PROFILE_ERASE]->connect_compat("pressed", this, "_profile_action", varray(PROFILE_ERASE)); profiles_hbc->add_child(memnew(VSeparator)); profile_actions[PROFILE_NEW] = memnew(Button(TTR("New"))); profiles_hbc->add_child(profile_actions[PROFILE_NEW]); - profile_actions[PROFILE_NEW]->connect("pressed", this, "_profile_action", varray(PROFILE_NEW)); + profile_actions[PROFILE_NEW]->connect_compat("pressed", this, "_profile_action", varray(PROFILE_NEW)); profiles_hbc->add_child(memnew(VSeparator)); profile_actions[PROFILE_IMPORT] = memnew(Button(TTR("Import"))); profiles_hbc->add_child(profile_actions[PROFILE_IMPORT]); - profile_actions[PROFILE_IMPORT]->connect("pressed", this, "_profile_action", varray(PROFILE_IMPORT)); + profile_actions[PROFILE_IMPORT]->connect_compat("pressed", this, "_profile_action", varray(PROFILE_IMPORT)); profile_actions[PROFILE_EXPORT] = memnew(Button(TTR("Export"))); profiles_hbc->add_child(profile_actions[PROFILE_EXPORT]); profile_actions[PROFILE_EXPORT]->set_disabled(true); - profile_actions[PROFILE_EXPORT]->connect("pressed", this, "_profile_action", varray(PROFILE_EXPORT)); + profile_actions[PROFILE_EXPORT]->connect_compat("pressed", this, "_profile_action", varray(PROFILE_EXPORT)); main_vbc->add_margin_child(TTR("Available Profiles:"), profiles_hbc); @@ -870,8 +870,8 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { class_list_vbc->add_margin_child(TTR("Enabled Classes:"), class_list, true); class_list->set_hide_root(true); class_list->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); - class_list->connect("cell_selected", this, "_class_list_item_selected"); - class_list->connect("item_edited", this, "_class_list_item_edited", varray(), CONNECT_DEFERRED); + class_list->connect_compat("cell_selected", this, "_class_list_item_selected"); + class_list->connect_compat("item_edited", this, "_class_list_item_edited", varray(), CONNECT_DEFERRED); VBoxContainer *property_list_vbc = memnew(VBoxContainer); h_split->add_child(property_list_vbc); @@ -882,7 +882,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { property_list->set_hide_root(true); property_list->set_hide_folding(true); property_list->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); - property_list->connect("item_edited", this, "_property_item_edited", varray(), CONNECT_DEFERRED); + property_list->connect_compat("item_edited", this, "_property_item_edited", varray(), CONNECT_DEFERRED); new_profile_dialog = memnew(ConfirmationDialog); new_profile_dialog->set_title(TTR("New profile name:")); @@ -890,20 +890,20 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { new_profile_dialog->add_child(new_profile_name); new_profile_name->set_custom_minimum_size(Size2(300 * EDSCALE, 1)); add_child(new_profile_dialog); - new_profile_dialog->connect("confirmed", this, "_create_new_profile"); + new_profile_dialog->connect_compat("confirmed", this, "_create_new_profile"); new_profile_dialog->register_text_enter(new_profile_name); new_profile_dialog->get_ok()->set_text(TTR("Create")); erase_profile_dialog = memnew(ConfirmationDialog); add_child(erase_profile_dialog); erase_profile_dialog->set_title(TTR("Erase Profile")); - erase_profile_dialog->connect("confirmed", this, "_erase_selected_profile"); + erase_profile_dialog->connect_compat("confirmed", this, "_erase_selected_profile"); import_profiles = memnew(EditorFileDialog); add_child(import_profiles); import_profiles->set_mode(EditorFileDialog::MODE_OPEN_FILES); import_profiles->add_filter("*.profile; " + TTR("Godot Feature Profile")); - import_profiles->connect("files_selected", this, "_import_profiles"); + import_profiles->connect_compat("files_selected", this, "_import_profiles"); import_profiles->set_title(TTR("Import Profile(s)")); import_profiles->set_access(EditorFileDialog::ACCESS_FILESYSTEM); @@ -911,7 +911,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { add_child(export_profile); export_profile->set_mode(EditorFileDialog::MODE_SAVE_FILE); export_profile->add_filter("*.profile; " + TTR("Godot Feature Profile")); - export_profile->connect("file_selected", this, "_export_profile"); + export_profile->connect_compat("file_selected", this, "_export_profile"); export_profile->set_title(TTR("Export Profile")); export_profile->set_access(EditorFileDialog::ACCESS_FILESYSTEM); @@ -921,7 +921,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { update_timer = memnew(Timer); update_timer->set_wait_time(1); //wait a second before updating editor add_child(update_timer); - update_timer->connect("timeout", this, "_emit_current_profile_changed"); + update_timer->connect_compat("timeout", this, "_emit_current_profile_changed"); update_timer->set_one_shot(true); updating_features = false; diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 8858db48df..dd6523e12c 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1537,9 +1537,9 @@ EditorFileDialog::EditorFileDialog() { pathhb->add_child(dir_next); pathhb->add_child(dir_up); - dir_prev->connect("pressed", this, "_go_back"); - dir_next->connect("pressed", this, "_go_forward"); - dir_up->connect("pressed", this, "_go_up"); + dir_prev->connect_compat("pressed", this, "_go_back"); + dir_next->connect_compat("pressed", this, "_go_forward"); + dir_up->connect_compat("pressed", this, "_go_up"); pathhb->add_child(memnew(Label(TTR("Path:")))); @@ -1549,20 +1549,20 @@ EditorFileDialog::EditorFileDialog() { refresh = memnew(ToolButton); refresh->set_tooltip(TTR("Refresh files.")); - refresh->connect("pressed", this, "_update_file_list"); + refresh->connect_compat("pressed", this, "_update_file_list"); pathhb->add_child(refresh); favorite = memnew(ToolButton); favorite->set_toggle_mode(true); favorite->set_tooltip(TTR("(Un)favorite current folder.")); - favorite->connect("pressed", this, "_favorite_pressed"); + favorite->connect_compat("pressed", this, "_favorite_pressed"); pathhb->add_child(favorite); show_hidden = memnew(ToolButton); show_hidden->set_toggle_mode(true); show_hidden->set_pressed(is_showing_hidden_files()); show_hidden->set_tooltip(TTR("Toggle the visibility of hidden files.")); - show_hidden->connect("toggled", this, "set_show_hidden_files"); + show_hidden->connect_compat("toggled", this, "set_show_hidden_files"); pathhb->add_child(show_hidden); pathhb->add_child(memnew(VSeparator)); @@ -1571,7 +1571,7 @@ EditorFileDialog::EditorFileDialog() { view_mode_group.instance(); mode_thumbnails = memnew(ToolButton); - mode_thumbnails->connect("pressed", this, "set_display_mode", varray(DISPLAY_THUMBNAILS)); + mode_thumbnails->connect_compat("pressed", this, "set_display_mode", varray(DISPLAY_THUMBNAILS)); mode_thumbnails->set_toggle_mode(true); mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS); mode_thumbnails->set_button_group(view_mode_group); @@ -1579,7 +1579,7 @@ EditorFileDialog::EditorFileDialog() { pathhb->add_child(mode_thumbnails); mode_list = memnew(ToolButton); - mode_list->connect("pressed", this, "set_display_mode", varray(DISPLAY_LIST)); + mode_list->connect_compat("pressed", this, "set_display_mode", varray(DISPLAY_LIST)); mode_list->set_toggle_mode(true); mode_list->set_pressed(display_mode == DISPLAY_LIST); mode_list->set_button_group(view_mode_group); @@ -1588,11 +1588,11 @@ EditorFileDialog::EditorFileDialog() { drives = memnew(OptionButton); pathhb->add_child(drives); - drives->connect("item_selected", this, "_select_drive"); + drives->connect_compat("item_selected", this, "_select_drive"); makedir = memnew(Button); makedir->set_text(TTR("Create Folder")); - makedir->connect("pressed", this, "_make_dir"); + makedir->connect_compat("pressed", this, "_make_dir"); pathhb->add_child(makedir); list_hb = memnew(HSplitContainer); @@ -1614,15 +1614,15 @@ EditorFileDialog::EditorFileDialog() { fav_hb->add_spacer(); fav_up = memnew(ToolButton); fav_hb->add_child(fav_up); - fav_up->connect("pressed", this, "_favorite_move_up"); + fav_up->connect_compat("pressed", this, "_favorite_move_up"); fav_down = memnew(ToolButton); fav_hb->add_child(fav_down); - fav_down->connect("pressed", this, "_favorite_move_down"); + fav_down->connect_compat("pressed", this, "_favorite_move_down"); favorites = memnew(ItemList); fav_vb->add_child(favorites); favorites->set_v_size_flags(SIZE_EXPAND_FILL); - favorites->connect("item_selected", this, "_favorite_selected"); + favorites->connect_compat("item_selected", this, "_favorite_selected"); VBoxContainer *rec_vb = memnew(VBoxContainer); vsc->add_child(rec_vb); @@ -1631,7 +1631,7 @@ EditorFileDialog::EditorFileDialog() { recent = memnew(ItemList); recent->set_allow_reselect(true); rec_vb->add_margin_child(TTR("Recent:"), recent, true); - recent->connect("item_selected", this, "_recent_selected"); + recent->connect_compat("item_selected", this, "_recent_selected"); VBoxContainer *item_vb = memnew(VBoxContainer); list_hb->add_child(item_vb); @@ -1650,13 +1650,13 @@ EditorFileDialog::EditorFileDialog() { item_list = memnew(ItemList); item_list->set_v_size_flags(SIZE_EXPAND_FILL); - item_list->connect("item_rmb_selected", this, "_item_list_item_rmb_selected"); - item_list->connect("rmb_clicked", this, "_item_list_rmb_clicked"); + item_list->connect_compat("item_rmb_selected", this, "_item_list_item_rmb_selected"); + item_list->connect_compat("rmb_clicked", this, "_item_list_rmb_clicked"); item_list->set_allow_rmb_select(true); list_vb->add_child(item_list); item_menu = memnew(PopupMenu); - item_menu->connect("id_pressed", this, "_item_menu_id_pressed"); + item_menu->connect_compat("id_pressed", this, "_item_menu_id_pressed"); add_child(item_menu); // Other stuff. @@ -1687,19 +1687,19 @@ EditorFileDialog::EditorFileDialog() { access = ACCESS_RESOURCES; _update_drives(); - connect("confirmed", this, "_action_pressed"); - item_list->connect("item_selected", this, "_item_selected", varray(), CONNECT_DEFERRED); - item_list->connect("multi_selected", this, "_multi_selected", varray(), CONNECT_DEFERRED); - item_list->connect("item_activated", this, "_item_db_selected", varray()); - item_list->connect("nothing_selected", this, "_items_clear_selection"); - dir->connect("text_entered", this, "_dir_entered"); - file->connect("text_entered", this, "_file_entered"); - filter->connect("item_selected", this, "_filter_selected"); + connect_compat("confirmed", this, "_action_pressed"); + item_list->connect_compat("item_selected", this, "_item_selected", varray(), CONNECT_DEFERRED); + item_list->connect_compat("multi_selected", this, "_multi_selected", varray(), CONNECT_DEFERRED); + item_list->connect_compat("item_activated", this, "_item_db_selected", varray()); + item_list->connect_compat("nothing_selected", this, "_items_clear_selection"); + dir->connect_compat("text_entered", this, "_dir_entered"); + file->connect_compat("text_entered", this, "_file_entered"); + filter->connect_compat("item_selected", this, "_filter_selected"); confirm_save = memnew(ConfirmationDialog); confirm_save->set_as_toplevel(true); add_child(confirm_save); - confirm_save->connect("confirmed", this, "_save_confirm_pressed"); + confirm_save->connect_compat("confirmed", this, "_save_confirm_pressed"); remove_dialog = memnew(DependencyRemoveDialog); add_child(remove_dialog); @@ -1713,7 +1713,7 @@ EditorFileDialog::EditorFileDialog() { makevb->add_margin_child(TTR("Name:"), makedirname); add_child(makedialog); makedialog->register_text_enter(makedirname); - makedialog->connect("confirmed", this, "_make_dir_confirm"); + makedialog->connect_compat("confirmed", this, "_make_dir_confirm"); mkdirerr = memnew(AcceptDialog); mkdirerr->set_text(TTR("Could not create folder.")); add_child(mkdirerr); @@ -1777,10 +1777,10 @@ EditorLineEditFileChooser::EditorLineEditFileChooser() { line_edit->set_h_size_flags(SIZE_EXPAND_FILL); button = memnew(Button); add_child(button); - button->connect("pressed", this, "_browse"); + button->connect_compat("pressed", this, "_browse"); dialog = memnew(EditorFileDialog); add_child(dialog); - dialog->connect("file_selected", this, "_chosen"); - dialog->connect("dir_selected", this, "_chosen"); - dialog->connect("files_selected", this, "_chosen"); + dialog->connect_compat("file_selected", this, "_chosen"); + dialog->connect_compat("dir_selected", this, "_chosen"); + dialog->connect_compat("files_selected", this, "_chosen"); } diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 0ade4c5c80..9c64540a9e 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1551,9 +1551,9 @@ EditorHelp::EditorHelp() { class_desc->set_v_size_flags(SIZE_EXPAND_FILL); class_desc->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); - class_desc->connect("meta_clicked", this, "_class_desc_select"); - class_desc->connect("gui_input", this, "_class_desc_input"); - class_desc->connect("resized", this, "_class_desc_resized"); + class_desc->connect_compat("meta_clicked", this, "_class_desc_select"); + class_desc->connect_compat("gui_input", this, "_class_desc_input"); + class_desc->connect_compat("resized", this, "_class_desc_resized"); _class_desc_resized(); // Added second so it opens at the bottom so it won't offset the entire widget. @@ -1633,7 +1633,7 @@ EditorHelpBit::EditorHelpBit() { rich_text = memnew(RichTextLabel); add_child(rich_text); - rich_text->connect("meta_clicked", this, "_meta_clicked"); + rich_text->connect_compat("meta_clicked", this, "_meta_clicked"); rich_text->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); rich_text->set_override_selected_font_color(false); set_custom_minimum_size(Size2(0, 70 * EDSCALE)); @@ -1645,8 +1645,8 @@ FindBar::FindBar() { add_child(search_text); search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); search_text->set_h_size_flags(SIZE_EXPAND_FILL); - search_text->connect("text_changed", this, "_search_text_changed"); - search_text->connect("text_entered", this, "_search_text_entered"); + search_text->connect_compat("text_changed", this, "_search_text_changed"); + search_text->connect_compat("text_entered", this, "_search_text_entered"); matches_label = memnew(Label); add_child(matches_label); @@ -1655,12 +1655,12 @@ FindBar::FindBar() { find_prev = memnew(ToolButton); add_child(find_prev); find_prev->set_focus_mode(FOCUS_NONE); - find_prev->connect("pressed", this, "_search_prev"); + find_prev->connect_compat("pressed", this, "_search_prev"); find_next = memnew(ToolButton); add_child(find_next); find_next->set_focus_mode(FOCUS_NONE); - find_next->connect("pressed", this, "_search_next"); + find_next->connect_compat("pressed", this, "_search_next"); Control *space = memnew(Control); add_child(space); @@ -1671,7 +1671,7 @@ FindBar::FindBar() { hide_button->set_focus_mode(FOCUS_NONE); hide_button->set_expand(true); hide_button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED); - hide_button->connect("pressed", this, "_hide_pressed"); + hide_button->connect_compat("pressed", this, "_hide_pressed"); } void FindBar::popup_search() { diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index d45b66afce..8bad46e4d0 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -111,7 +111,7 @@ void EditorHelpSearch::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_confirmed"); + connect_compat("confirmed", this, "_confirmed"); _update_icons(); } break; case NOTIFICATION_POPUP_HIDE: { @@ -206,21 +206,21 @@ EditorHelpSearch::EditorHelpSearch() { search_box = memnew(LineEdit); search_box->set_custom_minimum_size(Size2(200, 0) * EDSCALE); search_box->set_h_size_flags(SIZE_EXPAND_FILL); - search_box->connect("gui_input", this, "_search_box_gui_input"); - search_box->connect("text_changed", this, "_search_box_text_changed"); + search_box->connect_compat("gui_input", this, "_search_box_gui_input"); + search_box->connect_compat("text_changed", this, "_search_box_text_changed"); register_text_enter(search_box); hbox->add_child(search_box); case_sensitive_button = memnew(ToolButton); case_sensitive_button->set_tooltip(TTR("Case Sensitive")); - case_sensitive_button->connect("pressed", this, "_update_results"); + case_sensitive_button->connect_compat("pressed", this, "_update_results"); case_sensitive_button->set_toggle_mode(true); case_sensitive_button->set_focus_mode(FOCUS_NONE); hbox->add_child(case_sensitive_button); hierarchy_button = memnew(ToolButton); hierarchy_button->set_tooltip(TTR("Show Hierarchy")); - hierarchy_button->connect("pressed", this, "_update_results"); + hierarchy_button->connect_compat("pressed", this, "_update_results"); hierarchy_button->set_toggle_mode(true); hierarchy_button->set_pressed(true); hierarchy_button->set_focus_mode(FOCUS_NONE); @@ -237,7 +237,7 @@ EditorHelpSearch::EditorHelpSearch() { filter_combo->add_item(TTR("Constants Only"), SEARCH_CONSTANTS); filter_combo->add_item(TTR("Properties Only"), SEARCH_PROPERTIES); filter_combo->add_item(TTR("Theme Properties Only"), SEARCH_THEME_ITEMS); - filter_combo->connect("item_selected", this, "_filter_combo_item_selected"); + filter_combo->connect_compat("item_selected", this, "_filter_combo_item_selected"); hbox->add_child(filter_combo); // Create the results tree. @@ -251,8 +251,8 @@ EditorHelpSearch::EditorHelpSearch() { results_tree->set_custom_minimum_size(Size2(0, 100) * EDSCALE); results_tree->set_hide_root(true); results_tree->set_select_mode(Tree::SELECT_ROW); - results_tree->connect("item_activated", this, "_confirmed"); - results_tree->connect("item_selected", get_ok(), "set_disabled", varray(false)); + results_tree->connect_compat("item_activated", this, "_confirmed"); + results_tree->connect_compat("item_selected", get_ok(), "set_disabled", varray(false)); vbox->add_child(results_tree, true); } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index b16ec26fd1..adf6a42f53 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -430,7 +430,7 @@ bool EditorPropertyRevert::is_node_property_different(Node *p_node, const Varian return false; //pointless to check if we are not comparing against anything. } - if (p_current.get_type() == Variant::REAL && p_orig.get_type() == Variant::REAL) { + if (p_current.get_type() == Variant::FLOAT && p_orig.get_type() == Variant::FLOAT) { float a = p_current; float b = p_orig; @@ -570,7 +570,7 @@ void EditorProperty::_focusable_focused(int p_index) { void EditorProperty::add_focusable(Control *p_control) { - p_control->connect("focus_entered", this, "_focusable_focused", varray(focusables.size())); + p_control->connect_compat("focus_entered", this, "_focusable_focused", varray(focusables.size())); focusables.push_back(p_control); } @@ -778,10 +778,20 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const { help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel")); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); - String text = TTR("Property:") + " [u][b]" + p_text.get_slice("::", 0) + "[/b][/u]\n"; - text += p_text.get_slice("::", 1).strip_edges(); - help_bit->set_text(text); - help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene + PackedStringArray slices = p_text.split("::", false); + if (!slices.empty()) { + String property_name = slices[0].strip_edges(); + String text = TTR("Property:") + " [u][b]" + property_name + "[/b][/u]"; + + if (slices.size() > 1) { + String property_doc = slices[1].strip_edges(); + if (property_name != property_doc) { + text += "\n" + property_doc; + } + } + help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene + } + return help_bit; } @@ -828,13 +838,13 @@ void EditorProperty::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "checked"), "set_checked", "is_checked"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_red"), "set_draw_red", "is_draw_red"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keying"), "set_keying", "is_keying"); - ADD_SIGNAL(MethodInfo("property_changed", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT))); + ADD_SIGNAL(MethodInfo("property_changed", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT))); ADD_SIGNAL(MethodInfo("multiple_properties_changed", PropertyInfo(Variant::PACKED_STRING_ARRAY, "properties"), PropertyInfo(Variant::ARRAY, "value"))); - ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING, "property"))); - ADD_SIGNAL(MethodInfo("property_keyed_with_value", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT))); - ADD_SIGNAL(MethodInfo("property_checked", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::STRING, "bool"))); + ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING_NAME, "property"))); + ADD_SIGNAL(MethodInfo("property_keyed_with_value", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT))); + ADD_SIGNAL(MethodInfo("property_checked", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::STRING, "bool"))); ADD_SIGNAL(MethodInfo("resource_selected", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource"))); - ADD_SIGNAL(MethodInfo("object_id_selected", PropertyInfo(Variant::STRING, "property"), PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("object_id_selected", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::INT, "id"))); ADD_SIGNAL(MethodInfo("selected", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::INT, "focusable_idx"))); MethodInfo vm; @@ -925,7 +935,7 @@ bool EditorInspectorPlugin::parse_property(Object *p_object, Variant::Type p_typ &arg[0], &arg[1], &arg[2], &arg[3], &arg[4], &arg[5] }; - Variant::CallError err; + Callable::CallError err; return get_script_instance()->call("parse_property", (const Variant **)&argptr, 6, err); } return false; @@ -1005,10 +1015,20 @@ Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) cons help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel")); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); - String text = "[u][b]" + p_text.get_slice("::", 0) + "[/b][/u]\n"; - text += p_text.get_slice("::", 1).strip_edges(); - help_bit->set_text(text); - help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene + PackedStringArray slices = p_text.split("::", false); + if (!slices.empty()) { + String property_name = slices[0].strip_edges(); + String text = "[u][b]" + property_name + "[/b][/u]"; + + if (slices.size() > 1) { + String property_doc = slices[1].strip_edges(); + if (property_name != property_doc) { + text += "\n" + property_doc; + } + } + help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene + } + return help_bit; } @@ -1339,14 +1359,14 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<Edit if (ep) { ep->object = object; - ep->connect("property_changed", this, "_property_changed"); - ep->connect("property_keyed", this, "_property_keyed"); - ep->connect("property_keyed_with_value", this, "_property_keyed_with_value"); - ep->connect("property_checked", this, "_property_checked"); - ep->connect("selected", this, "_property_selected"); - ep->connect("multiple_properties_changed", this, "_multiple_properties_changed"); - ep->connect("resource_selected", this, "_resource_selected", varray(), CONNECT_DEFERRED); - ep->connect("object_id_selected", this, "_object_id_selected", varray(), CONNECT_DEFERRED); + ep->connect_compat("property_changed", this, "_property_changed"); + ep->connect_compat("property_keyed", this, "_property_keyed"); + ep->connect_compat("property_keyed_with_value", this, "_property_keyed_with_value"); + ep->connect_compat("property_checked", this, "_property_checked"); + ep->connect_compat("selected", this, "_property_selected"); + ep->connect_compat("multiple_properties_changed", this, "_multiple_properties_changed"); + ep->connect_compat("resource_selected", this, "_resource_selected", varray(), CONNECT_DEFERRED); + ep->connect_compat("object_id_selected", this, "_object_id_selected", varray(), CONNECT_DEFERRED); if (F->get().properties.size()) { @@ -1751,17 +1771,17 @@ void EditorInspector::update_tree() { if (ep) { - ep->connect("property_changed", this, "_property_changed"); + ep->connect_compat("property_changed", this, "_property_changed"); if (p.usage & PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED) { - ep->connect("property_changed", this, "_property_changed_update_all", varray(), CONNECT_DEFERRED); + ep->connect_compat("property_changed", this, "_property_changed_update_all", varray(), CONNECT_DEFERRED); } - ep->connect("property_keyed", this, "_property_keyed"); - ep->connect("property_keyed_with_value", this, "_property_keyed_with_value"); - ep->connect("property_checked", this, "_property_checked"); - ep->connect("selected", this, "_property_selected"); - ep->connect("multiple_properties_changed", this, "_multiple_properties_changed"); - ep->connect("resource_selected", this, "_resource_selected", varray(), CONNECT_DEFERRED); - ep->connect("object_id_selected", this, "_object_id_selected", varray(), CONNECT_DEFERRED); + ep->connect_compat("property_keyed", this, "_property_keyed"); + ep->connect_compat("property_keyed_with_value", this, "_property_keyed_with_value"); + ep->connect_compat("property_checked", this, "_property_checked"); + ep->connect_compat("selected", this, "_property_selected"); + ep->connect_compat("multiple_properties_changed", this, "_multiple_properties_changed"); + ep->connect_compat("resource_selected", this, "_resource_selected", varray(), CONNECT_DEFERRED); + ep->connect_compat("object_id_selected", this, "_object_id_selected", varray(), CONNECT_DEFERRED); if (doc_hint != String()) { ep->set_tooltip(property_prefix + p.name + "::" + doc_hint); } else { @@ -1889,7 +1909,7 @@ void EditorInspector::set_use_filter(bool p_use) { void EditorInspector::register_text_enter(Node *p_line_edit) { search_box = Object::cast_to<LineEdit>(p_line_edit); if (search_box) - search_box->connect("text_changed", this, "_filter_changed"); + search_box->connect_compat("text_changed", this, "_filter_changed"); } void EditorInspector::_filter_changed(const String &p_text) { @@ -2109,7 +2129,7 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) { object->get_property_list(&pinfo); for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) { if (E->get().name == p_path) { - Variant::CallError ce; + Callable::CallError ce; to_create = Variant::construct(E->get().type, NULL, 0, ce); break; } @@ -2165,7 +2185,7 @@ void EditorInspector::_node_removed(Node *p_node) { void EditorInspector::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { - EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", this, "_feature_profile_changed"); + EditorFeatureProfileManager::get_singleton()->connect_compat("current_feature_profile_changed", this, "_feature_profile_changed"); } if (p_what == NOTIFICATION_ENTER_TREE) { @@ -2174,7 +2194,7 @@ void EditorInspector::_notification(int p_what) { add_style_override("bg", get_stylebox("sub_inspector_bg", "Editor")); } else { add_style_override("bg", get_stylebox("bg", "Tree")); - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); } } if (p_what == NOTIFICATION_PREDELETE) { @@ -2183,7 +2203,7 @@ void EditorInspector::_notification(int p_what) { if (p_what == NOTIFICATION_EXIT_TREE) { if (!sub_inspector) { - get_tree()->disconnect("node_removed", this, "_node_removed"); + get_tree()->disconnect_compat("node_removed", this, "_node_removed"); } edit(NULL); } @@ -2337,6 +2357,6 @@ EditorInspector::EditorInspector() { property_focusable = -1; sub_inspector = false; - get_v_scrollbar()->connect("value_changed", this, "_vscroll_changed"); + get_v_scrollbar()->connect_compat("value_changed", this, "_vscroll_changed"); update_scroll_request = -1; } diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp index 727e758341..05a5df45a9 100644 --- a/editor/editor_layouts_dialog.cpp +++ b/editor/editor_layouts_dialog.cpp @@ -128,8 +128,8 @@ EditorLayoutsDialog::EditorLayoutsDialog() { name->set_margin(MARGIN_TOP, 5); name->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); name->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5); - name->connect("gui_input", this, "_line_gui_input"); - name->connect("focus_entered", layout_names, "unselect_all"); + name->connect_compat("gui_input", this, "_line_gui_input"); + name->connect_compat("focus_entered", layout_names, "unselect_all"); } void EditorLayoutsDialog::set_name_line_enabled(bool p_enabled) { diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 5b77db7707..ca755a6cb7 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -159,13 +159,13 @@ EditorLog::EditorLog() { hb->add_child(copybutton); copybutton->set_text(TTR("Copy")); copybutton->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KEY_MASK_CMD | KEY_C)); - copybutton->connect("pressed", this, "_copy_request"); + copybutton->connect_compat("pressed", this, "_copy_request"); clearbutton = memnew(Button); hb->add_child(clearbutton); clearbutton->set_text(TTR("Clear")); clearbutton->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_K)); - clearbutton->connect("pressed", this, "_clear_request"); + clearbutton->connect_compat("pressed", this, "_clear_request"); log = memnew(RichTextLabel); log->set_scroll_follow(true); diff --git a/editor/editor_network_profiler.cpp b/editor/editor_network_profiler.cpp index 1b80743237..1dffafa359 100644 --- a/editor/editor_network_profiler.cpp +++ b/editor/editor_network_profiler.cpp @@ -142,12 +142,12 @@ EditorNetworkProfiler::EditorNetworkProfiler() { activate = memnew(Button); activate->set_toggle_mode(true); activate->set_text(TTR("Start")); - activate->connect("pressed", this, "_activate_pressed"); + activate->connect_compat("pressed", this, "_activate_pressed"); hb->add_child(activate); clear_button = memnew(Button); clear_button->set_text(TTR("Clear")); - clear_button->connect("pressed", this, "_clear_pressed"); + clear_button->connect_compat("pressed", this, "_clear_pressed"); hb->add_child(clear_button); hb->add_spacer(); @@ -207,5 +207,5 @@ EditorNetworkProfiler::EditorNetworkProfiler() { frame_delay->set_wait_time(0.1); frame_delay->set_one_shot(true); add_child(frame_delay); - frame_delay->connect("timeout", this, "_update_frame"); + frame_delay->connect_compat("timeout", this, "_update_frame"); } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 6a6485575f..9cc6134f27 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -123,6 +123,7 @@ #include "editor/plugins/cpu_particles_2d_editor_plugin.h" #include "editor/plugins/cpu_particles_editor_plugin.h" #include "editor/plugins/curve_editor_plugin.h" +#include "editor/plugins/debugger_editor_plugin.h" #include "editor/plugins/editor_preview_plugins.h" #include "editor/plugins/gi_probe_editor_plugin.h" #include "editor/plugins/gradient_editor_plugin.h" @@ -168,7 +169,6 @@ #include "editor/quick_open.h" #include "editor/register_exporters.h" #include "editor/run_settings_dialog.h" -#include "editor/script_editor_debugger.h" #include "editor/settings_config_dialog.h" #include <stdio.h> @@ -374,8 +374,8 @@ void EditorNode::_notification(int p_what) { get_tree()->get_root()->set_as_audio_listener(false); get_tree()->get_root()->set_as_audio_listener_2d(false); get_tree()->set_auto_accept_quit(false); - get_tree()->connect("files_dropped", this, "_dropped_files"); - get_tree()->connect("global_menu_action", this, "_global_menu_action"); + get_tree()->connect_compat("files_dropped", this, "_dropped_files"); + get_tree()->connect_compat("global_menu_action", this, "_global_menu_action"); /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ } break; @@ -472,7 +472,7 @@ void EditorNode::_notification(int p_what) { recent_scenes->set_as_minsize(); // debugger area - if (ScriptEditor::get_singleton()->get_debugger()->is_visible()) + if (EditorDebuggerNode::get_singleton()->is_visible()) bottom_panel->add_style_override("panel", gui_base->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); // update_icons @@ -1846,7 +1846,7 @@ void EditorNode::_edit_current() { Node *selected_node = NULL; - if (current_obj->is_class("ScriptEditorDebuggerInspectedObject")) { + if (current_obj->is_class("EditorDebuggerRemoteObject")) { editable_warning = TTR("This is a remote object, so changes to it won't be kept.\nPlease read the documentation relevant to debugging to better understand this workflow."); capitalize = false; disable_folding = true; @@ -2048,9 +2048,13 @@ void EditorNode::_run(bool p_current, const String &p_custom) { editor_data.get_editor_breakpoints(&breakpoints); args = ProjectSettings::get_singleton()->get("editor/main_run_args"); - skip_breakpoints = ScriptEditor::get_singleton()->get_debugger()->is_skip_breakpoints(); + skip_breakpoints = EditorDebuggerNode::get_singleton()->is_skip_breakpoints(); - Error error = editor_run.run(run_filename, args, breakpoints, skip_breakpoints); + int instances = 1; + if (debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(RUN_DEBUG_TWO))) + instances = 2; + + Error error = editor_run.run(run_filename, args, breakpoints, skip_breakpoints, instances); if (error != OK) { @@ -2174,7 +2178,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { break; } - FALLTHROUGH; + [[fallthrough]]; } case SCENE_TAB_CLOSE: case FILE_SAVE_SCENE: { @@ -2195,7 +2199,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { break; } - FALLTHROUGH; + [[fallthrough]]; } case FILE_SAVE_AS_SCENE: { int scene_idx = (p_option == FILE_SAVE_SCENE || p_option == FILE_SAVE_AS_SCENE) ? -1 : tab_closing; @@ -2481,6 +2485,16 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { run_settings_dialog->popup_run_settings(); } break; + case RUN_DEBUG_ONE: { + debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(RUN_DEBUG_ONE), true); + debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(RUN_DEBUG_TWO), false); + + } break; + case RUN_DEBUG_TWO: { + debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(RUN_DEBUG_TWO), true); + debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(RUN_DEBUG_ONE), false); + + } break; case RUN_SETTINGS: { project_settings->popup_project_settings(); @@ -2571,7 +2585,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { bool ischecked = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(RUN_LIVE_DEBUG)); debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(RUN_LIVE_DEBUG), !ischecked); - ScriptEditor::get_singleton()->get_debugger()->set_live_debugging(!ischecked); + EditorDebuggerNode::get_singleton()->set_live_debugging(!ischecked); EditorSettings::get_singleton()->set_project_metadata("debug_options", "run_live_debug", !ischecked); } break; @@ -2746,10 +2760,10 @@ void EditorNode::_tool_menu_option(int p_idx) { Object *handler = ObjectDB::get_instance(params[0]); String callback = params[1]; Variant *ud = ¶ms[2]; - Variant::CallError ce; + Callable::CallError ce; handler->call(callback, (const Variant **)&ud, 1, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { String err = Variant::get_call_error_text(handler, callback, (const Variant **)&ud, 1, ce); ERR_PRINT("Error calling function from tool menu: " + err); } @@ -2958,7 +2972,7 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed ToolButton *tb = memnew(ToolButton); tb->set_toggle_mode(true); - tb->connect("pressed", singleton, "_editor_select", varray(singleton->main_editor_buttons.size())); + tb->connect_compat("pressed", singleton, "_editor_select", varray(singleton->main_editor_buttons.size())); tb->set_text(p_editor->get_name()); Ref<Texture2D> icon = p_editor->get_icon(); @@ -3242,7 +3256,7 @@ void EditorNode::_set_main_scene_state(Dictionary p_state, Node *p_for_scene) { //this should only happen at the very end - ScriptEditor::get_singleton()->get_debugger()->update_live_edit_root(); + EditorDebuggerNode::get_singleton()->update_live_edit_root(); ScriptEditor::get_singleton()->set_scene_root_script(editor_data.get_scene_root_script(editor_data.get_edited_scene())); editor_data.notify_edited_scene_changed(); } @@ -3477,7 +3491,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b opening_prev = false; scene_tree_dock->set_selected(new_scene); - ScriptEditor::get_singleton()->get_debugger()->update_live_edit_root(); + EditorDebuggerNode::get_singleton()->update_live_edit_root(); push_item(new_scene); @@ -3619,7 +3633,7 @@ void EditorNode::_quick_run() { _run(false, quick_run->get_selected()); } -void EditorNode::notify_child_process_exited() { +void EditorNode::notify_all_debug_sessions_exited() { _menu_option_confirm(RUN_STOP, false); stop_button->set_pressed(false); @@ -3703,9 +3717,13 @@ void EditorNode::unregister_editor_types() { _init_callbacks.clear(); } -void EditorNode::stop_child_process() { +void EditorNode::stop_child_process(OS::ProcessID p_pid) { - _menu_option_confirm(RUN_STOP, false); + if (has_child_process(p_pid)) { + editor_run.stop_child_process(p_pid); + if (!editor_run.get_child_process_count()) // All children stopped. Closing. + _menu_option_confirm(RUN_STOP, false); + } } Ref<Script> EditorNode::get_object_custom_type_base(const Object *p_object) const { @@ -4785,7 +4803,7 @@ void EditorNode::_scene_tab_changed(int p_tab) { ToolButton *EditorNode::add_bottom_panel_item(String p_text, Control *p_item) { ToolButton *tb = memnew(ToolButton); - tb->connect("toggled", this, "_bottom_panel_switch", varray(bottom_panel_items.size())); + tb->connect_compat("toggled", this, "_bottom_panel_switch", varray(bottom_panel_items.size())); tb->set_text(p_text); tb->set_toggle_mode(true); tb->set_focus_mode(Control::FOCUS_NONE); @@ -4847,8 +4865,8 @@ void EditorNode::raise_bottom_panel_item(Control *p_item) { } for (int i = 0; i < bottom_panel_items.size(); i++) { - bottom_panel_items[i].button->disconnect("toggled", this, "_bottom_panel_switch"); - bottom_panel_items[i].button->connect("toggled", this, "_bottom_panel_switch", varray(i)); + bottom_panel_items[i].button->disconnect_compat("toggled", this, "_bottom_panel_switch"); + bottom_panel_items[i].button->connect_compat("toggled", this, "_bottom_panel_switch", varray(i)); } } @@ -4869,8 +4887,8 @@ void EditorNode::remove_bottom_panel_item(Control *p_item) { } for (int i = 0; i < bottom_panel_items.size(); i++) { - bottom_panel_items[i].button->disconnect("toggled", this, "_bottom_panel_switch"); - bottom_panel_items[i].button->connect("toggled", this, "_bottom_panel_switch", varray(i)); + bottom_panel_items[i].button->disconnect_compat("toggled", this, "_bottom_panel_switch"); + bottom_panel_items[i].button->connect_compat("toggled", this, "_bottom_panel_switch", varray(i)); } } @@ -4888,7 +4906,7 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { bottom_panel_items[i].button->set_pressed(i == p_idx); bottom_panel_items[i].control->set_visible(i == p_idx); } - if (ScriptEditor::get_singleton()->get_debugger() == bottom_panel_items[p_idx].control) { // this is the debug panel which uses tabs, so the top section should be smaller + if (EditorDebuggerNode::get_singleton() == bottom_panel_items[p_idx].control) { // this is the debug panel which uses tabs, so the top section should be smaller bottom_panel->add_style_override("panel", gui_base->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); } else { bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); @@ -5823,7 +5841,7 @@ EditorNode::EditorNode() { EDITOR_DEF_RST("interface/scene_tabs/show_thumbnail_on_hover", true); EDITOR_DEF_RST("interface/inspector/capitalize_properties", true); EDITOR_DEF_RST("interface/inspector/default_float_step", 0.001); - EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::REAL, "interface/inspector/default_float_step", PROPERTY_HINT_RANGE, "0,1,0")); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::FLOAT, "interface/inspector/default_float_step", PROPERTY_HINT_RANGE, "0,1,0")); EDITOR_DEF_RST("interface/inspector/disable_folding", false); EDITOR_DEF_RST("interface/inspector/auto_unfold_foreign_scenes", true); EDITOR_DEF("interface/inspector/horizontal_vector2_editing", false); @@ -5925,8 +5943,8 @@ EditorNode::EditorNode() { hsplits.push_back(right_hsplit); for (int i = 0; i < vsplits.size(); i++) { - vsplits[i]->connect("dragged", this, "_dock_split_dragged"); - hsplits[i]->connect("dragged", this, "_dock_split_dragged"); + vsplits[i]->connect_compat("dragged", this, "_dock_split_dragged"); + hsplits[i]->connect_compat("dragged", this, "_dock_split_dragged"); } dock_select_popup = memnew(PopupPanel); @@ -5938,7 +5956,7 @@ EditorNode::EditorNode() { dock_tab_move_left = memnew(ToolButton); dock_tab_move_left->set_icon(theme->get_icon("Back", "EditorIcons")); dock_tab_move_left->set_focus_mode(Control::FOCUS_NONE); - dock_tab_move_left->connect("pressed", this, "_dock_move_left"); + dock_tab_move_left->connect_compat("pressed", this, "_dock_move_left"); dock_hb->add_child(dock_tab_move_left); Label *dock_label = memnew(Label); @@ -5950,16 +5968,16 @@ EditorNode::EditorNode() { dock_tab_move_right = memnew(ToolButton); dock_tab_move_right->set_icon(theme->get_icon("Forward", "EditorIcons")); dock_tab_move_right->set_focus_mode(Control::FOCUS_NONE); - dock_tab_move_right->connect("pressed", this, "_dock_move_right"); + dock_tab_move_right->connect_compat("pressed", this, "_dock_move_right"); dock_hb->add_child(dock_tab_move_right); dock_vb->add_child(dock_hb); dock_select = memnew(Control); dock_select->set_custom_minimum_size(Size2(128, 64) * EDSCALE); - dock_select->connect("gui_input", this, "_dock_select_input"); - dock_select->connect("draw", this, "_dock_select_draw"); - dock_select->connect("mouse_exited", this, "_dock_popup_exit"); + dock_select->connect_compat("gui_input", this, "_dock_select_input"); + dock_select->connect_compat("draw", this, "_dock_select_draw"); + dock_select->connect_compat("mouse_exited", this, "_dock_popup_exit"); dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL); dock_vb->add_child(dock_select); @@ -5970,11 +5988,11 @@ EditorNode::EditorNode() { dock_slot[i]->set_custom_minimum_size(Size2(170, 0) * EDSCALE); dock_slot[i]->set_v_size_flags(Control::SIZE_EXPAND_FILL); dock_slot[i]->set_popup(dock_select_popup); - dock_slot[i]->connect("pre_popup_pressed", this, "_dock_pre_popup", varray(i)); + dock_slot[i]->connect_compat("pre_popup_pressed", this, "_dock_pre_popup", varray(i)); dock_slot[i]->set_tab_align(TabContainer::ALIGN_LEFT); dock_slot[i]->set_drag_to_rearrange_enabled(true); dock_slot[i]->set_tabs_rearrange_group(1); - dock_slot[i]->connect("tab_changed", this, "_dock_tab_changed"); + dock_slot[i]->connect_compat("tab_changed", this, "_dock_tab_changed"); dock_slot[i]->set_use_hidden_tabs_for_min_size(true); } @@ -5982,7 +6000,7 @@ EditorNode::EditorNode() { add_child(dock_drag_timer); dock_drag_timer->set_wait_time(0.5); dock_drag_timer->set_one_shot(true); - dock_drag_timer->connect("timeout", this, "_save_docks"); + dock_drag_timer->connect_compat("timeout", this, "_save_docks"); top_split = memnew(VSplitContainer); center_split->add_child(top_split); @@ -6015,21 +6033,21 @@ EditorNode::EditorNode() { scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/scene_tabs/always_show_close_button", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); scene_tabs->set_min_width(int(EDITOR_DEF("interface/scene_tabs/minimum_width", 50)) * EDSCALE); scene_tabs->set_drag_to_rearrange_enabled(true); - scene_tabs->connect("tab_changed", this, "_scene_tab_changed"); - scene_tabs->connect("right_button_pressed", this, "_scene_tab_script_edited"); - scene_tabs->connect("tab_close", this, "_scene_tab_closed", varray(SCENE_TAB_CLOSE)); - scene_tabs->connect("tab_hover", this, "_scene_tab_hover"); - scene_tabs->connect("mouse_exited", this, "_scene_tab_exit"); - scene_tabs->connect("gui_input", this, "_scene_tab_input"); - scene_tabs->connect("reposition_active_tab_request", this, "_reposition_active_tab"); - scene_tabs->connect("resized", this, "_update_scene_tabs"); + scene_tabs->connect_compat("tab_changed", this, "_scene_tab_changed"); + scene_tabs->connect_compat("right_button_pressed", this, "_scene_tab_script_edited"); + scene_tabs->connect_compat("tab_close", this, "_scene_tab_closed", varray(SCENE_TAB_CLOSE)); + scene_tabs->connect_compat("tab_hover", this, "_scene_tab_hover"); + scene_tabs->connect_compat("mouse_exited", this, "_scene_tab_exit"); + scene_tabs->connect_compat("gui_input", this, "_scene_tab_input"); + scene_tabs->connect_compat("reposition_active_tab_request", this, "_reposition_active_tab"); + scene_tabs->connect_compat("resized", this, "_update_scene_tabs"); tabbar_container = memnew(HBoxContainer); scene_tabs->set_h_size_flags(Control::SIZE_EXPAND_FILL); scene_tabs_context_menu = memnew(PopupMenu); tabbar_container->add_child(scene_tabs_context_menu); - scene_tabs_context_menu->connect("id_pressed", this, "_menu_option"); + scene_tabs_context_menu->connect_compat("id_pressed", this, "_menu_option"); scene_tabs_context_menu->set_hide_on_window_lose_focus(true); srt->add_child(tabbar_container); @@ -6041,7 +6059,7 @@ EditorNode::EditorNode() { distraction_free->set_shortcut(ED_SHORTCUT("editor/distraction_free_mode", TTR("Distraction Free Mode"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F11)); #endif distraction_free->set_tooltip(TTR("Toggle distraction-free mode.")); - distraction_free->connect("pressed", this, "_toggle_distraction_free_mode"); + distraction_free->connect_compat("pressed", this, "_toggle_distraction_free_mode"); distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons")); distraction_free->set_toggle_mode(true); @@ -6051,7 +6069,7 @@ EditorNode::EditorNode() { scene_tab_add->set_tooltip(TTR("Add a new scene.")); scene_tab_add->set_icon(gui_base->get_icon("Add", "EditorIcons")); scene_tab_add->add_color_override("icon_color_normal", Color(0.6f, 0.6f, 0.6f, 0.8f)); - scene_tab_add->connect("pressed", this, "_menu_option", make_binds(FILE_NEW_SCENE)); + scene_tab_add->connect_compat("pressed", this, "_menu_option", make_binds(FILE_NEW_SCENE)); scene_root_parent = memnew(PanelContainer); scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE); @@ -6086,14 +6104,14 @@ EditorNode::EditorNode() { prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons")); prev_scene->set_tooltip(TTR("Go to previously opened scene.")); prev_scene->set_disabled(true); - prev_scene->connect("pressed", this, "_menu_option", make_binds(FILE_OPEN_PREV)); + prev_scene->connect_compat("pressed", this, "_menu_option", make_binds(FILE_OPEN_PREV)); gui_base->add_child(prev_scene); prev_scene->set_position(Point2(3, 24)); prev_scene->hide(); accept = memnew(AcceptDialog); gui_base->add_child(accept); - accept->connect("confirmed", this, "_menu_confirm_current"); + accept->connect_compat("confirmed", this, "_menu_confirm_current"); project_export = memnew(ProjectExportDialog); gui_base->add_child(project_export); @@ -6120,16 +6138,16 @@ EditorNode::EditorNode() { gui_base->add_child(feature_profile_manager); about = memnew(EditorAbout); gui_base->add_child(about); - feature_profile_manager->connect("current_feature_profile_changed", this, "_feature_profile_changed"); + feature_profile_manager->connect_compat("current_feature_profile_changed", this, "_feature_profile_changed"); warning = memnew(AcceptDialog); warning->add_button(TTR("Copy Text"), true, "copy"); gui_base->add_child(warning); - warning->connect("custom_action", this, "_copy_warning"); + warning->connect_compat("custom_action", this, "_copy_warning"); ED_SHORTCUT("editor/next_tab", TTR("Next tab"), KEY_MASK_CMD + KEY_TAB); ED_SHORTCUT("editor/prev_tab", TTR("Previous tab"), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_TAB); - ED_SHORTCUT("editor/filter_files", TTR("Filter Files..."), KEY_MASK_ALT + KEY_MASK_CMD + KEY_P); + ED_SHORTCUT("editor/filter_files", TTR("Filter Files..."), KEY_MASK_CMD + KEY_MASK_ALT + KEY_P); PopupMenu *p; file_menu->set_tooltip(TTR("Operations with scene files.")); @@ -6144,13 +6162,14 @@ EditorNode::EditorNode() { p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/save_scene", TTR("Save Scene"), KEY_MASK_CMD + KEY_S), FILE_SAVE_SCENE); - p->add_shortcut(ED_SHORTCUT("editor/save_scene_as", TTR("Save Scene As..."), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_S), FILE_SAVE_AS_SCENE); - p->add_shortcut(ED_SHORTCUT("editor/save_all_scenes", TTR("Save All Scenes"), KEY_MASK_ALT + KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_S), FILE_SAVE_ALL_SCENES); + p->add_shortcut(ED_SHORTCUT("editor/save_scene_as", TTR("Save Scene As..."), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_S), FILE_SAVE_AS_SCENE); + p->add_shortcut(ED_SHORTCUT("editor/save_all_scenes", TTR("Save All Scenes"), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_S), FILE_SAVE_ALL_SCENES); p->add_separator(); + p->add_shortcut(ED_SHORTCUT("editor/quick_open", TTR("Quick Open..."), KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_O), FILE_QUICK_OPEN); - p->add_shortcut(ED_SHORTCUT("editor/quick_open_scene", TTR("Quick Open Scene..."), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCENE); - p->add_shortcut(ED_SHORTCUT("editor/quick_open_script", TTR("Quick Open Script..."), KEY_MASK_ALT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCRIPT); + p->add_shortcut(ED_SHORTCUT("editor/quick_open_scene", TTR("Quick Open Scene..."), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_O), FILE_QUICK_OPEN_SCENE); + p->add_shortcut(ED_SHORTCUT("editor/quick_open_script", TTR("Quick Open Script..."), KEY_MASK_CMD + KEY_MASK_ALT + KEY_O), FILE_QUICK_OPEN_SCRIPT); p->add_separator(); PopupMenu *pm_export = memnew(PopupMenu); @@ -6159,20 +6178,20 @@ EditorNode::EditorNode() { p->add_submenu_item(TTR("Convert To..."), "Export"); pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_MeshLibrary", TTR("MeshLibrary...")), FILE_EXPORT_MESH_LIBRARY); pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_TileSet", TTR("TileSet...")), FILE_EXPORT_TILESET); - pm_export->connect("id_pressed", this, "_menu_option"); + pm_export->connect_compat("id_pressed", this, "_menu_option"); p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/undo", TTR("Undo"), KEY_MASK_CMD + KEY_Z), EDIT_UNDO, true); - p->add_shortcut(ED_SHORTCUT("editor/redo", TTR("Redo"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Z), EDIT_REDO, true); + p->add_shortcut(ED_SHORTCUT("editor/redo", TTR("Redo"), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_Z), EDIT_REDO, true); p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/revert_scene", TTR("Revert Scene")), EDIT_REVERT); - p->add_shortcut(ED_SHORTCUT("editor/close_scene", TTR("Close Scene"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_W), FILE_CLOSE); + p->add_shortcut(ED_SHORTCUT("editor/close_scene", TTR("Close Scene"), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_W), FILE_CLOSE); recent_scenes = memnew(PopupMenu); recent_scenes->set_name("RecentScenes"); p->add_child(recent_scenes); - recent_scenes->connect("id_pressed", this, "_open_recent_scene"); + recent_scenes->connect_compat("id_pressed", this, "_open_recent_scene"); p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/file_quit", TTR("Quit"), KEY_MASK_CMD + KEY_Q), FILE_QUIT, true); @@ -6188,11 +6207,11 @@ EditorNode::EditorNode() { p = project_menu->get_popup(); p->set_hide_on_window_lose_focus(true); p->add_shortcut(ED_SHORTCUT("editor/project_settings", TTR("Project Settings...")), RUN_SETTINGS); - p->connect("id_pressed", this, "_menu_option"); + p->connect_compat("id_pressed", this, "_menu_option"); vcs_actions_menu = VersionControlEditorPlugin::get_singleton()->get_version_control_actions_panel(); vcs_actions_menu->set_name("Version Control"); - vcs_actions_menu->connect("index_pressed", this, "_version_control_menu_option"); + vcs_actions_menu->connect_compat("index_pressed", this, "_version_control_menu_option"); p->add_separator(); p->add_child(vcs_actions_menu); p->add_submenu_item(TTR("Version Control"), "Version Control"); @@ -6205,12 +6224,12 @@ EditorNode::EditorNode() { p->add_item(TTR("Open Project Data Folder"), RUN_PROJECT_DATA_FOLDER); plugin_config_dialog = memnew(PluginConfigDialog); - plugin_config_dialog->connect("plugin_ready", this, "_on_plugin_ready"); + plugin_config_dialog->connect_compat("plugin_ready", this, "_on_plugin_ready"); gui_base->add_child(plugin_config_dialog); tool_menu = memnew(PopupMenu); tool_menu->set_name("Tools"); - tool_menu->connect("index_pressed", this, "_tool_menu_option"); + tool_menu->connect_compat("index_pressed", this, "_tool_menu_option"); p->add_child(tool_menu); p->add_submenu_item(TTR("Tools"), "Tools"); tool_menu->add_item(TTR("Orphan Resource Explorer..."), TOOLS_ORPHAN_RESOURCES); @@ -6219,7 +6238,7 @@ EditorNode::EditorNode() { #ifdef OSX_ENABLED p->add_shortcut(ED_SHORTCUT("editor/quit_to_project_list", TTR("Quit to Project List"), KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_Q), RUN_PROJECT_MANAGER, true); #else - p->add_shortcut(ED_SHORTCUT("editor/quit_to_project_list", TTR("Quit to Project List"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Q), RUN_PROJECT_MANAGER, true); + p->add_shortcut(ED_SHORTCUT("editor/quit_to_project_list", TTR("Quit to Project List"), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_Q), RUN_PROJECT_MANAGER, true); #endif menu_hb->add_spacer(); @@ -6254,7 +6273,14 @@ EditorNode::EditorNode() { p->add_check_shortcut(ED_SHORTCUT("editor/sync_script_changes", TTR("Sync Script Changes")), RUN_RELOAD_SCRIPTS); p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is turned on, any script that is saved will be reloaded on the running game.\nWhen used remotely on a device, this is more efficient with network filesystem.")); p->set_item_checked(p->get_item_count() - 1, true); - p->connect("id_pressed", this, "_menu_option"); + + // Multi-instance, start/stop + p->add_separator(); + p->add_radio_check_item(TTR("Debug 1 instance"), RUN_DEBUG_ONE); + p->add_radio_check_item(TTR("Debug 2 instances"), RUN_DEBUG_TWO); + p->set_item_checked(p->get_item_index(RUN_DEBUG_ONE), true); + + p->connect_compat("id_pressed", this, "_menu_option"); menu_hb->add_spacer(); @@ -6273,7 +6299,7 @@ EditorNode::EditorNode() { editor_layouts = memnew(PopupMenu); editor_layouts->set_name("Layouts"); p->add_child(editor_layouts); - editor_layouts->connect("id_pressed", this, "_layout_menu_option"); + editor_layouts->connect_compat("id_pressed", this, "_layout_menu_option"); p->add_submenu_item(TTR("Editor Layout"), "Layouts"); p->add_separator(); #ifdef OSX_ENABLED @@ -6315,7 +6341,7 @@ EditorNode::EditorNode() { p = help_menu->get_popup(); p->set_hide_on_window_lose_focus(true); - p->connect("id_pressed", this, "_menu_option"); + p->connect_compat("id_pressed", this, "_menu_option"); p->add_icon_shortcut(gui_base->get_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("editor/editor_help", TTR("Search"), KEY_MASK_SHIFT | KEY_F1), HELP_SEARCH); p->add_separator(); p->add_icon_shortcut(gui_base->get_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/online_docs", TTR("Online Docs")), HELP_DOCS); @@ -6333,7 +6359,7 @@ EditorNode::EditorNode() { play_button->set_toggle_mode(true); play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); play_button->set_focus_mode(Control::FOCUS_NONE); - play_button->connect("pressed", this, "_menu_option", make_binds(RUN_PLAY)); + play_button->connect_compat("pressed", this, "_menu_option", make_binds(RUN_PLAY)); play_button->set_tooltip(TTR("Play the project.")); #ifdef OSX_ENABLED play_button->set_shortcut(ED_SHORTCUT("editor/play", TTR("Play"), KEY_MASK_CMD | KEY_B)); @@ -6358,7 +6384,7 @@ EditorNode::EditorNode() { play_hb->add_child(stop_button); stop_button->set_focus_mode(Control::FOCUS_NONE); stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons")); - stop_button->connect("pressed", this, "_menu_option", make_binds(RUN_STOP)); + stop_button->connect_compat("pressed", this, "_menu_option", make_binds(RUN_STOP)); stop_button->set_tooltip(TTR("Stop the scene.")); stop_button->set_disabled(true); #ifdef OSX_ENABLED @@ -6369,14 +6395,14 @@ EditorNode::EditorNode() { run_native = memnew(EditorRunNative); play_hb->add_child(run_native); - run_native->connect("native_run", this, "_menu_option", varray(RUN_PLAY_NATIVE)); + run_native->connect_compat("native_run", this, "_menu_option", varray(RUN_PLAY_NATIVE)); play_scene_button = memnew(ToolButton); play_hb->add_child(play_scene_button); play_scene_button->set_toggle_mode(true); play_scene_button->set_focus_mode(Control::FOCUS_NONE); play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); - play_scene_button->connect("pressed", this, "_menu_option", make_binds(RUN_PLAY_SCENE)); + play_scene_button->connect_compat("pressed", this, "_menu_option", make_binds(RUN_PLAY_SCENE)); play_scene_button->set_tooltip(TTR("Play the edited scene.")); #ifdef OSX_ENABLED play_scene_button->set_shortcut(ED_SHORTCUT("editor/play_scene", TTR("Play Scene"), KEY_MASK_CMD | KEY_R)); @@ -6389,7 +6415,7 @@ EditorNode::EditorNode() { play_custom_scene_button->set_toggle_mode(true); play_custom_scene_button->set_focus_mode(Control::FOCUS_NONE); play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); - play_custom_scene_button->connect("pressed", this, "_menu_option", make_binds(RUN_PLAY_CUSTOM_SCENE)); + play_custom_scene_button->connect_compat("pressed", this, "_menu_option", make_binds(RUN_PLAY_CUSTOM_SCENE)); play_custom_scene_button->set_tooltip(TTR("Play custom scene")); #ifdef OSX_ENABLED play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_R)); @@ -6404,7 +6430,7 @@ EditorNode::EditorNode() { video_driver = memnew(OptionButton); video_driver->set_flat(true); video_driver->set_focus_mode(Control::FOCUS_NONE); - video_driver->connect("item_selected", this, "_video_driver_selected"); + video_driver->connect_compat("item_selected", this, "_video_driver_selected"); video_driver->add_font_override("font", gui_base->get_font("bold", "EditorFonts")); // TODO re-enable when GLES2 is ported video_driver->set_disabled(true); @@ -6429,7 +6455,7 @@ EditorNode::EditorNode() { video_restart_dialog = memnew(ConfirmationDialog); video_restart_dialog->set_text(TTR("Changing the video driver requires restarting the editor.")); video_restart_dialog->get_ok()->set_text(TTR("Save & Restart")); - video_restart_dialog->connect("confirmed", this, "_menu_option", varray(SET_VIDEO_DRIVER_SAVE_AND_RESTART)); + video_restart_dialog->connect_compat("confirmed", this, "_menu_option", varray(SET_VIDEO_DRIVER_SAVE_AND_RESTART)); gui_base->add_child(video_restart_dialog); progress_hb = memnew(BackgroundProgress); @@ -6438,13 +6464,13 @@ EditorNode::EditorNode() { gui_base->add_child(layout_dialog); layout_dialog->set_hide_on_ok(false); layout_dialog->set_size(Size2(225, 270) * EDSCALE); - layout_dialog->connect("name_confirmed", this, "_dialog_action"); + layout_dialog->connect_compat("name_confirmed", this, "_dialog_action"); update_spinner = memnew(MenuButton); update_spinner->set_tooltip(TTR("Spins when the editor window redraws.")); right_menu_hb->add_child(update_spinner); update_spinner->set_icon(gui_base->get_icon("Progress1", "EditorIcons")); - update_spinner->get_popup()->connect("id_pressed", this, "_menu_option"); + update_spinner->get_popup()->connect_compat("id_pressed", this, "_menu_option"); p = update_spinner->get_popup(); p->add_radio_check_item(TTR("Update Continuously"), SETTINGS_UPDATE_CONTINUOUSLY); p->add_radio_check_item(TTR("Update When Changed"), SETTINGS_UPDATE_WHEN_CHANGED); @@ -6460,9 +6486,9 @@ EditorNode::EditorNode() { node_dock = memnew(NodeDock); filesystem_dock = memnew(FileSystemDock(this)); - filesystem_dock->connect("inherit", this, "_inherit_request"); - filesystem_dock->connect("instance", this, "_instance_request"); - filesystem_dock->connect("display_mode_changed", this, "_save_docks"); + filesystem_dock->connect_compat("inherit", this, "_inherit_request"); + filesystem_dock->connect_compat("instance", this, "_instance_request"); + filesystem_dock->connect_compat("display_mode_changed", this, "_save_docks"); // Scene: Top left dock_slot[DOCK_SLOT_LEFT_UR]->add_child(scene_tree_dock); @@ -6548,7 +6574,7 @@ EditorNode::EditorNode() { bottom_panel_hb->add_child(bottom_panel_raise); bottom_panel_raise->hide(); bottom_panel_raise->set_toggle_mode(true); - bottom_panel_raise->connect("toggled", this, "_bottom_panel_raise_toggled"); + bottom_panel_raise->connect_compat("toggled", this, "_bottom_panel_raise_toggled"); log = memnew(EditorLog); ToolButton *output_button = add_bottom_panel_item(TTR("Output"), log); @@ -6556,37 +6582,37 @@ EditorNode::EditorNode() { old_split_ofs = 0; - center_split->connect("resized", this, "_vp_resized"); + center_split->connect_compat("resized", this, "_vp_resized"); orphan_resources = memnew(OrphanResourcesDialog); gui_base->add_child(orphan_resources); confirmation = memnew(ConfirmationDialog); gui_base->add_child(confirmation); - confirmation->connect("confirmed", this, "_menu_confirm_current"); + confirmation->connect_compat("confirmed", this, "_menu_confirm_current"); save_confirmation = memnew(ConfirmationDialog); save_confirmation->add_button(TTR("Don't Save"), OS::get_singleton()->get_swap_ok_cancel(), "discard"); gui_base->add_child(save_confirmation); - save_confirmation->connect("confirmed", this, "_menu_confirm_current"); - save_confirmation->connect("custom_action", this, "_discard_changes"); + save_confirmation->connect_compat("confirmed", this, "_menu_confirm_current"); + save_confirmation->connect_compat("custom_action", this, "_discard_changes"); custom_build_manage_templates = memnew(ConfirmationDialog); custom_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates.")); custom_build_manage_templates->get_ok()->set_text(TTR("Manage Templates")); - custom_build_manage_templates->connect("confirmed", this, "_menu_option", varray(SETTINGS_MANAGE_EXPORT_TEMPLATES)); + custom_build_manage_templates->connect_compat("confirmed", this, "_menu_option", varray(SETTINGS_MANAGE_EXPORT_TEMPLATES)); gui_base->add_child(custom_build_manage_templates); install_android_build_template = memnew(ConfirmationDialog); install_android_build_template->set_text(TTR("This will set up your project for custom Android builds by installing the source template to \"res://android/build\".\nYou can then apply modifications and build your own custom APK on export (adding modules, changing the AndroidManifest.xml, etc.).\nNote that in order to make custom builds instead of using pre-built APKs, the \"Use Custom Build\" option should be enabled in the Android export preset.")); install_android_build_template->get_ok()->set_text(TTR("Install")); - install_android_build_template->connect("confirmed", this, "_menu_confirm_current"); + install_android_build_template->connect_compat("confirmed", this, "_menu_confirm_current"); gui_base->add_child(install_android_build_template); remove_android_build_template = memnew(ConfirmationDialog); remove_android_build_template->set_text(TTR("The Android build template is already installed in this project and it won't be overwritten.\nRemove the \"res://android/build\" directory manually before attempting this operation again.")); remove_android_build_template->get_ok()->set_text(TTR("Show in File Manager")); - remove_android_build_template->connect("confirmed", this, "_menu_option", varray(FILE_EXPLORE_ANDROID_BUILD_TEMPLATES)); + remove_android_build_template->connect_compat("confirmed", this, "_menu_option", varray(FILE_EXPLORE_ANDROID_BUILD_TEMPLATES)); gui_base->add_child(remove_android_build_template); file_templates = memnew(EditorFileDialog); @@ -6605,7 +6631,7 @@ EditorNode::EditorNode() { file_export_lib = memnew(EditorFileDialog); file_export_lib->set_title(TTR("Export Library")); file_export_lib->set_mode(EditorFileDialog::MODE_SAVE_FILE); - file_export_lib->connect("file_selected", this, "_dialog_action"); + file_export_lib->connect_compat("file_selected", this, "_dialog_action"); file_export_lib_merge = memnew(CheckBox); file_export_lib_merge->set_text(TTR("Merge With Existing")); file_export_lib_merge->set_pressed(true); @@ -6622,16 +6648,16 @@ EditorNode::EditorNode() { file_script->add_filter("*." + E->get()); } gui_base->add_child(file_script); - file_script->connect("file_selected", this, "_dialog_action"); + file_script->connect_compat("file_selected", this, "_dialog_action"); - file_menu->get_popup()->connect("id_pressed", this, "_menu_option"); - file_menu->connect("about_to_show", this, "_update_file_menu_opened"); - file_menu->get_popup()->connect("popup_hide", this, "_update_file_menu_closed"); + file_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); + file_menu->connect_compat("about_to_show", this, "_update_file_menu_opened"); + file_menu->get_popup()->connect_compat("popup_hide", this, "_update_file_menu_closed"); - settings_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + settings_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); - file->connect("file_selected", this, "_dialog_action"); - file_templates->connect("file_selected", this, "_dialog_action"); + file->connect_compat("file_selected", this, "_dialog_action"); + file_templates->connect_compat("file_selected", this, "_dialog_action"); preview_gen = memnew(AudioStreamPreviewGenerator); add_child(preview_gen); @@ -6639,6 +6665,7 @@ EditorNode::EditorNode() { file_server = memnew(EditorFileServer); + add_editor_plugin(memnew(DebuggerEditorPlugin(this))); add_editor_plugin(memnew(AnimationPlayerEditorPlugin(this))); add_editor_plugin(memnew(CanvasItemEditorPlugin(this))); add_editor_plugin(memnew(SpatialEditorPlugin(this))); @@ -6767,8 +6794,8 @@ EditorNode::EditorNode() { open_imported = memnew(ConfirmationDialog); open_imported->get_ok()->set_text(TTR("Open Anyway")); new_inherited_button = open_imported->add_button(TTR("New Inherited"), !OS::get_singleton()->get_swap_ok_cancel(), "inherit"); - open_imported->connect("confirmed", this, "_open_imported"); - open_imported->connect("custom_action", this, "_inherit_imported"); + open_imported->connect_compat("confirmed", this, "_open_imported"); + open_imported->connect_compat("custom_action", this, "_inherit_imported"); gui_base->add_child(open_imported); saved_version = 1; @@ -6777,11 +6804,11 @@ EditorNode::EditorNode() { quick_open = memnew(EditorQuickOpen); gui_base->add_child(quick_open); - quick_open->connect("quick_open", this, "_quick_opened"); + quick_open->connect_compat("quick_open", this, "_quick_opened"); quick_run = memnew(EditorQuickOpen); gui_base->add_child(quick_run); - quick_run->connect("quick_open", this, "_quick_run"); + quick_run->connect_compat("quick_open", this, "_quick_run"); _update_recent_scenes(); @@ -6803,10 +6830,10 @@ EditorNode::EditorNode() { execute_output_dialog->set_title(""); gui_base->add_child(execute_output_dialog); - EditorFileSystem::get_singleton()->connect("sources_changed", this, "_sources_changed"); - EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_fs_changed"); - EditorFileSystem::get_singleton()->connect("resources_reimported", this, "_resources_reimported"); - EditorFileSystem::get_singleton()->connect("resources_reload", this, "_resources_changed"); + EditorFileSystem::get_singleton()->connect_compat("sources_changed", this, "_sources_changed"); + EditorFileSystem::get_singleton()->connect_compat("filesystem_changed", this, "_fs_changed"); + EditorFileSystem::get_singleton()->connect_compat("resources_reimported", this, "_resources_reimported"); + EditorFileSystem::get_singleton()->connect_compat("resources_reload", this, "_resources_changed"); _build_icon_type_cache(); @@ -6815,7 +6842,7 @@ EditorNode::EditorNode() { pick_main_scene = memnew(ConfirmationDialog); gui_base->add_child(pick_main_scene); pick_main_scene->get_ok()->set_text(TTR("Select")); - pick_main_scene->connect("confirmed", this, "_menu_option", varray(SETTINGS_PICK_MAIN_SCENE)); + pick_main_scene->connect_compat("confirmed", this, "_menu_option", varray(SETTINGS_PICK_MAIN_SCENE)); for (int i = 0; i < _init_callbacks.size(); i++) _init_callbacks[i](); @@ -6855,7 +6882,7 @@ EditorNode::EditorNode() { screenshot_timer = memnew(Timer); screenshot_timer->set_one_shot(true); screenshot_timer->set_wait_time(settings_menu->get_popup()->get_submenu_popup_delay() + 0.1f); - screenshot_timer->connect("timeout", this, "_request_screenshot"); + screenshot_timer->connect_compat("timeout", this, "_request_screenshot"); add_child(screenshot_timer); screenshot_timer->set_owner(get_owner()); } diff --git a/editor/editor_node.h b/editor/editor_node.h index ef9be0677d..a982b9d85f 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -162,6 +162,8 @@ private: RUN_PLAY_NATIVE, RUN_PLAY_CUSTOM_SCENE, RUN_SCENE_SETTINGS, + RUN_DEBUG_ONE, + RUN_DEBUG_TWO, RUN_SETTINGS, RUN_PROJECT_DATA_FOLDER, RUN_PROJECT_MANAGER, @@ -764,10 +766,10 @@ public: void set_convert_old_scene(bool p_old) { convert_old = p_old; } - void notify_child_process_exited(); + void notify_all_debug_sessions_exited(); - OS::ProcessID get_child_process_id() const { return editor_run.get_pid(); } - void stop_child_process(); + OS::ProcessID has_child_process(OS::ProcessID p_pid) const { return editor_run.has_child_process(p_pid); } + void stop_child_process(OS::ProcessID p_pid); Ref<Theme> get_editor_theme() const { return theme; } Ref<Script> get_object_custom_type_base(const Object *p_object) const; diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index 6a1d052e02..696474d4b1 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -106,7 +106,7 @@ void EditorPath::update_path() { if (name == "") name = r->get_class(); - } else if (obj->is_class("ScriptEditorDebuggerInspectedObject")) + } else if (obj->is_class("EditorDebuggerRemoteObject")) name = obj->call("get_title"); else if (Object::cast_to<Node>(obj)) name = Object::cast_to<Node>(obj)->get_name(); @@ -152,6 +152,6 @@ EditorPath::EditorPath(EditorHistory *p_history) { history = p_history; set_clip_text(true); set_text_align(ALIGN_LEFT); - get_popup()->connect("about_to_show", this, "_about_to_show"); - get_popup()->connect("id_pressed", this, "_id_pressed"); + get_popup()->connect_compat("about_to_show", this, "_about_to_show"); + get_popup()->connect_compat("id_pressed", this, "_id_pressed"); } diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index 16decf5c04..c499e52f79 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -43,8 +43,8 @@ void EditorPluginSettings::_notification(int p_what) { if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN) { update_plugins(); } else if (p_what == Node::NOTIFICATION_READY) { - plugin_config_dialog->connect("plugin_ready", EditorNode::get_singleton(), "_on_plugin_ready"); - plugin_list->connect("button_pressed", this, "_cell_button_pressed"); + plugin_config_dialog->connect_compat("plugin_ready", EditorNode::get_singleton(), "_on_plugin_ready"); + plugin_list->connect_compat("button_pressed", this, "_cell_button_pressed"); } } @@ -219,10 +219,10 @@ EditorPluginSettings::EditorPluginSettings() { title_hb->add_child(memnew(Label(TTR("Installed Plugins:")))); title_hb->add_spacer(); create_plugin = memnew(Button(TTR("Create"))); - create_plugin->connect("pressed", this, "_create_clicked"); + create_plugin->connect_compat("pressed", this, "_create_clicked"); title_hb->add_child(create_plugin); update_list = memnew(Button(TTR("Update"))); - update_list->connect("pressed", this, "update_plugins"); + update_list->connect_compat("pressed", this, "update_plugins"); title_hb->add_child(update_list); add_child(title_hb); @@ -245,7 +245,7 @@ EditorPluginSettings::EditorPluginSettings() { plugin_list->set_column_min_width(3, 80 * EDSCALE); plugin_list->set_column_min_width(4, 40 * EDSCALE); plugin_list->set_hide_root(true); - plugin_list->connect("item_edited", this, "_plugin_activity_changed"); + plugin_list->connect_compat("item_edited", this, "_plugin_activity_changed"); VBoxContainer *mc = memnew(VBoxContainer); mc->add_child(plugin_list); diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 96a4551763..dd784c0980 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -686,12 +686,12 @@ EditorProfiler::EditorProfiler() { activate = memnew(Button); activate->set_toggle_mode(true); activate->set_text(TTR("Start")); - activate->connect("pressed", this, "_activate_pressed"); + activate->connect_compat("pressed", this, "_activate_pressed"); hb->add_child(activate); clear_button = memnew(Button); clear_button->set_text(TTR("Clear")); - clear_button->connect("pressed", this, "_clear_pressed"); + clear_button->connect_compat("pressed", this, "_clear_pressed"); hb->add_child(clear_button); hb->add_child(memnew(Label(TTR("Measure:")))); @@ -701,7 +701,7 @@ EditorProfiler::EditorProfiler() { display_mode->add_item(TTR("Average Time (sec)")); display_mode->add_item(TTR("Frame %")); display_mode->add_item(TTR("Physics Frame %")); - display_mode->connect("item_selected", this, "_combo_changed"); + display_mode->connect_compat("item_selected", this, "_combo_changed"); hb->add_child(display_mode); @@ -710,7 +710,7 @@ EditorProfiler::EditorProfiler() { display_time = memnew(OptionButton); display_time->add_item(TTR("Inclusive")); display_time->add_item(TTR("Self")); - display_time->connect("item_selected", this, "_combo_changed"); + display_time->connect_compat("item_selected", this, "_combo_changed"); hb->add_child(display_time); @@ -721,7 +721,7 @@ EditorProfiler::EditorProfiler() { cursor_metric_edit = memnew(SpinBox); cursor_metric_edit->set_h_size_flags(SIZE_FILL); hb->add_child(cursor_metric_edit); - cursor_metric_edit->connect("value_changed", this, "_cursor_metric_changed"); + cursor_metric_edit->connect_compat("value_changed", this, "_cursor_metric_changed"); hb->add_constant_override("separation", 8 * EDSCALE); @@ -745,14 +745,14 @@ EditorProfiler::EditorProfiler() { variables->set_column_title(2, TTR("Calls")); variables->set_column_expand(2, false); variables->set_column_min_width(2, 60 * EDSCALE); - variables->connect("item_edited", this, "_item_edited"); + variables->connect_compat("item_edited", this, "_item_edited"); graph = memnew(TextureRect); graph->set_expand(true); graph->set_mouse_filter(MOUSE_FILTER_STOP); - graph->connect("draw", this, "_graph_tex_draw"); - graph->connect("gui_input", this, "_graph_tex_input"); - graph->connect("mouse_exited", this, "_graph_tex_mouse_exit"); + graph->connect_compat("draw", this, "_graph_tex_draw"); + graph->connect_compat("gui_input", this, "_graph_tex_input"); + graph->connect_compat("mouse_exited", this, "_graph_tex_mouse_exit"); h_split->add_child(graph); graph->set_h_size_flags(SIZE_EXPAND_FILL); @@ -768,13 +768,13 @@ EditorProfiler::EditorProfiler() { frame_delay->set_wait_time(0.1); frame_delay->set_one_shot(true); add_child(frame_delay); - frame_delay->connect("timeout", this, "_update_frame"); + frame_delay->connect_compat("timeout", this, "_update_frame"); plot_delay = memnew(Timer); plot_delay->set_wait_time(0.1); plot_delay->set_one_shot(true); add_child(plot_delay); - plot_delay->connect("timeout", this, "_update_plot"); + plot_delay->connect_compat("timeout", this, "_update_plot"); plot_sigs.insert("physics_frame_time"); plot_sigs.insert("category_frame_time"); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index a93bc6169e..e154b13eac 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -64,7 +64,11 @@ void EditorPropertyText::_text_changed(const String &p_string) { if (updating) return; - emit_changed(get_edited_property(), p_string, "", true); + if (string_name) { + emit_changed(get_edited_property(), StringName(p_string), "", true); + } else { + emit_changed(get_edited_property(), p_string, "", true); + } } void EditorPropertyText::update_property() { @@ -75,6 +79,9 @@ void EditorPropertyText::update_property() { updating = false; } +void EditorPropertyText::set_string_name(bool p_enabled) { + string_name = p_enabled; +} void EditorPropertyText::set_placeholder(const String &p_string) { text->set_placeholder(p_string); } @@ -89,9 +96,10 @@ EditorPropertyText::EditorPropertyText() { text = memnew(LineEdit); add_child(text); add_focusable(text); - text->connect("text_changed", this, "_text_changed"); - text->connect("text_entered", this, "_text_entered"); + text->connect_compat("text_changed", this, "_text_changed"); + text->connect_compat("text_entered", this, "_text_entered"); + string_name = false; updating = false; } @@ -110,7 +118,7 @@ void EditorPropertyMultilineText::_open_big_text() { if (!big_text_dialog) { big_text = memnew(TextEdit); - big_text->connect("text_changed", this, "_big_text_changed"); + big_text->connect_compat("text_changed", this, "_big_text_changed"); big_text->set_wrap_enabled(true); big_text_dialog = memnew(AcceptDialog); big_text_dialog->add_child(big_text); @@ -156,13 +164,13 @@ EditorPropertyMultilineText::EditorPropertyMultilineText() { add_child(hb); set_bottom_editor(hb); text = memnew(TextEdit); - text->connect("text_changed", this, "_text_changed"); + text->connect_compat("text_changed", this, "_text_changed"); text->set_wrap_enabled(true); add_focusable(text); hb->add_child(text); text->set_h_size_flags(SIZE_EXPAND_FILL); open_big_text = memnew(ToolButton); - open_big_text->connect("pressed", this, "_open_big_text"); + open_big_text->connect_compat("pressed", this, "_open_big_text"); hb->add_child(open_big_text); big_text_dialog = NULL; big_text = NULL; @@ -172,7 +180,12 @@ EditorPropertyMultilineText::EditorPropertyMultilineText() { void EditorPropertyTextEnum::_option_selected(int p_which) { - emit_changed(get_edited_property(), options->get_item_text(p_which)); + if (string_name) { + + emit_changed(get_edited_property(), StringName(options->get_item_text(p_which))); + } else { + emit_changed(get_edited_property(), options->get_item_text(p_which)); + } } void EditorPropertyTextEnum::update_property() { @@ -187,10 +200,11 @@ void EditorPropertyTextEnum::update_property() { } } -void EditorPropertyTextEnum::setup(const Vector<String> &p_options) { +void EditorPropertyTextEnum::setup(const Vector<String> &p_options, bool p_string_name) { for (int i = 0; i < p_options.size(); i++) { options->add_item(p_options[i], i); } + string_name = p_string_name; } void EditorPropertyTextEnum::_bind_methods() { @@ -202,10 +216,11 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() { options = memnew(OptionButton); options->set_clip_text(true); options->set_flat(true); + string_name = false; add_child(options); add_focusable(options); - options->connect("item_selected", this, "_option_selected"); + options->connect_compat("item_selected", this, "_option_selected"); } ///////////////////// PATH ///////////////////////// @@ -218,8 +233,8 @@ void EditorPropertyPath::_path_pressed() { if (!dialog) { dialog = memnew(EditorFileDialog); - dialog->connect("file_selected", this, "_path_selected"); - dialog->connect("dir_selected", this, "_path_selected"); + dialog->connect_compat("file_selected", this, "_path_selected"); + dialog->connect_compat("dir_selected", this, "_path_selected"); add_child(dialog); } @@ -293,8 +308,8 @@ EditorPropertyPath::EditorPropertyPath() { add_child(path_hb); path = memnew(LineEdit); path_hb->add_child(path); - path->connect("text_entered", this, "_path_selected"); - path->connect("focus_exited", this, "_path_focus_exited"); + path->connect_compat("text_entered", this, "_path_selected"); + path->connect_compat("focus_exited", this, "_path_focus_exited"); path->set_h_size_flags(SIZE_EXPAND_FILL); path_edit = memnew(Button); @@ -302,7 +317,7 @@ EditorPropertyPath::EditorPropertyPath() { path_hb->add_child(path_edit); add_focusable(path); dialog = NULL; - path_edit->connect("pressed", this, "_path_pressed"); + path_edit->connect_compat("pressed", this, "_path_pressed"); folder = false; global = false; save_mode = false; @@ -346,10 +361,10 @@ EditorPropertyClassName::EditorPropertyClassName() { add_child(property); add_focusable(property); property->set_text(selected_type); - property->connect("pressed", this, "_property_selected"); + property->connect_compat("pressed", this, "_property_selected"); dialog = memnew(CreateDialog); dialog->set_base_type(base_type); - dialog->connect("create", this, "_dialog_created"); + dialog->connect_compat("create", this, "_dialog_created"); add_child(dialog); } @@ -365,7 +380,7 @@ void EditorPropertyMember::_property_select() { if (!selector) { selector = memnew(PropertySelector); - selector->connect("selected", this, "_property_selected"); + selector->connect_compat("selected", this, "_property_selected"); add_child(selector); } @@ -455,7 +470,7 @@ EditorPropertyMember::EditorPropertyMember() { property->set_clip_text(true); add_child(property); add_focusable(property); - property->connect("pressed", this, "_property_select"); + property->connect_compat("pressed", this, "_property_select"); } ///////////////////// CHECK ///////////////////////// @@ -480,7 +495,7 @@ EditorPropertyCheck::EditorPropertyCheck() { checkbox->set_text(TTR("On")); add_child(checkbox); add_focusable(checkbox); - checkbox->connect("pressed", this, "_checkbox_pressed"); + checkbox->connect_compat("pressed", this, "_checkbox_pressed"); } ///////////////////// ENUM ///////////////////////// @@ -531,7 +546,7 @@ EditorPropertyEnum::EditorPropertyEnum() { options->set_flat(true); add_child(options); add_focusable(options); - options->connect("item_selected", this, "_option_selected"); + options->connect_compat("item_selected", this, "_option_selected"); } ///////////////////// FLAGS ///////////////////////// @@ -576,7 +591,7 @@ void EditorPropertyFlags::setup(const Vector<String> &p_options) { CheckBox *cb = memnew(CheckBox); cb->set_text(option); cb->set_clip_text(true); - cb->connect("pressed", this, "_flag_toggled"); + cb->connect_compat("pressed", this, "_flag_toggled"); add_focusable(cb); vbox->add_child(cb); flags.push_back(cb); @@ -787,20 +802,20 @@ EditorPropertyLayers::EditorPropertyLayers() { HBoxContainer *hb = memnew(HBoxContainer); add_child(hb); grid = memnew(EditorPropertyLayersGrid); - grid->connect("flag_changed", this, "_grid_changed"); + grid->connect_compat("flag_changed", this, "_grid_changed"); grid->set_h_size_flags(SIZE_EXPAND_FILL); hb->add_child(grid); button = memnew(Button); button->set_toggle_mode(true); button->set_text(".."); - button->connect("pressed", this, "_button_pressed"); + button->connect_compat("pressed", this, "_button_pressed"); hb->add_child(button); set_bottom_editor(hb); layers = memnew(PopupMenu); add_child(layers); layers->set_hide_on_checkable_item_selection(false); - layers->connect("id_pressed", this, "_menu_pressed"); - layers->connect("popup_hide", button, "set_pressed", varray(false)); + layers->connect_compat("id_pressed", this, "_menu_pressed"); + layers->connect_compat("popup_hide", button, "set_pressed", varray(false)); } ///////////////////// INT ///////////////////////// @@ -841,7 +856,7 @@ EditorPropertyInteger::EditorPropertyInteger() { spin->set_flat(true); add_child(spin); add_focusable(spin); - spin->connect("value_changed", this, "_value_changed"); + spin->connect_compat("value_changed", this, "_value_changed"); setting = false; } @@ -881,7 +896,7 @@ EditorPropertyObjectID::EditorPropertyObjectID() { edit = memnew(Button); add_child(edit); add_focusable(edit); - edit->connect("pressed", this, "_edit_pressed"); + edit->connect_compat("pressed", this, "_edit_pressed"); } ///////////////////// FLOAT ///////////////////////// @@ -921,7 +936,7 @@ EditorPropertyFloat::EditorPropertyFloat() { spin->set_flat(true); add_child(spin); add_focusable(spin); - spin->connect("value_changed", this, "_value_changed"); + spin->connect_compat("value_changed", this, "_value_changed"); setting = false; } @@ -1100,14 +1115,14 @@ void EditorPropertyEasing::_bind_methods() { EditorPropertyEasing::EditorPropertyEasing() { easing_draw = memnew(Control); - easing_draw->connect("draw", this, "_draw_easing"); - easing_draw->connect("gui_input", this, "_drag_easing"); + easing_draw->connect_compat("draw", this, "_draw_easing"); + easing_draw->connect_compat("gui_input", this, "_drag_easing"); easing_draw->set_default_cursor_shape(Control::CURSOR_MOVE); add_child(easing_draw); preset = memnew(PopupMenu); add_child(preset); - preset->connect("id_pressed", this, "_set_preset"); + preset->connect_compat("id_pressed", this, "_set_preset"); spin = memnew(EditorSpinSlider); spin->set_flat(true); @@ -1117,8 +1132,8 @@ EditorPropertyEasing::EditorPropertyEasing() { spin->set_hide_slider(true); spin->set_allow_lesser(true); spin->set_allow_greater(true); - spin->connect("value_changed", this, "_spin_value_changed"); - spin->get_line_edit()->connect("focus_exited", this, "_spin_focus_exited"); + spin->connect_compat("value_changed", this, "_spin_value_changed"); + spin->get_line_edit()->connect_compat("focus_exited", this, "_spin_focus_exited"); spin->hide(); add_child(spin); @@ -1196,7 +1211,7 @@ EditorPropertyVector2::EditorPropertyVector2() { spin[i]->set_label(desc[i]); bc->add_child(spin[i]); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); if (horizontal) { spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); } @@ -1280,7 +1295,7 @@ EditorPropertyRect2::EditorPropertyRect2() { spin[i]->set_flat(true); bc->add_child(spin[i]); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); if (horizontal) { spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); } @@ -1361,7 +1376,7 @@ EditorPropertyVector3::EditorPropertyVector3() { spin[i]->set_label(desc[i]); bc->add_child(spin[i]); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); if (horizontal) { spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); } @@ -1444,7 +1459,7 @@ EditorPropertyPlane::EditorPropertyPlane() { spin[i]->set_label(desc[i]); bc->add_child(spin[i]); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); if (horizontal) { spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); } @@ -1527,7 +1542,7 @@ EditorPropertyQuat::EditorPropertyQuat() { spin[i]->set_label(desc[i]); bc->add_child(spin[i]); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); if (horizontal) { spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); } @@ -1609,7 +1624,7 @@ EditorPropertyAABB::EditorPropertyAABB() { g->add_child(spin[i]); spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); } set_bottom_editor(g); setting = false; @@ -1684,7 +1699,7 @@ EditorPropertyTransform2D::EditorPropertyTransform2D() { g->add_child(spin[i]); spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); } set_bottom_editor(g); setting = false; @@ -1765,7 +1780,7 @@ EditorPropertyBasis::EditorPropertyBasis() { g->add_child(spin[i]); spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); } set_bottom_editor(g); setting = false; @@ -1852,7 +1867,7 @@ EditorPropertyTransform::EditorPropertyTransform() { g->add_child(spin[i]); spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); add_focusable(spin[i]); - spin[i]->connect("value_changed", this, "_value_changed", varray(desc[i])); + spin[i]->connect_compat("value_changed", this, "_value_changed", varray(desc[i])); } set_bottom_editor(g); setting = false; @@ -1917,9 +1932,9 @@ EditorPropertyColor::EditorPropertyColor() { picker = memnew(ColorPickerButton); add_child(picker); picker->set_flat(true); - picker->connect("color_changed", this, "_color_changed"); - picker->connect("popup_closed", this, "_popup_closed"); - picker->connect("picker_created", this, "_picker_created"); + picker->connect_compat("color_changed", this, "_color_changed"); + picker->connect_compat("popup_closed", this, "_popup_closed"); + picker->connect_compat("picker_created", this, "_picker_created"); } ////////////// NODE PATH ////////////////////// @@ -1966,7 +1981,7 @@ void EditorPropertyNodePath::_node_assign() { scene_tree->get_scene_tree()->set_show_enabled_subscene(true); scene_tree->get_scene_tree()->set_valid_types(valid_types); add_child(scene_tree); - scene_tree->connect("selected", this, "_node_selected"); + scene_tree->connect_compat("selected", this, "_node_selected"); } scene_tree->popup_centered_ratio(); } @@ -2048,12 +2063,12 @@ EditorPropertyNodePath::EditorPropertyNodePath() { assign->set_flat(true); assign->set_h_size_flags(SIZE_EXPAND_FILL); assign->set_clip_text(true); - assign->connect("pressed", this, "_node_assign"); + assign->connect_compat("pressed", this, "_node_assign"); hbc->add_child(assign); clear = memnew(Button); clear->set_flat(true); - clear->connect("pressed", this, "_node_clear"); + clear->connect_compat("pressed", this, "_node_clear"); hbc->add_child(clear); use_path_from_scene_root = false; @@ -2120,7 +2135,7 @@ void EditorPropertyResource::_menu_option(int p_which) { if (!file) { file = memnew(EditorFileDialog); - file->connect("file_selected", this, "_file_selected"); + file->connect_compat("file_selected", this, "_file_selected"); add_child(file); } file->set_mode(EditorFileDialog::MODE_OPEN_FILE); @@ -2289,7 +2304,7 @@ void EditorPropertyResource::_menu_option(int p_which) { scene_tree->get_scene_tree()->set_valid_types(valid_types); scene_tree->get_scene_tree()->set_show_enabled_subscene(true); add_child(scene_tree); - scene_tree->connect("selected", this, "_viewport_selected"); + scene_tree->connect_compat("selected", this, "_viewport_selected"); scene_tree->set_title(TTR("Pick a Viewport")); } scene_tree->popup_centered_ratio(); @@ -2607,9 +2622,9 @@ void EditorPropertyResource::update_property() { sub_inspector->set_sub_inspector(true); sub_inspector->set_enable_capitalize_paths(true); - sub_inspector->connect("property_keyed", this, "_sub_inspector_property_keyed"); - sub_inspector->connect("resource_selected", this, "_sub_inspector_resource_selected"); - sub_inspector->connect("object_id_selected", this, "_sub_inspector_object_id_selected"); + sub_inspector->connect_compat("property_keyed", this, "_sub_inspector_property_keyed"); + sub_inspector->connect_compat("resource_selected", this, "_sub_inspector_resource_selected"); + sub_inspector->connect_compat("object_id_selected", this, "_sub_inspector_object_id_selected"); sub_inspector->set_keying(is_keying()); sub_inspector->set_read_only(is_read_only()); sub_inspector->set_use_folding(is_using_folding()); @@ -2892,9 +2907,9 @@ EditorPropertyResource::EditorPropertyResource() { assign->set_flat(true); assign->set_h_size_flags(SIZE_EXPAND_FILL); assign->set_clip_text(true); - assign->connect("pressed", this, "_resource_selected"); + assign->connect_compat("pressed", this, "_resource_selected"); assign->set_drag_forwarding(this); - assign->connect("draw", this, "_button_draw"); + assign->connect_compat("draw", this, "_button_draw"); hbc->add_child(assign); add_focusable(assign); @@ -2905,18 +2920,18 @@ EditorPropertyResource::EditorPropertyResource() { preview->set_margin(MARGIN_BOTTOM, -1); preview->set_margin(MARGIN_RIGHT, -1); assign->add_child(preview); - assign->connect("gui_input", this, "_button_input"); + assign->connect_compat("gui_input", this, "_button_input"); menu = memnew(PopupMenu); add_child(menu); edit = memnew(Button); edit->set_flat(true); edit->set_toggle_mode(true); - menu->connect("id_pressed", this, "_menu_option"); - menu->connect("popup_hide", edit, "set_pressed", varray(false)); - edit->connect("pressed", this, "_update_menu"); + menu->connect_compat("id_pressed", this, "_menu_option"); + menu->connect_compat("popup_hide", edit, "set_pressed", varray(false)); + edit->connect_compat("pressed", this, "_update_menu"); hbc->add_child(edit); - edit->connect("gui_input", this, "_button_input"); + edit->connect_compat("gui_input", this, "_button_input"); add_focusable(edit); file = NULL; @@ -3024,7 +3039,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ add_property_editor(p_path, editor); } } break; - case Variant::REAL: { + case Variant::FLOAT: { if (p_hint == PROPERTY_HINT_EXP_EASING) { EditorPropertyEasing *editor = memnew(EditorPropertyEasing); @@ -3158,7 +3173,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ editor->setup(min, max, step, hide_slider); add_property_editor(p_path, editor); - } break; // 5 + } break; case Variant::RECT2: { EditorPropertyRect2 *editor = memnew(EditorPropertyRect2); double min = -65535, max = 65535, step = default_float_step; @@ -3245,7 +3260,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ editor->setup(min, max, step, hide_slider); add_property_editor(p_path, editor); - } break; // 10 + } break; case Variant::AABB: { EditorPropertyAABB *editor = memnew(EditorPropertyAABB); double min = -65535, max = 65535, step = default_float_step; @@ -3305,6 +3320,22 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ editor->setup(p_hint != PROPERTY_HINT_COLOR_NO_ALPHA); add_property_editor(p_path, editor); } break; + case Variant::STRING_NAME: { + + if (p_hint == PROPERTY_HINT_ENUM) { + EditorPropertyTextEnum *editor = memnew(EditorPropertyTextEnum); + Vector<String> options = p_hint_text.split(","); + editor->setup(options, true); + add_property_editor(p_path, editor); + } else { + EditorPropertyText *editor = memnew(EditorPropertyText); + if (p_hint == PROPERTY_HINT_PLACEHOLDER_TEXT) { + editor->set_placeholder(p_hint_text); + } + editor->set_string_name(true); + add_property_editor(p_path, editor); + } + } break; case Variant::NODE_PATH: { EditorPropertyNodePath *editor = memnew(EditorPropertyNodePath); @@ -3318,7 +3349,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } add_property_editor(p_path, editor); - } break; // 15 + } break; case Variant::_RID: { EditorPropertyRID *editor = memnew(EditorPropertyRID); add_property_editor(p_path, editor); @@ -3357,15 +3388,25 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ EditorPropertyArray *editor = memnew(EditorPropertyArray); editor->setup(Variant::PACKED_BYTE_ARRAY); add_property_editor(p_path, editor); - } break; // 20 - case Variant::PACKED_INT_ARRAY: { + } break; + case Variant::PACKED_INT32_ARRAY: { EditorPropertyArray *editor = memnew(EditorPropertyArray); - editor->setup(Variant::PACKED_INT_ARRAY); + editor->setup(Variant::PACKED_INT32_ARRAY); add_property_editor(p_path, editor); } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_INT64_ARRAY: { EditorPropertyArray *editor = memnew(EditorPropertyArray); - editor->setup(Variant::PACKED_REAL_ARRAY); + editor->setup(Variant::PACKED_INT64_ARRAY); + add_property_editor(p_path, editor); + } break; + case Variant::PACKED_FLOAT32_ARRAY: { + EditorPropertyArray *editor = memnew(EditorPropertyArray); + editor->setup(Variant::PACKED_FLOAT32_ARRAY); + add_property_editor(p_path, editor); + } break; + case Variant::PACKED_FLOAT64_ARRAY: { + EditorPropertyArray *editor = memnew(EditorPropertyArray); + editor->setup(Variant::PACKED_FLOAT64_ARRAY); add_property_editor(p_path, editor); } break; case Variant::PACKED_STRING_ARRAY: { @@ -3382,7 +3423,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ EditorPropertyArray *editor = memnew(EditorPropertyArray); editor->setup(Variant::PACKED_VECTOR3_ARRAY); add_property_editor(p_path, editor); - } break; // 25 + } break; case Variant::PACKED_COLOR_ARRAY: { EditorPropertyArray *editor = memnew(EditorPropertyArray); editor->setup(Variant::PACKED_COLOR_ARRAY); diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 7c343f1c67..c5fc8aaf77 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -53,6 +53,7 @@ class EditorPropertyText : public EditorProperty { LineEdit *text; bool updating; + bool string_name; void _text_changed(const String &p_string); void _text_entered(const String &p_string); @@ -60,6 +61,7 @@ protected: static void _bind_methods(); public: + void set_string_name(bool p_enabled); virtual void update_property(); void set_placeholder(const String &p_string); EditorPropertyText(); @@ -91,12 +93,13 @@ class EditorPropertyTextEnum : public EditorProperty { OptionButton *options; void _option_selected(int p_which); + bool string_name; protected: static void _bind_methods(); public: - void setup(const Vector<String> &p_options); + void setup(const Vector<String> &p_options, bool p_string_name = false); virtual void update_property(); EditorPropertyTextEnum(); }; diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 4b8bf7f687..541069338c 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -198,7 +198,7 @@ void EditorPropertyArray::_change_type_menu(int p_index) { } Variant value; - Variant::CallError ce; + Callable::CallError ce; value = Variant::construct(Variant::Type(p_index), NULL, 0, ce); Variant array = object->get_array(); array.set(changing_type_idx, value); @@ -231,11 +231,17 @@ void EditorPropertyArray::update_property() { case Variant::PACKED_BYTE_ARRAY: { arrtype = "PackedByteArray"; } break; - case Variant::PACKED_INT_ARRAY: { - arrtype = "PackedIntArray"; + case Variant::PACKED_INT32_ARRAY: { + arrtype = "PackedInt32Array"; } break; - case Variant::PACKED_REAL_ARRAY: { - arrtype = "PackedRealArray"; + case Variant::PACKED_FLOAT32_ARRAY: { + arrtype = "PackedFloat32Array"; + } break; + case Variant::PACKED_INT64_ARRAY: { + arrtype = "PackedInt64Array"; + } break; + case Variant::PACKED_FLOAT64_ARRAY: { + arrtype = "PackedFloat64Array"; } break; case Variant::PACKED_STRING_ARRAY: { arrtype = "PackedStringArray"; @@ -290,7 +296,7 @@ void EditorPropertyArray::update_property() { length->set_max(1000000); length->set_h_size_flags(SIZE_EXPAND_FILL); hbc->add_child(length); - length->connect("value_changed", this, "_length_changed"); + length->connect_compat("value_changed", this, "_length_changed"); page_hb = memnew(HBoxContainer); vbox->add_child(page_hb); @@ -301,7 +307,7 @@ void EditorPropertyArray::update_property() { page->set_step(1); page_hb->add_child(page); page->set_h_size_flags(SIZE_EXPAND_FILL); - page->connect("value_changed", this, "_page_changed"); + page->connect_compat("value_changed", this, "_page_changed"); } else { //bye bye children of the box while (vbox->get_child_count() > 2) { @@ -353,8 +359,8 @@ void EditorPropertyArray::update_property() { prop->set_object_and_property(object.ptr(), prop_name); prop->set_label(itos(i + offset)); prop->set_selectable(false); - prop->connect("property_changed", this, "_property_changed"); - prop->connect("object_id_selected", this, "_object_id_selected"); + prop->connect_compat("property_changed", this, "_property_changed"); + prop->connect_compat("object_id_selected", this, "_object_id_selected"); prop->set_h_size_flags(SIZE_EXPAND_FILL); HBoxContainer *hb = memnew(HBoxContainer); @@ -369,12 +375,12 @@ void EditorPropertyArray::update_property() { Button *edit = memnew(Button); edit->set_icon(get_icon("Edit", "EditorIcons")); hb->add_child(edit); - edit->connect("pressed", this, "_change_type", varray(edit, i + offset)); + edit->connect_compat("pressed", this, "_change_type", varray(edit, i + offset)); } else { Button *remove = memnew(Button); remove->set_icon(get_icon("Remove", "EditorIcons")); - remove->connect("pressed", this, "_remove_pressed", varray(i + offset)); + remove->connect_compat("pressed", this, "_remove_pressed", varray(i + offset)); hb->add_child(remove); } @@ -412,7 +418,7 @@ void EditorPropertyArray::_edit_pressed() { Variant array = get_edited_object()->get(get_edited_property()); if (!array.is_array()) { - Variant::CallError ce; + Callable::CallError ce; array = Variant::construct(array_type, NULL, 0, ce); get_edited_object()->set(get_edited_property(), array); @@ -443,7 +449,7 @@ void EditorPropertyArray::_length_changed(double p_page) { int size = array.call("size"); for (int i = previous_size; i < size; i++) { if (array.get(i).get_type() == Variant::NIL) { - Variant::CallError ce; + Callable::CallError ce; array.set(i, Variant::construct(subtype, NULL, 0, ce)); } } @@ -453,7 +459,7 @@ void EditorPropertyArray::_length_changed(double p_page) { int size = array.call("size"); // Pool*Array don't initialize their elements, have to do it manually for (int i = previous_size; i < size; i++) { - Variant::CallError ce; + Callable::CallError ce; array.set(i, Variant::construct(array.get(i).get_type(), NULL, 0, ce)); } } @@ -503,7 +509,7 @@ EditorPropertyArray::EditorPropertyArray() { edit->set_flat(true); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->set_clip_text(true); - edit->connect("pressed", this, "_edit_pressed"); + edit->connect_compat("pressed", this, "_edit_pressed"); edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); @@ -513,7 +519,7 @@ EditorPropertyArray::EditorPropertyArray() { updating = false; change_type = memnew(PopupMenu); add_child(change_type); - change_type->connect("id_pressed", this, "_change_type_menu"); + change_type->connect_compat("id_pressed", this, "_change_type_menu"); for (int i = 0; i < Variant::VARIANT_MAX; i++) { String type = Variant::get_type_name(Variant::Type(i)); @@ -586,7 +592,7 @@ void EditorPropertyDictionary::_change_type_menu(int p_index) { if (changing_type_idx < 0) { Variant value; - Variant::CallError ce; + Callable::CallError ce; value = Variant::construct(Variant::Type(p_index), NULL, 0, ce); if (changing_type_idx == -1) { object->set_new_item_key(value); @@ -602,7 +608,7 @@ void EditorPropertyDictionary::_change_type_menu(int p_index) { if (p_index < Variant::VARIANT_MAX) { Variant value; - Variant::CallError ce; + Callable::CallError ce; value = Variant::construct(Variant::Type(p_index), NULL, 0, ce); Variant key = dict.get_key_at_index(changing_type_idx); dict[key] = value; @@ -661,7 +667,7 @@ void EditorPropertyDictionary::update_property() { page->set_step(1); page_hb->add_child(page); page->set_h_size_flags(SIZE_EXPAND_FILL); - page->connect("value_changed", this, "_page_changed"); + page->connect_compat("value_changed", this, "_page_changed"); } else { // Queue children for deletion, deleting immediately might cause errors. for (int i = 1; i < vbox->get_child_count(); i++) { @@ -724,7 +730,7 @@ void EditorPropertyDictionary::update_property() { prop = editor; } break; - case Variant::REAL: { + case Variant::FLOAT: { EditorPropertyFloat *editor = memnew(EditorPropertyFloat); editor->setup(-100000, 100000, 0.001, true, false, true, true); @@ -804,6 +810,12 @@ void EditorPropertyDictionary::update_property() { prop = memnew(EditorPropertyColor); } break; + case Variant::STRING_NAME: { + EditorPropertyText *ept = memnew(EditorPropertyText); + ept->set_string_name(true); + prop = ept; + + } break; case Variant::NODE_PATH: { prop = memnew(EditorPropertyNodePath); @@ -845,16 +857,28 @@ void EditorPropertyDictionary::update_property() { editor->setup(Variant::PACKED_BYTE_ARRAY); prop = editor; } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { + + EditorPropertyArray *editor = memnew(EditorPropertyArray); + editor->setup(Variant::PACKED_INT32_ARRAY); + prop = editor; + } break; + case Variant::PACKED_FLOAT32_ARRAY: { + + EditorPropertyArray *editor = memnew(EditorPropertyArray); + editor->setup(Variant::PACKED_FLOAT32_ARRAY); + prop = editor; + } break; + case Variant::PACKED_INT64_ARRAY: { EditorPropertyArray *editor = memnew(EditorPropertyArray); - editor->setup(Variant::PACKED_INT_ARRAY); + editor->setup(Variant::PACKED_INT64_ARRAY); prop = editor; } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_FLOAT64_ARRAY: { EditorPropertyArray *editor = memnew(EditorPropertyArray); - editor->setup(Variant::PACKED_REAL_ARRAY); + editor->setup(Variant::PACKED_FLOAT64_ARRAY); prop = editor; } break; case Variant::PACKED_STRING_ARRAY: { @@ -916,8 +940,8 @@ void EditorPropertyDictionary::update_property() { } prop->set_selectable(false); - prop->connect("property_changed", this, "_property_changed"); - prop->connect("object_id_selected", this, "_object_id_selected"); + prop->connect_compat("property_changed", this, "_property_changed"); + prop->connect_compat("object_id_selected", this, "_object_id_selected"); HBoxContainer *hb = memnew(HBoxContainer); if (add_vbox) { @@ -930,14 +954,14 @@ void EditorPropertyDictionary::update_property() { Button *edit = memnew(Button); edit->set_icon(get_icon("Edit", "EditorIcons")); hb->add_child(edit); - edit->connect("pressed", this, "_change_type", varray(edit, change_index)); + edit->connect_compat("pressed", this, "_change_type", varray(edit, change_index)); prop->update_property(); if (i == amount + 1) { Button *butt_add_item = memnew(Button); butt_add_item->set_text(TTR("Add Key/Value Pair")); - butt_add_item->connect("pressed", this, "_add_key_value"); + butt_add_item->connect_compat("pressed", this, "_add_key_value"); add_vbox->add_child(butt_add_item); } } @@ -964,7 +988,7 @@ void EditorPropertyDictionary::_edit_pressed() { Variant prop_val = get_edited_object()->get(get_edited_property()); if (prop_val.get_type() == Variant::NIL) { - Variant::CallError ce; + Callable::CallError ce; prop_val = Variant::construct(Variant::DICTIONARY, NULL, 0, ce); get_edited_object()->set(get_edited_property(), prop_val); } @@ -999,7 +1023,7 @@ EditorPropertyDictionary::EditorPropertyDictionary() { edit->set_flat(true); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->set_clip_text(true); - edit->connect("pressed", this, "_edit_pressed"); + edit->connect_compat("pressed", this, "_edit_pressed"); edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); @@ -1008,7 +1032,7 @@ EditorPropertyDictionary::EditorPropertyDictionary() { updating = false; change_type = memnew(PopupMenu); add_child(change_type); - change_type->connect("id_pressed", this, "_change_type_menu"); + change_type->connect_compat("id_pressed", this, "_change_type_menu"); for (int i = 0; i < Variant::VARIANT_MAX; i++) { String type = Variant::get_type_name(Variant::Type(i)); diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index ff7420e19b..3200a0ac8b 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -38,7 +38,7 @@ EditorRun::Status EditorRun::get_status() const { return status; } -Error EditorRun::run(const String &p_scene, const String &p_custom_args, const List<String> &p_breakpoints, const bool &p_skip_breakpoints) { +Error EditorRun::run(const String &p_scene, const String &p_custom_args, const List<String> &p_breakpoints, const bool &p_skip_breakpoints, const int &p_instances) { List<String> args; @@ -187,20 +187,40 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L }; printf("\n"); - pid = 0; - Error err = OS::get_singleton()->execute(exec, args, false, &pid); - ERR_FAIL_COND_V(err, err); + for (int i = 0; i < p_instances; i++) { + OS::ProcessID pid = 0; + Error err = OS::get_singleton()->execute(exec, args, false, &pid); + ERR_FAIL_COND_V(err, err); + pids.push_back(pid); + } status = STATUS_PLAY; return OK; } +bool EditorRun::has_child_process(OS::ProcessID p_pid) const { + for (const List<OS::ProcessID>::Element *E = pids.front(); E; E = E->next()) { + if (E->get() == p_pid) + return true; + } + return false; +} + +void EditorRun::stop_child_process(OS::ProcessID p_pid) { + if (has_child_process(p_pid)) { + OS::get_singleton()->kill(p_pid); + pids.erase(p_pid); + } +} + void EditorRun::stop() { - if (status != STATUS_STOP && pid != 0) { + if (status != STATUS_STOP && pids.size() > 0) { - OS::get_singleton()->kill(pid); + for (List<OS::ProcessID>::Element *E = pids.front(); E; E = E->next()) { + OS::get_singleton()->kill(E->get()); + } } status = STATUS_STOP; diff --git a/editor/editor_run.h b/editor/editor_run.h index b50a2c2f0e..389a1e6b20 100644 --- a/editor/editor_run.h +++ b/editor/editor_run.h @@ -42,7 +42,7 @@ public: STATUS_STOP }; - OS::ProcessID pid; + List<OS::ProcessID> pids; private: bool debug_collisions; @@ -51,11 +51,13 @@ private: public: Status get_status() const; - Error run(const String &p_scene, const String &p_custom_args, const List<String> &p_breakpoints, const bool &p_skip_breakpoints = false); + Error run(const String &p_scene, const String &p_custom_args, const List<String> &p_breakpoints, const bool &p_skip_breakpoints = false, const int &p_instances = 1); void run_native_notify() { status = STATUS_PLAY; } void stop(); - OS::ProcessID get_pid() const { return pid; } + void stop_child_process(OS::ProcessID p_pid); + bool has_child_process(OS::ProcessID p_pid) const; + int get_child_process_count() const { return pids.size(); } void set_debug_collisions(bool p_debug); bool get_debug_collisions() const; diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index db88b0cea4..490ae19e17 100644 --- a/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -55,8 +55,8 @@ void EditorRunNative::_notification(int p_what) { small_icon.instance(); small_icon->create_from_image(im); MenuButton *mb = memnew(MenuButton); - mb->get_popup()->connect("id_pressed", this, "_run_native", varray(i)); - mb->connect("pressed", this, "_run_native", varray(-1, i)); + mb->get_popup()->connect_compat("id_pressed", this, "_run_native", varray(i)); + mb->connect_compat("pressed", this, "_run_native", varray(-1, i)); mb->set_icon(small_icon); add_child(mb); menus[i] = mb; diff --git a/editor/editor_run_script.cpp b/editor/editor_run_script.cpp index 1f269c246a..628055cac6 100644 --- a/editor/editor_run_script.cpp +++ b/editor/editor_run_script.cpp @@ -71,10 +71,10 @@ void EditorScript::_run() { return; } - Variant::CallError ce; - ce.error = Variant::CallError::CALL_OK; + Callable::CallError ce; + ce.error = Callable::CallError::CALL_OK; get_script_instance()->call("_run", NULL, 0, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { EditorNode::add_io_error(TTR("Couldn't run script:") + "\n " + s->get_path() + "\n" + TTR("Did you forget the '_run' method?")); } diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index c4a84bfcdc..e95343afc9 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -294,7 +294,7 @@ void SectionedInspector::register_search_box(LineEdit *p_box) { search_box = p_box; inspector->register_text_enter(p_box); - search_box->connect("text_changed", this, "_search_changed"); + search_box->connect_compat("text_changed", this, "_search_changed"); } void SectionedInspector::_search_changed(const String &p_what) { @@ -332,7 +332,7 @@ SectionedInspector::SectionedInspector() : right_vb->add_child(inspector, true); inspector->set_use_doc_hints(true); - sections->connect("cell_selected", this, "_section_selected"); + sections->connect_compat("cell_selected", this, "_section_selected"); } SectionedInspector::~SectionedInspector() { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index d81b9bbb82..bd2505f146 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -319,7 +319,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("interface/editor/display_scale", 0); hints["interface/editor/display_scale"] = PropertyInfo(Variant::INT, "interface/editor/display_scale", PROPERTY_HINT_ENUM, "Auto,75%,100%,125%,150%,175%,200%,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/custom_display_scale", 1.0f); - hints["interface/editor/custom_display_scale"] = PropertyInfo(Variant::REAL, "interface/editor/custom_display_scale", PROPERTY_HINT_RANGE, "0.5,3,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/editor/custom_display_scale"] = PropertyInfo(Variant::FLOAT, "interface/editor/custom_display_scale", PROPERTY_HINT_RANGE, "0.5,3,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/main_font_size", 14); hints["interface/editor/main_font_size"] = PropertyInfo(Variant::INT, "interface/editor/main_font_size", PROPERTY_HINT_RANGE, "8,48,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/code_font_size", 14); @@ -335,9 +335,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["interface/editor/code_font"] = PropertyInfo(Variant::STRING, "interface/editor/code_font", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/dim_editor_on_dialog_popup", true); _initial_set("interface/editor/low_processor_mode_sleep_usec", 6900); // ~144 FPS - hints["interface/editor/low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/editor/low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/unfocused_low_processor_mode_sleep_usec", 50000); // 20 FPS - hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/separate_distraction_mode", false); _initial_set("interface/editor/automatically_open_screenshots", true); _initial_set("interface/editor/hide_console_window", false); @@ -354,15 +354,15 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("interface/theme/accent_color", Color(0.41, 0.61, 0.91)); hints["interface/theme/accent_color"] = PropertyInfo(Variant::COLOR, "interface/theme/accent_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/contrast", 0.25); - hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01"); + hints["interface/theme/contrast"] = PropertyInfo(Variant::FLOAT, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01"); _initial_set("interface/theme/relationship_line_opacity", 0.1); - hints["interface/theme/relationship_line_opacity"] = PropertyInfo(Variant::REAL, "interface/theme/relationship_line_opacity", PROPERTY_HINT_RANGE, "0.00, 1, 0.01"); + hints["interface/theme/relationship_line_opacity"] = PropertyInfo(Variant::FLOAT, "interface/theme/relationship_line_opacity", PROPERTY_HINT_RANGE, "0.00, 1, 0.01"); _initial_set("interface/theme/highlight_tabs", false); _initial_set("interface/theme/border_size", 1); _initial_set("interface/theme/use_graph_node_headers", false); hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/additional_spacing", 0); - hints["interface/theme/additional_spacing"] = PropertyInfo(Variant::REAL, "interface/theme/additional_spacing", PROPERTY_HINT_RANGE, "0,5,0.1", PROPERTY_USAGE_DEFAULT); + hints["interface/theme/additional_spacing"] = PropertyInfo(Variant::FLOAT, "interface/theme/additional_spacing", PROPERTY_HINT_RANGE, "0,5,0.1", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/custom_theme", ""); hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT); @@ -477,15 +477,15 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("text_editor/cursor/block_caret", false); _initial_set("text_editor/cursor/caret_blink", true); _initial_set("text_editor/cursor/caret_blink_speed", 0.5); - hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::REAL, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.01"); + hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::FLOAT, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.01"); _initial_set("text_editor/cursor/right_click_moves_caret", true); // Completion _initial_set("text_editor/completion/idle_parse_delay", 2.0); - hints["text_editor/completion/idle_parse_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/idle_parse_delay", PROPERTY_HINT_RANGE, "0.1, 10, 0.01"); + hints["text_editor/completion/idle_parse_delay"] = PropertyInfo(Variant::FLOAT, "text_editor/completion/idle_parse_delay", PROPERTY_HINT_RANGE, "0.1, 10, 0.01"); _initial_set("text_editor/completion/auto_brace_complete", true); _initial_set("text_editor/completion/code_complete_delay", 0.3); - hints["text_editor/completion/code_complete_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/code_complete_delay", PROPERTY_HINT_RANGE, "0.01, 5, 0.01"); + hints["text_editor/completion/code_complete_delay"] = PropertyInfo(Variant::FLOAT, "text_editor/completion/code_complete_delay", PROPERTY_HINT_RANGE, "0.01, 5, 0.01"); _initial_set("text_editor/completion/put_callhint_tooltip_below_current_line", true); _initial_set("text_editor/completion/callhint_tooltip_offset", Vector2()); _initial_set("text_editor/completion/complete_file_paths", true); @@ -541,23 +541,23 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // 3D: Navigation feel _initial_set("editors/3d/navigation_feel/orbit_sensitivity", 0.4); - hints["editors/3d/navigation_feel/orbit_sensitivity"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_sensitivity", PROPERTY_HINT_RANGE, "0.0, 2, 0.01"); + hints["editors/3d/navigation_feel/orbit_sensitivity"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/orbit_sensitivity", PROPERTY_HINT_RANGE, "0.0, 2, 0.01"); _initial_set("editors/3d/navigation_feel/orbit_inertia", 0.05); - hints["editors/3d/navigation_feel/orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); + hints["editors/3d/navigation_feel/orbit_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); _initial_set("editors/3d/navigation_feel/translation_inertia", 0.15); - hints["editors/3d/navigation_feel/translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); + hints["editors/3d/navigation_feel/translation_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); _initial_set("editors/3d/navigation_feel/zoom_inertia", 0.075); - hints["editors/3d/navigation_feel/zoom_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/zoom_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); + hints["editors/3d/navigation_feel/zoom_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/zoom_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); _initial_set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.075); - hints["editors/3d/navigation_feel/manipulation_orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); + hints["editors/3d/navigation_feel/manipulation_orbit_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/manipulation_orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); _initial_set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.075); - hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); + hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); // 3D: Freelook _initial_set("editors/3d/freelook/freelook_inertia", 0.1); - hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); + hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); _initial_set("editors/3d/freelook/freelook_base_speed", 5.0); - hints["editors/3d/freelook/freelook_base_speed"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_base_speed", PROPERTY_HINT_RANGE, "0.0, 10, 0.01"); + hints["editors/3d/freelook/freelook_base_speed"] = PropertyInfo(Variant::FLOAT, "editors/3d/freelook/freelook_base_speed", PROPERTY_HINT_RANGE, "0.0, 10, 0.01"); _initial_set("editors/3d/freelook/freelook_activation_modifier", 0); hints["editors/3d/freelook/freelook_activation_modifier"] = PropertyInfo(Variant::INT, "editors/3d/freelook/freelook_activation_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl"); _initial_set("editors/3d/freelook/freelook_speed_zoom_link", false); diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index bdd5c57b43..9197546772 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -490,9 +490,9 @@ EditorSpinSlider::EditorSpinSlider() { grabber->hide(); grabber->set_as_toplevel(true); grabber->set_mouse_filter(MOUSE_FILTER_STOP); - grabber->connect("mouse_entered", this, "_grabber_mouse_entered"); - grabber->connect("mouse_exited", this, "_grabber_mouse_exited"); - grabber->connect("gui_input", this, "_grabber_gui_input"); + grabber->connect_compat("mouse_entered", this, "_grabber_mouse_entered"); + grabber->connect_compat("mouse_exited", this, "_grabber_mouse_exited"); + grabber->connect_compat("gui_input", this, "_grabber_gui_input"); mouse_over_spin = false; mouse_over_grabber = false; mousewheel_over_grabber = false; @@ -502,9 +502,9 @@ EditorSpinSlider::EditorSpinSlider() { add_child(value_input); value_input->set_as_toplevel(true); value_input->hide(); - value_input->connect("modal_closed", this, "_value_input_closed"); - value_input->connect("text_entered", this, "_value_input_entered"); - value_input->connect("focus_exited", this, "_value_focus_exited"); + value_input->connect_compat("modal_closed", this, "_value_input_closed"); + value_input->connect_compat("text_entered", this, "_value_input_entered"); + value_input->connect_compat("focus_exited", this, "_value_focus_exited"); value_input_just_closed = false; hide_slider = false; read_only = false; diff --git a/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp index cd533649e3..1dd3ac5246 100644 --- a/editor/editor_sub_scene.cpp +++ b/editor/editor_sub_scene.cpp @@ -239,24 +239,24 @@ EditorSubScene::EditorSubScene() { HBoxContainer *hb = memnew(HBoxContainer); path = memnew(LineEdit); - path->connect("text_entered", this, "_path_changed"); + path->connect_compat("text_entered", this, "_path_changed"); hb->add_child(path); path->set_h_size_flags(SIZE_EXPAND_FILL); Button *b = memnew(Button); b->set_text(TTR("Browse")); hb->add_child(b); - b->connect("pressed", this, "_path_browse"); + b->connect_compat("pressed", this, "_path_browse"); vb->add_margin_child(TTR("Scene Path:"), hb); tree = memnew(Tree); tree->set_v_size_flags(SIZE_EXPAND_FILL); vb->add_margin_child(TTR("Import From Node:"), tree, true); tree->set_select_mode(Tree::SELECT_MULTI); - tree->connect("multi_selected", this, "_item_multi_selected"); + tree->connect_compat("multi_selected", this, "_item_multi_selected"); //tree->connect("nothing_selected", this, "_deselect_items"); - tree->connect("cell_selected", this, "_selected_changed"); + tree->connect_compat("cell_selected", this, "_selected_changed"); - tree->connect("item_activated", this, "_ok", make_binds(), CONNECT_DEFERRED); + tree->connect_compat("item_activated", this, "_ok", make_binds(), CONNECT_DEFERRED); file_dialog = memnew(EditorFileDialog); List<String> extensions; @@ -269,5 +269,5 @@ EditorSubScene::EditorSubScene() { file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); add_child(file_dialog); - file_dialog->connect("file_selected", this, "_path_selected"); + file_dialog->connect_compat("file_selected", this, "_path_selected"); } diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 50e3408037..39d4b70a6a 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -852,12 +852,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { Ref<StyleBoxFlat> style_panel_debugger = style_content_panel->duplicate(); style_panel_debugger->set_border_width(MARGIN_BOTTOM, 0); theme->set_stylebox("DebuggerPanel", "EditorStyles", style_panel_debugger); - theme->set_stylebox("DebuggerTabFG", "EditorStyles", style_tab_selected); - theme->set_stylebox("DebuggerTabBG", "EditorStyles", style_tab_unselected); Ref<StyleBoxFlat> style_panel_invisible_top = style_content_panel->duplicate(); int stylebox_offset = theme->get_font("tab_fg", "TabContainer")->get_height() + theme->get_stylebox("tab_fg", "TabContainer")->get_minimum_size().height + theme->get_stylebox("panel", "TabContainer")->get_default_margin(MARGIN_TOP); style_panel_invisible_top->set_expand_margin_size(MARGIN_TOP, -stylebox_offset); + style_panel_invisible_top->set_default_margin(MARGIN_TOP, 0); theme->set_stylebox("BottomPanelDebuggerOverride", "EditorStyles", style_panel_invisible_top); // LineEdit diff --git a/editor/editor_visual_profiler.cpp b/editor/editor_visual_profiler.cpp index 579ac2e9ab..5fb77181bc 100644 --- a/editor/editor_visual_profiler.cpp +++ b/editor/editor_visual_profiler.cpp @@ -588,8 +588,7 @@ void EditorVisualProfiler::_graph_tex_input(const Ref<InputEvent> &p_ev) { if (activate->is_pressed()) { if (!seeking) { - //probably not need to break request, can just stop profiling - //emit_signal("break_request"); + // Break request is not required, just stop profiling } } @@ -679,7 +678,6 @@ void EditorVisualProfiler::_bind_methods() { ClassDB::bind_method(D_METHOD("_item_selected"), &EditorVisualProfiler::_item_selected); ADD_SIGNAL(MethodInfo("enable_profiling", PropertyInfo(Variant::BOOL, "enable"))); - ADD_SIGNAL(MethodInfo("break_request")); } void EditorVisualProfiler::set_enabled(bool p_enable) { @@ -755,12 +753,12 @@ EditorVisualProfiler::EditorVisualProfiler() { activate = memnew(Button); activate->set_toggle_mode(true); activate->set_text(TTR("Start")); - activate->connect("pressed", this, "_activate_pressed"); + activate->connect_compat("pressed", this, "_activate_pressed"); hb->add_child(activate); clear_button = memnew(Button); clear_button->set_text(TTR("Clear")); - clear_button->connect("pressed", this, "_clear_pressed"); + clear_button->connect_compat("pressed", this, "_clear_pressed"); hb->add_child(clear_button); hb->add_child(memnew(Label(TTR("Measure:")))); @@ -768,18 +766,18 @@ EditorVisualProfiler::EditorVisualProfiler() { display_mode = memnew(OptionButton); display_mode->add_item(TTR("Frame Time (msec)")); display_mode->add_item(TTR("Frame %")); - display_mode->connect("item_selected", this, "_combo_changed"); + display_mode->connect_compat("item_selected", this, "_combo_changed"); hb->add_child(display_mode); frame_relative = memnew(CheckBox(TTR("Fit to Frame"))); frame_relative->set_pressed(true); hb->add_child(frame_relative); - frame_relative->connect("pressed", this, "_update_plot"); + frame_relative->connect_compat("pressed", this, "_update_plot"); linked = memnew(CheckBox(TTR("Linked"))); linked->set_pressed(true); hb->add_child(linked); - linked->connect("pressed", this, "_update_plot"); + linked->connect_compat("pressed", this, "_update_plot"); hb->add_spacer(); @@ -788,7 +786,7 @@ EditorVisualProfiler::EditorVisualProfiler() { cursor_metric_edit = memnew(SpinBox); cursor_metric_edit->set_h_size_flags(SIZE_FILL); hb->add_child(cursor_metric_edit); - cursor_metric_edit->connect("value_changed", this, "_cursor_metric_changed"); + cursor_metric_edit->connect_compat("value_changed", this, "_cursor_metric_changed"); hb->add_constant_override("separation", 8 * EDSCALE); @@ -812,15 +810,15 @@ EditorVisualProfiler::EditorVisualProfiler() { variables->set_column_title(2, TTR("GPU")); variables->set_column_expand(2, false); variables->set_column_min_width(2, 60 * EDSCALE); - variables->connect("cell_selected", this, "_item_selected"); + variables->connect_compat("cell_selected", this, "_item_selected"); graph = memnew(TextureRect); graph->set_expand(true); graph->set_mouse_filter(MOUSE_FILTER_STOP); //graph->set_ignore_mouse(false); - graph->connect("draw", this, "_graph_tex_draw"); - graph->connect("gui_input", this, "_graph_tex_input"); - graph->connect("mouse_exited", this, "_graph_tex_mouse_exit"); + graph->connect_compat("draw", this, "_graph_tex_draw"); + graph->connect_compat("gui_input", this, "_graph_tex_input"); + graph->connect_compat("mouse_exited", this, "_graph_tex_mouse_exit"); h_split->add_child(graph); graph->set_h_size_flags(SIZE_EXPAND_FILL); @@ -837,13 +835,13 @@ EditorVisualProfiler::EditorVisualProfiler() { frame_delay->set_wait_time(0.1); frame_delay->set_one_shot(true); add_child(frame_delay); - frame_delay->connect("timeout", this, "_update_frame"); + frame_delay->connect_compat("timeout", this, "_update_frame"); plot_delay = memnew(Timer); plot_delay->set_wait_time(0.1); plot_delay->set_one_shot(true); add_child(plot_delay); - plot_delay->connect("timeout", this, "_update_plot"); + plot_delay->connect_compat("timeout", this, "_update_plot"); seeking = false; graph_height_cpu = 1; diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 9f957cadc8..5ff4cb6246 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -93,14 +93,14 @@ void ExportTemplateManager::_update_template_list() { Button *redownload = memnew(Button); redownload->set_text(TTR("Redownload")); current_hb->add_child(redownload); - redownload->connect("pressed", this, "_download_template", varray(current_version)); + redownload->connect_compat("pressed", this, "_download_template", varray(current_version)); } Button *uninstall = memnew(Button); uninstall->set_text(TTR("Uninstall")); current_hb->add_child(uninstall); current->set_text(current_version + " " + TTR("(Installed)")); - uninstall->connect("pressed", this, "_uninstall_template", varray(current_version)); + uninstall->connect_compat("pressed", this, "_uninstall_template", varray(current_version)); } else { current->add_color_override("font_color", get_color("error_color", "Editor")); @@ -112,7 +112,7 @@ void ExportTemplateManager::_update_template_list() { redownload->set_tooltip(TTR("Official export templates aren't available for development builds.")); } - redownload->connect("pressed", this, "_download_template", varray(current_version)); + redownload->connect_compat("pressed", this, "_download_template", varray(current_version)); current_hb->add_child(redownload); current->set_text(current_version + " " + TTR("(Missing)")); } @@ -134,7 +134,7 @@ void ExportTemplateManager::_update_template_list() { uninstall->set_text(TTR("Uninstall")); hbc->add_child(uninstall); - uninstall->connect("pressed", this, "_uninstall_template", varray(E->get())); + uninstall->connect_compat("pressed", this, "_uninstall_template", varray(E->get())); installed_vb->add_child(hbc); } @@ -385,7 +385,7 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_ ERR_CONTINUE(!m.has("url") || !m.has("name")); LinkButton *lb = memnew(LinkButton); lb->set_text(m["name"]); - lb->connect("pressed", this, "_begin_template_download", varray(m["url"])); + lb->connect_compat("pressed", this, "_begin_template_download", varray(m["url"])); template_list->add_child(lb); mirrors_found = true; } @@ -689,14 +689,14 @@ ExportTemplateManager::ExportTemplateManager() { remove_confirm = memnew(ConfirmationDialog); remove_confirm->set_title(TTR("Remove Template")); add_child(remove_confirm); - remove_confirm->connect("confirmed", this, "_uninstall_template_confirm"); + remove_confirm->connect_compat("confirmed", this, "_uninstall_template_confirm"); template_open = memnew(FileDialog); template_open->set_title(TTR("Select Template File")); template_open->add_filter("*.tpz ; " + TTR("Godot Export Templates")); template_open->set_access(FileDialog::ACCESS_FILESYSTEM); template_open->set_mode(FileDialog::MODE_OPEN_FILE); - template_open->connect("file_selected", this, "_install_from_file", varray(true)); + template_open->connect_compat("file_selected", this, "_install_from_file", varray(true)); add_child(template_open); set_title(TTR("Export Template Manager")); @@ -704,18 +704,18 @@ ExportTemplateManager::ExportTemplateManager() { request_mirror = memnew(HTTPRequest); add_child(request_mirror); - request_mirror->connect("request_completed", this, "_http_download_mirror_completed"); + request_mirror->connect_compat("request_completed", this, "_http_download_mirror_completed"); download_templates = memnew(HTTPRequest); add_child(download_templates); - download_templates->connect("request_completed", this, "_http_download_templates_completed"); + download_templates->connect_compat("request_completed", this, "_http_download_templates_completed"); template_downloader = memnew(AcceptDialog); template_downloader->set_title(TTR("Download Templates")); template_downloader->get_ok()->set_text(TTR("Close")); template_downloader->set_exclusive(true); add_child(template_downloader); - template_downloader->connect("popup_hide", this, "_window_template_downloader_closed"); + template_downloader->connect_compat("popup_hide", this, "_window_template_downloader_closed"); VBoxContainer *vbc = memnew(VBoxContainer); template_downloader->add_child(vbc); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index b32f90f7b9..5363d6a1e2 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -300,19 +300,19 @@ void FileSystemDock::_notification(int p_what) { if (initialized) return; initialized = true; - EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", this, "_feature_profile_changed"); + EditorFeatureProfileManager::get_singleton()->connect_compat("current_feature_profile_changed", this, "_feature_profile_changed"); - EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_fs_changed"); - EditorResourcePreview::get_singleton()->connect("preview_invalidated", this, "_preview_invalidated"); + EditorFileSystem::get_singleton()->connect_compat("filesystem_changed", this, "_fs_changed"); + EditorResourcePreview::get_singleton()->connect_compat("preview_invalidated", this, "_preview_invalidated"); String ei = "EditorIcons"; button_reload->set_icon(get_icon("Reload", ei)); button_toggle_display_mode->set_icon(get_icon("Panels2", ei)); - button_file_list_display_mode->connect("pressed", this, "_toggle_file_display"); + button_file_list_display_mode->connect_compat("pressed", this, "_toggle_file_display"); - files->connect("item_activated", this, "_file_list_activate_file"); - button_hist_next->connect("pressed", this, "_fw_history"); - button_hist_prev->connect("pressed", this, "_bw_history"); + files->connect_compat("item_activated", this, "_file_list_activate_file"); + button_hist_next->connect_compat("pressed", this, "_fw_history"); + button_hist_prev->connect_compat("pressed", this, "_bw_history"); tree_search_box->set_right_icon(get_icon("Search", ei)); tree_search_box->set_clear_button_enabled(true); file_list_search_box->set_right_icon(get_icon("Search", ei)); @@ -320,10 +320,10 @@ void FileSystemDock::_notification(int p_what) { button_hist_next->set_icon(get_icon("Forward", ei)); button_hist_prev->set_icon(get_icon("Back", ei)); - file_list_popup->connect("id_pressed", this, "_file_list_rmb_option"); - tree_popup->connect("id_pressed", this, "_tree_rmb_option"); + file_list_popup->connect_compat("id_pressed", this, "_file_list_rmb_option"); + tree_popup->connect_compat("id_pressed", this, "_tree_rmb_option"); - current_path->connect("text_entered", this, "_navigate_to_path"); + current_path->connect_compat("text_entered", this, "_navigate_to_path"); always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders")); @@ -1775,7 +1775,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected } } -void FileSystemDock::_resource_created() const { +void FileSystemDock::_resource_created() { Object *c = new_resource_dialog->instance_selected(); ERR_FAIL_COND(!c); @@ -2552,7 +2552,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { button_reload = memnew(Button); button_reload->set_flat(true); - button_reload->connect("pressed", this, "_rescan"); + button_reload->connect_compat("pressed", this, "_rescan"); button_reload->set_focus_mode(FOCUS_NONE); button_reload->set_tooltip(TTR("Re-Scan Filesystem")); button_reload->hide(); @@ -2561,7 +2561,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { button_toggle_display_mode = memnew(Button); button_toggle_display_mode->set_flat(true); button_toggle_display_mode->set_toggle_mode(true); - button_toggle_display_mode->connect("toggled", this, "_toggle_split_mode"); + button_toggle_display_mode->connect_compat("toggled", this, "_toggle_split_mode"); button_toggle_display_mode->set_focus_mode(FOCUS_NONE); button_toggle_display_mode->set_tooltip(TTR("Toggle Split Mode")); toolbar_hbc->add_child(button_toggle_display_mode); @@ -2573,7 +2573,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { tree_search_box = memnew(LineEdit); tree_search_box->set_h_size_flags(SIZE_EXPAND_FILL); tree_search_box->set_placeholder(TTR("Search files")); - tree_search_box->connect("text_changed", this, "_search_changed", varray(tree_search_box)); + tree_search_box->connect_compat("text_changed", this, "_search_changed", varray(tree_search_box)); toolbar2_hbc->add_child(tree_search_box); file_list_popup = memnew(PopupMenu); @@ -2597,12 +2597,12 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { tree->set_custom_minimum_size(Size2(0, 15 * EDSCALE)); split_box->add_child(tree); - tree->connect("item_activated", this, "_tree_activate_file"); - tree->connect("multi_selected", this, "_tree_multi_selected"); - tree->connect("item_rmb_selected", this, "_tree_rmb_select"); - tree->connect("empty_rmb", this, "_tree_rmb_empty"); - tree->connect("nothing_selected", this, "_tree_empty_selected"); - tree->connect("gui_input", this, "_tree_gui_input"); + tree->connect_compat("item_activated", this, "_tree_activate_file"); + tree->connect_compat("multi_selected", this, "_tree_multi_selected"); + tree->connect_compat("item_rmb_selected", this, "_tree_rmb_select"); + tree->connect_compat("empty_rmb", this, "_tree_rmb_empty"); + tree->connect_compat("nothing_selected", this, "_tree_empty_selected"); + tree->connect_compat("gui_input", this, "_tree_gui_input"); file_list_vb = memnew(VBoxContainer); file_list_vb->set_v_size_flags(SIZE_EXPAND_FILL); @@ -2614,7 +2614,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { file_list_search_box = memnew(LineEdit); file_list_search_box->set_h_size_flags(SIZE_EXPAND_FILL); file_list_search_box->set_placeholder(TTR("Search files")); - file_list_search_box->connect("text_changed", this, "_search_changed", varray(file_list_search_box)); + file_list_search_box->connect_compat("text_changed", this, "_search_changed", varray(file_list_search_box)); path_hb->add_child(file_list_search_box); button_file_list_display_mode = memnew(ToolButton); @@ -2624,10 +2624,10 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { files->set_v_size_flags(SIZE_EXPAND_FILL); files->set_select_mode(ItemList::SELECT_MULTI); files->set_drag_forwarding(this); - files->connect("item_rmb_selected", this, "_file_list_rmb_select"); - files->connect("gui_input", this, "_file_list_gui_input"); - files->connect("multi_selected", this, "_file_multi_selected"); - files->connect("rmb_clicked", this, "_file_list_rmb_pressed"); + files->connect_compat("item_rmb_selected", this, "_file_list_rmb_select"); + files->connect_compat("gui_input", this, "_file_list_gui_input"); + files->connect_compat("multi_selected", this, "_file_multi_selected"); + files->connect_compat("rmb_clicked", this, "_file_list_rmb_pressed"); files->set_custom_minimum_size(Size2(0, 15 * EDSCALE)); files->set_allow_rmb_select(true); file_list_vb->add_child(files); @@ -2651,14 +2651,14 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { add_child(owners_editor); remove_dialog = memnew(DependencyRemoveDialog); - remove_dialog->connect("file_removed", this, "_file_deleted"); - remove_dialog->connect("folder_removed", this, "_folder_deleted"); + remove_dialog->connect_compat("file_removed", this, "_file_deleted"); + remove_dialog->connect_compat("folder_removed", this, "_folder_deleted"); add_child(remove_dialog); move_dialog = memnew(EditorDirDialog); move_dialog->get_ok()->set_text(TTR("Move")); add_child(move_dialog); - move_dialog->connect("dir_selected", this, "_move_operation_confirm"); + move_dialog->connect_compat("dir_selected", this, "_move_operation_confirm"); rename_dialog = memnew(ConfirmationDialog); VBoxContainer *rename_dialog_vb = memnew(VBoxContainer); @@ -2669,13 +2669,13 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { rename_dialog->get_ok()->set_text(TTR("Rename")); add_child(rename_dialog); rename_dialog->register_text_enter(rename_dialog_text); - rename_dialog->connect("confirmed", this, "_rename_operation_confirm"); + rename_dialog->connect_compat("confirmed", this, "_rename_operation_confirm"); overwrite_dialog = memnew(ConfirmationDialog); overwrite_dialog->set_text(TTR("There is already file or folder with the same name in this location.")); overwrite_dialog->get_ok()->set_text(TTR("Overwrite")); add_child(overwrite_dialog); - overwrite_dialog->connect("confirmed", this, "_move_with_overwrite"); + overwrite_dialog->connect_compat("confirmed", this, "_move_with_overwrite"); duplicate_dialog = memnew(ConfirmationDialog); VBoxContainer *duplicate_dialog_vb = memnew(VBoxContainer); @@ -2686,7 +2686,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { duplicate_dialog->get_ok()->set_text(TTR("Duplicate")); add_child(duplicate_dialog); duplicate_dialog->register_text_enter(duplicate_dialog_text); - duplicate_dialog->connect("confirmed", this, "_duplicate_operation_confirm"); + duplicate_dialog->connect_compat("confirmed", this, "_duplicate_operation_confirm"); make_dir_dialog = memnew(ConfirmationDialog); make_dir_dialog->set_title(TTR("Create Folder")); @@ -2697,7 +2697,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { make_folder_dialog_vb->add_margin_child(TTR("Name:"), make_dir_dialog_text); add_child(make_dir_dialog); make_dir_dialog->register_text_enter(make_dir_dialog_text); - make_dir_dialog->connect("confirmed", this, "_make_dir_confirm"); + make_dir_dialog->connect_compat("confirmed", this, "_make_dir_confirm"); make_scene_dialog = memnew(ConfirmationDialog); make_scene_dialog->set_title(TTR("Create Scene")); @@ -2708,7 +2708,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { make_scene_dialog_vb->add_margin_child(TTR("Name:"), make_scene_dialog_text); add_child(make_scene_dialog); make_scene_dialog->register_text_enter(make_scene_dialog_text); - make_scene_dialog->connect("confirmed", this, "_make_scene_confirm"); + make_scene_dialog->connect_compat("confirmed", this, "_make_scene_confirm"); make_script_dialog = memnew(ScriptCreateDialog); make_script_dialog->set_title(TTR("Create Script")); @@ -2717,7 +2717,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { new_resource_dialog = memnew(CreateDialog); add_child(new_resource_dialog); new_resource_dialog->set_base_type("Resource"); - new_resource_dialog->connect("create", this, "_resource_created"); + new_resource_dialog->connect_compat("create", this, "_resource_created"); searched_string = String(); uncollapsed_paths_before_search = Vector<String>(); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index d20d4add4e..1969f85e72 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -215,7 +215,7 @@ private: void _files_moved(String p_old_file, String p_new_file); void _folder_moved(String p_old_folder, String p_new_folder); - void _resource_created() const; + void _resource_created(); void _make_dir_confirm(); void _make_scene_confirm(); void _rename_operation_confirm(); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index f4bc6ae4be..0bc9b0585c 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -319,8 +319,8 @@ FindInFilesDialog::FindInFilesDialog() { _search_text_line_edit = memnew(LineEdit); _search_text_line_edit->set_h_size_flags(SIZE_EXPAND_FILL); - _search_text_line_edit->connect("text_changed", this, "_on_search_text_modified"); - _search_text_line_edit->connect("text_entered", this, "_on_search_text_entered"); + _search_text_line_edit->connect_compat("text_changed", this, "_on_search_text_modified"); + _search_text_line_edit->connect_compat("text_entered", this, "_on_search_text_entered"); gc->add_child(_search_text_line_edit); _replace_label = memnew(Label); @@ -330,7 +330,7 @@ FindInFilesDialog::FindInFilesDialog() { _replace_text_line_edit = memnew(LineEdit); _replace_text_line_edit->set_h_size_flags(SIZE_EXPAND_FILL); - _replace_text_line_edit->connect("text_entered", this, "_on_replace_text_entered"); + _replace_text_line_edit->connect_compat("text_entered", this, "_on_replace_text_entered"); _replace_text_line_edit->hide(); gc->add_child(_replace_text_line_edit); @@ -367,12 +367,12 @@ FindInFilesDialog::FindInFilesDialog() { Button *folder_button = memnew(Button); folder_button->set_text("..."); - folder_button->connect("pressed", this, "_on_folder_button_pressed"); + folder_button->connect_compat("pressed", this, "_on_folder_button_pressed"); hbc->add_child(folder_button); _folder_dialog = memnew(FileDialog); _folder_dialog->set_mode(FileDialog::MODE_OPEN_DIR); - _folder_dialog->connect("dir_selected", this, "_on_folder_selected"); + _folder_dialog->connect_compat("dir_selected", this, "_on_folder_selected"); add_child(_folder_dialog); gc->add_child(hbc); @@ -563,8 +563,8 @@ const char *FindInFilesPanel::SIGNAL_FILES_MODIFIED = "files_modified"; FindInFilesPanel::FindInFilesPanel() { _finder = memnew(FindInFiles); - _finder->connect(FindInFiles::SIGNAL_RESULT_FOUND, this, "_on_result_found"); - _finder->connect(FindInFiles::SIGNAL_FINISHED, this, "_on_finished"); + _finder->connect_compat(FindInFiles::SIGNAL_RESULT_FOUND, this, "_on_result_found"); + _finder->connect_compat(FindInFiles::SIGNAL_FINISHED, this, "_on_finished"); add_child(_finder); VBoxContainer *vbc = memnew(VBoxContainer); @@ -594,9 +594,15 @@ FindInFilesPanel::FindInFilesPanel() { _status_label = memnew(Label); hbc->add_child(_status_label); + _refresh_button = memnew(Button); + _refresh_button->set_text(TTR("Refresh")); + _refresh_button->connect_compat("pressed", this, "_on_refresh_button_clicked"); + _refresh_button->hide(); + hbc->add_child(_refresh_button); + _cancel_button = memnew(Button); _cancel_button->set_text(TTR("Cancel")); - _cancel_button->connect("pressed", this, "_on_cancel_button_clicked"); + _cancel_button->connect_compat("pressed", this, "_on_cancel_button_clicked"); _cancel_button->hide(); hbc->add_child(_cancel_button); @@ -606,8 +612,8 @@ FindInFilesPanel::FindInFilesPanel() { _results_display = memnew(Tree); _results_display->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("source", "EditorFonts")); _results_display->set_v_size_flags(SIZE_EXPAND_FILL); - _results_display->connect("item_selected", this, "_on_result_selected"); - _results_display->connect("item_edited", this, "_on_item_edited"); + _results_display->connect_compat("item_selected", this, "_on_result_selected"); + _results_display->connect_compat("item_edited", this, "_on_item_edited"); _results_display->set_hide_root(true); _results_display->set_select_mode(Tree::SELECT_ROW); _results_display->set_allow_rmb_select(true); @@ -625,12 +631,12 @@ FindInFilesPanel::FindInFilesPanel() { _replace_line_edit = memnew(LineEdit); _replace_line_edit->set_h_size_flags(SIZE_EXPAND_FILL); - _replace_line_edit->connect("text_changed", this, "_on_replace_text_changed"); + _replace_line_edit->connect_compat("text_changed", this, "_on_replace_text_changed"); _replace_container->add_child(_replace_line_edit); _replace_all_button = memnew(Button); _replace_all_button->set_text(TTR("Replace all (no undo)")); - _replace_all_button->connect("pressed", this, "_on_replace_all_clicked"); + _replace_all_button->connect_compat("pressed", this, "_on_replace_all_clicked"); _replace_container->add_child(_replace_all_button); _replace_container->hide(); @@ -681,6 +687,7 @@ void FindInFilesPanel::start_search() { _finder->start(); update_replace_buttons(); + _refresh_button->hide(); _cancel_button->show(); } @@ -691,6 +698,7 @@ void FindInFilesPanel::stop_search() { _status_label->set_text(""); update_replace_buttons(); set_progress_visible(false); + _refresh_button->show(); _cancel_button->hide(); } @@ -793,9 +801,14 @@ void FindInFilesPanel::_on_finished() { _status_label->set_text(TTR("Search complete")); update_replace_buttons(); set_progress_visible(false); + _refresh_button->show(); _cancel_button->hide(); } +void FindInFilesPanel::_on_refresh_button_clicked() { + start_search(); +} + void FindInFilesPanel::_on_cancel_button_clicked() { stop_search(); } @@ -970,6 +983,7 @@ void FindInFilesPanel::_bind_methods() { ClassDB::bind_method("_on_result_found", &FindInFilesPanel::_on_result_found); ClassDB::bind_method("_on_item_edited", &FindInFilesPanel::_on_item_edited); ClassDB::bind_method("_on_finished", &FindInFilesPanel::_on_finished); + ClassDB::bind_method("_on_refresh_button_clicked", &FindInFilesPanel::_on_refresh_button_clicked); ClassDB::bind_method("_on_cancel_button_clicked", &FindInFilesPanel::_on_cancel_button_clicked); ClassDB::bind_method("_on_result_selected", &FindInFilesPanel::_on_result_selected); ClassDB::bind_method("_on_replace_text_changed", &FindInFilesPanel::_on_replace_text_changed); diff --git a/editor/find_in_files.h b/editor/find_in_files.h index 5dc4ef5e19..7002f750b7 100644 --- a/editor/find_in_files.h +++ b/editor/find_in_files.h @@ -179,6 +179,7 @@ protected: private: void _on_result_found(String fpath, int line_number, int begin, int end, String text); void _on_finished(); + void _on_refresh_button_clicked(); void _on_cancel_button_clicked(); void _on_result_selected(); void _on_item_edited(); @@ -206,6 +207,7 @@ private: Label *_search_text_label; Tree *_results_display; Label *_status_label; + Button *_refresh_button; Button *_cancel_button; ProgressBar *_progress_bar; Map<String, TreeItem *> _file_items; diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index cd185ae12e..444958b0ac 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "groups_editor.h" + #include "editor/scene_tree_editor.h" #include "editor_node.h" #include "editor_scale.h" @@ -435,9 +436,9 @@ GroupDialog::GroupDialog() { groups->set_allow_rmb_select(true); groups->set_v_size_flags(SIZE_EXPAND_FILL); groups->add_constant_override("draw_guides", 1); - groups->connect("item_selected", this, "_group_selected"); - groups->connect("button_pressed", this, "_delete_group_pressed"); - groups->connect("item_edited", this, "_group_renamed"); + groups->connect_compat("item_selected", this, "_group_selected"); + groups->connect_compat("button_pressed", this, "_delete_group_pressed"); + groups->connect_compat("item_edited", this, "_group_renamed"); HBoxContainer *chbc = memnew(HBoxContainer); vbc_left->add_child(chbc); @@ -446,12 +447,12 @@ GroupDialog::GroupDialog() { add_group_text = memnew(LineEdit); chbc->add_child(add_group_text); add_group_text->set_h_size_flags(SIZE_EXPAND_FILL); - add_group_text->connect("text_entered", this, "_add_group_pressed"); + add_group_text->connect_compat("text_entered", this, "_add_group_pressed"); Button *add_group_button = memnew(Button); add_group_button->set_text(TTR("Add")); chbc->add_child(add_group_button); - add_group_button->connect("pressed", this, "_add_group_pressed", varray(String())); + add_group_button->connect_compat("pressed", this, "_add_group_pressed", varray(String())); VBoxContainer *vbc_add = memnew(VBoxContainer); hbc->add_child(vbc_add); @@ -468,7 +469,6 @@ GroupDialog::GroupDialog() { nodes_to_add->set_select_mode(Tree::SELECT_MULTI); nodes_to_add->set_v_size_flags(SIZE_EXPAND_FILL); nodes_to_add->add_constant_override("draw_guides", 1); - nodes_to_add->connect("item_selected", this, "_nodes_to_add_selected"); HBoxContainer *add_filter_hbc = memnew(HBoxContainer); add_filter_hbc->add_constant_override("separate", 0); @@ -478,7 +478,7 @@ GroupDialog::GroupDialog() { add_filter->set_h_size_flags(SIZE_EXPAND_FILL); add_filter->set_placeholder(TTR("Filter nodes")); add_filter_hbc->add_child(add_filter); - add_filter->connect("text_changed", this, "_add_filter_changed"); + add_filter->connect_compat("text_changed", this, "_add_filter_changed"); VBoxContainer *vbc_buttons = memnew(VBoxContainer); hbc->add_child(vbc_buttons); @@ -487,7 +487,7 @@ GroupDialog::GroupDialog() { add_button = memnew(ToolButton); add_button->set_text(TTR("Add")); - add_button->connect("pressed", this, "_add_pressed"); + add_button->connect_compat("pressed", this, "_add_pressed"); vbc_buttons->add_child(add_button); vbc_buttons->add_spacer(); @@ -496,7 +496,7 @@ GroupDialog::GroupDialog() { remove_button = memnew(ToolButton); remove_button->set_text(TTR("Remove")); - remove_button->connect("pressed", this, "_removed_pressed"); + remove_button->connect_compat("pressed", this, "_removed_pressed"); vbc_buttons->add_child(remove_button); @@ -515,7 +515,6 @@ GroupDialog::GroupDialog() { nodes_to_remove->set_hide_folding(true); nodes_to_remove->set_select_mode(Tree::SELECT_MULTI); nodes_to_remove->add_constant_override("draw_guides", 1); - nodes_to_remove->connect("item_selected", this, "_node_to_remove_selected"); HBoxContainer *remove_filter_hbc = memnew(HBoxContainer); remove_filter_hbc->add_constant_override("separate", 0); @@ -525,7 +524,7 @@ GroupDialog::GroupDialog() { remove_filter->set_h_size_flags(SIZE_EXPAND_FILL); remove_filter->set_placeholder(TTR("Filter nodes")); remove_filter_hbc->add_child(remove_filter); - remove_filter->connect("text_changed", this, "_remove_filter_changed"); + remove_filter->connect_compat("text_changed", this, "_remove_filter_changed"); group_empty = memnew(Label()); group_empty->set_text(TTR("Empty groups will be automatically removed.")); @@ -686,12 +685,12 @@ GroupsEditor::GroupsEditor() { group_dialog = memnew(GroupDialog); group_dialog->set_as_toplevel(true); add_child(group_dialog); - group_dialog->connect("group_edited", this, "update_tree"); + group_dialog->connect_compat("group_edited", this, "update_tree"); Button *group_dialog_button = memnew(Button); group_dialog_button->set_text(TTR("Manage Groups")); vbc->add_child(group_dialog_button); - group_dialog_button->connect("pressed", this, "_show_group_dialog"); + group_dialog_button->connect_compat("pressed", this, "_show_group_dialog"); HBoxContainer *hbc = memnew(HBoxContainer); vbc->add_child(hbc); @@ -699,18 +698,18 @@ GroupsEditor::GroupsEditor() { group_name = memnew(LineEdit); group_name->set_h_size_flags(SIZE_EXPAND_FILL); hbc->add_child(group_name); - group_name->connect("text_entered", this, "_add_group"); + group_name->connect_compat("text_entered", this, "_add_group"); add = memnew(Button); add->set_text(TTR("Add")); hbc->add_child(add); - add->connect("pressed", this, "_add_group", varray(String())); + add->connect_compat("pressed", this, "_add_group", varray(String())); tree = memnew(Tree); tree->set_hide_root(true); tree->set_v_size_flags(SIZE_EXPAND_FILL); vbc->add_child(tree); - tree->connect("button_pressed", this, "_remove_group"); + tree->connect_compat("button_pressed", this, "_remove_group"); tree->add_constant_override("draw_guides", 1); add_constant_override("separation", 3 * EDSCALE); } diff --git a/editor/icons/icon_2_d.svg b/editor/icons/2D.svg index e1a96aeab6..e1a96aeab6 100644 --- a/editor/icons/icon_2_d.svg +++ b/editor/icons/2D.svg diff --git a/editor/icons/icon_3_d.svg b/editor/icons/3D.svg index 2a1d5ff36d..2a1d5ff36d 100644 --- a/editor/icons/icon_3_d.svg +++ b/editor/icons/3D.svg diff --git a/editor/icons/icon_a_a_b_b.svg b/editor/icons/AABB.svg index d6fbc52541..d6fbc52541 100644 --- a/editor/icons/icon_a_a_b_b.svg +++ b/editor/icons/AABB.svg diff --git a/editor/icons/icon_a_r_v_r_anchor.svg b/editor/icons/ARVRAnchor.svg index f1571b3fcc..f1571b3fcc 100644 --- a/editor/icons/icon_a_r_v_r_anchor.svg +++ b/editor/icons/ARVRAnchor.svg diff --git a/editor/icons/icon_a_r_v_r_camera.svg b/editor/icons/ARVRCamera.svg index f59a8c8b4a..f59a8c8b4a 100644 --- a/editor/icons/icon_a_r_v_r_camera.svg +++ b/editor/icons/ARVRCamera.svg diff --git a/editor/icons/icon_a_r_v_r_controller.svg b/editor/icons/ARVRController.svg index 40e5b8dce1..40e5b8dce1 100644 --- a/editor/icons/icon_a_r_v_r_controller.svg +++ b/editor/icons/ARVRController.svg diff --git a/editor/icons/icon_a_r_v_r_origin.svg b/editor/icons/ARVROrigin.svg index dbb93ba7a5..dbb93ba7a5 100644 --- a/editor/icons/icon_a_r_v_r_origin.svg +++ b/editor/icons/ARVROrigin.svg diff --git a/editor/icons/icon_accept_dialog.svg b/editor/icons/AcceptDialog.svg index e0bf7b8336..e0bf7b8336 100644 --- a/editor/icons/icon_accept_dialog.svg +++ b/editor/icons/AcceptDialog.svg diff --git a/editor/icons/icon_action_copy.svg b/editor/icons/ActionCopy.svg index d7a1e1097a..d7a1e1097a 100644 --- a/editor/icons/icon_action_copy.svg +++ b/editor/icons/ActionCopy.svg diff --git a/editor/icons/icon_action_cut.svg b/editor/icons/ActionCut.svg index 97df9b2d5a..97df9b2d5a 100644 --- a/editor/icons/icon_action_cut.svg +++ b/editor/icons/ActionCut.svg diff --git a/editor/icons/icon_action_paste.svg b/editor/icons/ActionPaste.svg index 6d46f899f8..6d46f899f8 100644 --- a/editor/icons/icon_action_paste.svg +++ b/editor/icons/ActionPaste.svg diff --git a/editor/icons/icon_add.svg b/editor/icons/Add.svg index a241829603..a241829603 100644 --- a/editor/icons/icon_add.svg +++ b/editor/icons/Add.svg diff --git a/editor/icons/icon_add_atlas_tile.svg b/editor/icons/AddAtlasTile.svg index 97d3590678..97d3590678 100644 --- a/editor/icons/icon_add_atlas_tile.svg +++ b/editor/icons/AddAtlasTile.svg diff --git a/editor/icons/icon_add_autotile.svg b/editor/icons/AddAutotile.svg index c6f1df422d..c6f1df422d 100644 --- a/editor/icons/icon_add_autotile.svg +++ b/editor/icons/AddAutotile.svg diff --git a/editor/icons/icon_add_single_tile.svg b/editor/icons/AddSingleTile.svg index 319fef8078..319fef8078 100644 --- a/editor/icons/icon_add_single_tile.svg +++ b/editor/icons/AddSingleTile.svg diff --git a/editor/icons/icon_add_split.svg b/editor/icons/AddSplit.svg index 1f33e8c72b..1f33e8c72b 100644 --- a/editor/icons/icon_add_split.svg +++ b/editor/icons/AddSplit.svg diff --git a/editor/icons/icon_anchor.svg b/editor/icons/Anchor.svg index 119960d177..119960d177 100644 --- a/editor/icons/icon_anchor.svg +++ b/editor/icons/Anchor.svg diff --git a/editor/icons/icon_animated_sprite.svg b/editor/icons/AnimatedSprite.svg index 411ddda015..411ddda015 100644 --- a/editor/icons/icon_animated_sprite.svg +++ b/editor/icons/AnimatedSprite.svg diff --git a/editor/icons/icon_animated_sprite_3d.svg b/editor/icons/AnimatedSprite3D.svg index 974c4e04eb..974c4e04eb 100644 --- a/editor/icons/icon_animated_sprite_3d.svg +++ b/editor/icons/AnimatedSprite3D.svg diff --git a/editor/icons/icon_animated_texture.svg b/editor/icons/AnimatedTexture.svg index 3719b64747..3719b64747 100644 --- a/editor/icons/icon_animated_texture.svg +++ b/editor/icons/AnimatedTexture.svg diff --git a/editor/icons/icon_animation.svg b/editor/icons/Animation.svg index 2cb738a8a6..2cb738a8a6 100644 --- a/editor/icons/icon_animation.svg +++ b/editor/icons/Animation.svg diff --git a/editor/icons/icon_animation_filter.svg b/editor/icons/AnimationFilter.svg index 45c323543d..45c323543d 100644 --- a/editor/icons/icon_animation_filter.svg +++ b/editor/icons/AnimationFilter.svg diff --git a/editor/icons/icon_animation_player.svg b/editor/icons/AnimationPlayer.svg index a5f7804e0d..a5f7804e0d 100644 --- a/editor/icons/icon_animation_player.svg +++ b/editor/icons/AnimationPlayer.svg diff --git a/editor/icons/icon_animation_track_group.svg b/editor/icons/AnimationTrackGroup.svg index d0d14b7c44..d0d14b7c44 100644 --- a/editor/icons/icon_animation_track_group.svg +++ b/editor/icons/AnimationTrackGroup.svg diff --git a/editor/icons/icon_animation_track_list.svg b/editor/icons/AnimationTrackList.svg index e47c8b18cb..e47c8b18cb 100644 --- a/editor/icons/icon_animation_track_list.svg +++ b/editor/icons/AnimationTrackList.svg diff --git a/editor/icons/icon_animation_tree.svg b/editor/icons/AnimationTree.svg index 718eaac2d2..718eaac2d2 100644 --- a/editor/icons/icon_animation_tree.svg +++ b/editor/icons/AnimationTree.svg diff --git a/editor/icons/icon_area.svg b/editor/icons/Area.svg index 21ebe3c251..21ebe3c251 100644 --- a/editor/icons/icon_area.svg +++ b/editor/icons/Area.svg diff --git a/editor/icons/icon_area_2d.svg b/editor/icons/Area2D.svg index e374205b13..e374205b13 100644 --- a/editor/icons/icon_area_2d.svg +++ b/editor/icons/Area2D.svg diff --git a/editor/icons/icon_array.svg b/editor/icons/Array.svg index d499fcac3a..d499fcac3a 100644 --- a/editor/icons/icon_array.svg +++ b/editor/icons/Array.svg diff --git a/editor/icons/icon_array_mesh.svg b/editor/icons/ArrayMesh.svg index 394a18623d..394a18623d 100644 --- a/editor/icons/icon_array_mesh.svg +++ b/editor/icons/ArrayMesh.svg diff --git a/editor/icons/icon_arrow_down.svg b/editor/icons/ArrowDown.svg index 49a93e6e28..49a93e6e28 100644 --- a/editor/icons/icon_arrow_down.svg +++ b/editor/icons/ArrowDown.svg diff --git a/editor/icons/icon_arrow_left.svg b/editor/icons/ArrowLeft.svg index fbbe5d9075..fbbe5d9075 100644 --- a/editor/icons/icon_arrow_left.svg +++ b/editor/icons/ArrowLeft.svg diff --git a/editor/icons/icon_arrow_right.svg b/editor/icons/ArrowRight.svg index 7895158bb1..7895158bb1 100644 --- a/editor/icons/icon_arrow_right.svg +++ b/editor/icons/ArrowRight.svg diff --git a/editor/icons/icon_arrow_up.svg b/editor/icons/ArrowUp.svg index 9bf19a6a12..9bf19a6a12 100644 --- a/editor/icons/icon_arrow_up.svg +++ b/editor/icons/ArrowUp.svg diff --git a/editor/icons/icon_asset_lib.svg b/editor/icons/AssetLib.svg index 72b20ec047..72b20ec047 100644 --- a/editor/icons/icon_asset_lib.svg +++ b/editor/icons/AssetLib.svg diff --git a/editor/icons/icon_atlas_texture.svg b/editor/icons/AtlasTexture.svg index 28a44e179a..28a44e179a 100644 --- a/editor/icons/icon_atlas_texture.svg +++ b/editor/icons/AtlasTexture.svg diff --git a/editor/icons/icon_audio_bus_bypass.svg b/editor/icons/AudioBusBypass.svg index c251a7c83f..c251a7c83f 100644 --- a/editor/icons/icon_audio_bus_bypass.svg +++ b/editor/icons/AudioBusBypass.svg diff --git a/editor/icons/icon_audio_bus_layout.svg b/editor/icons/AudioBusLayout.svg index f95794a7c7..f95794a7c7 100644 --- a/editor/icons/icon_audio_bus_layout.svg +++ b/editor/icons/AudioBusLayout.svg diff --git a/editor/icons/icon_audio_bus_mute.svg b/editor/icons/AudioBusMute.svg index 4750b0fec0..4750b0fec0 100644 --- a/editor/icons/icon_audio_bus_mute.svg +++ b/editor/icons/AudioBusMute.svg diff --git a/editor/icons/icon_audio_bus_solo.svg b/editor/icons/AudioBusSolo.svg index 5be72a8961..5be72a8961 100644 --- a/editor/icons/icon_audio_bus_solo.svg +++ b/editor/icons/AudioBusSolo.svg diff --git a/editor/icons/icon_audio_stream_o_g_g_vorbis.svg b/editor/icons/AudioStreamOGGVorbis.svg index a8d6fb6bf1..a8d6fb6bf1 100644 --- a/editor/icons/icon_audio_stream_o_g_g_vorbis.svg +++ b/editor/icons/AudioStreamOGGVorbis.svg diff --git a/editor/icons/icon_audio_stream_player.svg b/editor/icons/AudioStreamPlayer.svg index bbe2793407..bbe2793407 100644 --- a/editor/icons/icon_audio_stream_player.svg +++ b/editor/icons/AudioStreamPlayer.svg diff --git a/editor/icons/icon_audio_stream_player_2_d.svg b/editor/icons/AudioStreamPlayer2D.svg index 090b23ff7c..090b23ff7c 100644 --- a/editor/icons/icon_audio_stream_player_2_d.svg +++ b/editor/icons/AudioStreamPlayer2D.svg diff --git a/editor/icons/icon_audio_stream_player_3_d.svg b/editor/icons/AudioStreamPlayer3D.svg index 95da9818aa..95da9818aa 100644 --- a/editor/icons/icon_audio_stream_player_3_d.svg +++ b/editor/icons/AudioStreamPlayer3D.svg diff --git a/editor/icons/icon_audio_stream_sample.svg b/editor/icons/AudioStreamSample.svg index a8d6fb6bf1..a8d6fb6bf1 100644 --- a/editor/icons/icon_audio_stream_sample.svg +++ b/editor/icons/AudioStreamSample.svg diff --git a/editor/icons/icon_auto_end.svg b/editor/icons/AutoEnd.svg index 35f5fb2b1c..35f5fb2b1c 100644 --- a/editor/icons/icon_auto_end.svg +++ b/editor/icons/AutoEnd.svg diff --git a/editor/icons/icon_auto_key.svg b/editor/icons/AutoKey.svg index 3d5569397f..3d5569397f 100644 --- a/editor/icons/icon_auto_key.svg +++ b/editor/icons/AutoKey.svg diff --git a/editor/icons/icon_auto_play.svg b/editor/icons/AutoPlay.svg index dbe41f244f..dbe41f244f 100644 --- a/editor/icons/icon_auto_play.svg +++ b/editor/icons/AutoPlay.svg diff --git a/editor/icons/icon_auto_triangle.svg b/editor/icons/AutoTriangle.svg index 13b8f7c5d2..13b8f7c5d2 100644 --- a/editor/icons/icon_auto_triangle.svg +++ b/editor/icons/AutoTriangle.svg diff --git a/editor/icons/icon_back.svg b/editor/icons/Back.svg index c8ea97fa5c..c8ea97fa5c 100644 --- a/editor/icons/icon_back.svg +++ b/editor/icons/Back.svg diff --git a/editor/icons/icon_back_buffer_copy.svg b/editor/icons/BackBufferCopy.svg index c16cfe9009..c16cfe9009 100644 --- a/editor/icons/icon_back_buffer_copy.svg +++ b/editor/icons/BackBufferCopy.svg diff --git a/editor/icons/icon_bake.svg b/editor/icons/Bake.svg index 9bcfb174dc..9bcfb174dc 100644 --- a/editor/icons/icon_bake.svg +++ b/editor/icons/Bake.svg diff --git a/editor/icons/icon_baked_lightmap.svg b/editor/icons/BakedLightmap.svg index 338a100022..338a100022 100644 --- a/editor/icons/icon_baked_lightmap.svg +++ b/editor/icons/BakedLightmap.svg diff --git a/editor/icons/icon_baked_lightmap_data.svg b/editor/icons/BakedLightmapData.svg index e8d471c2af..e8d471c2af 100644 --- a/editor/icons/icon_baked_lightmap_data.svg +++ b/editor/icons/BakedLightmapData.svg diff --git a/editor/icons/icon_basis.svg b/editor/icons/Basis.svg index ecdb0f4ec0..ecdb0f4ec0 100644 --- a/editor/icons/icon_basis.svg +++ b/editor/icons/Basis.svg diff --git a/editor/icons/icon_bezier_handles_balanced.svg b/editor/icons/BezierHandlesBalanced.svg index 6656d3f5eb..6656d3f5eb 100644 --- a/editor/icons/icon_bezier_handles_balanced.svg +++ b/editor/icons/BezierHandlesBalanced.svg diff --git a/editor/icons/icon_bezier_handles_free.svg b/editor/icons/BezierHandlesFree.svg index 06abfe34ab..06abfe34ab 100644 --- a/editor/icons/icon_bezier_handles_free.svg +++ b/editor/icons/BezierHandlesFree.svg diff --git a/editor/icons/icon_bezier_handles_mirror.svg b/editor/icons/BezierHandlesMirror.svg index be85f170c7..be85f170c7 100644 --- a/editor/icons/icon_bezier_handles_mirror.svg +++ b/editor/icons/BezierHandlesMirror.svg diff --git a/editor/icons/icon_bit_map.svg b/editor/icons/BitMap.svg index b61c1b7dc5..b61c1b7dc5 100644 --- a/editor/icons/icon_bit_map.svg +++ b/editor/icons/BitMap.svg diff --git a/editor/icons/icon_bitmap_font.svg b/editor/icons/BitmapFont.svg index 5e5bd859c9..5e5bd859c9 100644 --- a/editor/icons/icon_bitmap_font.svg +++ b/editor/icons/BitmapFont.svg diff --git a/editor/icons/icon_blend.svg b/editor/icons/Blend.svg index c78b9287fa..c78b9287fa 100644 --- a/editor/icons/icon_blend.svg +++ b/editor/icons/Blend.svg diff --git a/editor/icons/icon_bone.svg b/editor/icons/Bone.svg index fafebb0394..fafebb0394 100644 --- a/editor/icons/icon_bone.svg +++ b/editor/icons/Bone.svg diff --git a/editor/icons/icon_bone_2_d.svg b/editor/icons/Bone2D.svg index 94bfff61e4..94bfff61e4 100644 --- a/editor/icons/icon_bone_2_d.svg +++ b/editor/icons/Bone2D.svg diff --git a/editor/icons/icon_bone_attachment.svg b/editor/icons/BoneAttachment.svg index 0b7dede0b6..0b7dede0b6 100644 --- a/editor/icons/icon_bone_attachment.svg +++ b/editor/icons/BoneAttachment.svg diff --git a/editor/icons/icon_bone_track.svg b/editor/icons/BoneTrack.svg index 0f6f9bb6cd..0f6f9bb6cd 100644 --- a/editor/icons/icon_bone_track.svg +++ b/editor/icons/BoneTrack.svg diff --git a/editor/icons/icon_box_shape.svg b/editor/icons/BoxShape.svg index 171e95f4fa..171e95f4fa 100644 --- a/editor/icons/icon_box_shape.svg +++ b/editor/icons/BoxShape.svg diff --git a/editor/icons/icon_bucket.svg b/editor/icons/Bucket.svg index fc3481290d..fc3481290d 100644 --- a/editor/icons/icon_bucket.svg +++ b/editor/icons/Bucket.svg diff --git a/editor/icons/icon_bus_vu_empty.svg b/editor/icons/BusVuEmpty.svg index 5260b9e252..5260b9e252 100644 --- a/editor/icons/icon_bus_vu_empty.svg +++ b/editor/icons/BusVuEmpty.svg diff --git a/editor/icons/icon_bus_vu_frozen.svg b/editor/icons/BusVuFrozen.svg index c10bb5a1a2..c10bb5a1a2 100644 --- a/editor/icons/icon_bus_vu_frozen.svg +++ b/editor/icons/BusVuFrozen.svg diff --git a/editor/icons/icon_bus_vu_full.svg b/editor/icons/BusVuFull.svg index 377ac60bc1..377ac60bc1 100644 --- a/editor/icons/icon_bus_vu_full.svg +++ b/editor/icons/BusVuFull.svg diff --git a/editor/icons/icon_button.svg b/editor/icons/Button.svg index 6ea5663dda..6ea5663dda 100644 --- a/editor/icons/icon_button.svg +++ b/editor/icons/Button.svg diff --git a/editor/icons/icon_button_group.svg b/editor/icons/ButtonGroup.svg index 683a8c3054..683a8c3054 100644 --- a/editor/icons/icon_button_group.svg +++ b/editor/icons/ButtonGroup.svg diff --git a/editor/icons/icon_c_p_u_particles.svg b/editor/icons/CPUParticles.svg index af4115c93f..af4115c93f 100644 --- a/editor/icons/icon_c_p_u_particles.svg +++ b/editor/icons/CPUParticles.svg diff --git a/editor/icons/icon_c_p_u_particles_2_d.svg b/editor/icons/CPUParticles2D.svg index 25afc35bec..25afc35bec 100644 --- a/editor/icons/icon_c_p_u_particles_2_d.svg +++ b/editor/icons/CPUParticles2D.svg diff --git a/editor/icons/Callable.svg b/editor/icons/Callable.svg new file mode 100644 index 0000000000..8f421f4fed --- /dev/null +++ b/editor/icons/Callable.svg @@ -0,0 +1,5 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 4.2333 4.2333" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -292.77)"> +<path transform="matrix(.26458 0 0 .26458 0 292.77)" d="m12 1c-2 2-4 4-7 4h-4v5h4c3 3.8e-5 5 2 7 4v-13zm1 4v5c2.5896-0.015798 2.5896-4.9849 0-5zm-11 6v4h2l1-4h-3z" fill="#e0e0e0"/> +</g> +</svg> diff --git a/editor/icons/icon_camera.svg b/editor/icons/Camera.svg index af1cb8a2e9..af1cb8a2e9 100644 --- a/editor/icons/icon_camera.svg +++ b/editor/icons/Camera.svg diff --git a/editor/icons/icon_camera_2d.svg b/editor/icons/Camera2D.svg index 9a91b3017b..9a91b3017b 100644 --- a/editor/icons/icon_camera_2d.svg +++ b/editor/icons/Camera2D.svg diff --git a/editor/icons/icon_camera_texture.svg b/editor/icons/CameraTexture.svg index e61b5902f0..e61b5902f0 100644 --- a/editor/icons/icon_camera_texture.svg +++ b/editor/icons/CameraTexture.svg diff --git a/editor/icons/icon_canvas_item.svg b/editor/icons/CanvasItem.svg index eefe501ca8..eefe501ca8 100644 --- a/editor/icons/icon_canvas_item.svg +++ b/editor/icons/CanvasItem.svg diff --git a/editor/icons/icon_canvas_item_material.svg b/editor/icons/CanvasItemMaterial.svg index 7df06ed686..7df06ed686 100644 --- a/editor/icons/icon_canvas_item_material.svg +++ b/editor/icons/CanvasItemMaterial.svg diff --git a/editor/icons/icon_canvas_item_shader.svg b/editor/icons/CanvasItemShader.svg index 834fe61472..834fe61472 100644 --- a/editor/icons/icon_canvas_item_shader.svg +++ b/editor/icons/CanvasItemShader.svg diff --git a/editor/icons/icon_canvas_item_shader_graph.svg b/editor/icons/CanvasItemShaderGraph.svg index 3e83751698..3e83751698 100644 --- a/editor/icons/icon_canvas_item_shader_graph.svg +++ b/editor/icons/CanvasItemShaderGraph.svg diff --git a/editor/icons/icon_canvas_layer.svg b/editor/icons/CanvasLayer.svg index a3fcc903d7..a3fcc903d7 100644 --- a/editor/icons/icon_canvas_layer.svg +++ b/editor/icons/CanvasLayer.svg diff --git a/editor/icons/icon_canvas_modulate.svg b/editor/icons/CanvasModulate.svg index a7b788d638..a7b788d638 100644 --- a/editor/icons/icon_canvas_modulate.svg +++ b/editor/icons/CanvasModulate.svg diff --git a/editor/icons/icon_capsule_mesh.svg b/editor/icons/CapsuleMesh.svg index 1c9470105f..1c9470105f 100644 --- a/editor/icons/icon_capsule_mesh.svg +++ b/editor/icons/CapsuleMesh.svg diff --git a/editor/icons/icon_capsule_shape.svg b/editor/icons/CapsuleShape.svg index ba035ca196..ba035ca196 100644 --- a/editor/icons/icon_capsule_shape.svg +++ b/editor/icons/CapsuleShape.svg diff --git a/editor/icons/icon_capsule_shape_2d.svg b/editor/icons/CapsuleShape2D.svg index 81de995cb4..81de995cb4 100644 --- a/editor/icons/icon_capsule_shape_2d.svg +++ b/editor/icons/CapsuleShape2D.svg diff --git a/editor/icons/icon_center_container.svg b/editor/icons/CenterContainer.svg index 5d854a3cc3..5d854a3cc3 100644 --- a/editor/icons/icon_center_container.svg +++ b/editor/icons/CenterContainer.svg diff --git a/editor/icons/icon_check_box.svg b/editor/icons/CheckBox.svg index 6cb1f2aacd..6cb1f2aacd 100644 --- a/editor/icons/icon_check_box.svg +++ b/editor/icons/CheckBox.svg diff --git a/editor/icons/icon_check_button.svg b/editor/icons/CheckButton.svg index f689c5fe47..f689c5fe47 100644 --- a/editor/icons/icon_check_button.svg +++ b/editor/icons/CheckButton.svg diff --git a/editor/icons/icon_checkerboard.svg b/editor/icons/Checkerboard.svg index 7923291017..7923291017 100644 --- a/editor/icons/icon_checkerboard.svg +++ b/editor/icons/Checkerboard.svg diff --git a/editor/icons/icon_circle_shape_2d.svg b/editor/icons/CircleShape2D.svg index e41fc8807c..e41fc8807c 100644 --- a/editor/icons/icon_circle_shape_2d.svg +++ b/editor/icons/CircleShape2D.svg diff --git a/editor/icons/icon_class_list.svg b/editor/icons/ClassList.svg index ae2494724d..ae2494724d 100644 --- a/editor/icons/icon_class_list.svg +++ b/editor/icons/ClassList.svg diff --git a/editor/icons/icon_clear.svg b/editor/icons/Clear.svg index 91343ca6af..91343ca6af 100644 --- a/editor/icons/icon_clear.svg +++ b/editor/icons/Clear.svg diff --git a/editor/icons/icon_clipped_camera.svg b/editor/icons/ClippedCamera.svg index 8c80c04e27..8c80c04e27 100644 --- a/editor/icons/icon_clipped_camera.svg +++ b/editor/icons/ClippedCamera.svg diff --git a/editor/icons/icon_close.svg b/editor/icons/Close.svg index 4147c7bcdd..4147c7bcdd 100644 --- a/editor/icons/icon_close.svg +++ b/editor/icons/Close.svg diff --git a/editor/icons/icon_collapse.svg b/editor/icons/Collapse.svg index 62b5e55d81..62b5e55d81 100644 --- a/editor/icons/icon_collapse.svg +++ b/editor/icons/Collapse.svg diff --git a/editor/icons/icon_collision_polygon.svg b/editor/icons/CollisionPolygon.svg index 5e849ae4e3..5e849ae4e3 100644 --- a/editor/icons/icon_collision_polygon.svg +++ b/editor/icons/CollisionPolygon.svg diff --git a/editor/icons/icon_collision_polygon_2d.svg b/editor/icons/CollisionPolygon2D.svg index 54148f3fd4..54148f3fd4 100644 --- a/editor/icons/icon_collision_polygon_2d.svg +++ b/editor/icons/CollisionPolygon2D.svg diff --git a/editor/icons/icon_collision_shape.svg b/editor/icons/CollisionShape.svg index 8f14996a97..8f14996a97 100644 --- a/editor/icons/icon_collision_shape.svg +++ b/editor/icons/CollisionShape.svg diff --git a/editor/icons/icon_collision_shape_2d.svg b/editor/icons/CollisionShape2D.svg index 8210bf917f..8210bf917f 100644 --- a/editor/icons/icon_collision_shape_2d.svg +++ b/editor/icons/CollisionShape2D.svg diff --git a/editor/icons/icon_color.svg b/editor/icons/Color.svg index de0540763e..de0540763e 100644 --- a/editor/icons/icon_color.svg +++ b/editor/icons/Color.svg diff --git a/editor/icons/icon_color_pick.svg b/editor/icons/ColorPick.svg index d73225bd60..d73225bd60 100644 --- a/editor/icons/icon_color_pick.svg +++ b/editor/icons/ColorPick.svg diff --git a/editor/icons/icon_color_picker.svg b/editor/icons/ColorPicker.svg index 3d03615708..3d03615708 100644 --- a/editor/icons/icon_color_picker.svg +++ b/editor/icons/ColorPicker.svg diff --git a/editor/icons/icon_color_picker_button.svg b/editor/icons/ColorPickerButton.svg index b9fa86db6a..b9fa86db6a 100644 --- a/editor/icons/icon_color_picker_button.svg +++ b/editor/icons/ColorPickerButton.svg diff --git a/editor/icons/icon_color_ramp.svg b/editor/icons/ColorRamp.svg index e0f0a67483..e0f0a67483 100644 --- a/editor/icons/icon_color_ramp.svg +++ b/editor/icons/ColorRamp.svg diff --git a/editor/icons/icon_color_rect.svg b/editor/icons/ColorRect.svg index c2054de9d3..c2054de9d3 100644 --- a/editor/icons/icon_color_rect.svg +++ b/editor/icons/ColorRect.svg diff --git a/editor/icons/icon_color_track_vu.svg b/editor/icons/ColorTrackVu.svg index 5760f81070..5760f81070 100644 --- a/editor/icons/icon_color_track_vu.svg +++ b/editor/icons/ColorTrackVu.svg diff --git a/editor/icons/icon_concave_polygon_shape.svg b/editor/icons/ConcavePolygonShape.svg index 001ab82826..001ab82826 100644 --- a/editor/icons/icon_concave_polygon_shape.svg +++ b/editor/icons/ConcavePolygonShape.svg diff --git a/editor/icons/icon_concave_polygon_shape_2d.svg b/editor/icons/ConcavePolygonShape2D.svg index 38a92095c9..38a92095c9 100644 --- a/editor/icons/icon_concave_polygon_shape_2d.svg +++ b/editor/icons/ConcavePolygonShape2D.svg diff --git a/editor/icons/icon_cone_twist_joint.svg b/editor/icons/ConeTwistJoint.svg index 0e5e98a17b..0e5e98a17b 100644 --- a/editor/icons/icon_cone_twist_joint.svg +++ b/editor/icons/ConeTwistJoint.svg diff --git a/editor/icons/icon_confirmation_dialog.svg b/editor/icons/ConfirmationDialog.svg index d1f13fbb3b..d1f13fbb3b 100644 --- a/editor/icons/icon_confirmation_dialog.svg +++ b/editor/icons/ConfirmationDialog.svg diff --git a/editor/icons/icon_container.svg b/editor/icons/Container.svg index aaea67faa1..aaea67faa1 100644 --- a/editor/icons/icon_container.svg +++ b/editor/icons/Container.svg diff --git a/editor/icons/icon_control.svg b/editor/icons/Control.svg index ff6a52e29a..ff6a52e29a 100644 --- a/editor/icons/icon_control.svg +++ b/editor/icons/Control.svg diff --git a/editor/icons/icon_control_align_bottom_center.svg b/editor/icons/ControlAlignBottomCenter.svg index 7aee8caa79..7aee8caa79 100644 --- a/editor/icons/icon_control_align_bottom_center.svg +++ b/editor/icons/ControlAlignBottomCenter.svg diff --git a/editor/icons/icon_control_align_bottom_left.svg b/editor/icons/ControlAlignBottomLeft.svg index aa26eb570a..aa26eb570a 100644 --- a/editor/icons/icon_control_align_bottom_left.svg +++ b/editor/icons/ControlAlignBottomLeft.svg diff --git a/editor/icons/icon_control_align_bottom_right.svg b/editor/icons/ControlAlignBottomRight.svg index 737328e6f0..737328e6f0 100644 --- a/editor/icons/icon_control_align_bottom_right.svg +++ b/editor/icons/ControlAlignBottomRight.svg diff --git a/editor/icons/icon_control_align_bottom_wide.svg b/editor/icons/ControlAlignBottomWide.svg index ad0d7fac85..ad0d7fac85 100644 --- a/editor/icons/icon_control_align_bottom_wide.svg +++ b/editor/icons/ControlAlignBottomWide.svg diff --git a/editor/icons/icon_control_align_center.svg b/editor/icons/ControlAlignCenter.svg index 14dd500500..14dd500500 100644 --- a/editor/icons/icon_control_align_center.svg +++ b/editor/icons/ControlAlignCenter.svg diff --git a/editor/icons/icon_control_align_center_left.svg b/editor/icons/ControlAlignCenterLeft.svg index 52f1d4d143..52f1d4d143 100644 --- a/editor/icons/icon_control_align_center_left.svg +++ b/editor/icons/ControlAlignCenterLeft.svg diff --git a/editor/icons/icon_control_align_center_right.svg b/editor/icons/ControlAlignCenterRight.svg index 201796f172..201796f172 100644 --- a/editor/icons/icon_control_align_center_right.svg +++ b/editor/icons/ControlAlignCenterRight.svg diff --git a/editor/icons/icon_control_align_left_center.svg b/editor/icons/ControlAlignLeftCenter.svg index 8135c9d851..8135c9d851 100644 --- a/editor/icons/icon_control_align_left_center.svg +++ b/editor/icons/ControlAlignLeftCenter.svg diff --git a/editor/icons/icon_control_align_left_wide.svg b/editor/icons/ControlAlignLeftWide.svg index 56d16bec76..56d16bec76 100644 --- a/editor/icons/icon_control_align_left_wide.svg +++ b/editor/icons/ControlAlignLeftWide.svg diff --git a/editor/icons/icon_control_align_right_center.svg b/editor/icons/ControlAlignRightCenter.svg index 69c4dba40d..69c4dba40d 100644 --- a/editor/icons/icon_control_align_right_center.svg +++ b/editor/icons/ControlAlignRightCenter.svg diff --git a/editor/icons/icon_control_align_right_wide.svg b/editor/icons/ControlAlignRightWide.svg index b0a46cdb82..b0a46cdb82 100644 --- a/editor/icons/icon_control_align_right_wide.svg +++ b/editor/icons/ControlAlignRightWide.svg diff --git a/editor/icons/icon_control_align_top_center.svg b/editor/icons/ControlAlignTopCenter.svg index cafb3ff856..cafb3ff856 100644 --- a/editor/icons/icon_control_align_top_center.svg +++ b/editor/icons/ControlAlignTopCenter.svg diff --git a/editor/icons/icon_control_align_top_left.svg b/editor/icons/ControlAlignTopLeft.svg index ad288647fb..ad288647fb 100644 --- a/editor/icons/icon_control_align_top_left.svg +++ b/editor/icons/ControlAlignTopLeft.svg diff --git a/editor/icons/icon_control_align_top_right.svg b/editor/icons/ControlAlignTopRight.svg index d9955de728..d9955de728 100644 --- a/editor/icons/icon_control_align_top_right.svg +++ b/editor/icons/ControlAlignTopRight.svg diff --git a/editor/icons/icon_control_align_top_wide.svg b/editor/icons/ControlAlignTopWide.svg index 2526b45ad9..2526b45ad9 100644 --- a/editor/icons/icon_control_align_top_wide.svg +++ b/editor/icons/ControlAlignTopWide.svg diff --git a/editor/icons/icon_control_align_wide.svg b/editor/icons/ControlAlignWide.svg index 5d1467cd9b..5d1467cd9b 100644 --- a/editor/icons/icon_control_align_wide.svg +++ b/editor/icons/ControlAlignWide.svg diff --git a/editor/icons/icon_control_hcenter_wide.svg b/editor/icons/ControlHcenterWide.svg index 51c9aeb22d..51c9aeb22d 100644 --- a/editor/icons/icon_control_hcenter_wide.svg +++ b/editor/icons/ControlHcenterWide.svg diff --git a/editor/icons/icon_control_layout.svg b/editor/icons/ControlLayout.svg index e39e6b474c..e39e6b474c 100644 --- a/editor/icons/icon_control_layout.svg +++ b/editor/icons/ControlLayout.svg diff --git a/editor/icons/icon_control_vcenter_wide.svg b/editor/icons/ControlVcenterWide.svg index 93bbc5748b..93bbc5748b 100644 --- a/editor/icons/icon_control_vcenter_wide.svg +++ b/editor/icons/ControlVcenterWide.svg diff --git a/editor/icons/icon_convex_polygon_shape.svg b/editor/icons/ConvexPolygonShape.svg index bfb9230586..bfb9230586 100644 --- a/editor/icons/icon_convex_polygon_shape.svg +++ b/editor/icons/ConvexPolygonShape.svg diff --git a/editor/icons/icon_convex_polygon_shape_2d.svg b/editor/icons/ConvexPolygonShape2D.svg index 8d16523d93..8d16523d93 100644 --- a/editor/icons/icon_convex_polygon_shape_2d.svg +++ b/editor/icons/ConvexPolygonShape2D.svg diff --git a/editor/icons/icon_copy_node_path.svg b/editor/icons/CopyNodePath.svg index 2cabe0a44e..2cabe0a44e 100644 --- a/editor/icons/icon_copy_node_path.svg +++ b/editor/icons/CopyNodePath.svg diff --git a/editor/icons/icon_create_new_scene_from.svg b/editor/icons/CreateNewSceneFrom.svg index ffeaa36bc4..ffeaa36bc4 100644 --- a/editor/icons/icon_create_new_scene_from.svg +++ b/editor/icons/CreateNewSceneFrom.svg diff --git a/editor/icons/icon_crosshair.svg b/editor/icons/Crosshair.svg index b6fa5ec654..b6fa5ec654 100644 --- a/editor/icons/icon_crosshair.svg +++ b/editor/icons/Crosshair.svg diff --git a/editor/icons/icon_crypto_key.svg b/editor/icons/CryptoKey.svg index 45b53c815d..45b53c815d 100644 --- a/editor/icons/icon_crypto_key.svg +++ b/editor/icons/CryptoKey.svg diff --git a/editor/icons/icon_cube_map.svg b/editor/icons/CubeMap.svg index c9e6f1fa7d..c9e6f1fa7d 100644 --- a/editor/icons/icon_cube_map.svg +++ b/editor/icons/CubeMap.svg diff --git a/editor/icons/icon_cube_mesh.svg b/editor/icons/CubeMesh.svg index aeb5324b1b..aeb5324b1b 100644 --- a/editor/icons/icon_cube_mesh.svg +++ b/editor/icons/CubeMesh.svg diff --git a/editor/icons/icon_curve.svg b/editor/icons/Curve.svg index 14895337c6..14895337c6 100644 --- a/editor/icons/icon_curve.svg +++ b/editor/icons/Curve.svg diff --git a/editor/icons/icon_curve_2d.svg b/editor/icons/Curve2D.svg index 23f585c7c5..23f585c7c5 100644 --- a/editor/icons/icon_curve_2d.svg +++ b/editor/icons/Curve2D.svg diff --git a/editor/icons/icon_curve_3d.svg b/editor/icons/Curve3D.svg index f14c581ec3..f14c581ec3 100644 --- a/editor/icons/icon_curve_3d.svg +++ b/editor/icons/Curve3D.svg diff --git a/editor/icons/icon_curve_close.svg b/editor/icons/CurveClose.svg index 7d7bae88c2..7d7bae88c2 100644 --- a/editor/icons/icon_curve_close.svg +++ b/editor/icons/CurveClose.svg diff --git a/editor/icons/icon_curve_constant.svg b/editor/icons/CurveConstant.svg index 713a3a982a..713a3a982a 100644 --- a/editor/icons/icon_curve_constant.svg +++ b/editor/icons/CurveConstant.svg diff --git a/editor/icons/icon_curve_create.svg b/editor/icons/CurveCreate.svg index 43811f93f5..43811f93f5 100644 --- a/editor/icons/icon_curve_create.svg +++ b/editor/icons/CurveCreate.svg diff --git a/editor/icons/icon_curve_curve.svg b/editor/icons/CurveCurve.svg index 60f965abc1..60f965abc1 100644 --- a/editor/icons/icon_curve_curve.svg +++ b/editor/icons/CurveCurve.svg diff --git a/editor/icons/icon_curve_delete.svg b/editor/icons/CurveDelete.svg index afb545840f..afb545840f 100644 --- a/editor/icons/icon_curve_delete.svg +++ b/editor/icons/CurveDelete.svg diff --git a/editor/icons/icon_curve_edit.svg b/editor/icons/CurveEdit.svg index 5d1d6560e1..5d1d6560e1 100644 --- a/editor/icons/icon_curve_edit.svg +++ b/editor/icons/CurveEdit.svg diff --git a/editor/icons/icon_curve_in.svg b/editor/icons/CurveIn.svg index b9e203dea0..b9e203dea0 100644 --- a/editor/icons/icon_curve_in.svg +++ b/editor/icons/CurveIn.svg diff --git a/editor/icons/icon_curve_in_out.svg b/editor/icons/CurveInOut.svg index 6d3c57d4f5..6d3c57d4f5 100644 --- a/editor/icons/icon_curve_in_out.svg +++ b/editor/icons/CurveInOut.svg diff --git a/editor/icons/icon_curve_linear.svg b/editor/icons/CurveLinear.svg index 2256f493ce..2256f493ce 100644 --- a/editor/icons/icon_curve_linear.svg +++ b/editor/icons/CurveLinear.svg diff --git a/editor/icons/icon_curve_out.svg b/editor/icons/CurveOut.svg index 9b04df6b6c..9b04df6b6c 100644 --- a/editor/icons/icon_curve_out.svg +++ b/editor/icons/CurveOut.svg diff --git a/editor/icons/icon_curve_out_in.svg b/editor/icons/CurveOutIn.svg index 4a08d30966..4a08d30966 100644 --- a/editor/icons/icon_curve_out_in.svg +++ b/editor/icons/CurveOutIn.svg diff --git a/editor/icons/icon_curve_texture.svg b/editor/icons/CurveTexture.svg index 05f9d62775..05f9d62775 100644 --- a/editor/icons/icon_curve_texture.svg +++ b/editor/icons/CurveTexture.svg diff --git a/editor/icons/icon_cylinder_mesh.svg b/editor/icons/CylinderMesh.svg index f204edc985..f204edc985 100644 --- a/editor/icons/icon_cylinder_mesh.svg +++ b/editor/icons/CylinderMesh.svg diff --git a/editor/icons/icon_cylinder_shape.svg b/editor/icons/CylinderShape.svg index f0aa5833d2..f0aa5833d2 100644 --- a/editor/icons/icon_cylinder_shape.svg +++ b/editor/icons/CylinderShape.svg diff --git a/editor/icons/icon_damped_spring_joint_2d.svg b/editor/icons/DampedSpringJoint2D.svg index 9bd842bcc8..9bd842bcc8 100644 --- a/editor/icons/icon_damped_spring_joint_2d.svg +++ b/editor/icons/DampedSpringJoint2D.svg diff --git a/editor/icons/icon_debug.svg b/editor/icons/Debug.svg index 7490862c4a..7490862c4a 100644 --- a/editor/icons/icon_debug.svg +++ b/editor/icons/Debug.svg diff --git a/editor/icons/icon_debug_continue.svg b/editor/icons/DebugContinue.svg index 69c64c4fd4..69c64c4fd4 100644 --- a/editor/icons/icon_debug_continue.svg +++ b/editor/icons/DebugContinue.svg diff --git a/editor/icons/icon_debug_next.svg b/editor/icons/DebugNext.svg index 133be255e1..133be255e1 100644 --- a/editor/icons/icon_debug_next.svg +++ b/editor/icons/DebugNext.svg diff --git a/editor/icons/icon_debug_skip_breakpoints_off.svg b/editor/icons/DebugSkipBreakpointsOff.svg index f8923510bb..f8923510bb 100644 --- a/editor/icons/icon_debug_skip_breakpoints_off.svg +++ b/editor/icons/DebugSkipBreakpointsOff.svg diff --git a/editor/icons/icon_debug_skip_breakpoints_on.svg b/editor/icons/DebugSkipBreakpointsOn.svg index d4a4b4c138..d4a4b4c138 100644 --- a/editor/icons/icon_debug_skip_breakpoints_on.svg +++ b/editor/icons/DebugSkipBreakpointsOn.svg diff --git a/editor/icons/icon_debug_step.svg b/editor/icons/DebugStep.svg index c0356463fe..c0356463fe 100644 --- a/editor/icons/icon_debug_step.svg +++ b/editor/icons/DebugStep.svg diff --git a/editor/icons/icon_default_project_icon.svg b/editor/icons/DefaultProjectIcon.svg index 10ecbd019d..10ecbd019d 100644 --- a/editor/icons/icon_default_project_icon.svg +++ b/editor/icons/DefaultProjectIcon.svg diff --git a/editor/icons/icon_delete_split.svg b/editor/icons/DeleteSplit.svg index 7424de3b8a..7424de3b8a 100644 --- a/editor/icons/icon_delete_split.svg +++ b/editor/icons/DeleteSplit.svg diff --git a/editor/icons/icon_dictionary.svg b/editor/icons/Dictionary.svg index 668ef37a86..668ef37a86 100644 --- a/editor/icons/icon_dictionary.svg +++ b/editor/icons/Dictionary.svg diff --git a/editor/icons/icon_directional_light.svg b/editor/icons/DirectionalLight.svg index faac2be134..faac2be134 100644 --- a/editor/icons/icon_directional_light.svg +++ b/editor/icons/DirectionalLight.svg diff --git a/editor/icons/icon_distraction_free.svg b/editor/icons/DistractionFree.svg index 8608b33f58..8608b33f58 100644 --- a/editor/icons/icon_distraction_free.svg +++ b/editor/icons/DistractionFree.svg diff --git a/editor/icons/icon_duplicate.svg b/editor/icons/Duplicate.svg index d506b7a8c7..d506b7a8c7 100644 --- a/editor/icons/icon_duplicate.svg +++ b/editor/icons/Duplicate.svg diff --git a/editor/icons/icon_dynamic_font.svg b/editor/icons/DynamicFont.svg index fe5eca2e35..fe5eca2e35 100644 --- a/editor/icons/icon_dynamic_font.svg +++ b/editor/icons/DynamicFont.svg diff --git a/editor/icons/icon_dynamic_font_data.svg b/editor/icons/DynamicFontData.svg index 56426dd33e..56426dd33e 100644 --- a/editor/icons/icon_dynamic_font_data.svg +++ b/editor/icons/DynamicFontData.svg diff --git a/editor/icons/icon_edit.svg b/editor/icons/Edit.svg index bb7ffa2fce..bb7ffa2fce 100644 --- a/editor/icons/icon_edit.svg +++ b/editor/icons/Edit.svg diff --git a/editor/icons/icon_edit_bezier.svg b/editor/icons/EditBezier.svg index be9e2f22b8..be9e2f22b8 100644 --- a/editor/icons/icon_edit_bezier.svg +++ b/editor/icons/EditBezier.svg diff --git a/editor/icons/icon_edit_internal.svg b/editor/icons/EditInternal.svg index 2a538102ce..2a538102ce 100644 --- a/editor/icons/icon_edit_internal.svg +++ b/editor/icons/EditInternal.svg diff --git a/editor/icons/icon_edit_key.svg b/editor/icons/EditKey.svg index 883ddfda71..883ddfda71 100644 --- a/editor/icons/icon_edit_key.svg +++ b/editor/icons/EditKey.svg diff --git a/editor/icons/icon_edit_pivot.svg b/editor/icons/EditPivot.svg index ae303535b4..ae303535b4 100644 --- a/editor/icons/icon_edit_pivot.svg +++ b/editor/icons/EditPivot.svg diff --git a/editor/icons/icon_edit_resource.svg b/editor/icons/EditResource.svg index e16ca00355..e16ca00355 100644 --- a/editor/icons/icon_edit_resource.svg +++ b/editor/icons/EditResource.svg diff --git a/editor/icons/icon_editor_3d_handle.svg b/editor/icons/Editor3DHandle.svg index 687a5b184d..687a5b184d 100644 --- a/editor/icons/icon_editor_3d_handle.svg +++ b/editor/icons/Editor3DHandle.svg diff --git a/editor/icons/icon_editor_control_anchor.svg b/editor/icons/EditorControlAnchor.svg index 11e2bb5175..11e2bb5175 100644 --- a/editor/icons/icon_editor_control_anchor.svg +++ b/editor/icons/EditorControlAnchor.svg diff --git a/editor/icons/icon_editor_curve_handle.svg b/editor/icons/EditorCurveHandle.svg index c405ceab9d..c405ceab9d 100644 --- a/editor/icons/icon_editor_curve_handle.svg +++ b/editor/icons/EditorCurveHandle.svg diff --git a/editor/icons/icon_editor_handle.svg b/editor/icons/EditorHandle.svg index 8b11e782db..8b11e782db 100644 --- a/editor/icons/icon_editor_handle.svg +++ b/editor/icons/EditorHandle.svg diff --git a/editor/icons/icon_editor_handle_add.svg b/editor/icons/EditorHandleAdd.svg index bf3b604d5c..bf3b604d5c 100644 --- a/editor/icons/icon_editor_handle_add.svg +++ b/editor/icons/EditorHandleAdd.svg diff --git a/editor/icons/icon_editor_internal_handle.svg b/editor/icons/EditorInternalHandle.svg index 244e6b5d6c..244e6b5d6c 100644 --- a/editor/icons/icon_editor_internal_handle.svg +++ b/editor/icons/EditorInternalHandle.svg diff --git a/editor/icons/icon_editor_path_sharp_handle.svg b/editor/icons/EditorPathSharpHandle.svg index db160dfeae..db160dfeae 100644 --- a/editor/icons/icon_editor_path_sharp_handle.svg +++ b/editor/icons/EditorPathSharpHandle.svg diff --git a/editor/icons/icon_editor_path_smooth_handle.svg b/editor/icons/EditorPathSmoothHandle.svg index 34f3d290bd..34f3d290bd 100644 --- a/editor/icons/icon_editor_path_smooth_handle.svg +++ b/editor/icons/EditorPathSmoothHandle.svg diff --git a/editor/icons/icon_editor_pivot.svg b/editor/icons/EditorPivot.svg index 8e00f60530..8e00f60530 100644 --- a/editor/icons/icon_editor_pivot.svg +++ b/editor/icons/EditorPivot.svg diff --git a/editor/icons/icon_editor_plugin.svg b/editor/icons/EditorPlugin.svg index 72f2bd5c28..72f2bd5c28 100644 --- a/editor/icons/icon_editor_plugin.svg +++ b/editor/icons/EditorPlugin.svg diff --git a/editor/icons/icon_editor_position.svg b/editor/icons/EditorPosition.svg index 7b17fb5aa3..7b17fb5aa3 100644 --- a/editor/icons/icon_editor_position.svg +++ b/editor/icons/EditorPosition.svg diff --git a/editor/icons/icon_editor_position_previous.svg b/editor/icons/EditorPositionPrevious.svg index 8c1d2992a5..8c1d2992a5 100644 --- a/editor/icons/icon_editor_position_previous.svg +++ b/editor/icons/EditorPositionPrevious.svg diff --git a/editor/icons/icon_editor_position_unselected.svg b/editor/icons/EditorPositionUnselected.svg index b9a38ca371..b9a38ca371 100644 --- a/editor/icons/icon_editor_position_unselected.svg +++ b/editor/icons/EditorPositionUnselected.svg diff --git a/editor/icons/icon_enum.svg b/editor/icons/Enum.svg index efa3050e95..efa3050e95 100644 --- a/editor/icons/icon_enum.svg +++ b/editor/icons/Enum.svg diff --git a/editor/icons/icon_environment.svg b/editor/icons/Environment.svg index ee29342942..ee29342942 100644 --- a/editor/icons/icon_environment.svg +++ b/editor/icons/Environment.svg diff --git a/editor/icons/icon_error.svg b/editor/icons/Error.svg index 05e548068d..05e548068d 100644 --- a/editor/icons/icon_error.svg +++ b/editor/icons/Error.svg diff --git a/editor/icons/icon_error_sign.svg b/editor/icons/ErrorSign.svg index 96aace5c0c..96aace5c0c 100644 --- a/editor/icons/icon_error_sign.svg +++ b/editor/icons/ErrorSign.svg diff --git a/editor/icons/icon_expand_bottom_dock.svg b/editor/icons/ExpandBottomDock.svg index 09cc3b9b07..09cc3b9b07 100644 --- a/editor/icons/icon_expand_bottom_dock.svg +++ b/editor/icons/ExpandBottomDock.svg diff --git a/editor/icons/icon_favorites.svg b/editor/icons/Favorites.svg index 79e0c8475e..79e0c8475e 100644 --- a/editor/icons/icon_favorites.svg +++ b/editor/icons/Favorites.svg diff --git a/editor/icons/icon_file.svg b/editor/icons/File.svg index 22d330fd56..22d330fd56 100644 --- a/editor/icons/icon_file.svg +++ b/editor/icons/File.svg diff --git a/editor/icons/icon_file_big_thumb.svg b/editor/icons/FileBigThumb.svg index 50900ab684..50900ab684 100644 --- a/editor/icons/icon_file_big_thumb.svg +++ b/editor/icons/FileBigThumb.svg diff --git a/editor/icons/icon_file_broken.svg b/editor/icons/FileBroken.svg index af79f02c12..af79f02c12 100644 --- a/editor/icons/icon_file_broken.svg +++ b/editor/icons/FileBroken.svg diff --git a/editor/icons/icon_file_broken_big_thumb.svg b/editor/icons/FileBrokenBigThumb.svg index 08dee26f1c..08dee26f1c 100644 --- a/editor/icons/icon_file_broken_big_thumb.svg +++ b/editor/icons/FileBrokenBigThumb.svg diff --git a/editor/icons/icon_file_dead.svg b/editor/icons/FileDead.svg index c40aa1b9a4..c40aa1b9a4 100644 --- a/editor/icons/icon_file_dead.svg +++ b/editor/icons/FileDead.svg diff --git a/editor/icons/icon_file_dead_big_thumb.svg b/editor/icons/FileDeadBigThumb.svg index 79369873a6..79369873a6 100644 --- a/editor/icons/icon_file_dead_big_thumb.svg +++ b/editor/icons/FileDeadBigThumb.svg diff --git a/editor/icons/icon_file_dead_medium_thumb.svg b/editor/icons/FileDeadMediumThumb.svg index 62496daaae..62496daaae 100644 --- a/editor/icons/icon_file_dead_medium_thumb.svg +++ b/editor/icons/FileDeadMediumThumb.svg diff --git a/editor/icons/icon_file_dialog.svg b/editor/icons/FileDialog.svg index 7708659c21..7708659c21 100644 --- a/editor/icons/icon_file_dialog.svg +++ b/editor/icons/FileDialog.svg diff --git a/editor/icons/icon_file_list.svg b/editor/icons/FileList.svg index e47c8b18cb..e47c8b18cb 100644 --- a/editor/icons/icon_file_list.svg +++ b/editor/icons/FileList.svg diff --git a/editor/icons/icon_file_medium_thumb.svg b/editor/icons/FileMediumThumb.svg index 4c7d78b58e..4c7d78b58e 100644 --- a/editor/icons/icon_file_medium_thumb.svg +++ b/editor/icons/FileMediumThumb.svg diff --git a/editor/icons/icon_file_thumbnail.svg b/editor/icons/FileThumbnail.svg index 571335a935..571335a935 100644 --- a/editor/icons/icon_file_thumbnail.svg +++ b/editor/icons/FileThumbnail.svg diff --git a/editor/icons/icon_filesystem.svg b/editor/icons/Filesystem.svg index da6fa2ad60..da6fa2ad60 100644 --- a/editor/icons/icon_filesystem.svg +++ b/editor/icons/Filesystem.svg diff --git a/editor/icons/icon_fixed_material.svg b/editor/icons/FixedMaterial.svg index 903691689b..903691689b 100644 --- a/editor/icons/icon_fixed_material.svg +++ b/editor/icons/FixedMaterial.svg diff --git a/editor/icons/icon_fixed_spatial_material.svg b/editor/icons/FixedSpatialMaterial.svg index ba1e251088..ba1e251088 100644 --- a/editor/icons/icon_fixed_spatial_material.svg +++ b/editor/icons/FixedSpatialMaterial.svg diff --git a/editor/icons/icon_folder.svg b/editor/icons/Folder.svg index 00ff7a95e9..00ff7a95e9 100644 --- a/editor/icons/icon_folder.svg +++ b/editor/icons/Folder.svg diff --git a/editor/icons/icon_folder_big_thumb.svg b/editor/icons/FolderBigThumb.svg index a620d17b8f..a620d17b8f 100644 --- a/editor/icons/icon_folder_big_thumb.svg +++ b/editor/icons/FolderBigThumb.svg diff --git a/editor/icons/icon_folder_medium_thumb.svg b/editor/icons/FolderMediumThumb.svg index 431650aff0..431650aff0 100644 --- a/editor/icons/icon_folder_medium_thumb.svg +++ b/editor/icons/FolderMediumThumb.svg diff --git a/editor/icons/icon_font.svg b/editor/icons/Font.svg index 4b71b59d2e..4b71b59d2e 100644 --- a/editor/icons/icon_font.svg +++ b/editor/icons/Font.svg diff --git a/editor/icons/icon_forward.svg b/editor/icons/Forward.svg index aecd4b362c..aecd4b362c 100644 --- a/editor/icons/icon_forward.svg +++ b/editor/icons/Forward.svg diff --git a/editor/icons/icon_g_i_probe.svg b/editor/icons/GIProbe.svg index 5a5bfd3c5a..5a5bfd3c5a 100644 --- a/editor/icons/icon_g_i_probe.svg +++ b/editor/icons/GIProbe.svg diff --git a/editor/icons/icon_g_i_probe_data.svg b/editor/icons/GIProbeData.svg index d4765be30f..d4765be30f 100644 --- a/editor/icons/icon_g_i_probe_data.svg +++ b/editor/icons/GIProbeData.svg diff --git a/editor/icons/icon_generic_6_d_o_f_joint.svg b/editor/icons/Generic6DOFJoint.svg index 30d892e7a1..30d892e7a1 100644 --- a/editor/icons/icon_generic_6_d_o_f_joint.svg +++ b/editor/icons/Generic6DOFJoint.svg diff --git a/editor/icons/icon_gizmo_baked_lightmap.svg b/editor/icons/GizmoBakedLightmap.svg index 9568f7ff25..9568f7ff25 100644 --- a/editor/icons/icon_gizmo_baked_lightmap.svg +++ b/editor/icons/GizmoBakedLightmap.svg diff --git a/editor/icons/icon_gizmo_c_p_u_particles.svg b/editor/icons/GizmoCPUParticles.svg index d4e86d9c42..d4e86d9c42 100644 --- a/editor/icons/icon_gizmo_c_p_u_particles.svg +++ b/editor/icons/GizmoCPUParticles.svg diff --git a/editor/icons/icon_gizmo_camera.svg b/editor/icons/GizmoCamera.svg index f28efb813e..f28efb813e 100644 --- a/editor/icons/icon_gizmo_camera.svg +++ b/editor/icons/GizmoCamera.svg diff --git a/editor/icons/icon_gizmo_directional_light.svg b/editor/icons/GizmoDirectionalLight.svg index dc2d6bf82d..dc2d6bf82d 100644 --- a/editor/icons/icon_gizmo_directional_light.svg +++ b/editor/icons/GizmoDirectionalLight.svg diff --git a/editor/icons/icon_gizmo_g_i_probe.svg b/editor/icons/GizmoGIProbe.svg index c792dc5a28..c792dc5a28 100644 --- a/editor/icons/icon_gizmo_g_i_probe.svg +++ b/editor/icons/GizmoGIProbe.svg diff --git a/editor/icons/icon_gizmo_light.svg b/editor/icons/GizmoLight.svg index 1e47082a0a..1e47082a0a 100644 --- a/editor/icons/icon_gizmo_light.svg +++ b/editor/icons/GizmoLight.svg diff --git a/editor/icons/icon_gizmo_listener.svg b/editor/icons/GizmoListener.svg index 9e28c7730f..9e28c7730f 100644 --- a/editor/icons/icon_gizmo_listener.svg +++ b/editor/icons/GizmoListener.svg diff --git a/editor/icons/icon_gizmo_particles.svg b/editor/icons/GizmoParticles.svg index 1c5d8c5f2d..1c5d8c5f2d 100644 --- a/editor/icons/icon_gizmo_particles.svg +++ b/editor/icons/GizmoParticles.svg diff --git a/editor/icons/icon_gizmo_reflection_probe.svg b/editor/icons/GizmoReflectionProbe.svg index 82136821c7..82136821c7 100644 --- a/editor/icons/icon_gizmo_reflection_probe.svg +++ b/editor/icons/GizmoReflectionProbe.svg diff --git a/editor/icons/icon_gizmo_spatial_sample_player.svg b/editor/icons/GizmoSpatialSamplePlayer.svg index ee471124dc..ee471124dc 100644 --- a/editor/icons/icon_gizmo_spatial_sample_player.svg +++ b/editor/icons/GizmoSpatialSamplePlayer.svg diff --git a/editor/icons/icon_gizmo_spot_light.svg b/editor/icons/GizmoSpotLight.svg index 23a8364679..23a8364679 100644 --- a/editor/icons/icon_gizmo_spot_light.svg +++ b/editor/icons/GizmoSpotLight.svg diff --git a/editor/icons/icon_godot.svg b/editor/icons/Godot.svg index 8ca9fdcabd..8ca9fdcabd 100644 --- a/editor/icons/icon_godot.svg +++ b/editor/icons/Godot.svg diff --git a/editor/icons/icon_gradient.svg b/editor/icons/Gradient.svg index b67a9e6f8a..b67a9e6f8a 100644 --- a/editor/icons/icon_gradient.svg +++ b/editor/icons/Gradient.svg diff --git a/editor/icons/icon_gradient_texture.svg b/editor/icons/GradientTexture.svg index 1388c141bd..1388c141bd 100644 --- a/editor/icons/icon_gradient_texture.svg +++ b/editor/icons/GradientTexture.svg diff --git a/editor/icons/icon_graph_edit.svg b/editor/icons/GraphEdit.svg index 7ab7245260..7ab7245260 100644 --- a/editor/icons/icon_graph_edit.svg +++ b/editor/icons/GraphEdit.svg diff --git a/editor/icons/icon_graph_node.svg b/editor/icons/GraphNode.svg index c8d4fda910..c8d4fda910 100644 --- a/editor/icons/icon_graph_node.svg +++ b/editor/icons/GraphNode.svg diff --git a/editor/icons/icon_grid.svg b/editor/icons/Grid.svg index 869bc649fe..869bc649fe 100644 --- a/editor/icons/icon_grid.svg +++ b/editor/icons/Grid.svg diff --git a/editor/icons/icon_grid_container.svg b/editor/icons/GridContainer.svg index 9fffd8b342..9fffd8b342 100644 --- a/editor/icons/icon_grid_container.svg +++ b/editor/icons/GridContainer.svg diff --git a/editor/icons/icon_groove_joint_2d.svg b/editor/icons/GrooveJoint2D.svg index a2c7b741ad..a2c7b741ad 100644 --- a/editor/icons/icon_groove_joint_2d.svg +++ b/editor/icons/GrooveJoint2D.svg diff --git a/editor/icons/icon_group.svg b/editor/icons/Group.svg index 7e0b2f3675..7e0b2f3675 100644 --- a/editor/icons/icon_group.svg +++ b/editor/icons/Group.svg diff --git a/editor/icons/icon_group_viewport.svg b/editor/icons/GroupViewport.svg index 768c87e18d..768c87e18d 100644 --- a/editor/icons/icon_group_viewport.svg +++ b/editor/icons/GroupViewport.svg diff --git a/editor/icons/icon_groups.svg b/editor/icons/Groups.svg index 5c8bd73f0f..5c8bd73f0f 100644 --- a/editor/icons/icon_groups.svg +++ b/editor/icons/Groups.svg diff --git a/editor/icons/icon_GUI_checked.svg b/editor/icons/GuiChecked.svg index 8d00eca8d3..8d00eca8d3 100644 --- a/editor/icons/icon_GUI_checked.svg +++ b/editor/icons/GuiChecked.svg diff --git a/editor/icons/icon_gui_close.svg b/editor/icons/GuiClose.svg index 3596061877..3596061877 100644 --- a/editor/icons/icon_gui_close.svg +++ b/editor/icons/GuiClose.svg diff --git a/editor/icons/icon_gui_close_customizable.svg b/editor/icons/GuiCloseCustomizable.svg index 3596061877..3596061877 100644 --- a/editor/icons/icon_gui_close_customizable.svg +++ b/editor/icons/GuiCloseCustomizable.svg diff --git a/editor/icons/icon_GUI_dropdown.svg b/editor/icons/GuiDropdown.svg index 3ed9466f4a..3ed9466f4a 100644 --- a/editor/icons/icon_GUI_dropdown.svg +++ b/editor/icons/GuiDropdown.svg diff --git a/editor/icons/icon_GUI_ellipsis.svg b/editor/icons/GuiEllipsis.svg index 4d530d635e..4d530d635e 100644 --- a/editor/icons/icon_GUI_ellipsis.svg +++ b/editor/icons/GuiEllipsis.svg diff --git a/editor/icons/icon_gui_graph_node_port.svg b/editor/icons/GuiGraphNodePort.svg index 2023a30ead..2023a30ead 100644 --- a/editor/icons/icon_gui_graph_node_port.svg +++ b/editor/icons/GuiGraphNodePort.svg diff --git a/editor/icons/icon_GUI_h_tick.svg b/editor/icons/GuiHTick.svg index 01fecf5d12..01fecf5d12 100644 --- a/editor/icons/icon_GUI_h_tick.svg +++ b/editor/icons/GuiHTick.svg diff --git a/editor/icons/icon_GUI_hsplitter.svg b/editor/icons/GuiHsplitter.svg index f94a81cb1e..f94a81cb1e 100644 --- a/editor/icons/icon_GUI_hsplitter.svg +++ b/editor/icons/GuiHsplitter.svg diff --git a/editor/icons/icon_GUI_mini_checkerboard.svg b/editor/icons/GuiMiniCheckerboard.svg index dc6c7e37d1..dc6c7e37d1 100644 --- a/editor/icons/icon_GUI_mini_checkerboard.svg +++ b/editor/icons/GuiMiniCheckerboard.svg diff --git a/editor/icons/icon_GUI_option_arrow.svg b/editor/icons/GuiOptionArrow.svg index 28435e08c3..28435e08c3 100644 --- a/editor/icons/icon_GUI_option_arrow.svg +++ b/editor/icons/GuiOptionArrow.svg diff --git a/editor/icons/icon_GUI_progress_bar.svg b/editor/icons/GuiProgressBar.svg index a7a57adaa7..a7a57adaa7 100644 --- a/editor/icons/icon_GUI_progress_bar.svg +++ b/editor/icons/GuiProgressBar.svg diff --git a/editor/icons/icon_GUI_progress_fill.svg b/editor/icons/GuiProgressFill.svg index a75bf93edd..a75bf93edd 100644 --- a/editor/icons/icon_GUI_progress_fill.svg +++ b/editor/icons/GuiProgressFill.svg diff --git a/editor/icons/icon_GUI_radio_checked.svg b/editor/icons/GuiRadioChecked.svg index 447b57f8ae..447b57f8ae 100644 --- a/editor/icons/icon_GUI_radio_checked.svg +++ b/editor/icons/GuiRadioChecked.svg diff --git a/editor/icons/icon_GUI_radio_unchecked.svg b/editor/icons/GuiRadioUnchecked.svg index 1e8117bd10..1e8117bd10 100644 --- a/editor/icons/icon_GUI_radio_unchecked.svg +++ b/editor/icons/GuiRadioUnchecked.svg diff --git a/editor/icons/icon_gui_resizer.svg b/editor/icons/GuiResizer.svg index 545a1c9612..545a1c9612 100644 --- a/editor/icons/icon_gui_resizer.svg +++ b/editor/icons/GuiResizer.svg diff --git a/editor/icons/icon_GUI_scroll_arrow_left.svg b/editor/icons/GuiScrollArrowLeft.svg index a118f04e17..a118f04e17 100644 --- a/editor/icons/icon_GUI_scroll_arrow_left.svg +++ b/editor/icons/GuiScrollArrowLeft.svg diff --git a/editor/icons/icon_GUI_scroll_arrow_left_hl.svg b/editor/icons/GuiScrollArrowLeftHl.svg index 046356f18b..046356f18b 100644 --- a/editor/icons/icon_GUI_scroll_arrow_left_hl.svg +++ b/editor/icons/GuiScrollArrowLeftHl.svg diff --git a/editor/icons/icon_GUI_scroll_arrow_right.svg b/editor/icons/GuiScrollArrowRight.svg index 4e0a8b5327..4e0a8b5327 100644 --- a/editor/icons/icon_GUI_scroll_arrow_right.svg +++ b/editor/icons/GuiScrollArrowRight.svg diff --git a/editor/icons/icon_GUI_scroll_arrow_right_hl.svg b/editor/icons/GuiScrollArrowRightHl.svg index 4224ca8de4..4224ca8de4 100644 --- a/editor/icons/icon_GUI_scroll_arrow_right_hl.svg +++ b/editor/icons/GuiScrollArrowRightHl.svg diff --git a/editor/icons/icon_GUI_scroll_bg.svg b/editor/icons/GuiScrollBg.svg index 263b42ea61..263b42ea61 100644 --- a/editor/icons/icon_GUI_scroll_bg.svg +++ b/editor/icons/GuiScrollBg.svg diff --git a/editor/icons/icon_GUI_scroll_grabber.svg b/editor/icons/GuiScrollGrabber.svg index 9f6e9f2e25..9f6e9f2e25 100644 --- a/editor/icons/icon_GUI_scroll_grabber.svg +++ b/editor/icons/GuiScrollGrabber.svg diff --git a/editor/icons/icon_GUI_scroll_grabber_hl.svg b/editor/icons/GuiScrollGrabberHl.svg index bf5bce6934..bf5bce6934 100644 --- a/editor/icons/icon_GUI_scroll_grabber_hl.svg +++ b/editor/icons/GuiScrollGrabberHl.svg diff --git a/editor/icons/icon_GUI_scroll_grabber_pressed.svg b/editor/icons/GuiScrollGrabberPressed.svg index da26032474..da26032474 100644 --- a/editor/icons/icon_GUI_scroll_grabber_pressed.svg +++ b/editor/icons/GuiScrollGrabberPressed.svg diff --git a/editor/icons/icon_GUI_slider_grabber.svg b/editor/icons/GuiSliderGrabber.svg index dd751ead80..dd751ead80 100644 --- a/editor/icons/icon_GUI_slider_grabber.svg +++ b/editor/icons/GuiSliderGrabber.svg diff --git a/editor/icons/icon_GUI_slider_grabber_hl.svg b/editor/icons/GuiSliderGrabberHl.svg index 90d62934ec..90d62934ec 100644 --- a/editor/icons/icon_GUI_slider_grabber_hl.svg +++ b/editor/icons/GuiSliderGrabberHl.svg diff --git a/editor/icons/icon_GUI_space.svg b/editor/icons/GuiSpace.svg index b43e97b6e1..b43e97b6e1 100644 --- a/editor/icons/icon_GUI_space.svg +++ b/editor/icons/GuiSpace.svg diff --git a/editor/icons/icon_GUI_spinbox_updown.svg b/editor/icons/GuiSpinboxUpdown.svg index a6776728e3..a6776728e3 100644 --- a/editor/icons/icon_GUI_spinbox_updown.svg +++ b/editor/icons/GuiSpinboxUpdown.svg diff --git a/editor/icons/icon_GUI_tab.svg b/editor/icons/GuiTab.svg index 8451ebe5c0..8451ebe5c0 100644 --- a/editor/icons/icon_GUI_tab.svg +++ b/editor/icons/GuiTab.svg diff --git a/editor/icons/icon_GUI_tab_menu.svg b/editor/icons/GuiTabMenu.svg index 8bf5ef2f7d..8bf5ef2f7d 100644 --- a/editor/icons/icon_GUI_tab_menu.svg +++ b/editor/icons/GuiTabMenu.svg diff --git a/editor/icons/icon_GUI_tab_menu_hl.svg b/editor/icons/GuiTabMenuHl.svg index 42d58a5abf..42d58a5abf 100644 --- a/editor/icons/icon_GUI_tab_menu_hl.svg +++ b/editor/icons/GuiTabMenuHl.svg diff --git a/editor/icons/icon_GUI_toggle_off.svg b/editor/icons/GuiToggleOff.svg index 46f13d198d..46f13d198d 100644 --- a/editor/icons/icon_GUI_toggle_off.svg +++ b/editor/icons/GuiToggleOff.svg diff --git a/editor/icons/icon_GUI_toggle_on.svg b/editor/icons/GuiToggleOn.svg index 0316680daa..0316680daa 100644 --- a/editor/icons/icon_GUI_toggle_on.svg +++ b/editor/icons/GuiToggleOn.svg diff --git a/editor/icons/icon_GUI_tree_arrow_down.svg b/editor/icons/GuiTreeArrowDown.svg index fd2d900711..fd2d900711 100644 --- a/editor/icons/icon_GUI_tree_arrow_down.svg +++ b/editor/icons/GuiTreeArrowDown.svg diff --git a/editor/icons/icon_GUI_tree_arrow_right.svg b/editor/icons/GuiTreeArrowRight.svg index e20c92e2e7..e20c92e2e7 100644 --- a/editor/icons/icon_GUI_tree_arrow_right.svg +++ b/editor/icons/GuiTreeArrowRight.svg diff --git a/editor/icons/icon_GUI_tree_arrow_up.svg b/editor/icons/GuiTreeArrowUp.svg index 464363a8b1..464363a8b1 100644 --- a/editor/icons/icon_GUI_tree_arrow_up.svg +++ b/editor/icons/GuiTreeArrowUp.svg diff --git a/editor/icons/icon_GUI_tree_updown.svg b/editor/icons/GuiTreeUpdown.svg index 66716845df..66716845df 100644 --- a/editor/icons/icon_GUI_tree_updown.svg +++ b/editor/icons/GuiTreeUpdown.svg diff --git a/editor/icons/icon_GUI_unchecked.svg b/editor/icons/GuiUnchecked.svg index 9575422df3..9575422df3 100644 --- a/editor/icons/icon_GUI_unchecked.svg +++ b/editor/icons/GuiUnchecked.svg diff --git a/editor/icons/icon_GUI_v_tick.svg b/editor/icons/GuiVTick.svg index 4205237952..4205237952 100644 --- a/editor/icons/icon_GUI_v_tick.svg +++ b/editor/icons/GuiVTick.svg diff --git a/editor/icons/icon_GUI_viewport_hdiagsplitter.svg b/editor/icons/GuiViewportHdiagsplitter.svg index b1705582dc..b1705582dc 100644 --- a/editor/icons/icon_GUI_viewport_hdiagsplitter.svg +++ b/editor/icons/GuiViewportHdiagsplitter.svg diff --git a/editor/icons/icon_GUI_viewport_vdiagsplitter.svg b/editor/icons/GuiViewportVdiagsplitter.svg index 0817529ff1..0817529ff1 100644 --- a/editor/icons/icon_GUI_viewport_vdiagsplitter.svg +++ b/editor/icons/GuiViewportVdiagsplitter.svg diff --git a/editor/icons/icon_GUI_viewport_vhsplitter.svg b/editor/icons/GuiViewportVhsplitter.svg index a11fbd1b4c..a11fbd1b4c 100644 --- a/editor/icons/icon_GUI_viewport_vhsplitter.svg +++ b/editor/icons/GuiViewportVhsplitter.svg diff --git a/editor/icons/icon_GUI_visibility_hidden.svg b/editor/icons/GuiVisibilityHidden.svg index 1d1e61d1bb..1d1e61d1bb 100644 --- a/editor/icons/icon_GUI_visibility_hidden.svg +++ b/editor/icons/GuiVisibilityHidden.svg diff --git a/editor/icons/icon_GUI_visibility_visible.svg b/editor/icons/GuiVisibilityVisible.svg index 2e56f57ed8..2e56f57ed8 100644 --- a/editor/icons/icon_GUI_visibility_visible.svg +++ b/editor/icons/GuiVisibilityVisible.svg diff --git a/editor/icons/icon_GUI_visibility_xray.svg b/editor/icons/GuiVisibilityXray.svg index 241ff3e7e5..241ff3e7e5 100644 --- a/editor/icons/icon_GUI_visibility_xray.svg +++ b/editor/icons/GuiVisibilityXray.svg diff --git a/editor/icons/icon_GUI_vsplit_bg.svg b/editor/icons/GuiVsplitBg.svg index fa572c797e..fa572c797e 100644 --- a/editor/icons/icon_GUI_vsplit_bg.svg +++ b/editor/icons/GuiVsplitBg.svg diff --git a/editor/icons/icon_GUI_vsplitter.svg b/editor/icons/GuiVsplitter.svg index 8629801713..8629801713 100644 --- a/editor/icons/icon_GUI_vsplitter.svg +++ b/editor/icons/GuiVsplitter.svg diff --git a/editor/icons/icon_h_box_container.svg b/editor/icons/HBoxContainer.svg index 0ddbaf5a2e..0ddbaf5a2e 100644 --- a/editor/icons/icon_h_box_container.svg +++ b/editor/icons/HBoxContainer.svg diff --git a/editor/icons/icon_h_scroll_bar.svg b/editor/icons/HScrollBar.svg index 039ebdf0c1..039ebdf0c1 100644 --- a/editor/icons/icon_h_scroll_bar.svg +++ b/editor/icons/HScrollBar.svg diff --git a/editor/icons/icon_h_separator.svg b/editor/icons/HSeparator.svg index 762992acb8..762992acb8 100644 --- a/editor/icons/icon_h_separator.svg +++ b/editor/icons/HSeparator.svg diff --git a/editor/icons/icon_h_slider.svg b/editor/icons/HSlider.svg index 20fbf0d00b..20fbf0d00b 100644 --- a/editor/icons/icon_h_slider.svg +++ b/editor/icons/HSlider.svg diff --git a/editor/icons/icon_h_split_container.svg b/editor/icons/HSplitContainer.svg index ae7c05ee61..ae7c05ee61 100644 --- a/editor/icons/icon_h_split_container.svg +++ b/editor/icons/HSplitContainer.svg diff --git a/editor/icons/icon_h_t_t_p_request.svg b/editor/icons/HTTPRequest.svg index c79af15a43..c79af15a43 100644 --- a/editor/icons/icon_h_t_t_p_request.svg +++ b/editor/icons/HTTPRequest.svg diff --git a/editor/icons/icon_headphones.svg b/editor/icons/Headphones.svg index 82ef7acb29..82ef7acb29 100644 --- a/editor/icons/icon_headphones.svg +++ b/editor/icons/Headphones.svg diff --git a/editor/icons/icon_height_map_shape.svg b/editor/icons/HeightMapShape.svg index 2e0bf53565..2e0bf53565 100644 --- a/editor/icons/icon_height_map_shape.svg +++ b/editor/icons/HeightMapShape.svg diff --git a/editor/icons/icon_help.svg b/editor/icons/Help.svg index d993c95982..d993c95982 100644 --- a/editor/icons/icon_help.svg +++ b/editor/icons/Help.svg diff --git a/editor/icons/icon_help_search.svg b/editor/icons/HelpSearch.svg index 4a82ba23c7..4a82ba23c7 100644 --- a/editor/icons/icon_help_search.svg +++ b/editor/icons/HelpSearch.svg diff --git a/editor/icons/icon_hinge_joint.svg b/editor/icons/HingeJoint.svg index 21b3e29cb5..21b3e29cb5 100644 --- a/editor/icons/icon_hinge_joint.svg +++ b/editor/icons/HingeJoint.svg diff --git a/editor/icons/icon_history.svg b/editor/icons/History.svg index 48eed7b0c8..48eed7b0c8 100644 --- a/editor/icons/icon_history.svg +++ b/editor/icons/History.svg diff --git a/editor/icons/icon_hsize.svg b/editor/icons/Hsize.svg index 075bab1050..075bab1050 100644 --- a/editor/icons/icon_hsize.svg +++ b/editor/icons/Hsize.svg diff --git a/editor/icons/icon_image.svg b/editor/icons/Image.svg index f3beda898e..f3beda898e 100644 --- a/editor/icons/icon_image.svg +++ b/editor/icons/Image.svg diff --git a/editor/icons/icon_image_texture.svg b/editor/icons/ImageTexture.svg index 6e9905881b..6e9905881b 100644 --- a/editor/icons/icon_image_texture.svg +++ b/editor/icons/ImageTexture.svg diff --git a/editor/icons/icon_immediate_geometry.svg b/editor/icons/ImmediateGeometry.svg index 5679d5906f..5679d5906f 100644 --- a/editor/icons/icon_immediate_geometry.svg +++ b/editor/icons/ImmediateGeometry.svg diff --git a/editor/icons/icon_import_check.svg b/editor/icons/ImportCheck.svg index b2b967f37a..b2b967f37a 100644 --- a/editor/icons/icon_import_check.svg +++ b/editor/icons/ImportCheck.svg diff --git a/editor/icons/icon_import_fail.svg b/editor/icons/ImportFail.svg index 6c81f88d9f..6c81f88d9f 100644 --- a/editor/icons/icon_import_fail.svg +++ b/editor/icons/ImportFail.svg diff --git a/editor/icons/icon_information_sign.svg b/editor/icons/InformationSign.svg index a99be1b042..a99be1b042 100644 --- a/editor/icons/icon_information_sign.svg +++ b/editor/icons/InformationSign.svg diff --git a/editor/icons/icon_insert_after.svg b/editor/icons/InsertAfter.svg index cab00048ac..cab00048ac 100644 --- a/editor/icons/icon_insert_after.svg +++ b/editor/icons/InsertAfter.svg diff --git a/editor/icons/icon_insert_before.svg b/editor/icons/InsertBefore.svg index 366be3a1e6..366be3a1e6 100644 --- a/editor/icons/icon_insert_before.svg +++ b/editor/icons/InsertBefore.svg diff --git a/editor/icons/icon_instance.svg b/editor/icons/Instance.svg index 8fc985bb51..8fc985bb51 100644 --- a/editor/icons/icon_instance.svg +++ b/editor/icons/Instance.svg diff --git a/editor/icons/icon_instance_options.svg b/editor/icons/InstanceOptions.svg index ca9a5bcc87..ca9a5bcc87 100644 --- a/editor/icons/icon_instance_options.svg +++ b/editor/icons/InstanceOptions.svg diff --git a/editor/icons/icon_interp_cubic.svg b/editor/icons/InterpCubic.svg index c2dd7db08c..c2dd7db08c 100644 --- a/editor/icons/icon_interp_cubic.svg +++ b/editor/icons/InterpCubic.svg diff --git a/editor/icons/icon_interp_linear.svg b/editor/icons/InterpLinear.svg index 368be15315..368be15315 100644 --- a/editor/icons/icon_interp_linear.svg +++ b/editor/icons/InterpLinear.svg diff --git a/editor/icons/icon_interp_raw.svg b/editor/icons/InterpRaw.svg index 1c6ae0062a..1c6ae0062a 100644 --- a/editor/icons/icon_interp_raw.svg +++ b/editor/icons/InterpRaw.svg diff --git a/editor/icons/icon_interp_wrap_clamp.svg b/editor/icons/InterpWrapClamp.svg index 9634dc8a07..9634dc8a07 100644 --- a/editor/icons/icon_interp_wrap_clamp.svg +++ b/editor/icons/InterpWrapClamp.svg diff --git a/editor/icons/icon_interp_wrap_loop.svg b/editor/icons/InterpWrapLoop.svg index 6fbb4356c8..6fbb4356c8 100644 --- a/editor/icons/icon_interp_wrap_loop.svg +++ b/editor/icons/InterpWrapLoop.svg diff --git a/editor/icons/icon_interpolated_camera.svg b/editor/icons/InterpolatedCamera.svg index 4bc4ba1ee9..4bc4ba1ee9 100644 --- a/editor/icons/icon_interpolated_camera.svg +++ b/editor/icons/InterpolatedCamera.svg diff --git a/editor/icons/icon_inverse_kinematics.svg b/editor/icons/InverseKinematics.svg index a98c989ccc..a98c989ccc 100644 --- a/editor/icons/icon_inverse_kinematics.svg +++ b/editor/icons/InverseKinematics.svg diff --git a/editor/icons/icon_issue.svg b/editor/icons/Issue.svg index ddaaf41440..ddaaf41440 100644 --- a/editor/icons/icon_issue.svg +++ b/editor/icons/Issue.svg diff --git a/editor/icons/icon_item_list.svg b/editor/icons/ItemList.svg index 311ed08a44..311ed08a44 100644 --- a/editor/icons/icon_item_list.svg +++ b/editor/icons/ItemList.svg diff --git a/editor/icons/icon_joy_axis.svg b/editor/icons/JoyAxis.svg index cb7b5cdf8f..cb7b5cdf8f 100644 --- a/editor/icons/icon_joy_axis.svg +++ b/editor/icons/JoyAxis.svg diff --git a/editor/icons/icon_joy_button.svg b/editor/icons/JoyButton.svg index 9f4fbfdf2d..9f4fbfdf2d 100644 --- a/editor/icons/icon_joy_button.svg +++ b/editor/icons/JoyButton.svg diff --git a/editor/icons/icon_joypad.svg b/editor/icons/Joypad.svg index 8cb5de0c0e..8cb5de0c0e 100644 --- a/editor/icons/icon_joypad.svg +++ b/editor/icons/Joypad.svg diff --git a/editor/icons/icon_key.svg b/editor/icons/Key.svg index d134735c53..d134735c53 100644 --- a/editor/icons/icon_key.svg +++ b/editor/icons/Key.svg diff --git a/editor/icons/icon_key_animation.svg b/editor/icons/KeyAnimation.svg index 6db513ca26..6db513ca26 100644 --- a/editor/icons/icon_key_animation.svg +++ b/editor/icons/KeyAnimation.svg diff --git a/editor/icons/icon_key_audio.svg b/editor/icons/KeyAudio.svg index 75576885ec..75576885ec 100644 --- a/editor/icons/icon_key_audio.svg +++ b/editor/icons/KeyAudio.svg diff --git a/editor/icons/icon_key_bezier.svg b/editor/icons/KeyBezier.svg index dc5800fd5a..dc5800fd5a 100644 --- a/editor/icons/icon_key_bezier.svg +++ b/editor/icons/KeyBezier.svg diff --git a/editor/icons/icon_key_bezier_handle.svg b/editor/icons/KeyBezierHandle.svg index 9f00f61304..9f00f61304 100644 --- a/editor/icons/icon_key_bezier_handle.svg +++ b/editor/icons/KeyBezierHandle.svg diff --git a/editor/icons/icon_key_bezier_point.svg b/editor/icons/KeyBezierPoint.svg index 0edb55cda1..0edb55cda1 100644 --- a/editor/icons/icon_key_bezier_point.svg +++ b/editor/icons/KeyBezierPoint.svg diff --git a/editor/icons/icon_key_bezier_selected.svg b/editor/icons/KeyBezierSelected.svg index 9e50e2bdf1..9e50e2bdf1 100644 --- a/editor/icons/icon_key_bezier_selected.svg +++ b/editor/icons/KeyBezierSelected.svg diff --git a/editor/icons/icon_key_call.svg b/editor/icons/KeyCall.svg index 6cc442c391..6cc442c391 100644 --- a/editor/icons/icon_key_call.svg +++ b/editor/icons/KeyCall.svg diff --git a/editor/icons/icon_key_hover.svg b/editor/icons/KeyHover.svg index 417621716b..417621716b 100644 --- a/editor/icons/icon_key_hover.svg +++ b/editor/icons/KeyHover.svg diff --git a/editor/icons/icon_key_invalid.svg b/editor/icons/KeyInvalid.svg index 8ac9445b31..8ac9445b31 100644 --- a/editor/icons/icon_key_invalid.svg +++ b/editor/icons/KeyInvalid.svg diff --git a/editor/icons/icon_key_next.svg b/editor/icons/KeyNext.svg index 2d064e7e86..2d064e7e86 100644 --- a/editor/icons/icon_key_next.svg +++ b/editor/icons/KeyNext.svg diff --git a/editor/icons/icon_key_position.svg b/editor/icons/KeyPosition.svg index d152b76e8d..d152b76e8d 100644 --- a/editor/icons/icon_key_position.svg +++ b/editor/icons/KeyPosition.svg diff --git a/editor/icons/icon_key_rotation.svg b/editor/icons/KeyRotation.svg index 0d3577eac4..0d3577eac4 100644 --- a/editor/icons/icon_key_rotation.svg +++ b/editor/icons/KeyRotation.svg diff --git a/editor/icons/icon_key_scale.svg b/editor/icons/KeyScale.svg index a1214db62e..a1214db62e 100644 --- a/editor/icons/icon_key_scale.svg +++ b/editor/icons/KeyScale.svg diff --git a/editor/icons/icon_key_selected.svg b/editor/icons/KeySelected.svg index 6594aec6ee..6594aec6ee 100644 --- a/editor/icons/icon_key_selected.svg +++ b/editor/icons/KeySelected.svg diff --git a/editor/icons/icon_key_value.svg b/editor/icons/KeyValue.svg index 8a4787d6ed..8a4787d6ed 100644 --- a/editor/icons/icon_key_value.svg +++ b/editor/icons/KeyValue.svg diff --git a/editor/icons/icon_key_xform.svg b/editor/icons/KeyXform.svg index 4a567075a7..4a567075a7 100644 --- a/editor/icons/icon_key_xform.svg +++ b/editor/icons/KeyXform.svg diff --git a/editor/icons/icon_keyboard.svg b/editor/icons/Keyboard.svg index bd8736278d..bd8736278d 100644 --- a/editor/icons/icon_keyboard.svg +++ b/editor/icons/Keyboard.svg diff --git a/editor/icons/icon_kinematic_body.svg b/editor/icons/KinematicBody.svg index 16078fbdec..16078fbdec 100644 --- a/editor/icons/icon_kinematic_body.svg +++ b/editor/icons/KinematicBody.svg diff --git a/editor/icons/icon_kinematic_body_2d.svg b/editor/icons/KinematicBody2D.svg index be9dfa2d27..be9dfa2d27 100644 --- a/editor/icons/icon_kinematic_body_2d.svg +++ b/editor/icons/KinematicBody2D.svg diff --git a/editor/icons/icon_label.svg b/editor/icons/Label.svg index 24de398501..24de398501 100644 --- a/editor/icons/icon_label.svg +++ b/editor/icons/Label.svg diff --git a/editor/icons/icon_large_texture.svg b/editor/icons/LargeTexture.svg index 15920bf3d3..15920bf3d3 100644 --- a/editor/icons/icon_large_texture.svg +++ b/editor/icons/LargeTexture.svg diff --git a/editor/icons/icon_light_2d.svg b/editor/icons/Light2D.svg index 87cfb29149..87cfb29149 100644 --- a/editor/icons/icon_light_2d.svg +++ b/editor/icons/Light2D.svg diff --git a/editor/icons/icon_light_occluder_2d.svg b/editor/icons/LightOccluder2D.svg index 2905f9badd..2905f9badd 100644 --- a/editor/icons/icon_light_occluder_2d.svg +++ b/editor/icons/LightOccluder2D.svg diff --git a/editor/icons/icon_line_2d.svg b/editor/icons/Line2D.svg index 9728262e50..9728262e50 100644 --- a/editor/icons/icon_line_2d.svg +++ b/editor/icons/Line2D.svg diff --git a/editor/icons/icon_line_edit.svg b/editor/icons/LineEdit.svg index 4df7a3b248..4df7a3b248 100644 --- a/editor/icons/icon_line_edit.svg +++ b/editor/icons/LineEdit.svg diff --git a/editor/icons/icon_line_shape_2d.svg b/editor/icons/LineShape2D.svg index 758c0fbef2..758c0fbef2 100644 --- a/editor/icons/icon_line_shape_2d.svg +++ b/editor/icons/LineShape2D.svg diff --git a/editor/icons/icon_link_button.svg b/editor/icons/LinkButton.svg index bf7f7657eb..bf7f7657eb 100644 --- a/editor/icons/icon_link_button.svg +++ b/editor/icons/LinkButton.svg diff --git a/editor/icons/icon_list_select.svg b/editor/icons/ListSelect.svg index 42feb1922b..42feb1922b 100644 --- a/editor/icons/icon_list_select.svg +++ b/editor/icons/ListSelect.svg diff --git a/editor/icons/icon_listener.svg b/editor/icons/Listener.svg index 96eaeaffa9..96eaeaffa9 100644 --- a/editor/icons/icon_listener.svg +++ b/editor/icons/Listener.svg diff --git a/editor/icons/icon_load.svg b/editor/icons/Load.svg index 7ee6ae2a2d..7ee6ae2a2d 100644 --- a/editor/icons/icon_load.svg +++ b/editor/icons/Load.svg diff --git a/editor/icons/icon_lock.svg b/editor/icons/Lock.svg index 4136dad557..4136dad557 100644 --- a/editor/icons/icon_lock.svg +++ b/editor/icons/Lock.svg diff --git a/editor/icons/icon_lock_viewport.svg b/editor/icons/LockViewport.svg index 99c066055d..99c066055d 100644 --- a/editor/icons/icon_lock_viewport.svg +++ b/editor/icons/LockViewport.svg diff --git a/editor/icons/icon_logo.svg b/editor/icons/Logo.svg index f5379c48d4..f5379c48d4 100644 --- a/editor/icons/icon_logo.svg +++ b/editor/icons/Logo.svg diff --git a/editor/icons/icon_loop.svg b/editor/icons/Loop.svg index bbb8dadc06..bbb8dadc06 100644 --- a/editor/icons/icon_loop.svg +++ b/editor/icons/Loop.svg diff --git a/editor/icons/icon_loop_interpolation.svg b/editor/icons/LoopInterpolation.svg index 052a34ab36..052a34ab36 100644 --- a/editor/icons/icon_loop_interpolation.svg +++ b/editor/icons/LoopInterpolation.svg diff --git a/editor/icons/icon_main_play.svg b/editor/icons/MainPlay.svg index 5fd62b9453..5fd62b9453 100644 --- a/editor/icons/icon_main_play.svg +++ b/editor/icons/MainPlay.svg diff --git a/editor/icons/icon_margin_container.svg b/editor/icons/MarginContainer.svg index f11b415c06..f11b415c06 100644 --- a/editor/icons/icon_margin_container.svg +++ b/editor/icons/MarginContainer.svg diff --git a/editor/icons/icon_match_case.svg b/editor/icons/MatchCase.svg index 1b348f3d46..1b348f3d46 100644 --- a/editor/icons/icon_match_case.svg +++ b/editor/icons/MatchCase.svg diff --git a/editor/icons/icon_material_preview_cube.svg b/editor/icons/MaterialPreviewCube.svg index 7992ce05c1..7992ce05c1 100644 --- a/editor/icons/icon_material_preview_cube.svg +++ b/editor/icons/MaterialPreviewCube.svg diff --git a/editor/icons/icon_material_preview_cube_off.svg b/editor/icons/MaterialPreviewCubeOff.svg index 6dfe169eae..6dfe169eae 100644 --- a/editor/icons/icon_material_preview_cube_off.svg +++ b/editor/icons/MaterialPreviewCubeOff.svg diff --git a/editor/icons/icon_material_preview_light_1.svg b/editor/icons/MaterialPreviewLight1.svg index 3003793013..3003793013 100644 --- a/editor/icons/icon_material_preview_light_1.svg +++ b/editor/icons/MaterialPreviewLight1.svg diff --git a/editor/icons/icon_material_preview_light_1_off.svg b/editor/icons/MaterialPreviewLight1Off.svg index 6948e3d77e..6948e3d77e 100644 --- a/editor/icons/icon_material_preview_light_1_off.svg +++ b/editor/icons/MaterialPreviewLight1Off.svg diff --git a/editor/icons/icon_material_preview_light_2.svg b/editor/icons/MaterialPreviewLight2.svg index 08c05379e4..08c05379e4 100644 --- a/editor/icons/icon_material_preview_light_2.svg +++ b/editor/icons/MaterialPreviewLight2.svg diff --git a/editor/icons/icon_material_preview_light_2_off.svg b/editor/icons/MaterialPreviewLight2Off.svg index cc48927ece..cc48927ece 100644 --- a/editor/icons/icon_material_preview_light_2_off.svg +++ b/editor/icons/MaterialPreviewLight2Off.svg diff --git a/editor/icons/icon_material_preview_sphere.svg b/editor/icons/MaterialPreviewSphere.svg index 4f4ef67e20..4f4ef67e20 100644 --- a/editor/icons/icon_material_preview_sphere.svg +++ b/editor/icons/MaterialPreviewSphere.svg diff --git a/editor/icons/icon_material_preview_sphere_off.svg b/editor/icons/MaterialPreviewSphereOff.svg index f702b4fd27..f702b4fd27 100644 --- a/editor/icons/icon_material_preview_sphere_off.svg +++ b/editor/icons/MaterialPreviewSphereOff.svg diff --git a/editor/icons/icon_member_constant.svg b/editor/icons/MemberConstant.svg index ec82749cf4..ec82749cf4 100644 --- a/editor/icons/icon_member_constant.svg +++ b/editor/icons/MemberConstant.svg diff --git a/editor/icons/icon_member_method.svg b/editor/icons/MemberMethod.svg index ea5c64482c..ea5c64482c 100644 --- a/editor/icons/icon_member_method.svg +++ b/editor/icons/MemberMethod.svg diff --git a/editor/icons/icon_member_property.svg b/editor/icons/MemberProperty.svg index 4b6b7ab5df..4b6b7ab5df 100644 --- a/editor/icons/icon_member_property.svg +++ b/editor/icons/MemberProperty.svg diff --git a/editor/icons/icon_member_signal.svg b/editor/icons/MemberSignal.svg index 5159e4acd7..5159e4acd7 100644 --- a/editor/icons/icon_member_signal.svg +++ b/editor/icons/MemberSignal.svg diff --git a/editor/icons/icon_member_theme.svg b/editor/icons/MemberTheme.svg index 7aaaf2b808..7aaaf2b808 100644 --- a/editor/icons/icon_member_theme.svg +++ b/editor/icons/MemberTheme.svg diff --git a/editor/icons/icon_menu_button.svg b/editor/icons/MenuButton.svg index 8c23927783..8c23927783 100644 --- a/editor/icons/icon_menu_button.svg +++ b/editor/icons/MenuButton.svg diff --git a/editor/icons/icon_mesh.svg b/editor/icons/Mesh.svg index 0fb9e74584..0fb9e74584 100644 --- a/editor/icons/icon_mesh.svg +++ b/editor/icons/Mesh.svg diff --git a/editor/icons/icon_mesh_instance.svg b/editor/icons/MeshInstance.svg index 68344b7dbd..68344b7dbd 100644 --- a/editor/icons/icon_mesh_instance.svg +++ b/editor/icons/MeshInstance.svg diff --git a/editor/icons/icon_mesh_instance_2d.svg b/editor/icons/MeshInstance2D.svg index a173d02771..a173d02771 100644 --- a/editor/icons/icon_mesh_instance_2d.svg +++ b/editor/icons/MeshInstance2D.svg diff --git a/editor/icons/icon_mesh_library.svg b/editor/icons/MeshLibrary.svg index 13ae8fece7..13ae8fece7 100644 --- a/editor/icons/icon_mesh_library.svg +++ b/editor/icons/MeshLibrary.svg diff --git a/editor/icons/icon_mesh_texture.svg b/editor/icons/MeshTexture.svg index b3beff05c0..b3beff05c0 100644 --- a/editor/icons/icon_mesh_texture.svg +++ b/editor/icons/MeshTexture.svg diff --git a/editor/icons/icon_mini_object.svg b/editor/icons/MiniObject.svg index 0b34a9fdbb..0b34a9fdbb 100644 --- a/editor/icons/icon_mini_object.svg +++ b/editor/icons/MiniObject.svg diff --git a/editor/icons/icon_mirror_x.svg b/editor/icons/MirrorX.svg index 445a4e058d..445a4e058d 100644 --- a/editor/icons/icon_mirror_x.svg +++ b/editor/icons/MirrorX.svg diff --git a/editor/icons/icon_mirror_y.svg b/editor/icons/MirrorY.svg index ebfcf8cabd..ebfcf8cabd 100644 --- a/editor/icons/icon_mirror_y.svg +++ b/editor/icons/MirrorY.svg diff --git a/editor/icons/icon_mouse.svg b/editor/icons/Mouse.svg index 571288675a..571288675a 100644 --- a/editor/icons/icon_mouse.svg +++ b/editor/icons/Mouse.svg diff --git a/editor/icons/icon_move_down.svg b/editor/icons/MoveDown.svg index ba0c5d80ba..ba0c5d80ba 100644 --- a/editor/icons/icon_move_down.svg +++ b/editor/icons/MoveDown.svg diff --git a/editor/icons/icon_move_left.svg b/editor/icons/MoveLeft.svg index f4ad280ae1..f4ad280ae1 100644 --- a/editor/icons/icon_move_left.svg +++ b/editor/icons/MoveLeft.svg diff --git a/editor/icons/icon_move_point.svg b/editor/icons/MovePoint.svg index a8c11e7cb3..a8c11e7cb3 100644 --- a/editor/icons/icon_move_point.svg +++ b/editor/icons/MovePoint.svg diff --git a/editor/icons/icon_move_right.svg b/editor/icons/MoveRight.svg index 4d1c3b1145..4d1c3b1145 100644 --- a/editor/icons/icon_move_right.svg +++ b/editor/icons/MoveRight.svg diff --git a/editor/icons/icon_move_up.svg b/editor/icons/MoveUp.svg index 87c7834597..87c7834597 100644 --- a/editor/icons/icon_move_up.svg +++ b/editor/icons/MoveUp.svg diff --git a/editor/icons/icon_multi_edit.svg b/editor/icons/MultiEdit.svg index 9a5b3237b2..9a5b3237b2 100644 --- a/editor/icons/icon_multi_edit.svg +++ b/editor/icons/MultiEdit.svg diff --git a/editor/icons/icon_multi_line.svg b/editor/icons/MultiLine.svg index dd79bb50d8..dd79bb50d8 100644 --- a/editor/icons/icon_multi_line.svg +++ b/editor/icons/MultiLine.svg diff --git a/editor/icons/icon_multi_mesh.svg b/editor/icons/MultiMesh.svg index d317129ef4..d317129ef4 100644 --- a/editor/icons/icon_multi_mesh.svg +++ b/editor/icons/MultiMesh.svg diff --git a/editor/icons/icon_multi_mesh_instance.svg b/editor/icons/MultiMeshInstance.svg index c114a725db..c114a725db 100644 --- a/editor/icons/icon_multi_mesh_instance.svg +++ b/editor/icons/MultiMeshInstance.svg diff --git a/editor/icons/icon_multi_mesh_instance_2d.svg b/editor/icons/MultiMeshInstance2D.svg index 6c54a63ae2..6c54a63ae2 100644 --- a/editor/icons/icon_multi_mesh_instance_2d.svg +++ b/editor/icons/MultiMeshInstance2D.svg diff --git a/editor/icons/icon_navigation.svg b/editor/icons/Navigation.svg index d5a8f8618b..d5a8f8618b 100644 --- a/editor/icons/icon_navigation.svg +++ b/editor/icons/Navigation.svg diff --git a/editor/icons/icon_navigation_2d.svg b/editor/icons/Navigation2D.svg index 79dc532aee..79dc532aee 100644 --- a/editor/icons/icon_navigation_2d.svg +++ b/editor/icons/Navigation2D.svg diff --git a/editor/icons/icon_navigation_mesh.svg b/editor/icons/NavigationMesh.svg index 9bc4a00d53..9bc4a00d53 100644 --- a/editor/icons/icon_navigation_mesh.svg +++ b/editor/icons/NavigationMesh.svg diff --git a/editor/icons/icon_navigation_mesh_instance.svg b/editor/icons/NavigationMeshInstance.svg index 737d9c319d..737d9c319d 100644 --- a/editor/icons/icon_navigation_mesh_instance.svg +++ b/editor/icons/NavigationMeshInstance.svg diff --git a/editor/icons/icon_navigation_polygon.svg b/editor/icons/NavigationPolygon.svg index df2ddb07f6..df2ddb07f6 100644 --- a/editor/icons/icon_navigation_polygon.svg +++ b/editor/icons/NavigationPolygon.svg diff --git a/editor/icons/icon_navigation_polygon_instance.svg b/editor/icons/NavigationPolygonInstance.svg index e16d10614e..e16d10614e 100644 --- a/editor/icons/icon_navigation_polygon_instance.svg +++ b/editor/icons/NavigationPolygonInstance.svg diff --git a/editor/icons/icon_new.svg b/editor/icons/New.svg index a3199e3fba..a3199e3fba 100644 --- a/editor/icons/icon_new.svg +++ b/editor/icons/New.svg diff --git a/editor/icons/icon_new_root.svg b/editor/icons/NewRoot.svg index d32777d507..d32777d507 100644 --- a/editor/icons/icon_new_root.svg +++ b/editor/icons/NewRoot.svg diff --git a/editor/icons/icon_nil.svg b/editor/icons/Nil.svg index 04a29abaaa..04a29abaaa 100644 --- a/editor/icons/icon_nil.svg +++ b/editor/icons/Nil.svg diff --git a/editor/icons/icon_nine_patch_rect.svg b/editor/icons/NinePatchRect.svg index c5b04ec049..c5b04ec049 100644 --- a/editor/icons/icon_nine_patch_rect.svg +++ b/editor/icons/NinePatchRect.svg diff --git a/editor/icons/icon_node.svg b/editor/icons/Node.svg index 93f0ce80b1..93f0ce80b1 100644 --- a/editor/icons/icon_node.svg +++ b/editor/icons/Node.svg diff --git a/editor/icons/icon_node_2d.svg b/editor/icons/Node2D.svg index 5ca5754daa..5ca5754daa 100644 --- a/editor/icons/icon_node_2d.svg +++ b/editor/icons/Node2D.svg diff --git a/editor/icons/icon_node_path.svg b/editor/icons/NodePath.svg index 580283b75a..580283b75a 100644 --- a/editor/icons/icon_node_path.svg +++ b/editor/icons/NodePath.svg diff --git a/editor/icons/icon_node_warning.svg b/editor/icons/NodeWarning.svg index 587a49412e..587a49412e 100644 --- a/editor/icons/icon_node_warning.svg +++ b/editor/icons/NodeWarning.svg diff --git a/editor/icons/icon_non_favorite.svg b/editor/icons/NonFavorite.svg index eb0ebf052c..eb0ebf052c 100644 --- a/editor/icons/icon_non_favorite.svg +++ b/editor/icons/NonFavorite.svg diff --git a/editor/icons/icon_o_r_m_material_3d.svg b/editor/icons/ORMMaterial3D.svg index 3dd6013436..3dd6013436 100644 --- a/editor/icons/icon_o_r_m_material_3d.svg +++ b/editor/icons/ORMMaterial3D.svg diff --git a/editor/icons/icon_object.svg b/editor/icons/Object.svg index c3d1b47538..c3d1b47538 100644 --- a/editor/icons/icon_object.svg +++ b/editor/icons/Object.svg diff --git a/editor/icons/icon_occluder_polygon_2d.svg b/editor/icons/OccluderPolygon2D.svg index 19244f35ca..19244f35ca 100644 --- a/editor/icons/icon_occluder_polygon_2d.svg +++ b/editor/icons/OccluderPolygon2D.svg diff --git a/editor/icons/icon_omni_light.svg b/editor/icons/OmniLight.svg index 6fa0454e8c..6fa0454e8c 100644 --- a/editor/icons/icon_omni_light.svg +++ b/editor/icons/OmniLight.svg diff --git a/editor/icons/icon_onion.svg b/editor/icons/Onion.svg index ff1376c316..ff1376c316 100644 --- a/editor/icons/icon_onion.svg +++ b/editor/icons/Onion.svg diff --git a/editor/icons/icon_option_button.svg b/editor/icons/OptionButton.svg index 6b4402481d..6b4402481d 100644 --- a/editor/icons/icon_option_button.svg +++ b/editor/icons/OptionButton.svg diff --git a/editor/icons/icon_overbright_indicator.svg b/editor/icons/OverbrightIndicator.svg index 9e6f53b727..9e6f53b727 100644 --- a/editor/icons/icon_overbright_indicator.svg +++ b/editor/icons/OverbrightIndicator.svg diff --git a/editor/icons/icon_override.svg b/editor/icons/Override.svg index 2d8a1fb309..2d8a1fb309 100644 --- a/editor/icons/icon_override.svg +++ b/editor/icons/Override.svg diff --git a/editor/icons/icon_packed_byte_array.svg b/editor/icons/PackedByteArray.svg index 5409a47bc4..5409a47bc4 100644 --- a/editor/icons/icon_packed_byte_array.svg +++ b/editor/icons/PackedByteArray.svg diff --git a/editor/icons/icon_packed_color_array.svg b/editor/icons/PackedColorArray.svg index 7a312d0e91..7a312d0e91 100644 --- a/editor/icons/icon_packed_color_array.svg +++ b/editor/icons/PackedColorArray.svg diff --git a/editor/icons/icon_packed_data_container.svg b/editor/icons/PackedDataContainer.svg index 18bad53f66..18bad53f66 100644 --- a/editor/icons/icon_packed_data_container.svg +++ b/editor/icons/PackedDataContainer.svg diff --git a/editor/icons/icon_packed_real_array.svg b/editor/icons/PackedFloat32Array.svg index 734f40cd05..734f40cd05 100644 --- a/editor/icons/icon_packed_real_array.svg +++ b/editor/icons/PackedFloat32Array.svg diff --git a/editor/icons/PackedFloat64Array.svg b/editor/icons/PackedFloat64Array.svg new file mode 100644 index 0000000000..734f40cd05 --- /dev/null +++ b/editor/icons/PackedFloat64Array.svg @@ -0,0 +1 @@ +<svg height="12" viewBox="0 0 16 12" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/><path d="m6 2a3 3 0 0 0 -3 3v5h2v-2h1v-2h-1v-1a1 1 0 0 1 1-1zm1 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-5zm3 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-1h1v-2h-1v-2z" fill="#61daf4"/><path d="m7 2v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-5z" fill="#fff" fill-opacity=".39216"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_packed_int_array.svg b/editor/icons/PackedInt32Array.svg index a664b2d5fd..a664b2d5fd 100644 --- a/editor/icons/icon_packed_int_array.svg +++ b/editor/icons/PackedInt32Array.svg diff --git a/editor/icons/PackedInt64Array.svg b/editor/icons/PackedInt64Array.svg new file mode 100644 index 0000000000..a664b2d5fd --- /dev/null +++ b/editor/icons/PackedInt64Array.svg @@ -0,0 +1 @@ +<svg height="12" viewBox="0 0 16 12" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/><path d="m3 2v2h2v-2zm2 2v2h-2v4h4v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3-3zm5 3a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1-1v-1h1v-2h-1v-2h-2z" fill="#7dc6ef"/><path d="m5 4v6h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3-3z" fill="#fff" fill-opacity=".39216"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_packed_scene.svg b/editor/icons/PackedScene.svg index 9c1d88db1c..9c1d88db1c 100644 --- a/editor/icons/icon_packed_scene.svg +++ b/editor/icons/PackedScene.svg diff --git a/editor/icons/icon_packed_string_array.svg b/editor/icons/PackedStringArray.svg index 7e66f5f5e5..7e66f5f5e5 100644 --- a/editor/icons/icon_packed_string_array.svg +++ b/editor/icons/PackedStringArray.svg diff --git a/editor/icons/icon_packed_vector2_array.svg b/editor/icons/PackedVector2Array.svg index 170512eb39..170512eb39 100644 --- a/editor/icons/icon_packed_vector2_array.svg +++ b/editor/icons/PackedVector2Array.svg diff --git a/editor/icons/icon_packed_vector3_array.svg b/editor/icons/PackedVector3Array.svg index cd3578182f..cd3578182f 100644 --- a/editor/icons/icon_packed_vector3_array.svg +++ b/editor/icons/PackedVector3Array.svg diff --git a/editor/icons/icon_paint_vertex.svg b/editor/icons/PaintVertex.svg index cab3716bf5..cab3716bf5 100644 --- a/editor/icons/icon_paint_vertex.svg +++ b/editor/icons/PaintVertex.svg diff --git a/editor/icons/icon_panel.svg b/editor/icons/Panel.svg index 10a67bae7e..10a67bae7e 100644 --- a/editor/icons/icon_panel.svg +++ b/editor/icons/Panel.svg diff --git a/editor/icons/icon_panel_container.svg b/editor/icons/PanelContainer.svg index 08c5492f7e..08c5492f7e 100644 --- a/editor/icons/icon_panel_container.svg +++ b/editor/icons/PanelContainer.svg diff --git a/editor/icons/icon_panels_1.svg b/editor/icons/Panels1.svg index 850aad2cff..850aad2cff 100644 --- a/editor/icons/icon_panels_1.svg +++ b/editor/icons/Panels1.svg diff --git a/editor/icons/icon_panels_2.svg b/editor/icons/Panels2.svg index 5f3fc6cf48..5f3fc6cf48 100644 --- a/editor/icons/icon_panels_2.svg +++ b/editor/icons/Panels2.svg diff --git a/editor/icons/icon_panels_2_alt.svg b/editor/icons/Panels2Alt.svg index edee3a660f..edee3a660f 100644 --- a/editor/icons/icon_panels_2_alt.svg +++ b/editor/icons/Panels2Alt.svg diff --git a/editor/icons/icon_panels_3.svg b/editor/icons/Panels3.svg index 3ddcb5e2ef..3ddcb5e2ef 100644 --- a/editor/icons/icon_panels_3.svg +++ b/editor/icons/Panels3.svg diff --git a/editor/icons/icon_panels_3_alt.svg b/editor/icons/Panels3Alt.svg index 0f36a24da8..0f36a24da8 100644 --- a/editor/icons/icon_panels_3_alt.svg +++ b/editor/icons/Panels3Alt.svg diff --git a/editor/icons/icon_panels_4.svg b/editor/icons/Panels4.svg index 7b2189087f..7b2189087f 100644 --- a/editor/icons/icon_panels_4.svg +++ b/editor/icons/Panels4.svg diff --git a/editor/icons/icon_panorama_sky.svg b/editor/icons/PanoramaSky.svg index bfff6840bd..bfff6840bd 100644 --- a/editor/icons/icon_panorama_sky.svg +++ b/editor/icons/PanoramaSky.svg diff --git a/editor/icons/icon_parallax_background.svg b/editor/icons/ParallaxBackground.svg index 09e6a7d19d..09e6a7d19d 100644 --- a/editor/icons/icon_parallax_background.svg +++ b/editor/icons/ParallaxBackground.svg diff --git a/editor/icons/icon_parallax_layer.svg b/editor/icons/ParallaxLayer.svg index d8a5ef5e1f..d8a5ef5e1f 100644 --- a/editor/icons/icon_parallax_layer.svg +++ b/editor/icons/ParallaxLayer.svg diff --git a/editor/icons/icon_particles.svg b/editor/icons/Particles.svg index f1378e3f8c..f1378e3f8c 100644 --- a/editor/icons/icon_particles.svg +++ b/editor/icons/Particles.svg diff --git a/editor/icons/icon_particles_2d.svg b/editor/icons/Particles2D.svg index 7151194e36..7151194e36 100644 --- a/editor/icons/icon_particles_2d.svg +++ b/editor/icons/Particles2D.svg diff --git a/editor/icons/icon_particles_material.svg b/editor/icons/ParticlesMaterial.svg index af45f9888a..af45f9888a 100644 --- a/editor/icons/icon_particles_material.svg +++ b/editor/icons/ParticlesMaterial.svg diff --git a/editor/icons/icon_path.svg b/editor/icons/Path.svg index cde9a06903..cde9a06903 100644 --- a/editor/icons/icon_path.svg +++ b/editor/icons/Path.svg diff --git a/editor/icons/icon_path_2d.svg b/editor/icons/Path2D.svg index 8aa0453b88..8aa0453b88 100644 --- a/editor/icons/icon_path_2d.svg +++ b/editor/icons/Path2D.svg diff --git a/editor/icons/icon_path_follow.svg b/editor/icons/PathFollow.svg index 8e904ab5a5..8e904ab5a5 100644 --- a/editor/icons/icon_path_follow.svg +++ b/editor/icons/PathFollow.svg diff --git a/editor/icons/icon_path_follow_2d.svg b/editor/icons/PathFollow2D.svg index 20a32f2d83..20a32f2d83 100644 --- a/editor/icons/icon_path_follow_2d.svg +++ b/editor/icons/PathFollow2D.svg diff --git a/editor/icons/icon_pause.svg b/editor/icons/Pause.svg index 14c9971383..14c9971383 100644 --- a/editor/icons/icon_pause.svg +++ b/editor/icons/Pause.svg diff --git a/editor/icons/icon_physical_bone.svg b/editor/icons/PhysicalBone.svg index 0a34eb6e48..0a34eb6e48 100644 --- a/editor/icons/icon_physical_bone.svg +++ b/editor/icons/PhysicalBone.svg diff --git a/editor/icons/icon_pin.svg b/editor/icons/Pin.svg index 85cd815b64..85cd815b64 100644 --- a/editor/icons/icon_pin.svg +++ b/editor/icons/Pin.svg diff --git a/editor/icons/icon_pin_joint.svg b/editor/icons/PinJoint.svg index 147553d316..147553d316 100644 --- a/editor/icons/icon_pin_joint.svg +++ b/editor/icons/PinJoint.svg diff --git a/editor/icons/icon_pin_joint_2d.svg b/editor/icons/PinJoint2D.svg index f1dcafb923..f1dcafb923 100644 --- a/editor/icons/icon_pin_joint_2d.svg +++ b/editor/icons/PinJoint2D.svg diff --git a/editor/icons/icon_pin_pressed.svg b/editor/icons/PinPressed.svg index 85cd815b64..85cd815b64 100644 --- a/editor/icons/icon_pin_pressed.svg +++ b/editor/icons/PinPressed.svg diff --git a/editor/icons/icon_plane.svg b/editor/icons/Plane.svg index 3a943af0b3..3a943af0b3 100644 --- a/editor/icons/icon_plane.svg +++ b/editor/icons/Plane.svg diff --git a/editor/icons/icon_plane_mesh.svg b/editor/icons/PlaneMesh.svg index ddcc623c67..ddcc623c67 100644 --- a/editor/icons/icon_plane_mesh.svg +++ b/editor/icons/PlaneMesh.svg diff --git a/editor/icons/icon_plane_shape.svg b/editor/icons/PlaneShape.svg index 2c90cf6d53..2c90cf6d53 100644 --- a/editor/icons/icon_plane_shape.svg +++ b/editor/icons/PlaneShape.svg diff --git a/editor/icons/icon_play.svg b/editor/icons/Play.svg index 4c16215a68..4c16215a68 100644 --- a/editor/icons/icon_play.svg +++ b/editor/icons/Play.svg diff --git a/editor/icons/icon_play_backwards.svg b/editor/icons/PlayBackwards.svg index c98f15ea50..c98f15ea50 100644 --- a/editor/icons/icon_play_backwards.svg +++ b/editor/icons/PlayBackwards.svg diff --git a/editor/icons/icon_play_custom.svg b/editor/icons/PlayCustom.svg index e19a8e7028..e19a8e7028 100644 --- a/editor/icons/icon_play_custom.svg +++ b/editor/icons/PlayCustom.svg diff --git a/editor/icons/icon_play_overlay.svg b/editor/icons/PlayOverlay.svg index 1fb2da6596..1fb2da6596 100644 --- a/editor/icons/icon_play_overlay.svg +++ b/editor/icons/PlayOverlay.svg diff --git a/editor/icons/icon_play_scene.svg b/editor/icons/PlayScene.svg index 5e5097fd66..5e5097fd66 100644 --- a/editor/icons/icon_play_scene.svg +++ b/editor/icons/PlayScene.svg diff --git a/editor/icons/icon_play_start.svg b/editor/icons/PlayStart.svg index 2ade7371e0..2ade7371e0 100644 --- a/editor/icons/icon_play_start.svg +++ b/editor/icons/PlayStart.svg diff --git a/editor/icons/icon_play_start_backwards.svg b/editor/icons/PlayStartBackwards.svg index 195f9a646e..195f9a646e 100644 --- a/editor/icons/icon_play_start_backwards.svg +++ b/editor/icons/PlayStartBackwards.svg diff --git a/editor/icons/icon_play_travel.svg b/editor/icons/PlayTravel.svg index d772476e15..d772476e15 100644 --- a/editor/icons/icon_play_travel.svg +++ b/editor/icons/PlayTravel.svg diff --git a/editor/icons/icon_plugin_script.svg b/editor/icons/PluginScript.svg index 0d080c132e..0d080c132e 100644 --- a/editor/icons/icon_plugin_script.svg +++ b/editor/icons/PluginScript.svg diff --git a/editor/icons/icon_point_mesh.svg b/editor/icons/PointMesh.svg index 0504b7ff01..0504b7ff01 100644 --- a/editor/icons/icon_point_mesh.svg +++ b/editor/icons/PointMesh.svg diff --git a/editor/icons/icon_polygon_2_d.svg b/editor/icons/Polygon2D.svg index 485109072e..485109072e 100644 --- a/editor/icons/icon_polygon_2_d.svg +++ b/editor/icons/Polygon2D.svg diff --git a/editor/icons/icon_polygon_path_finder.svg b/editor/icons/PolygonPathFinder.svg index b41067d08a..b41067d08a 100644 --- a/editor/icons/icon_polygon_path_finder.svg +++ b/editor/icons/PolygonPathFinder.svg diff --git a/editor/icons/icon_popup.svg b/editor/icons/Popup.svg index 93f7e5000d..93f7e5000d 100644 --- a/editor/icons/icon_popup.svg +++ b/editor/icons/Popup.svg diff --git a/editor/icons/icon_popup_dialog.svg b/editor/icons/PopupDialog.svg index d871e56a63..d871e56a63 100644 --- a/editor/icons/icon_popup_dialog.svg +++ b/editor/icons/PopupDialog.svg diff --git a/editor/icons/icon_popup_menu.svg b/editor/icons/PopupMenu.svg index dd7b2bb0fd..dd7b2bb0fd 100644 --- a/editor/icons/icon_popup_menu.svg +++ b/editor/icons/PopupMenu.svg diff --git a/editor/icons/icon_popup_panel.svg b/editor/icons/PopupPanel.svg index 47a5448f5b..47a5448f5b 100644 --- a/editor/icons/icon_popup_panel.svg +++ b/editor/icons/PopupPanel.svg diff --git a/editor/icons/icon_portal.svg b/editor/icons/Portal.svg index 99d626e2f4..99d626e2f4 100644 --- a/editor/icons/icon_portal.svg +++ b/editor/icons/Portal.svg diff --git a/editor/icons/icon_position_2d.svg b/editor/icons/Position2D.svg index 22d4ab05ca..22d4ab05ca 100644 --- a/editor/icons/icon_position_2d.svg +++ b/editor/icons/Position2D.svg diff --git a/editor/icons/icon_position_3d.svg b/editor/icons/Position3D.svg index 0401942d69..0401942d69 100644 --- a/editor/icons/icon_position_3d.svg +++ b/editor/icons/Position3D.svg diff --git a/editor/icons/icon_prism_mesh.svg b/editor/icons/PrismMesh.svg index c391652add..c391652add 100644 --- a/editor/icons/icon_prism_mesh.svg +++ b/editor/icons/PrismMesh.svg diff --git a/editor/icons/icon_procedural_sky.svg b/editor/icons/ProceduralSky.svg index 356a966fe9..356a966fe9 100644 --- a/editor/icons/icon_procedural_sky.svg +++ b/editor/icons/ProceduralSky.svg diff --git a/editor/icons/icon_progress_1.svg b/editor/icons/Progress1.svg index 01c2f8f334..01c2f8f334 100644 --- a/editor/icons/icon_progress_1.svg +++ b/editor/icons/Progress1.svg diff --git a/editor/icons/icon_progress_2.svg b/editor/icons/Progress2.svg index a18ceb0381..a18ceb0381 100644 --- a/editor/icons/icon_progress_2.svg +++ b/editor/icons/Progress2.svg diff --git a/editor/icons/icon_progress_3.svg b/editor/icons/Progress3.svg index 55b01dad83..55b01dad83 100644 --- a/editor/icons/icon_progress_3.svg +++ b/editor/icons/Progress3.svg diff --git a/editor/icons/icon_progress_4.svg b/editor/icons/Progress4.svg index a038bbec70..a038bbec70 100644 --- a/editor/icons/icon_progress_4.svg +++ b/editor/icons/Progress4.svg diff --git a/editor/icons/icon_progress_5.svg b/editor/icons/Progress5.svg index 64144978af..64144978af 100644 --- a/editor/icons/icon_progress_5.svg +++ b/editor/icons/Progress5.svg diff --git a/editor/icons/icon_progress_6.svg b/editor/icons/Progress6.svg index 83b1806263..83b1806263 100644 --- a/editor/icons/icon_progress_6.svg +++ b/editor/icons/Progress6.svg diff --git a/editor/icons/icon_progress_7.svg b/editor/icons/Progress7.svg index 77d4321a14..77d4321a14 100644 --- a/editor/icons/icon_progress_7.svg +++ b/editor/icons/Progress7.svg diff --git a/editor/icons/icon_progress_8.svg b/editor/icons/Progress8.svg index ee76ba4499..ee76ba4499 100644 --- a/editor/icons/icon_progress_8.svg +++ b/editor/icons/Progress8.svg diff --git a/editor/icons/icon_progress_bar.svg b/editor/icons/ProgressBar.svg index 70f99e3bbb..70f99e3bbb 100644 --- a/editor/icons/icon_progress_bar.svg +++ b/editor/icons/ProgressBar.svg diff --git a/editor/icons/icon_project_icon_loading.svg b/editor/icons/ProjectIconLoading.svg index 3802b67654..3802b67654 100644 --- a/editor/icons/icon_project_icon_loading.svg +++ b/editor/icons/ProjectIconLoading.svg diff --git a/editor/icons/icon_proximity_group.svg b/editor/icons/ProximityGroup.svg index 7df1cc9093..7df1cc9093 100644 --- a/editor/icons/icon_proximity_group.svg +++ b/editor/icons/ProximityGroup.svg diff --git a/editor/icons/icon_proxy_texture.svg b/editor/icons/ProxyTexture.svg index 0c19363cb4..0c19363cb4 100644 --- a/editor/icons/icon_proxy_texture.svg +++ b/editor/icons/ProxyTexture.svg diff --git a/editor/icons/icon_quad.svg b/editor/icons/Quad.svg index 4657e0b0bd..4657e0b0bd 100644 --- a/editor/icons/icon_quad.svg +++ b/editor/icons/Quad.svg diff --git a/editor/icons/icon_quad_mesh.svg b/editor/icons/QuadMesh.svg index de0bd3e127..de0bd3e127 100644 --- a/editor/icons/icon_quad_mesh.svg +++ b/editor/icons/QuadMesh.svg diff --git a/editor/icons/icon_quat.svg b/editor/icons/Quat.svg index 8702a3041a..8702a3041a 100644 --- a/editor/icons/icon_quat.svg +++ b/editor/icons/Quat.svg diff --git a/editor/icons/icon_r_i_d.svg b/editor/icons/RID.svg index a6ace54d12..a6ace54d12 100644 --- a/editor/icons/icon_r_i_d.svg +++ b/editor/icons/RID.svg diff --git a/editor/icons/icon_ray_cast.svg b/editor/icons/RayCast.svg index e782b27e9f..e782b27e9f 100644 --- a/editor/icons/icon_ray_cast.svg +++ b/editor/icons/RayCast.svg diff --git a/editor/icons/icon_ray_cast_2d.svg b/editor/icons/RayCast2D.svg index 02faaa51c9..02faaa51c9 100644 --- a/editor/icons/icon_ray_cast_2d.svg +++ b/editor/icons/RayCast2D.svg diff --git a/editor/icons/icon_ray_shape.svg b/editor/icons/RayShape.svg index 37c2206740..37c2206740 100644 --- a/editor/icons/icon_ray_shape.svg +++ b/editor/icons/RayShape.svg diff --git a/editor/icons/icon_ray_shape_2d.svg b/editor/icons/RayShape2D.svg index 109c254fc3..109c254fc3 100644 --- a/editor/icons/icon_ray_shape_2d.svg +++ b/editor/icons/RayShape2D.svg diff --git a/editor/icons/icon_rayito.svg b/editor/icons/Rayito.svg index 4fd6a2827b..4fd6a2827b 100644 --- a/editor/icons/icon_rayito.svg +++ b/editor/icons/Rayito.svg diff --git a/editor/icons/icon_rect2.svg b/editor/icons/Rect2.svg index 25feb52cab..25feb52cab 100644 --- a/editor/icons/icon_rect2.svg +++ b/editor/icons/Rect2.svg diff --git a/editor/icons/Rect2i.svg b/editor/icons/Rect2i.svg new file mode 100644 index 0000000000..d28c098ed6 --- /dev/null +++ b/editor/icons/Rect2i.svg @@ -0,0 +1,4 @@ +<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg"> +<path d="m9 2v2h-1c-1.7267 0-3 1.3359-3 3 0 1.6569 1.3431 3 3 3h1v-2h-1c-0.55228 0-1-0.44772-1-1s0.44772-1 1-1h1v1c0 1.6569 1.3431 3 3 3v-2c-0.55228 0-0.93526-0.45152-1-1v-1h1v-2h-1v-2zm-5 2c-1.6569 0-2.9547 1.3438-3 3v3h2v-3c0-0.55228 0.44772-1 1-1h1v-2z" fill="#f191a5"/> +<path d="m13 2v2h2v-2zm0 4v4h2v-4z" fill="#7dc6ef"/> +</svg> diff --git a/editor/icons/icon_rectangle_shape_2d.svg b/editor/icons/RectangleShape2D.svg index 437547ece3..437547ece3 100644 --- a/editor/icons/icon_rectangle_shape_2d.svg +++ b/editor/icons/RectangleShape2D.svg diff --git a/editor/icons/icon_reference_rect.svg b/editor/icons/ReferenceRect.svg index 2fd530d584..2fd530d584 100644 --- a/editor/icons/icon_reference_rect.svg +++ b/editor/icons/ReferenceRect.svg diff --git a/editor/icons/icon_reflection_probe.svg b/editor/icons/ReflectionProbe.svg index 6bf9cc9013..6bf9cc9013 100644 --- a/editor/icons/icon_reflection_probe.svg +++ b/editor/icons/ReflectionProbe.svg diff --git a/editor/icons/icon_region_edit.svg b/editor/icons/RegionEdit.svg index 8443c0e454..8443c0e454 100644 --- a/editor/icons/icon_region_edit.svg +++ b/editor/icons/RegionEdit.svg diff --git a/editor/icons/icon_reload.svg b/editor/icons/Reload.svg index 223a725332..223a725332 100644 --- a/editor/icons/icon_reload.svg +++ b/editor/icons/Reload.svg diff --git a/editor/icons/icon_reload_small.svg b/editor/icons/ReloadSmall.svg index ce707b645a..ce707b645a 100644 --- a/editor/icons/icon_reload_small.svg +++ b/editor/icons/ReloadSmall.svg diff --git a/editor/icons/icon_remote_transform.svg b/editor/icons/RemoteTransform.svg index 2bdf8cd858..2bdf8cd858 100644 --- a/editor/icons/icon_remote_transform.svg +++ b/editor/icons/RemoteTransform.svg diff --git a/editor/icons/icon_remote_transform_2d.svg b/editor/icons/RemoteTransform2D.svg index 51c9e084df..51c9e084df 100644 --- a/editor/icons/icon_remote_transform_2d.svg +++ b/editor/icons/RemoteTransform2D.svg diff --git a/editor/icons/icon_remove.svg b/editor/icons/Remove.svg index 9372eb08b5..9372eb08b5 100644 --- a/editor/icons/icon_remove.svg +++ b/editor/icons/Remove.svg diff --git a/editor/icons/icon_remove_internal.svg b/editor/icons/RemoveInternal.svg index 0a7e06e6cd..0a7e06e6cd 100644 --- a/editor/icons/icon_remove_internal.svg +++ b/editor/icons/RemoveInternal.svg diff --git a/editor/icons/icon_rename.svg b/editor/icons/Rename.svg index 01923e3a0a..01923e3a0a 100644 --- a/editor/icons/icon_rename.svg +++ b/editor/icons/Rename.svg diff --git a/editor/icons/icon_reparent.svg b/editor/icons/Reparent.svg index 39b79cd3a1..39b79cd3a1 100644 --- a/editor/icons/icon_reparent.svg +++ b/editor/icons/Reparent.svg diff --git a/editor/icons/icon_reparent_to_new_node.svg b/editor/icons/ReparentToNewNode.svg index 37fbee848c..37fbee848c 100644 --- a/editor/icons/icon_reparent_to_new_node.svg +++ b/editor/icons/ReparentToNewNode.svg diff --git a/editor/icons/icon_resource_preloader.svg b/editor/icons/ResourcePreloader.svg index 417e63b604..417e63b604 100644 --- a/editor/icons/icon_resource_preloader.svg +++ b/editor/icons/ResourcePreloader.svg diff --git a/editor/icons/icon_rich_text_effect.svg b/editor/icons/RichTextEffect.svg index afe08685bd..afe08685bd 100644 --- a/editor/icons/icon_rich_text_effect.svg +++ b/editor/icons/RichTextEffect.svg diff --git a/editor/icons/icon_rich_text_label.svg b/editor/icons/RichTextLabel.svg index 3f4b33707c..3f4b33707c 100644 --- a/editor/icons/icon_rich_text_label.svg +++ b/editor/icons/RichTextLabel.svg diff --git a/editor/icons/icon_rigid_body.svg b/editor/icons/RigidBody.svg index 5d766f7c3d..5d766f7c3d 100644 --- a/editor/icons/icon_rigid_body.svg +++ b/editor/icons/RigidBody.svg diff --git a/editor/icons/icon_rigid_body_2d.svg b/editor/icons/RigidBody2D.svg index bb97fa650b..bb97fa650b 100644 --- a/editor/icons/icon_rigid_body_2d.svg +++ b/editor/icons/RigidBody2D.svg diff --git a/editor/icons/icon_room.svg b/editor/icons/Room.svg index 799be9f99a..799be9f99a 100644 --- a/editor/icons/icon_room.svg +++ b/editor/icons/Room.svg diff --git a/editor/icons/icon_room_bounds.svg b/editor/icons/RoomBounds.svg index ad90944ac6..ad90944ac6 100644 --- a/editor/icons/icon_room_bounds.svg +++ b/editor/icons/RoomBounds.svg diff --git a/editor/icons/icon_rotate_0.svg b/editor/icons/Rotate0.svg index 96174ca93b..96174ca93b 100644 --- a/editor/icons/icon_rotate_0.svg +++ b/editor/icons/Rotate0.svg diff --git a/editor/icons/icon_rotate_180.svg b/editor/icons/Rotate180.svg index 11415e1e19..11415e1e19 100644 --- a/editor/icons/icon_rotate_180.svg +++ b/editor/icons/Rotate180.svg diff --git a/editor/icons/icon_rotate_270.svg b/editor/icons/Rotate270.svg index be26bc4337..be26bc4337 100644 --- a/editor/icons/icon_rotate_270.svg +++ b/editor/icons/Rotate270.svg diff --git a/editor/icons/icon_rotate_90.svg b/editor/icons/Rotate90.svg index d46c56a1fc..d46c56a1fc 100644 --- a/editor/icons/icon_rotate_90.svg +++ b/editor/icons/Rotate90.svg diff --git a/editor/icons/icon_rotate_left.svg b/editor/icons/RotateLeft.svg index 223a725332..223a725332 100644 --- a/editor/icons/icon_rotate_left.svg +++ b/editor/icons/RotateLeft.svg diff --git a/editor/icons/icon_rotate_right.svg b/editor/icons/RotateRight.svg index 2b66bae998..2b66bae998 100644 --- a/editor/icons/icon_rotate_right.svg +++ b/editor/icons/RotateRight.svg diff --git a/editor/icons/icon_ruler.svg b/editor/icons/Ruler.svg index dbe02102ec..dbe02102ec 100644 --- a/editor/icons/icon_ruler.svg +++ b/editor/icons/Ruler.svg diff --git a/editor/icons/icon_sample_library.svg b/editor/icons/SampleLibrary.svg index e83a1a3778..e83a1a3778 100644 --- a/editor/icons/icon_sample_library.svg +++ b/editor/icons/SampleLibrary.svg diff --git a/editor/icons/icon_save.svg b/editor/icons/Save.svg index be5d3ef6fd..be5d3ef6fd 100644 --- a/editor/icons/icon_save.svg +++ b/editor/icons/Save.svg diff --git a/editor/icons/icon_script.svg b/editor/icons/Script.svg index 1c6ec51a48..1c6ec51a48 100644 --- a/editor/icons/icon_script.svg +++ b/editor/icons/Script.svg diff --git a/editor/icons/icon_script_create.svg b/editor/icons/ScriptCreate.svg index 0a03907a13..0a03907a13 100644 --- a/editor/icons/icon_script_create.svg +++ b/editor/icons/ScriptCreate.svg diff --git a/editor/icons/icon_script_create_dialog.svg b/editor/icons/ScriptCreateDialog.svg index 751b799ba9..751b799ba9 100644 --- a/editor/icons/icon_script_create_dialog.svg +++ b/editor/icons/ScriptCreateDialog.svg diff --git a/editor/icons/icon_script_extend.svg b/editor/icons/ScriptExtend.svg index efa0077ab1..efa0077ab1 100644 --- a/editor/icons/icon_script_extend.svg +++ b/editor/icons/ScriptExtend.svg diff --git a/editor/icons/icon_script_remove.svg b/editor/icons/ScriptRemove.svg index de67d02947..de67d02947 100644 --- a/editor/icons/icon_script_remove.svg +++ b/editor/icons/ScriptRemove.svg diff --git a/editor/icons/icon_scroll_container.svg b/editor/icons/ScrollContainer.svg index 738748ca91..738748ca91 100644 --- a/editor/icons/icon_scroll_container.svg +++ b/editor/icons/ScrollContainer.svg diff --git a/editor/icons/icon_search.svg b/editor/icons/Search.svg index 04dc4f7372..04dc4f7372 100644 --- a/editor/icons/icon_search.svg +++ b/editor/icons/Search.svg diff --git a/editor/icons/icon_segment_shape_2d.svg b/editor/icons/SegmentShape2D.svg index e4c04ae7c6..e4c04ae7c6 100644 --- a/editor/icons/icon_segment_shape_2d.svg +++ b/editor/icons/SegmentShape2D.svg diff --git a/editor/icons/icon_shader.svg b/editor/icons/Shader.svg index 479379d235..479379d235 100644 --- a/editor/icons/icon_shader.svg +++ b/editor/icons/Shader.svg diff --git a/editor/icons/icon_shader_material.svg b/editor/icons/ShaderMaterial.svg index 37c1610f29..37c1610f29 100644 --- a/editor/icons/icon_shader_material.svg +++ b/editor/icons/ShaderMaterial.svg diff --git a/editor/icons/icon_short_cut.svg b/editor/icons/ShortCut.svg index f4e302efdb..f4e302efdb 100644 --- a/editor/icons/icon_short_cut.svg +++ b/editor/icons/ShortCut.svg diff --git a/editor/icons/icon_signal.svg b/editor/icons/Signal.svg index 82fdf2b059..82fdf2b059 100644 --- a/editor/icons/icon_signal.svg +++ b/editor/icons/Signal.svg diff --git a/editor/icons/icon_signals.svg b/editor/icons/Signals.svg index 9c09546f84..9c09546f84 100644 --- a/editor/icons/icon_signals.svg +++ b/editor/icons/Signals.svg diff --git a/editor/icons/icon_signals_and_groups.svg b/editor/icons/SignalsAndGroups.svg index d568296d5f..d568296d5f 100644 --- a/editor/icons/icon_signals_and_groups.svg +++ b/editor/icons/SignalsAndGroups.svg diff --git a/editor/icons/icon_skeleton.svg b/editor/icons/Skeleton.svg index 015c842125..015c842125 100644 --- a/editor/icons/icon_skeleton.svg +++ b/editor/icons/Skeleton.svg diff --git a/editor/icons/icon_skeleton_2d.svg b/editor/icons/Skeleton2D.svg index 8e38b5c971..8e38b5c971 100644 --- a/editor/icons/icon_skeleton_2d.svg +++ b/editor/icons/Skeleton2D.svg diff --git a/editor/icons/icon_skeleton_i_k.svg b/editor/icons/SkeletonIK.svg index e69f6e8bf3..e69f6e8bf3 100644 --- a/editor/icons/icon_skeleton_i_k.svg +++ b/editor/icons/SkeletonIK.svg diff --git a/editor/icons/icon_slider_joint.svg b/editor/icons/SliderJoint.svg index fdd7487bbf..fdd7487bbf 100644 --- a/editor/icons/icon_slider_joint.svg +++ b/editor/icons/SliderJoint.svg diff --git a/editor/icons/icon_slot.svg b/editor/icons/Slot.svg index 24d54297a8..24d54297a8 100644 --- a/editor/icons/icon_slot.svg +++ b/editor/icons/Slot.svg diff --git a/editor/icons/icon_snap.svg b/editor/icons/Snap.svg index 632cf6c27d..632cf6c27d 100644 --- a/editor/icons/icon_snap.svg +++ b/editor/icons/Snap.svg diff --git a/editor/icons/icon_snap_grid.svg b/editor/icons/SnapGrid.svg index a4a1f33053..a4a1f33053 100644 --- a/editor/icons/icon_snap_grid.svg +++ b/editor/icons/SnapGrid.svg diff --git a/editor/icons/icon_soft_body.svg b/editor/icons/SoftBody.svg index 2c907df847..2c907df847 100644 --- a/editor/icons/icon_soft_body.svg +++ b/editor/icons/SoftBody.svg diff --git a/editor/icons/icon_sort.svg b/editor/icons/Sort.svg index 0b2f7f7ea9..0b2f7f7ea9 100644 --- a/editor/icons/icon_sort.svg +++ b/editor/icons/Sort.svg diff --git a/editor/icons/icon_spatial.svg b/editor/icons/Spatial.svg index 6a469dde13..6a469dde13 100644 --- a/editor/icons/icon_spatial.svg +++ b/editor/icons/Spatial.svg diff --git a/editor/icons/icon_spatial_material.svg b/editor/icons/SpatialMaterial.svg index cfd994a0fe..cfd994a0fe 100644 --- a/editor/icons/icon_spatial_material.svg +++ b/editor/icons/SpatialMaterial.svg diff --git a/editor/icons/icon_sphere_mesh.svg b/editor/icons/SphereMesh.svg index b01ba46bcf..b01ba46bcf 100644 --- a/editor/icons/icon_sphere_mesh.svg +++ b/editor/icons/SphereMesh.svg diff --git a/editor/icons/icon_sphere_shape.svg b/editor/icons/SphereShape.svg index 4da18a1a38..4da18a1a38 100644 --- a/editor/icons/icon_sphere_shape.svg +++ b/editor/icons/SphereShape.svg diff --git a/editor/icons/icon_spin_box.svg b/editor/icons/SpinBox.svg index 728710e440..728710e440 100644 --- a/editor/icons/icon_spin_box.svg +++ b/editor/icons/SpinBox.svg diff --git a/editor/icons/icon_spot_light.svg b/editor/icons/SpotLight.svg index 6a35ee3890..6a35ee3890 100644 --- a/editor/icons/icon_spot_light.svg +++ b/editor/icons/SpotLight.svg diff --git a/editor/icons/icon_spring_arm.svg b/editor/icons/SpringArm.svg index eb0c1ebd7d..eb0c1ebd7d 100644 --- a/editor/icons/icon_spring_arm.svg +++ b/editor/icons/SpringArm.svg diff --git a/editor/icons/icon_sprite.svg b/editor/icons/Sprite.svg index 26a10625fc..26a10625fc 100644 --- a/editor/icons/icon_sprite.svg +++ b/editor/icons/Sprite.svg diff --git a/editor/icons/icon_sprite_3d.svg b/editor/icons/Sprite3D.svg index 385bb8f87d..385bb8f87d 100644 --- a/editor/icons/icon_sprite_3d.svg +++ b/editor/icons/Sprite3D.svg diff --git a/editor/icons/icon_sprite_frames.svg b/editor/icons/SpriteFrames.svg index f27adcb78c..f27adcb78c 100644 --- a/editor/icons/icon_sprite_frames.svg +++ b/editor/icons/SpriteFrames.svg diff --git a/editor/icons/icon_sprite_sheet.svg b/editor/icons/SpriteSheet.svg index 9b3eda3287..9b3eda3287 100644 --- a/editor/icons/icon_sprite_sheet.svg +++ b/editor/icons/SpriteSheet.svg diff --git a/editor/icons/icon_standard_material_3d.svg b/editor/icons/StandardMaterial3D.svg index aa8bfc9a5b..aa8bfc9a5b 100644 --- a/editor/icons/icon_standard_material_3d.svg +++ b/editor/icons/StandardMaterial3D.svg diff --git a/editor/icons/icon_static_body.svg b/editor/icons/StaticBody.svg index de819bd76b..de819bd76b 100644 --- a/editor/icons/icon_static_body.svg +++ b/editor/icons/StaticBody.svg diff --git a/editor/icons/icon_static_body_2d.svg b/editor/icons/StaticBody2D.svg index 2d846c5471..2d846c5471 100644 --- a/editor/icons/icon_static_body_2d.svg +++ b/editor/icons/StaticBody2D.svg diff --git a/editor/icons/icon_status_error.svg b/editor/icons/StatusError.svg index ac3060e155..ac3060e155 100644 --- a/editor/icons/icon_status_error.svg +++ b/editor/icons/StatusError.svg diff --git a/editor/icons/icon_status_success.svg b/editor/icons/StatusSuccess.svg index 4a22c6fc7f..4a22c6fc7f 100644 --- a/editor/icons/icon_status_success.svg +++ b/editor/icons/StatusSuccess.svg diff --git a/editor/icons/icon_status_warning.svg b/editor/icons/StatusWarning.svg index 4ec16008d7..4ec16008d7 100644 --- a/editor/icons/icon_status_warning.svg +++ b/editor/icons/StatusWarning.svg diff --git a/editor/icons/icon_stop.svg b/editor/icons/Stop.svg index 2cb013c0df..2cb013c0df 100644 --- a/editor/icons/icon_stop.svg +++ b/editor/icons/Stop.svg diff --git a/editor/icons/icon_stream_texture.svg b/editor/icons/StreamTexture.svg index e7845e10f3..e7845e10f3 100644 --- a/editor/icons/icon_stream_texture.svg +++ b/editor/icons/StreamTexture.svg diff --git a/editor/icons/icon_string.svg b/editor/icons/String.svg index 9f3bb0b011..9f3bb0b011 100644 --- a/editor/icons/icon_string.svg +++ b/editor/icons/String.svg diff --git a/editor/icons/StringName.svg b/editor/icons/StringName.svg new file mode 100644 index 0000000000..bedaa6d634 --- /dev/null +++ b/editor/icons/StringName.svg @@ -0,0 +1,4 @@ +<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg"> +<path d="m5 2c-1.6569 0-3 1.3431-3 3v2c0 0.55228-0.44772 1-1 1h-1v2h1c1.6569 0 3-1.3431 3-3v-2c0-0.55228 0.44772-1 1-1h1v3c0 1.6569 1.3431 3 3 3h3v-4h1c0.55228 0 1 0.44772 1 1v3h2v-3c0-1.6569-1.3431-3-3-3h-5v-2zm3 4h2v2h-1c-0.55228 0-1-0.44772-1-1z" fill="#6ba7ec"/> +<path d="m10 4v6h2v-4h1c0.55228 0 1 0.44772 1 1v3h2v-3c0-1.6569-1.3431-3-3-3h-1z" fill="#fff" fill-opacity=".39216"/> +</svg> diff --git a/editor/icons/icon_style_box_empty.svg b/editor/icons/StyleBoxEmpty.svg index 0268b03ef2..0268b03ef2 100644 --- a/editor/icons/icon_style_box_empty.svg +++ b/editor/icons/StyleBoxEmpty.svg diff --git a/editor/icons/icon_style_box_flat.svg b/editor/icons/StyleBoxFlat.svg index a6f43be4c8..a6f43be4c8 100644 --- a/editor/icons/icon_style_box_flat.svg +++ b/editor/icons/StyleBoxFlat.svg diff --git a/editor/icons/icon_style_box_line.svg b/editor/icons/StyleBoxLine.svg index d7c26aac9d..d7c26aac9d 100644 --- a/editor/icons/icon_style_box_line.svg +++ b/editor/icons/StyleBoxLine.svg diff --git a/editor/icons/icon_style_box_texture.svg b/editor/icons/StyleBoxTexture.svg index 6f067a4db4..6f067a4db4 100644 --- a/editor/icons/icon_style_box_texture.svg +++ b/editor/icons/StyleBoxTexture.svg diff --git a/editor/icons/icon_tab_container.svg b/editor/icons/TabContainer.svg index fe0e426ef9..fe0e426ef9 100644 --- a/editor/icons/icon_tab_container.svg +++ b/editor/icons/TabContainer.svg diff --git a/editor/icons/icon_tabs.svg b/editor/icons/Tabs.svg index ad1e9069d0..ad1e9069d0 100644 --- a/editor/icons/icon_tabs.svg +++ b/editor/icons/Tabs.svg diff --git a/editor/icons/icon_test_cube.svg b/editor/icons/TestCube.svg index 16cf68520f..16cf68520f 100644 --- a/editor/icons/icon_test_cube.svg +++ b/editor/icons/TestCube.svg diff --git a/editor/icons/icon_text_edit.svg b/editor/icons/TextEdit.svg index 66f2fca4ba..66f2fca4ba 100644 --- a/editor/icons/icon_text_edit.svg +++ b/editor/icons/TextEdit.svg diff --git a/editor/icons/icon_text_file.svg b/editor/icons/TextFile.svg index d381048212..d381048212 100644 --- a/editor/icons/icon_text_file.svg +++ b/editor/icons/TextFile.svg diff --git a/editor/icons/icon_texture_3_d.svg b/editor/icons/Texture3D.svg index ed8ce3e4ef..ed8ce3e4ef 100644 --- a/editor/icons/icon_texture_3_d.svg +++ b/editor/icons/Texture3D.svg diff --git a/editor/icons/icon_texture_array.svg b/editor/icons/TextureArray.svg index 4631b1449c..4631b1449c 100644 --- a/editor/icons/icon_texture_array.svg +++ b/editor/icons/TextureArray.svg diff --git a/editor/icons/icon_texture_button.svg b/editor/icons/TextureButton.svg index 6e1d1b6436..6e1d1b6436 100644 --- a/editor/icons/icon_texture_button.svg +++ b/editor/icons/TextureButton.svg diff --git a/editor/icons/icon_texture_progress.svg b/editor/icons/TextureProgress.svg index 5763fde840..5763fde840 100644 --- a/editor/icons/icon_texture_progress.svg +++ b/editor/icons/TextureProgress.svg diff --git a/editor/icons/icon_texture_rect.svg b/editor/icons/TextureRect.svg index 1d1b5ed8f7..1d1b5ed8f7 100644 --- a/editor/icons/icon_texture_rect.svg +++ b/editor/icons/TextureRect.svg diff --git a/editor/icons/icon_theme.svg b/editor/icons/Theme.svg index e16acbfb72..e16acbfb72 100644 --- a/editor/icons/icon_theme.svg +++ b/editor/icons/Theme.svg diff --git a/editor/icons/icon_thumbnail_wait.svg b/editor/icons/ThumbnailWait.svg index fe242e81fb..fe242e81fb 100644 --- a/editor/icons/icon_thumbnail_wait.svg +++ b/editor/icons/ThumbnailWait.svg diff --git a/editor/icons/icon_tile_map.svg b/editor/icons/TileMap.svg index afdaeea7e8..afdaeea7e8 100644 --- a/editor/icons/icon_tile_map.svg +++ b/editor/icons/TileMap.svg diff --git a/editor/icons/icon_tile_set.svg b/editor/icons/TileSet.svg index 0948e6dae1..0948e6dae1 100644 --- a/editor/icons/icon_tile_set.svg +++ b/editor/icons/TileSet.svg diff --git a/editor/icons/icon_time.svg b/editor/icons/Time.svg index eb411c6858..eb411c6858 100644 --- a/editor/icons/icon_time.svg +++ b/editor/icons/Time.svg diff --git a/editor/icons/icon_timeline_indicator.svg b/editor/icons/TimelineIndicator.svg index fd18192705..fd18192705 100644 --- a/editor/icons/icon_timeline_indicator.svg +++ b/editor/icons/TimelineIndicator.svg diff --git a/editor/icons/icon_timer.svg b/editor/icons/Timer.svg index d445eeb1dd..d445eeb1dd 100644 --- a/editor/icons/icon_timer.svg +++ b/editor/icons/Timer.svg diff --git a/editor/icons/icon_tool_add_node.svg b/editor/icons/ToolAddNode.svg index 71599c0b0d..71599c0b0d 100644 --- a/editor/icons/icon_tool_add_node.svg +++ b/editor/icons/ToolAddNode.svg diff --git a/editor/icons/icon_tool_button.svg b/editor/icons/ToolButton.svg index 98a41d2a08..98a41d2a08 100644 --- a/editor/icons/icon_tool_button.svg +++ b/editor/icons/ToolButton.svg diff --git a/editor/icons/icon_tool_connect.svg b/editor/icons/ToolConnect.svg index 321f68654a..321f68654a 100644 --- a/editor/icons/icon_tool_connect.svg +++ b/editor/icons/ToolConnect.svg diff --git a/editor/icons/icon_tool_move.svg b/editor/icons/ToolMove.svg index a02296fed6..a02296fed6 100644 --- a/editor/icons/icon_tool_move.svg +++ b/editor/icons/ToolMove.svg diff --git a/editor/icons/icon_tool_pan.svg b/editor/icons/ToolPan.svg index e195542687..e195542687 100644 --- a/editor/icons/icon_tool_pan.svg +++ b/editor/icons/ToolPan.svg diff --git a/editor/icons/icon_tool_rotate.svg b/editor/icons/ToolRotate.svg index e25b08cd07..e25b08cd07 100644 --- a/editor/icons/icon_tool_rotate.svg +++ b/editor/icons/ToolRotate.svg diff --git a/editor/icons/icon_tool_scale.svg b/editor/icons/ToolScale.svg index 8fc1527296..8fc1527296 100644 --- a/editor/icons/icon_tool_scale.svg +++ b/editor/icons/ToolScale.svg diff --git a/editor/icons/icon_tool_select.svg b/editor/icons/ToolSelect.svg index 4285b3181b..4285b3181b 100644 --- a/editor/icons/icon_tool_select.svg +++ b/editor/icons/ToolSelect.svg diff --git a/editor/icons/icon_tool_triangle.svg b/editor/icons/ToolTriangle.svg index 17ce12265e..17ce12265e 100644 --- a/editor/icons/icon_tool_triangle.svg +++ b/editor/icons/ToolTriangle.svg diff --git a/editor/icons/icon_tools.svg b/editor/icons/Tools.svg index dc002d6a4d..dc002d6a4d 100644 --- a/editor/icons/icon_tools.svg +++ b/editor/icons/Tools.svg diff --git a/editor/icons/icon_touch_screen_button.svg b/editor/icons/TouchScreenButton.svg index d29e411f05..d29e411f05 100644 --- a/editor/icons/icon_touch_screen_button.svg +++ b/editor/icons/TouchScreenButton.svg diff --git a/editor/icons/icon_track_add_key.svg b/editor/icons/TrackAddKey.svg index 582003cd9b..582003cd9b 100644 --- a/editor/icons/icon_track_add_key.svg +++ b/editor/icons/TrackAddKey.svg diff --git a/editor/icons/icon_track_add_key_hl.svg b/editor/icons/TrackAddKeyHl.svg index 7f3c60a562..7f3c60a562 100644 --- a/editor/icons/icon_track_add_key_hl.svg +++ b/editor/icons/TrackAddKeyHl.svg diff --git a/editor/icons/icon_track_capture.svg b/editor/icons/TrackCapture.svg index 51a38ff1fb..51a38ff1fb 100644 --- a/editor/icons/icon_track_capture.svg +++ b/editor/icons/TrackCapture.svg diff --git a/editor/icons/icon_track_color.svg b/editor/icons/TrackColor.svg index 6a736c7a84..6a736c7a84 100644 --- a/editor/icons/icon_track_color.svg +++ b/editor/icons/TrackColor.svg diff --git a/editor/icons/icon_track_continuous.svg b/editor/icons/TrackContinuous.svg index 2e89cdd821..2e89cdd821 100644 --- a/editor/icons/icon_track_continuous.svg +++ b/editor/icons/TrackContinuous.svg diff --git a/editor/icons/icon_track_discrete.svg b/editor/icons/TrackDiscrete.svg index a0550822bf..a0550822bf 100644 --- a/editor/icons/icon_track_discrete.svg +++ b/editor/icons/TrackDiscrete.svg diff --git a/editor/icons/icon_track_trigger.svg b/editor/icons/TrackTrigger.svg index 5572b254a2..5572b254a2 100644 --- a/editor/icons/icon_track_trigger.svg +++ b/editor/icons/TrackTrigger.svg diff --git a/editor/icons/icon_transform.svg b/editor/icons/Transform.svg index 0ed5377ed7..0ed5377ed7 100644 --- a/editor/icons/icon_transform.svg +++ b/editor/icons/Transform.svg diff --git a/editor/icons/icon_transform_2_D.svg b/editor/icons/Transform2D.svg index a57587ba06..a57587ba06 100644 --- a/editor/icons/icon_transform_2_D.svg +++ b/editor/icons/Transform2D.svg diff --git a/editor/icons/icon_transition_end.svg b/editor/icons/TransitionEnd.svg index 8d6857432f..8d6857432f 100644 --- a/editor/icons/icon_transition_end.svg +++ b/editor/icons/TransitionEnd.svg diff --git a/editor/icons/icon_transition_end_auto.svg b/editor/icons/TransitionEndAuto.svg index fbfa7b03db..fbfa7b03db 100644 --- a/editor/icons/icon_transition_end_auto.svg +++ b/editor/icons/TransitionEndAuto.svg diff --git a/editor/icons/icon_transition_end_auto_big.svg b/editor/icons/TransitionEndAutoBig.svg index fcc894a3e6..fcc894a3e6 100644 --- a/editor/icons/icon_transition_end_auto_big.svg +++ b/editor/icons/TransitionEndAutoBig.svg diff --git a/editor/icons/icon_transition_end_big.svg b/editor/icons/TransitionEndBig.svg index cc93dd5808..cc93dd5808 100644 --- a/editor/icons/icon_transition_end_big.svg +++ b/editor/icons/TransitionEndBig.svg diff --git a/editor/icons/icon_transition_immediate.svg b/editor/icons/TransitionImmediate.svg index 56e9b6c0f3..56e9b6c0f3 100644 --- a/editor/icons/icon_transition_immediate.svg +++ b/editor/icons/TransitionImmediate.svg diff --git a/editor/icons/icon_transition_immediate_auto.svg b/editor/icons/TransitionImmediateAuto.svg index 8453bcff08..8453bcff08 100644 --- a/editor/icons/icon_transition_immediate_auto.svg +++ b/editor/icons/TransitionImmediateAuto.svg diff --git a/editor/icons/icon_transition_immediate_auto_big.svg b/editor/icons/TransitionImmediateAutoBig.svg index 77f7ba592e..77f7ba592e 100644 --- a/editor/icons/icon_transition_immediate_auto_big.svg +++ b/editor/icons/TransitionImmediateAutoBig.svg diff --git a/editor/icons/icon_transition_immediate_big.svg b/editor/icons/TransitionImmediateBig.svg index 94584c45f7..94584c45f7 100644 --- a/editor/icons/icon_transition_immediate_big.svg +++ b/editor/icons/TransitionImmediateBig.svg diff --git a/editor/icons/icon_transition_sync.svg b/editor/icons/TransitionSync.svg index affa353100..affa353100 100644 --- a/editor/icons/icon_transition_sync.svg +++ b/editor/icons/TransitionSync.svg diff --git a/editor/icons/icon_transition_sync_auto.svg b/editor/icons/TransitionSyncAuto.svg index 767773a000..767773a000 100644 --- a/editor/icons/icon_transition_sync_auto.svg +++ b/editor/icons/TransitionSyncAuto.svg diff --git a/editor/icons/icon_transition_sync_auto_big.svg b/editor/icons/TransitionSyncAutoBig.svg index c9735a2653..c9735a2653 100644 --- a/editor/icons/icon_transition_sync_auto_big.svg +++ b/editor/icons/TransitionSyncAutoBig.svg diff --git a/editor/icons/icon_transition_sync_big.svg b/editor/icons/TransitionSyncBig.svg index 959f26c6f1..959f26c6f1 100644 --- a/editor/icons/icon_transition_sync_big.svg +++ b/editor/icons/TransitionSyncBig.svg diff --git a/editor/icons/icon_translation.svg b/editor/icons/Translation.svg index 4195ce04a9..4195ce04a9 100644 --- a/editor/icons/icon_translation.svg +++ b/editor/icons/Translation.svg diff --git a/editor/icons/icon_transpose.svg b/editor/icons/Transpose.svg index e63c679323..e63c679323 100644 --- a/editor/icons/icon_transpose.svg +++ b/editor/icons/Transpose.svg diff --git a/editor/icons/icon_tree.svg b/editor/icons/Tree.svg index 8e450948ce..8e450948ce 100644 --- a/editor/icons/icon_tree.svg +++ b/editor/icons/Tree.svg diff --git a/editor/icons/icon_tween.svg b/editor/icons/Tween.svg index c311cbd05e..c311cbd05e 100644 --- a/editor/icons/icon_tween.svg +++ b/editor/icons/Tween.svg diff --git a/editor/icons/icon_unbone.svg b/editor/icons/Unbone.svg index 75df7e6ce9..75df7e6ce9 100644 --- a/editor/icons/icon_unbone.svg +++ b/editor/icons/Unbone.svg diff --git a/editor/icons/icon_ungroup.svg b/editor/icons/Ungroup.svg index c6e235f47d..c6e235f47d 100644 --- a/editor/icons/icon_ungroup.svg +++ b/editor/icons/Ungroup.svg diff --git a/editor/icons/icon_unlock.svg b/editor/icons/Unlock.svg index 52be7e2233..52be7e2233 100644 --- a/editor/icons/icon_unlock.svg +++ b/editor/icons/Unlock.svg diff --git a/editor/icons/icon_unpaint_vertex.svg b/editor/icons/UnpaintVertex.svg index 7bb94f06be..7bb94f06be 100644 --- a/editor/icons/icon_unpaint_vertex.svg +++ b/editor/icons/UnpaintVertex.svg diff --git a/editor/icons/icon_uv.svg b/editor/icons/Uv.svg index f68ea2c984..f68ea2c984 100644 --- a/editor/icons/icon_uv.svg +++ b/editor/icons/Uv.svg diff --git a/editor/icons/icon_v_box_container.svg b/editor/icons/VBoxContainer.svg index 17b83ced0a..17b83ced0a 100644 --- a/editor/icons/icon_v_box_container.svg +++ b/editor/icons/VBoxContainer.svg diff --git a/editor/icons/icon_v_scroll_bar.svg b/editor/icons/VScrollBar.svg index 285e54fbd1..285e54fbd1 100644 --- a/editor/icons/icon_v_scroll_bar.svg +++ b/editor/icons/VScrollBar.svg diff --git a/editor/icons/icon_v_separator.svg b/editor/icons/VSeparator.svg index 6476ea5ad7..6476ea5ad7 100644 --- a/editor/icons/icon_v_separator.svg +++ b/editor/icons/VSeparator.svg diff --git a/editor/icons/icon_v_slider.svg b/editor/icons/VSlider.svg index c6fc1e6e0f..c6fc1e6e0f 100644 --- a/editor/icons/icon_v_slider.svg +++ b/editor/icons/VSlider.svg diff --git a/editor/icons/icon_v_split_container.svg b/editor/icons/VSplitContainer.svg index b9bbb4bfc3..b9bbb4bfc3 100644 --- a/editor/icons/icon_v_split_container.svg +++ b/editor/icons/VSplitContainer.svg diff --git a/editor/icons/icon_variant.svg b/editor/icons/Variant.svg index 7c2e4559d1..7c2e4559d1 100644 --- a/editor/icons/icon_variant.svg +++ b/editor/icons/Variant.svg diff --git a/editor/icons/icon_vector2.svg b/editor/icons/Vector2.svg index b4e9b44c03..b4e9b44c03 100644 --- a/editor/icons/icon_vector2.svg +++ b/editor/icons/Vector2.svg diff --git a/editor/icons/Vector2i.svg b/editor/icons/Vector2i.svg new file mode 100644 index 0000000000..6cf9a896f3 --- /dev/null +++ b/editor/icons/Vector2i.svg @@ -0,0 +1,5 @@ +<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg"> +<path d="m8 2v2h1c0.55228 0 1 0.44772 1 1s-0.44772 1-1 1c-0.71466-1.248e-4 -1.3751 0.38109-1.7324 1-0.17472 0.30426-0.26633 0.64914-0.26562 1h-2e-3v2h5v-2h-3c1.0717-1.344e-4 2.0619-0.57191 2.5977-1.5 0.5359-0.9282 0.5359-2.0718 0-3-0.53578-0.92809-1.526-1.4999-2.5977-1.5zm-7 2v6h2c1.6569 0 3-1.3431 3-3v-3h-2v3c0 0.55228-0.44772 1-1 1v-4z" fill="#bd91f1"/> +<path d="m8 2v2h1c0.55228 0 1 0.44772 1 1s-0.44772 1-1 1c-0.71466-1.248e-4 -1.3751 0.38109-1.7324 1-0.17472 0.30426-0.26633 0.64914-0.26562 1h-0.001953v2h5v-2h-3c1.0717-1.344e-4 2.0619-0.57191 2.5977-1.5 0.5359-0.9282 0.5359-2.0718 0-3-0.53583-0.92809-1.526-1.4999-2.5977-1.5z" fill="#fff" fill-opacity=".39216"/> +<path d="m13 2v2h2v-2zm0 4v4h2v-4z" fill="#7dc6ef"/> +</svg> diff --git a/editor/icons/icon_vector3.svg b/editor/icons/Vector3.svg index 74861160d6..74861160d6 100644 --- a/editor/icons/icon_vector3.svg +++ b/editor/icons/Vector3.svg diff --git a/editor/icons/Vector3i.svg b/editor/icons/Vector3i.svg new file mode 100644 index 0000000000..d0be27886d --- /dev/null +++ b/editor/icons/Vector3i.svg @@ -0,0 +1,5 @@ +<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg"> +<path d="m8 2v2h2c0 0.55228-0.44772 1-1 1v2c0.55228 0 1 0.44772 1 1s-0.45296 0.92408-1 1h-1v2h1c1.0717-1.34e-4 2.0619-0.57191 2.5977-1.5 0.5359-0.9282 0.5359-2.0718 0-3-0.10406-0.1795-0.22646-0.34771-0.36523-0.50195 0.13855-0.15301 0.26094-0.31991 0.36523-0.49805 0.26209-0.45639 0.3995-0.97371 0.39844-1.5h0.0039v-2zm-7 2v6h2c1.6569 0 3-1.3431 3-3v-3h-2v3c0 0.55228-0.44772 1-1 1v-4z" fill="#e286f0"/> +<path d="m8 2v2h2c0 0.55228-0.44772 1-1 1v2c0.55228 0 1 0.44772 1 1s-0.44948 0.95585-1 1h-1v2h1c1.0717-1.34e-4 2.0619-0.57191 2.5977-1.5 0.5359-0.9282 0.5359-2.0718 0-3-0.10406-0.1795-0.22646-0.34771-0.36523-0.50195 0.13855-0.15301 0.26094-0.31991 0.36523-0.49805 0.26209-0.45639 0.3995-0.97371 0.39844-1.5h0.0039v-2z" fill="#fff" fill-opacity=".39216"/> +<path d="m13 2v2h2v-2zm0 4v4h2v-4z" fill="#7dc6ef"/> +</svg> diff --git a/editor/icons/icon_vehicle_body.svg b/editor/icons/VehicleBody.svg index a509730602..a509730602 100644 --- a/editor/icons/icon_vehicle_body.svg +++ b/editor/icons/VehicleBody.svg diff --git a/editor/icons/icon_vehicle_wheel.svg b/editor/icons/VehicleWheel.svg index bd870c0118..bd870c0118 100644 --- a/editor/icons/icon_vehicle_wheel.svg +++ b/editor/icons/VehicleWheel.svg diff --git a/editor/icons/icon_video_player.svg b/editor/icons/VideoPlayer.svg index 4e8dcf0ec2..4e8dcf0ec2 100644 --- a/editor/icons/icon_video_player.svg +++ b/editor/icons/VideoPlayer.svg diff --git a/editor/icons/icon_viewport.svg b/editor/icons/Viewport.svg index 7cd5d73cde..7cd5d73cde 100644 --- a/editor/icons/icon_viewport.svg +++ b/editor/icons/Viewport.svg diff --git a/editor/icons/icon_viewport_container.svg b/editor/icons/ViewportContainer.svg index 18dcddc15f..18dcddc15f 100644 --- a/editor/icons/icon_viewport_container.svg +++ b/editor/icons/ViewportContainer.svg diff --git a/editor/icons/icon_viewport_speed.svg b/editor/icons/ViewportSpeed.svg index 364eb4969b..364eb4969b 100644 --- a/editor/icons/icon_viewport_speed.svg +++ b/editor/icons/ViewportSpeed.svg diff --git a/editor/icons/icon_viewport_texture.svg b/editor/icons/ViewportTexture.svg index 145beff6bc..145beff6bc 100644 --- a/editor/icons/icon_viewport_texture.svg +++ b/editor/icons/ViewportTexture.svg diff --git a/editor/icons/icon_viewport_zoom.svg b/editor/icons/ViewportZoom.svg index 6d64d1b8a4..6d64d1b8a4 100644 --- a/editor/icons/icon_viewport_zoom.svg +++ b/editor/icons/ViewportZoom.svg diff --git a/editor/icons/icon_visibility_enabler.svg b/editor/icons/VisibilityEnabler.svg index 70e4f081c2..70e4f081c2 100644 --- a/editor/icons/icon_visibility_enabler.svg +++ b/editor/icons/VisibilityEnabler.svg diff --git a/editor/icons/icon_visibility_enabler_2d.svg b/editor/icons/VisibilityEnabler2D.svg index 2976e468ed..2976e468ed 100644 --- a/editor/icons/icon_visibility_enabler_2d.svg +++ b/editor/icons/VisibilityEnabler2D.svg diff --git a/editor/icons/icon_visibility_notifier.svg b/editor/icons/VisibilityNotifier.svg index c908d5c99d..c908d5c99d 100644 --- a/editor/icons/icon_visibility_notifier.svg +++ b/editor/icons/VisibilityNotifier.svg diff --git a/editor/icons/icon_visibility_notifier_2d.svg b/editor/icons/VisibilityNotifier2D.svg index e05d7d3887..e05d7d3887 100644 --- a/editor/icons/icon_visibility_notifier_2d.svg +++ b/editor/icons/VisibilityNotifier2D.svg diff --git a/editor/icons/icon_visual_shader.svg b/editor/icons/VisualShader.svg index 15cb60d2e3..15cb60d2e3 100644 --- a/editor/icons/icon_visual_shader.svg +++ b/editor/icons/VisualShader.svg diff --git a/editor/icons/icon_visual_shader_port.svg b/editor/icons/VisualShaderPort.svg index 9df6344fe2..9df6344fe2 100644 --- a/editor/icons/icon_visual_shader_port.svg +++ b/editor/icons/VisualShaderPort.svg diff --git a/editor/icons/icon_warning.svg b/editor/icons/Warning.svg index 698288d5a9..698288d5a9 100644 --- a/editor/icons/icon_warning.svg +++ b/editor/icons/Warning.svg diff --git a/editor/icons/icon_window_dialog.svg b/editor/icons/WindowDialog.svg index 3c7be2a58d..3c7be2a58d 100644 --- a/editor/icons/icon_window_dialog.svg +++ b/editor/icons/WindowDialog.svg diff --git a/editor/icons/icon_world.svg b/editor/icons/World.svg index 3db96a75a6..3db96a75a6 100644 --- a/editor/icons/icon_world.svg +++ b/editor/icons/World.svg diff --git a/editor/icons/icon_world_2d.svg b/editor/icons/World2D.svg index 862242ec44..862242ec44 100644 --- a/editor/icons/icon_world_2d.svg +++ b/editor/icons/World2D.svg diff --git a/editor/icons/icon_world_environment.svg b/editor/icons/WorldEnvironment.svg index e87a4b5b0c..e87a4b5b0c 100644 --- a/editor/icons/icon_world_environment.svg +++ b/editor/icons/WorldEnvironment.svg diff --git a/editor/icons/icon_x509_certificate.svg b/editor/icons/X509Certificate.svg index e175fa3234..e175fa3234 100644 --- a/editor/icons/icon_x509_certificate.svg +++ b/editor/icons/X509Certificate.svg diff --git a/editor/icons/icon_y_sort.svg b/editor/icons/YSort.svg index dbcefef216..dbcefef216 100644 --- a/editor/icons/icon_y_sort.svg +++ b/editor/icons/YSort.svg diff --git a/editor/icons/icon_zoom.svg b/editor/icons/Zoom.svg index aa517b6ae2..aa517b6ae2 100644 --- a/editor/icons/icon_zoom.svg +++ b/editor/icons/Zoom.svg diff --git a/editor/icons/icon_zoom_less.svg b/editor/icons/ZoomLess.svg index cf3b4475c9..cf3b4475c9 100644 --- a/editor/icons/icon_zoom_less.svg +++ b/editor/icons/ZoomLess.svg diff --git a/editor/icons/icon_zoom_more.svg b/editor/icons/ZoomMore.svg index 8847eea53f..8847eea53f 100644 --- a/editor/icons/icon_zoom_more.svg +++ b/editor/icons/ZoomMore.svg diff --git a/editor/icons/icon_zoom_reset.svg b/editor/icons/ZoomReset.svg index 6ecb4111fe..6ecb4111fe 100644 --- a/editor/icons/icon_zoom_reset.svg +++ b/editor/icons/ZoomReset.svg diff --git a/editor/icons/icon_bool.svg b/editor/icons/bool.svg index 5ffd40a815..5ffd40a815 100644 --- a/editor/icons/icon_bool.svg +++ b/editor/icons/bool.svg diff --git a/editor/icons/editor_icons_builders.py b/editor/icons/editor_icons_builders.py index dfd0802ce9..ea2c2e57d1 100644 --- a/editor/icons/editor_icons_builders.py +++ b/editor/icons/editor_icons_builders.py @@ -27,7 +27,6 @@ def make_editor_icons_action(target, source, env): icons_string.write("\\" + str(hex(ord(b)))[1:]) b = svgf.read(1) - icons_string.write('"') if fname != svg_icons[-1]: icons_string.write(",") @@ -44,17 +43,16 @@ def make_editor_icons_action(target, source, env): s.write("static const char *editor_icons_names[] = {\n") # this is used to store the indices of thumbnail icons - thumb_medium_indices = []; - thumb_big_indices = []; + thumb_medium_indices = [] + thumb_big_indices = [] index = 0 for f in svg_icons: fname = str(f) - icon_name = os.path.basename(fname)[5:-4].title().replace("_", "") + # Trim the `.svg` extension from the string. + icon_name = os.path.basename(fname)[:-4] # some special cases - if icon_name in ['Int', 'Bool', 'Float']: - icon_name = icon_name.lower() if icon_name.endswith("MediumThumb"): # don't know a better way to handle this thumb_medium_indices.append(str(index)) if icon_name.endswith("BigThumb"): # don't know a better way to handle this diff --git a/editor/icons/icon_float.svg b/editor/icons/float.svg index 5c09d4c244..5c09d4c244 100644 --- a/editor/icons/icon_float.svg +++ b/editor/icons/float.svg diff --git a/editor/icons/icon_gizmo_spatial_stream_player.svg b/editor/icons/icon_gizmo_spatial_stream_player.svg deleted file mode 100644 index 473fd2c2cd..0000000000 --- a/editor/icons/icon_gizmo_spatial_stream_player.svg +++ /dev/null @@ -1 +0,0 @@ -<svg height="128" viewBox="0 0 128 128" width="128" xmlns="http://www.w3.org/2000/svg"><path d="m99.645 6.0059c-.9956.029687-1.9837.18322-2.9414.45703l-56 16c-5.1336 1.4668-8.7021 6.198-8.7031 11.537v44.203c-11.16 1.0331-20 10.379-20 21.797.000011 12.103 9.8971 22 22 22 12.103-.00001 22-9.8971 22-22v-56.947l32-9.1426v28.293c-11.16 1.0331-20 10.379-20 21.797.000011 12.103 9.8971 22 22 22 12.103-.00001 22-9.8971 22-22v-66c-.00104-6.7137-5.6428-12.192-12.354-11.994z" fill-opacity=".29412"/><path d="m99.764 10.004a8.0008 8.0008 0 0 0 -1.9609.30469l-56 16a8.0008 8.0008 0 0 0 -5.8027 7.6914v48.121a18 18 0 0 0 -2-.12109 18 18 0 0 0 -18 18 18 18 0 0 0 18 18 18 18 0 0 0 18-18v-59.965l40-11.428v37.514a18 18 0 0 0 -2-.12109 18 18 0 0 0 -18 18 18 18 0 0 0 18 18 18 18 0 0 0 18-18v-66a8.0008 8.0008 0 0 0 -8.2363-7.9961z" fill="#f7f5cf"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_int.svg b/editor/icons/int.svg index 4226c8cb7e..4226c8cb7e 100644 --- a/editor/icons/icon_int.svg +++ b/editor/icons/int.svg diff --git a/editor/import/editor_import_plugin.cpp b/editor/import/editor_import_plugin.cpp index 53a654c971..aad378c94f 100644 --- a/editor/import/editor_import_plugin.cpp +++ b/editor/import/editor_import_plugin.cpp @@ -162,7 +162,7 @@ void EditorImportPlugin::_bind_methods() { ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::ARRAY, "get_import_options", PropertyInfo(Variant::INT, "preset"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_save_extension")); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_resource_type")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::REAL, "get_priority")); + ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::FLOAT, "get_priority")); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "get_import_order")); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "get_option_visibility", PropertyInfo(Variant::STRING, "option"), PropertyInfo(Variant::DICTIONARY, "options"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "import", PropertyInfo(Variant::STRING, "source_file"), PropertyInfo(Variant::STRING, "save_path"), PropertyInfo(Variant::DICTIONARY, "options"), PropertyInfo(Variant::ARRAY, "platform_variants"), PropertyInfo(Variant::ARRAY, "gen_files"))); diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index f9e8977924..731d094745 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -2183,6 +2183,8 @@ Error EditorSceneImporterGLTF::_map_skin_joints_indices_to_skeleton_bone_indices const GLTFNodeIndex node_i = skin.joints_original[joint_index]; const GLTFNode *node = state.nodes[node_i]; + skin.joint_i_to_name.insert(joint_index, node->name); + const int bone_index = skeleton.godot_skeleton->find_bone(node->name); ERR_FAIL_COND_V(bone_index < 0, FAILED); @@ -2204,12 +2206,18 @@ Error EditorSceneImporterGLTF::_create_skins(GLTFState &state) { const bool has_ibms = !gltf_skin.inverse_binds.empty(); for (int joint_i = 0; joint_i < gltf_skin.joints_original.size(); ++joint_i) { - int bone_i = gltf_skin.joint_i_to_bone_i[joint_i]; + Transform xform; if (has_ibms) { - skin->add_bind(bone_i, gltf_skin.inverse_binds[joint_i]); + xform = gltf_skin.inverse_binds[joint_i]; + } + + if (state.use_named_skin_binds) { + StringName name = gltf_skin.joint_i_to_name[joint_i]; + skin->add_named_bind(name, xform); } else { - skin->add_bind(bone_i, Transform()); + int bone_i = gltf_skin.joint_i_to_bone_i[joint_i]; + skin->add_bind(bone_i, xform); } } @@ -2995,6 +3003,7 @@ Node *EditorSceneImporterGLTF::import_scene(const String &p_path, uint32_t p_fla state.major_version = version.get_slice(".", 0).to_int(); state.minor_version = version.get_slice(".", 1).to_int(); + state.use_named_skin_binds = p_flags & IMPORT_USE_NAMED_SKIN_BINDS; /* STEP 0 PARSE SCENE */ Error err = _parse_scenes(state); diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h index 72d5b04e67..5d2711483b 100644 --- a/editor/import/editor_scene_importer_gltf.h +++ b/editor/import/editor_scene_importer_gltf.h @@ -231,6 +231,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { // A mapping from the joint indices (in the order of joints_original) to the // Godot Skeleton's bone_indices Map<int, int> joint_i_to_bone_i; + Map<int, StringName> joint_i_to_name; // The Actual Skin that will be created as a mapping between the IBM's of this skin // to the generated skeleton for the mesh instances. @@ -298,6 +299,8 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { int minor_version; Vector<uint8_t> glb_data; + bool use_named_skin_binds; + Vector<GLTFNode *> nodes; Vector<Vector<uint8_t> > buffers; Vector<GLTFBufferView> buffer_views; diff --git a/editor/import/resource_importer_bitmask.cpp b/editor/import/resource_importer_bitmask.cpp index 22989b81e4..252af9050b 100644 --- a/editor/import/resource_importer_bitmask.cpp +++ b/editor/import/resource_importer_bitmask.cpp @@ -75,7 +75,7 @@ String ResourceImporterBitMap::get_preset_name(int p_idx) const { void ResourceImporterBitMap::get_import_options(List<ImportOption> *r_options, int p_preset) const { r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "create_from", PROPERTY_HINT_ENUM, "Black & White,Alpha"), 0)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "threshold", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.5)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "threshold", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.5)); } Error ResourceImporterBitMap::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) { diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 4b0bfa7222..9fb6be50d9 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1160,7 +1160,7 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in bool scenes_out = p_preset == PRESET_MULTIPLE_SCENES || p_preset == PRESET_MULTIPLE_SCENES_AND_MATERIALS; bool animations_out = p_preset == PRESET_SEPARATE_ANIMATIONS || p_preset == PRESET_SEPARATE_MESHES_AND_ANIMATIONS || p_preset == PRESET_SEPARATE_MATERIALS_AND_ANIMATIONS || p_preset == PRESET_SEPARATE_MESHES_MATERIALS_AND_ANIMATIONS; - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "nodes/root_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001"), 1.0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "nodes/root_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001"), 1.0)); r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/custom_script", PROPERTY_HINT_FILE, script_ext_hint), "")); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "nodes/storage", PROPERTY_HINT_ENUM, "Single Scene,Instanced Sub-Scenes"), scenes_out ? 1 : 0)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/location", PROPERTY_HINT_ENUM, "Node,Mesh"), (meshes_out || materials_out) ? 1 : 0)); @@ -1170,17 +1170,18 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "meshes/ensure_tangents"), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "meshes/storage", PROPERTY_HINT_ENUM, "Built-In,Files (.mesh),Files (.tres)"), meshes_out ? 1 : 0)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "meshes/light_baking", PROPERTY_HINT_ENUM, "Disabled,Enable,Gen Lightmaps", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 0)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "meshes/lightmap_texel_size", PROPERTY_HINT_RANGE, "0.001,100,0.001"), 0.1)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "meshes/lightmap_texel_size", PROPERTY_HINT_RANGE, "0.001,100,0.001"), 0.1)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "skins/use_named_skins"), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "external_files/store_in_subdir"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/import", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15)); r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "animation/filter_script", PROPERTY_HINT_MULTILINE_TEXT), "")); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/storage", PROPERTY_HINT_ENUM, "Built-In,Files (.anim),Files (.tres)", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), animations_out)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/keep_custom_tracks"), animations_out)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/optimizer/enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_linear_error"), 0.05)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_angular_error"), 0.01)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_angle"), 22)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "animation/optimizer/max_linear_error"), 0.05)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "animation/optimizer/max_angular_error"), 0.01)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "animation/optimizer/max_angle"), 22)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/optimizer/remove_unused_tracks"), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/clips/amount", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 0)); for (int i = 0; i < 256; i++) { @@ -1313,6 +1314,9 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p if (int(p_options["materials/location"]) == 0) import_flags |= EditorSceneImporter::IMPORT_MATERIALS_IN_INSTANCES; + if (bool(p_options["skins/use_named_skins"])) + import_flags |= EditorSceneImporter::IMPORT_USE_NAMED_SKIN_BINDS; + Error err = OK; List<String> missing_deps; // for now, not much will be done with this Node *scene = importer->import_scene(src_path, import_flags, fps, &missing_deps, &err); diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index 2691b224eb..20e7af15b5 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -59,7 +59,8 @@ public: IMPORT_GENERATE_TANGENT_ARRAYS = 256, IMPORT_FAIL_ON_MISSING_DEPENDENCIES = 512, IMPORT_MATERIALS_IN_INSTANCES = 1024, - IMPORT_USE_COMPRESSION = 2048 + IMPORT_USE_COMPRESSION = 2048, + IMPORT_USE_NAMED_SKIN_BINDS = 4096, }; diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 7144bc04c8..3254b32dae 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -210,7 +210,7 @@ String ResourceImporterTexture::get_preset_name(int p_idx) const { void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options, int p_preset) const { r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Lossless,Lossy,VRAM Compressed,VRAM Uncompressed,Basis Universal", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), p_preset == PRESET_3D ? 2 : 0)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "compress/lossy_quality", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.7)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "compress/lossy_quality", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.7)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/hdr_mode", PROPERTY_HINT_ENUM, "Enabled,Force RGBE"), 0)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/bptc_ldr", PROPERTY_HINT_ENUM, "Enabled,RGBA Only"), 0)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/normal_map", PROPERTY_HINT_ENUM, "Detect,Enable,Disabled"), 0)); @@ -226,7 +226,7 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options, r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/HDR_as_SRGB"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "process/size_limit", PROPERTY_HINT_RANGE, "0,4096,1"), 0)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "detect_3d/compress_to", PROPERTY_HINT_ENUM, "Disabled,VRAM Compressed,Basis Universal"), (p_preset == PRESET_DETECT) ? 1 : 0)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "svg/scale", PROPERTY_HINT_RANGE, "0.001,100,0.001"), 1.0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "svg/scale", PROPERTY_HINT_RANGE, "0.001,100,0.001"), 1.0)); } void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image> &p_image, CompressMode p_compress_mode, Image::UsedChannels p_channels, Image::CompressMode p_compress_format, float p_lossy_quality, bool p_force_rgbe) { diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp index 4291d6f2d7..3172cc7279 100644 --- a/editor/import/resource_importer_texture_atlas.cpp +++ b/editor/import/resource_importer_texture_atlas.cpp @@ -143,8 +143,8 @@ static void _plot_triangle(Vector2 *vertices, const Vector2 &p_offset, bool p_tr int px = xi, py = yi; int sx = px, sy = py; - sx = CLAMP(sx, 0, src_width); - sy = CLAMP(sy, 0, src_height); + sx = CLAMP(sx, 0, src_width - 1); + sy = CLAMP(sy, 0, src_height - 1); Color color = p_src_image->get_pixel(sx, sy); if (p_transposed) { SWAP(px, py); @@ -165,8 +165,8 @@ static void _plot_triangle(Vector2 *vertices, const Vector2 &p_offset, bool p_tr for (int xi = (xf < width ? int(xf) : width - 1); xi >= (xt > 0 ? xt : 0); xi--) { int px = xi, py = yi; int sx = px, sy = py; - sx = CLAMP(sx, 0, src_width); - sy = CLAMP(sy, 0, src_height); + sx = CLAMP(sx, 0, src_width - 1); + sy = CLAMP(sy, 0, src_height - 1); Color color = p_src_image->get_pixel(sx, sy); if (p_transposed) { SWAP(px, py); diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index b65209d204..71f81051bc 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -82,7 +82,7 @@ void ResourceImporterWAV::get_import_options(List<ImportOption> *r_options, int r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/8_bit"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/mono"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/max_rate", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), false)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "force/max_rate_hz", PROPERTY_HINT_EXP_RANGE, "11025,192000,1"), 44100)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "force/max_rate_hz", PROPERTY_HINT_EXP_RANGE, "11025,192000,1"), 44100)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "edit/trim"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "edit/normalize"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "edit/loop"), false)); diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 1eb453f4d0..06c6f9940c 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -266,7 +266,7 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) { import_as->set_disabled(false); preset->set_disabled(false); - imported->set_text(itos(p_paths.size()) + TTR(" Files")); + imported->set_text(vformat(TTR("%d Files"), p_paths.size())); } void ImportDock::_update_preset_menu() { @@ -537,26 +537,26 @@ ImportDock::ImportDock() { add_margin_child(TTR("Import As:"), hb); import_as = memnew(OptionButton); import_as->set_disabled(true); - import_as->connect("item_selected", this, "_importer_selected"); + import_as->connect_compat("item_selected", this, "_importer_selected"); hb->add_child(import_as); import_as->set_h_size_flags(SIZE_EXPAND_FILL); preset = memnew(MenuButton); preset->set_text(TTR("Preset")); preset->set_disabled(true); - preset->get_popup()->connect("index_pressed", this, "_preset_selected"); + preset->get_popup()->connect_compat("index_pressed", this, "_preset_selected"); hb->add_child(preset); import_opts = memnew(EditorInspector); add_child(import_opts); import_opts->set_v_size_flags(SIZE_EXPAND_FILL); - import_opts->connect("property_toggled", this, "_property_toggled"); + import_opts->connect_compat("property_toggled", this, "_property_toggled"); hb = memnew(HBoxContainer); add_child(hb); import = memnew(Button); import->set_text(TTR("Reimport")); import->set_disabled(true); - import->connect("pressed", this, "_reimport_attempt"); + import->connect_compat("pressed", this, "_reimport_attempt"); hb->add_spacer(); hb->add_child(import); hb->add_spacer(); @@ -564,7 +564,7 @@ ImportDock::ImportDock() { reimport_confirm = memnew(ConfirmationDialog); reimport_confirm->get_ok()->set_text(TTR("Save scenes, re-import and restart")); add_child(reimport_confirm); - reimport_confirm->connect("confirmed", this, "_reimport_and_restart"); + reimport_confirm->connect_compat("confirmed", this, "_reimport_and_restart"); VBoxContainer *vbc_confirm = memnew(VBoxContainer()); vbc_confirm->add_child(memnew(Label(TTR("Changing the type of an imported file requires editor restart.")))); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 954a941a96..1f96092bba 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -247,7 +247,7 @@ void InspectorDock::_prepare_history() { } } else if (Object::cast_to<Node>(obj)) { text = Object::cast_to<Node>(obj)->get_name(); - } else if (obj->is_class("ScriptEditorDebuggerInspectedObject")) { + } else if (obj->is_class("EditorDebuggerRemoteObject")) { text = obj->call("get_title"); } else { text = obj->get_class(); @@ -260,7 +260,7 @@ void InspectorDock::_prepare_history() { } } -void InspectorDock::_select_history(int p_idx) const { +void InspectorDock::_select_history(int p_idx) { //push it to the top, it is not correct, but it's more useful ObjectID id = EditorNode::get_singleton()->get_editor_history()->get_history_obj(p_idx); Object *obj = ObjectDB::get_instance(id); @@ -269,7 +269,7 @@ void InspectorDock::_select_history(int p_idx) const { editor->push_item(obj); } -void InspectorDock::_resource_created() const { +void InspectorDock::_resource_created() { Object *c = new_resource_dialog->instance_selected(); ERR_FAIL_COND(!c); @@ -280,7 +280,7 @@ void InspectorDock::_resource_created() const { editor->push_item(c); } -void InspectorDock::_resource_selected(const RES &p_res, const String &p_property) const { +void InspectorDock::_resource_selected(const RES &p_res, const String &p_property) { if (p_res.is_null()) return; @@ -349,7 +349,6 @@ void InspectorDock::_bind_methods() { ClassDB::bind_method("_property_keyed", &InspectorDock::_property_keyed); ClassDB::bind_method("_transform_keyed", &InspectorDock::_transform_keyed); - ClassDB::bind_method("_new_resource", &InspectorDock::_new_resource); ClassDB::bind_method("_resource_file_selected", &InspectorDock::_resource_file_selected); ClassDB::bind_method("_open_resource_selector", &InspectorDock::_open_resource_selector); ClassDB::bind_method("_unref_resource", &InspectorDock::_unref_resource); @@ -511,14 +510,14 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { resource_new_button->set_tooltip(TTR("Create a new resource in memory and edit it.")); resource_new_button->set_icon(get_icon("New", "EditorIcons")); general_options_hb->add_child(resource_new_button); - resource_new_button->connect("pressed", this, "_new_resource"); + resource_new_button->connect("pressed", callable_mp(this, &InspectorDock::_new_resource)); resource_new_button->set_focus_mode(Control::FOCUS_NONE); resource_load_button = memnew(ToolButton); resource_load_button->set_tooltip(TTR("Load an existing resource from disk and edit it.")); resource_load_button->set_icon(get_icon("Load", "EditorIcons")); general_options_hb->add_child(resource_load_button); - resource_load_button->connect("pressed", this, "_open_resource_selector"); + resource_load_button->connect_compat("pressed", this, "_open_resource_selector"); resource_load_button->set_focus_mode(Control::FOCUS_NONE); resource_save_button = memnew(MenuButton); @@ -527,7 +526,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { general_options_hb->add_child(resource_save_button); resource_save_button->get_popup()->add_item(TTR("Save"), RESOURCE_SAVE); resource_save_button->get_popup()->add_item(TTR("Save As..."), RESOURCE_SAVE_AS); - resource_save_button->get_popup()->connect("id_pressed", this, "_menu_option"); + resource_save_button->get_popup()->connect_compat("id_pressed", this, "_menu_option"); resource_save_button->set_focus_mode(Control::FOCUS_NONE); resource_save_button->set_disabled(true); @@ -539,7 +538,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { backward_button->set_flat(true); backward_button->set_tooltip(TTR("Go to the previous edited object in history.")); backward_button->set_disabled(true); - backward_button->connect("pressed", this, "_edit_back"); + backward_button->connect_compat("pressed", this, "_edit_back"); forward_button = memnew(ToolButton); general_options_hb->add_child(forward_button); @@ -547,14 +546,14 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { forward_button->set_flat(true); forward_button->set_tooltip(TTR("Go to the next edited object in history.")); forward_button->set_disabled(true); - forward_button->connect("pressed", this, "_edit_forward"); + forward_button->connect_compat("pressed", this, "_edit_forward"); history_menu = memnew(MenuButton); history_menu->set_tooltip(TTR("History of recently edited objects.")); history_menu->set_icon(get_icon("History", "EditorIcons")); general_options_hb->add_child(history_menu); - history_menu->connect("about_to_show", this, "_prepare_history"); - history_menu->get_popup()->connect("id_pressed", this, "_select_history"); + history_menu->connect_compat("about_to_show", this, "_prepare_history"); + history_menu->get_popup()->connect_compat("id_pressed", this, "_select_history"); HBoxContainer *node_info_hb = memnew(HBoxContainer); add_child(node_info_hb); @@ -567,12 +566,12 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { object_menu->set_icon(get_icon("Tools", "EditorIcons")); node_info_hb->add_child(object_menu); object_menu->set_tooltip(TTR("Object properties.")); - object_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + object_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); new_resource_dialog = memnew(CreateDialog); editor->get_gui_base()->add_child(new_resource_dialog); new_resource_dialog->set_base_type("Resource"); - new_resource_dialog->connect("create", this, "_resource_created"); + new_resource_dialog->connect_compat("create", this, "_resource_created"); search = memnew(LineEdit); search->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -588,7 +587,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { warning->add_color_override("font_color", get_color("warning_color", "Editor")); warning->set_clip_text(true); warning->hide(); - warning->connect("pressed", this, "_warning_pressed"); + warning->connect_compat("pressed", this, "_warning_pressed"); warning_dialog = memnew(AcceptDialog); editor->get_gui_base()->add_child(warning_dialog); @@ -596,7 +595,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { load_resource_dialog = memnew(EditorFileDialog); add_child(load_resource_dialog); load_resource_dialog->set_current_dir("res://"); - load_resource_dialog->connect("file_selected", this, "_resource_file_selected"); + load_resource_dialog->connect_compat("file_selected", this, "_resource_file_selected"); inspector = memnew(EditorInspector); add_child(inspector); @@ -612,8 +611,8 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { inspector->set_use_filter(true); // TODO: check me - inspector->connect("resource_selected", this, "_resource_selected"); - inspector->connect("property_keyed", this, "_property_keyed"); + inspector->connect_compat("resource_selected", this, "_resource_selected"); + inspector->connect_compat("property_keyed", this, "_property_keyed"); } InspectorDock::~InspectorDock() { diff --git a/editor/inspector_dock.h b/editor/inspector_dock.h index a7da4bef4c..016aee12cf 100644 --- a/editor/inspector_dock.h +++ b/editor/inspector_dock.h @@ -104,13 +104,13 @@ class InspectorDock : public VBoxContainer { void _paste_resource() const; void _warning_pressed(); - void _resource_created() const; - void _resource_selected(const RES &p_res, const String &p_property = "") const; + void _resource_created(); + void _resource_selected(const RES &p_res, const String &p_property = ""); void _edit_forward(); void _edit_back(); void _menu_collapseall(); void _menu_expandall(); - void _select_history(int p_idx) const; + void _select_history(int p_idx); void _prepare_history(); void _property_keyed(const String &p_keyed, const Variant &p_value, bool p_advance); diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index c53c5f330b..f04afcd04d 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -107,7 +107,7 @@ NodeDock::NodeDock() { connections_button->set_h_size_flags(SIZE_EXPAND_FILL); connections_button->set_clip_text(true); mode_hb->add_child(connections_button); - connections_button->connect("pressed", this, "show_connections"); + connections_button->connect_compat("pressed", this, "show_connections"); groups_button = memnew(ToolButton); groups_button->set_text(TTR("Groups")); @@ -116,7 +116,7 @@ NodeDock::NodeDock() { groups_button->set_h_size_flags(SIZE_EXPAND_FILL); groups_button->set_clip_text(true); mode_hb->add_child(groups_button); - groups_button->connect("pressed", this, "show_groups"); + groups_button->connect_compat("pressed", this, "show_groups"); connections = memnew(ConnectionsDock(EditorNode::get_singleton())); connections->set_undoredo(EditorNode::get_undo_redo()); diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 1506ba319c..4e3333f528 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -132,8 +132,8 @@ void PluginConfigDialog::_on_required_text_changed(const String &) { void PluginConfigDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("confirmed", this, "_on_confirmed"); - get_cancel()->connect("pressed", this, "_on_cancelled"); + connect_compat("confirmed", this, "_on_confirmed"); + get_cancel()->connect_compat("pressed", this, "_on_cancelled"); } break; case NOTIFICATION_POST_POPUP: { @@ -194,7 +194,7 @@ PluginConfigDialog::PluginConfigDialog() { grid->add_child(name_lb); name_edit = memnew(LineEdit); - name_edit->connect("text_changed", this, "_on_required_text_changed"); + name_edit->connect_compat("text_changed", this, "_on_required_text_changed"); name_edit->set_placeholder("MyPlugin"); grid->add_child(name_edit); @@ -253,7 +253,7 @@ PluginConfigDialog::PluginConfigDialog() { grid->add_child(script_lb); script_edit = memnew(LineEdit); - script_edit->connect("text_changed", this, "_on_required_text_changed"); + script_edit->connect_compat("text_changed", this, "_on_required_text_changed"); script_edit->set_placeholder("\"plugin.gd\" -> res://addons/my_plugin/plugin.gd"); grid->add_child(script_edit); diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 2d038d11ad..6f29b6c76a 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -209,8 +209,8 @@ void AbstractPolygon2DEditor::_notification(int p_what) { button_delete->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons")); button_edit->set_pressed(true); - get_tree()->connect("node_removed", this, "_node_removed"); - create_resource->connect("confirmed", this, "_create_resource"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); + create_resource->connect_compat("confirmed", this, "_create_resource"); } break; } } @@ -820,17 +820,17 @@ AbstractPolygon2DEditor::AbstractPolygon2DEditor(EditorNode *p_editor, bool p_wi add_child(memnew(VSeparator)); button_create = memnew(ToolButton); add_child(button_create); - button_create->connect("pressed", this, "_menu_option", varray(MODE_CREATE)); + button_create->connect_compat("pressed", this, "_menu_option", varray(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(ToolButton); add_child(button_edit); - button_edit->connect("pressed", this, "_menu_option", varray(MODE_EDIT)); + button_edit->connect_compat("pressed", this, "_menu_option", varray(MODE_EDIT)); button_edit->set_toggle_mode(true); button_delete = memnew(ToolButton); add_child(button_delete); - button_delete->connect("pressed", this, "_menu_option", varray(MODE_DELETE)); + button_delete->connect_compat("pressed", this, "_menu_option", varray(MODE_DELETE)); button_delete->set_toggle_mode(true); create_resource = memnew(ConfirmationDialog); diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index 9261613ddd..c955f2b806 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -622,28 +622,28 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { top_hb->add_child(tool_blend); tool_blend->set_pressed(true); tool_blend->set_tooltip(TTR("Set the blending position within the space")); - tool_blend->connect("pressed", this, "_tool_switch", varray(3)); + tool_blend->connect_compat("pressed", this, "_tool_switch", varray(3)); tool_select = memnew(ToolButton); tool_select->set_toggle_mode(true); tool_select->set_button_group(bg); top_hb->add_child(tool_select); tool_select->set_tooltip(TTR("Select and move points, create points with RMB.")); - tool_select->connect("pressed", this, "_tool_switch", varray(0)); + tool_select->connect_compat("pressed", this, "_tool_switch", varray(0)); tool_create = memnew(ToolButton); tool_create->set_toggle_mode(true); tool_create->set_button_group(bg); top_hb->add_child(tool_create); tool_create->set_tooltip(TTR("Create points.")); - tool_create->connect("pressed", this, "_tool_switch", varray(1)); + tool_create->connect_compat("pressed", this, "_tool_switch", varray(1)); tool_erase_sep = memnew(VSeparator); top_hb->add_child(tool_erase_sep); tool_erase = memnew(ToolButton); top_hb->add_child(tool_erase); tool_erase->set_tooltip(TTR("Erase points.")); - tool_erase->connect("pressed", this, "_erase_selected"); + tool_erase->connect_compat("pressed", this, "_erase_selected"); top_hb->add_child(memnew(VSeparator)); @@ -652,7 +652,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { top_hb->add_child(snap); snap->set_pressed(true); snap->set_tooltip(TTR("Enable snap and show grid.")); - snap->connect("pressed", this, "_snap_toggled"); + snap->connect_compat("pressed", this, "_snap_toggled"); snap_value = memnew(SpinBox); top_hb->add_child(snap_value); @@ -670,12 +670,12 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { edit_value->set_min(-1000); edit_value->set_max(1000); edit_value->set_step(0.01); - edit_value->connect("value_changed", this, "_edit_point_pos"); + edit_value->connect_compat("value_changed", this, "_edit_point_pos"); open_editor = memnew(Button); edit_hb->add_child(open_editor); open_editor->set_text(TTR("Open Editor")); - open_editor->connect("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED); + open_editor->connect_compat("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED); edit_hb->hide(); open_editor->hide(); @@ -691,8 +691,8 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { panel->set_v_size_flags(SIZE_EXPAND_FILL); blend_space_draw = memnew(Control); - blend_space_draw->connect("gui_input", this, "_blend_space_gui_input"); - blend_space_draw->connect("draw", this, "_blend_space_draw"); + blend_space_draw->connect_compat("gui_input", this, "_blend_space_gui_input"); + blend_space_draw->connect_compat("draw", this, "_blend_space_draw"); blend_space_draw->set_focus_mode(FOCUS_ALL); panel->add_child(blend_space_draw); @@ -724,10 +724,10 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { bottom_hb->add_child(max_value); } - snap_value->connect("value_changed", this, "_config_changed"); - min_value->connect("value_changed", this, "_config_changed"); - max_value->connect("value_changed", this, "_config_changed"); - label_value->connect("text_changed", this, "_labels_changed"); + snap_value->connect_compat("value_changed", this, "_config_changed"); + min_value->connect_compat("value_changed", this, "_config_changed"); + max_value->connect_compat("value_changed", this, "_config_changed"); + label_value->connect_compat("text_changed", this, "_labels_changed"); error_panel = memnew(PanelContainer); add_child(error_panel); @@ -740,18 +740,18 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_add_menu_type"); + menu->connect_compat("id_pressed", this, "_add_menu_type"); animations_menu = memnew(PopupMenu); menu->add_child(animations_menu); animations_menu->set_name("animations"); - animations_menu->connect("index_pressed", this, "_add_animation_type"); + animations_menu->connect_compat("index_pressed", this, "_add_animation_type"); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - open_file->connect("file_selected", this, "_file_opened"); + open_file->connect_compat("file_selected", this, "_file_opened"); undo_redo = EditorNode::get_undo_redo(); selected_point = -1; diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index fdd8ffd58f..d2306a5d6b 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -55,12 +55,12 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_changed() { void AnimationNodeBlendSpace2DEditor::edit(const Ref<AnimationNode> &p_node) { if (blend_space.is_valid()) { - blend_space->disconnect("triangles_updated", this, "_blend_space_changed"); + blend_space->disconnect_compat("triangles_updated", this, "_blend_space_changed"); } blend_space = p_node; if (!blend_space.is_null()) { - blend_space->connect("triangles_updated", this, "_blend_space_changed"); + blend_space->connect_compat("triangles_updated", this, "_blend_space_changed"); _update_space(); } } @@ -870,42 +870,42 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(tool_blend); tool_blend->set_pressed(true); tool_blend->set_tooltip(TTR("Set the blending position within the space")); - tool_blend->connect("pressed", this, "_tool_switch", varray(3)); + tool_blend->connect_compat("pressed", this, "_tool_switch", varray(3)); tool_select = memnew(ToolButton); tool_select->set_toggle_mode(true); tool_select->set_button_group(bg); top_hb->add_child(tool_select); tool_select->set_tooltip(TTR("Select and move points, create points with RMB.")); - tool_select->connect("pressed", this, "_tool_switch", varray(0)); + tool_select->connect_compat("pressed", this, "_tool_switch", varray(0)); tool_create = memnew(ToolButton); tool_create->set_toggle_mode(true); tool_create->set_button_group(bg); top_hb->add_child(tool_create); tool_create->set_tooltip(TTR("Create points.")); - tool_create->connect("pressed", this, "_tool_switch", varray(1)); + tool_create->connect_compat("pressed", this, "_tool_switch", varray(1)); tool_triangle = memnew(ToolButton); tool_triangle->set_toggle_mode(true); tool_triangle->set_button_group(bg); top_hb->add_child(tool_triangle); tool_triangle->set_tooltip(TTR("Create triangles by connecting points.")); - tool_triangle->connect("pressed", this, "_tool_switch", varray(2)); + tool_triangle->connect_compat("pressed", this, "_tool_switch", varray(2)); tool_erase_sep = memnew(VSeparator); top_hb->add_child(tool_erase_sep); tool_erase = memnew(ToolButton); top_hb->add_child(tool_erase); tool_erase->set_tooltip(TTR("Erase points and triangles.")); - tool_erase->connect("pressed", this, "_erase_selected"); + tool_erase->connect_compat("pressed", this, "_erase_selected"); tool_erase->set_disabled(true); top_hb->add_child(memnew(VSeparator)); auto_triangles = memnew(ToolButton); top_hb->add_child(auto_triangles); - auto_triangles->connect("pressed", this, "_auto_triangles_toggled"); + auto_triangles->connect_compat("pressed", this, "_auto_triangles_toggled"); auto_triangles->set_toggle_mode(true); auto_triangles->set_tooltip(TTR("Generate blend triangles automatically (instead of manually)")); @@ -916,7 +916,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(snap); snap->set_pressed(true); snap->set_tooltip(TTR("Enable snap and show grid.")); - snap->connect("pressed", this, "_snap_toggled"); + snap->connect_compat("pressed", this, "_snap_toggled"); snap_x = memnew(SpinBox); top_hb->add_child(snap_x); @@ -937,7 +937,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(memnew(Label(TTR("Blend:")))); interpolation = memnew(OptionButton); top_hb->add_child(interpolation); - interpolation->connect("item_selected", this, "_config_changed"); + interpolation->connect_compat("item_selected", this, "_config_changed"); edit_hb = memnew(HBoxContainer); top_hb->add_child(edit_hb); @@ -948,17 +948,17 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { edit_x->set_min(-1000); edit_x->set_step(0.01); edit_x->set_max(1000); - edit_x->connect("value_changed", this, "_edit_point_pos"); + edit_x->connect_compat("value_changed", this, "_edit_point_pos"); edit_y = memnew(SpinBox); edit_hb->add_child(edit_y); edit_y->set_min(-1000); edit_y->set_step(0.01); edit_y->set_max(1000); - edit_y->connect("value_changed", this, "_edit_point_pos"); + edit_y->connect_compat("value_changed", this, "_edit_point_pos"); open_editor = memnew(Button); edit_hb->add_child(open_editor); open_editor->set_text(TTR("Open Editor")); - open_editor->connect("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED); + open_editor->connect_compat("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED); edit_hb->hide(); open_editor->hide(); @@ -999,8 +999,8 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { panel->set_h_size_flags(SIZE_EXPAND_FILL); blend_space_draw = memnew(Control); - blend_space_draw->connect("gui_input", this, "_blend_space_gui_input"); - blend_space_draw->connect("draw", this, "_blend_space_draw"); + blend_space_draw->connect_compat("gui_input", this, "_blend_space_gui_input"); + blend_space_draw->connect_compat("draw", this, "_blend_space_draw"); blend_space_draw->set_focus_mode(FOCUS_ALL); panel->add_child(blend_space_draw); @@ -1029,14 +1029,14 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { min_x_value->set_step(0.01); } - snap_x->connect("value_changed", this, "_config_changed"); - snap_y->connect("value_changed", this, "_config_changed"); - max_x_value->connect("value_changed", this, "_config_changed"); - min_x_value->connect("value_changed", this, "_config_changed"); - max_y_value->connect("value_changed", this, "_config_changed"); - min_y_value->connect("value_changed", this, "_config_changed"); - label_x->connect("text_changed", this, "_labels_changed"); - label_y->connect("text_changed", this, "_labels_changed"); + snap_x->connect_compat("value_changed", this, "_config_changed"); + snap_y->connect_compat("value_changed", this, "_config_changed"); + max_x_value->connect_compat("value_changed", this, "_config_changed"); + min_x_value->connect_compat("value_changed", this, "_config_changed"); + max_y_value->connect_compat("value_changed", this, "_config_changed"); + min_y_value->connect_compat("value_changed", this, "_config_changed"); + label_x->connect_compat("text_changed", this, "_labels_changed"); + label_y->connect_compat("text_changed", this, "_labels_changed"); error_panel = memnew(PanelContainer); add_child(error_panel); @@ -1050,18 +1050,18 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_add_menu_type"); + menu->connect_compat("id_pressed", this, "_add_menu_type"); animations_menu = memnew(PopupMenu); menu->add_child(animations_menu); animations_menu->set_name("animations"); - animations_menu->connect("index_pressed", this, "_add_animation_type"); + animations_menu->connect_compat("index_pressed", this, "_add_animation_type"); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - open_file->connect("file_selected", this, "_file_opened"); + open_file->connect_compat("file_selected", this, "_file_opened"); undo_redo = EditorNode::get_undo_redo(); selected_point = -1; diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index a100525d10..f2daa809b4 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -146,11 +146,11 @@ void AnimationNodeBlendTreeEditor::_update_graph() { name->set_expand_to_text_length(true); node->add_child(name); node->set_slot(0, false, 0, Color(), true, 0, get_color("font_color", "Label")); - name->connect("text_entered", this, "_node_renamed", varray(agnode)); - name->connect("focus_exited", this, "_node_renamed_focus_out", varray(name, agnode), CONNECT_DEFERRED); + name->connect_compat("text_entered", this, "_node_renamed", varray(agnode)); + name->connect_compat("focus_exited", this, "_node_renamed_focus_out", varray(name, agnode), CONNECT_DEFERRED); base = 1; node->set_show_close_button(true); - node->connect("close_request", this, "_delete_request", varray(E->get()), CONNECT_DEFERRED); + node->connect_compat("close_request", this, "_delete_request", varray(E->get()), CONNECT_DEFERRED); } for (int i = 0; i < agnode->get_input_count(); i++) { @@ -173,13 +173,13 @@ void AnimationNodeBlendTreeEditor::_update_graph() { prop->set_object_and_property(AnimationTreeEditor::get_singleton()->get_tree(), base_path); prop->update_property(); prop->set_name_split_ratio(0); - prop->connect("property_changed", this, "_property_changed"); + prop->connect_compat("property_changed", this, "_property_changed"); node->add_child(prop); visible_properties.push_back(prop); } } - node->connect("dragged", this, "_node_dragged", varray(E->get())); + node->connect_compat("dragged", this, "_node_dragged", varray(E->get())); if (AnimationTreeEditor::get_singleton()->can_edit(agnode)) { node->add_child(memnew(HSeparator)); @@ -187,7 +187,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { open_in_editor->set_text(TTR("Open Editor")); open_in_editor->set_icon(get_icon("Edit", "EditorIcons")); node->add_child(open_in_editor); - open_in_editor->connect("pressed", this, "_open_in_editor", varray(E->get()), CONNECT_DEFERRED); + open_in_editor->connect_compat("pressed", this, "_open_in_editor", varray(E->get()), CONNECT_DEFERRED); open_in_editor->set_h_size_flags(SIZE_SHRINK_CENTER); } @@ -198,7 +198,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { edit_filters->set_text(TTR("Edit Filters")); edit_filters->set_icon(get_icon("AnimationFilter", "EditorIcons")); node->add_child(edit_filters); - edit_filters->connect("pressed", this, "_edit_filters", varray(E->get()), CONNECT_DEFERRED); + edit_filters->connect_compat("pressed", this, "_edit_filters", varray(E->get()), CONNECT_DEFERRED); edit_filters->set_h_size_flags(SIZE_SHRINK_CENTER); } @@ -238,7 +238,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { animations[E->get()] = pb; node->add_child(pb); - mb->get_popup()->connect("index_pressed", this, "_anim_selected", varray(options, E->get()), CONNECT_DEFERRED); + mb->get_popup()->connect_compat("index_pressed", this, "_anim_selected", varray(options, E->get()), CONNECT_DEFERRED); } if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { @@ -911,7 +911,7 @@ bool AnimationNodeBlendTreeEditor::can_edit(const Ref<AnimationNode> &p_node) { void AnimationNodeBlendTreeEditor::edit(const Ref<AnimationNode> &p_node) { if (blend_tree.is_valid()) { - blend_tree->disconnect("removed_from_graph", this, "_removed_from_graph"); + blend_tree->disconnect_compat("removed_from_graph", this, "_removed_from_graph"); } blend_tree = p_node; @@ -919,7 +919,7 @@ void AnimationNodeBlendTreeEditor::edit(const Ref<AnimationNode> &p_node) { if (blend_tree.is_null()) { hide(); } else { - blend_tree->connect("removed_from_graph", this, "_removed_from_graph"); + blend_tree->connect_compat("removed_from_graph", this, "_removed_from_graph"); _update_graph(); } @@ -936,12 +936,12 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { graph->add_valid_right_disconnect_type(0); graph->add_valid_left_disconnect_type(0); graph->set_v_size_flags(SIZE_EXPAND_FILL); - graph->connect("connection_request", this, "_connection_request", varray(), CONNECT_DEFERRED); - graph->connect("disconnection_request", this, "_disconnection_request", varray(), CONNECT_DEFERRED); - graph->connect("node_selected", this, "_node_selected"); - graph->connect("scroll_offset_changed", this, "_scroll_changed"); - graph->connect("delete_nodes_request", this, "_delete_nodes_request"); - graph->connect("popup_request", this, "_popup_request"); + graph->connect_compat("connection_request", this, "_connection_request", varray(), CONNECT_DEFERRED); + graph->connect_compat("disconnection_request", this, "_disconnection_request", varray(), CONNECT_DEFERRED); + graph->connect_compat("node_selected", this, "_node_selected"); + graph->connect_compat("scroll_offset_changed", this, "_scroll_changed"); + graph->connect_compat("delete_nodes_request", this, "_delete_nodes_request"); + graph->connect_compat("popup_request", this, "_popup_request"); VSeparator *vs = memnew(VSeparator); graph->get_zoom_hbox()->add_child(vs); @@ -951,8 +951,8 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { graph->get_zoom_hbox()->add_child(add_node); add_node->set_text(TTR("Add Node...")); graph->get_zoom_hbox()->move_child(add_node, 0); - add_node->get_popup()->connect("id_pressed", this, "_add_node"); - add_node->connect("about_to_show", this, "_update_options_menu"); + add_node->get_popup()->connect_compat("id_pressed", this, "_add_node"); + add_node->connect_compat("about_to_show", this, "_update_options_menu"); add_options.push_back(AddOption("Animation", "AnimationNodeAnimation")); add_options.push_back(AddOption("OneShot", "AnimationNodeOneShot")); @@ -984,19 +984,19 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { filter_enabled = memnew(CheckBox); filter_enabled->set_text(TTR("Enable Filtering")); - filter_enabled->connect("pressed", this, "_filter_toggled"); + filter_enabled->connect_compat("pressed", this, "_filter_toggled"); filter_vbox->add_child(filter_enabled); filters = memnew(Tree); filter_vbox->add_child(filters); filters->set_v_size_flags(SIZE_EXPAND_FILL); filters->set_hide_root(true); - filters->connect("item_edited", this, "_filter_edited"); + filters->connect_compat("item_edited", this, "_filter_edited"); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - open_file->connect("file_selected", this, "_file_opened"); + open_file->connect_compat("file_selected", this, "_file_opened"); undo_redo = EditorNode::get_undo_redo(); } diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index d8bbac9c49..0f2a7376f5 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -38,10 +38,8 @@ #include "editor/animation_track_editor.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" - -// For onion skinning. -#include "editor/plugins/canvas_item_editor_plugin.h" -#include "editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning. +#include "editor/plugins/spatial_editor_plugin.h" // For onion skinning. #include "scene/main/viewport.h" #include "servers/visual_server.h" @@ -99,13 +97,13 @@ void AnimationPlayerEditor::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - tool_anim->get_popup()->connect("id_pressed", this, "_animation_tool_menu"); + tool_anim->get_popup()->connect_compat("id_pressed", this, "_animation_tool_menu"); - onion_skinning->get_popup()->connect("id_pressed", this, "_onion_skinning_menu"); + onion_skinning->get_popup()->connect_compat("id_pressed", this, "_onion_skinning_menu"); - blend_editor.next->connect("item_selected", this, "_blend_editor_next_changed"); + blend_editor.next->connect_compat("item_selected", this, "_blend_editor_next_changed"); - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); add_style_override("panel", editor->get_gui_base()->get_stylebox("panel", "Panel")); } break; @@ -375,8 +373,7 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource> &p_resou Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); if (err != OK) { - accept->set_text(TTR("Error saving resource!")); - accept->popup_centered_minsize(); + EditorNode::get_singleton()->show_warning(TTR("Error saving resource!")); return; } @@ -1504,16 +1501,16 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() { void AnimationPlayerEditor::_start_onion_skinning() { // FIXME: Using "idle_frame" makes onion layers update one frame behind the current. - if (!get_tree()->is_connected("idle_frame", this, "call_deferred")) { - get_tree()->connect("idle_frame", this, "call_deferred", varray("_prepare_onion_layers_1")); + if (!get_tree()->is_connected_compat("idle_frame", this, "call_deferred")) { + get_tree()->connect_compat("idle_frame", this, "call_deferred", varray("_prepare_onion_layers_1")); } } void AnimationPlayerEditor::_stop_onion_skinning() { - if (get_tree()->is_connected("idle_frame", this, "call_deferred")) { + if (get_tree()->is_connected_compat("idle_frame", this, "call_deferred")) { - get_tree()->disconnect("idle_frame", this, "call_deferred"); + get_tree()->disconnect_compat("idle_frame", this, "call_deferred"); _free_onion_layers(); @@ -1628,13 +1625,9 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay scale->set_tooltip(TTR("Scale animation playback globally for the node.")); scale->hide(); - accept = memnew(AcceptDialog); - add_child(accept); - accept->connect("confirmed", this, "_menu_confirm_current"); - delete_dialog = memnew(ConfirmationDialog); add_child(delete_dialog); - delete_dialog->connect("confirmed", this, "_animation_remove_confirmed"); + delete_dialog->connect_compat("confirmed", this, "_animation_remove_confirmed"); tool_anim = memnew(MenuButton); tool_anim->set_flat(false); @@ -1679,7 +1672,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay onion_toggle = memnew(ToolButton); onion_toggle->set_toggle_mode(true); onion_toggle->set_tooltip(TTR("Enable Onion Skinning")); - onion_toggle->connect("pressed", this, "_onion_skinning_menu", varray(ONION_SKINNING_ENABLE)); + onion_toggle->connect_compat("pressed", this, "_onion_skinning_menu", varray(ONION_SKINNING_ENABLE)); hb->add_child(onion_toggle); onion_skinning = memnew(MenuButton); @@ -1705,7 +1698,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay pin->set_toggle_mode(true); pin->set_tooltip(TTR("Pin AnimationPlayer")); hb->add_child(pin); - pin->connect("pressed", this, "_pin_pressed"); + pin->connect_compat("pressed", this, "_pin_pressed"); file = memnew(EditorFileDialog); add_child(file); @@ -1729,7 +1722,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay error_dialog->set_title(TTR("Error!")); add_child(error_dialog); - name_dialog->connect("confirmed", this, "_animation_name_edited"); + name_dialog->connect_compat("confirmed", this, "_animation_name_edited"); blend_editor.dialog = memnew(AcceptDialog); add_child(blend_editor.dialog); @@ -1745,21 +1738,21 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay blend_editor.dialog->set_title(TTR("Cross-Animation Blend Times")); updating_blends = false; - blend_editor.tree->connect("item_edited", this, "_blend_edited"); + blend_editor.tree->connect_compat("item_edited", this, "_blend_edited"); - autoplay->connect("pressed", this, "_autoplay_pressed"); + autoplay->connect_compat("pressed", this, "_autoplay_pressed"); autoplay->set_toggle_mode(true); - play->connect("pressed", this, "_play_pressed"); - play_from->connect("pressed", this, "_play_from_pressed"); - play_bw->connect("pressed", this, "_play_bw_pressed"); - play_bw_from->connect("pressed", this, "_play_bw_from_pressed"); - stop->connect("pressed", this, "_stop_pressed"); + play->connect_compat("pressed", this, "_play_pressed"); + play_from->connect_compat("pressed", this, "_play_from_pressed"); + play_bw->connect_compat("pressed", this, "_play_bw_pressed"); + play_bw_from->connect_compat("pressed", this, "_play_bw_from_pressed"); + stop->connect_compat("pressed", this, "_stop_pressed"); - animation->connect("item_selected", this, "_animation_selected", Vector<Variant>(), true); + animation->connect_compat("item_selected", this, "_animation_selected", Vector<Variant>(), true); - file->connect("file_selected", this, "_dialog_action"); - frame->connect("value_changed", this, "_seek_value_changed", Vector<Variant>(), true); - scale->connect("text_entered", this, "_scale_changed", Vector<Variant>(), true); + file->connect_compat("file_selected", this, "_dialog_action"); + frame->connect_compat("value_changed", this, "_seek_value_changed", Vector<Variant>(), true); + scale->connect_compat("text_entered", this, "_scale_changed", Vector<Variant>(), true); renaming = false; last_active = false; @@ -1769,14 +1762,14 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay add_child(track_editor); track_editor->set_v_size_flags(SIZE_EXPAND_FILL); - track_editor->connect("timeline_changed", this, "_animation_key_editor_seek"); - track_editor->connect("animation_len_changed", this, "_animation_key_editor_anim_len_changed"); + track_editor->connect_compat("timeline_changed", this, "_animation_key_editor_seek"); + track_editor->connect_compat("animation_len_changed", this, "_animation_key_editor_anim_len_changed"); _update_player(); // Onion skinning. - track_editor->connect("visibility_changed", this, "_editor_visibility_changed"); + track_editor->connect_compat("visibility_changed", this, "_editor_visibility_changed"); onion.enabled = false; onion.past = true; diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h index ab9db279d5..40815151a3 100644 --- a/editor/plugins/animation_player_editor_plugin.h +++ b/editor/plugins/animation_player_editor_plugin.h @@ -110,7 +110,6 @@ class AnimationPlayerEditor : public VBoxContainer { float timeline_position; EditorFileDialog *file; - AcceptDialog *accept; ConfirmationDialog *delete_dialog; int current_option; diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 035a67b821..6f29aba356 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1276,21 +1276,21 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_select->set_button_group(bg); tool_select->set_pressed(true); tool_select->set_tooltip(TTR("Select and move nodes.\nRMB to add new nodes.\nShift+LMB to create connections.")); - tool_select->connect("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); + tool_select->connect_compat("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); tool_create = memnew(ToolButton); top_hb->add_child(tool_create); tool_create->set_toggle_mode(true); tool_create->set_button_group(bg); tool_create->set_tooltip(TTR("Create new nodes.")); - tool_create->connect("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); + tool_create->connect_compat("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); tool_connect = memnew(ToolButton); top_hb->add_child(tool_connect); tool_connect->set_toggle_mode(true); tool_connect->set_button_group(bg); tool_connect->set_tooltip(TTR("Connect nodes.")); - tool_connect->connect("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); + tool_connect->connect_compat("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); tool_erase_hb = memnew(HBoxContainer); top_hb->add_child(tool_erase_hb); @@ -1298,7 +1298,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_erase = memnew(ToolButton); tool_erase->set_tooltip(TTR("Remove selected node or transition.")); tool_erase_hb->add_child(tool_erase); - tool_erase->connect("pressed", this, "_erase_selected"); + tool_erase->connect_compat("pressed", this, "_erase_selected"); tool_erase->set_disabled(true); tool_erase_hb->add_child(memnew(VSeparator)); @@ -1306,13 +1306,13 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_autoplay = memnew(ToolButton); tool_autoplay->set_tooltip(TTR("Toggle autoplay this animation on start, restart or seek to zero.")); tool_erase_hb->add_child(tool_autoplay); - tool_autoplay->connect("pressed", this, "_autoplay_selected"); + tool_autoplay->connect_compat("pressed", this, "_autoplay_selected"); tool_autoplay->set_disabled(true); tool_end = memnew(ToolButton); tool_end->set_tooltip(TTR("Set the end animation. This is useful for sub-transitions.")); tool_erase_hb->add_child(tool_end); - tool_end->connect("pressed", this, "_end_selected"); + tool_end->connect_compat("pressed", this, "_end_selected"); tool_end->set_disabled(true); top_hb->add_child(memnew(VSeparator)); @@ -1333,26 +1333,26 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { state_machine_draw = memnew(Control); panel->add_child(state_machine_draw); - state_machine_draw->connect("gui_input", this, "_state_machine_gui_input"); - state_machine_draw->connect("draw", this, "_state_machine_draw"); + state_machine_draw->connect_compat("gui_input", this, "_state_machine_gui_input"); + state_machine_draw->connect_compat("draw", this, "_state_machine_draw"); state_machine_draw->set_focus_mode(FOCUS_ALL); state_machine_play_pos = memnew(Control); state_machine_draw->add_child(state_machine_play_pos); state_machine_play_pos->set_mouse_filter(MOUSE_FILTER_PASS); //pass all to parent state_machine_play_pos->set_anchors_and_margins_preset(PRESET_WIDE); - state_machine_play_pos->connect("draw", this, "_state_machine_pos_draw"); + state_machine_play_pos->connect_compat("draw", this, "_state_machine_pos_draw"); v_scroll = memnew(VScrollBar); state_machine_draw->add_child(v_scroll); v_scroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE); - v_scroll->connect("value_changed", this, "_scroll_changed"); + v_scroll->connect_compat("value_changed", this, "_scroll_changed"); h_scroll = memnew(HScrollBar); state_machine_draw->add_child(h_scroll); h_scroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE); h_scroll->set_margin(MARGIN_RIGHT, -v_scroll->get_size().x * EDSCALE); - h_scroll->connect("value_changed", this, "_scroll_changed"); + h_scroll->connect_compat("value_changed", this, "_scroll_changed"); error_panel = memnew(PanelContainer); add_child(error_panel); @@ -1366,25 +1366,25 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_add_menu_type"); + menu->connect_compat("id_pressed", this, "_add_menu_type"); animations_menu = memnew(PopupMenu); menu->add_child(animations_menu); animations_menu->set_name("animations"); - animations_menu->connect("index_pressed", this, "_add_animation_type"); + animations_menu->connect_compat("index_pressed", this, "_add_animation_type"); name_edit = memnew(LineEdit); state_machine_draw->add_child(name_edit); name_edit->hide(); - name_edit->connect("text_entered", this, "_name_edited"); - name_edit->connect("focus_exited", this, "_name_edited_focus_out"); + name_edit->connect_compat("text_entered", this, "_name_edited"); + name_edit->connect_compat("focus_exited", this, "_name_edited_focus_out"); name_edit->set_as_toplevel(true); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - open_file->connect("file_selected", this, "_file_opened"); + open_file->connect_compat("file_selected", this, "_file_opened"); undo_redo = EditorNode::get_undo_redo(); over_text = false; diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index a729c90160..8900882725 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -85,7 +85,7 @@ void AnimationTreeEditor::_update_path() { b->set_button_group(group); b->set_pressed(true); b->set_focus_mode(FOCUS_NONE); - b->connect("pressed", this, "_path_button_pressed", varray(-1)); + b->connect_compat("pressed", this, "_path_button_pressed", varray(-1)); path_hb->add_child(b); for (int i = 0; i < button_path.size(); i++) { b = memnew(Button); @@ -95,7 +95,7 @@ void AnimationTreeEditor::_update_path() { path_hb->add_child(b); b->set_pressed(true); b->set_focus_mode(FOCUS_NONE); - b->connect("pressed", this, "_path_button_pressed", varray(i)); + b->connect_compat("pressed", this, "_path_button_pressed", varray(i)); } } diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 3d47dd46db..01c3c33995 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -112,7 +112,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() { icon = memnew(TextureButton); icon->set_custom_minimum_size(Size2(64, 64) * EDSCALE); icon->set_default_cursor_shape(CURSOR_POINTING_HAND); - icon->connect("pressed", this, "_asset_clicked"); + icon->connect_compat("pressed", this, "_asset_clicked"); hb->add_child(icon); @@ -123,17 +123,17 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() { title = memnew(LinkButton); title->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); - title->connect("pressed", this, "_asset_clicked"); + title->connect_compat("pressed", this, "_asset_clicked"); vb->add_child(title); category = memnew(LinkButton); category->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); - category->connect("pressed", this, "_category_clicked"); + category->connect_compat("pressed", this, "_category_clicked"); vb->add_child(category); author = memnew(LinkButton); author->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); - author->connect("pressed", this, "_author_clicked"); + author->connect_compat("pressed", this, "_author_clicked"); vb->add_child(author); price = memnew(Label); @@ -263,7 +263,7 @@ void EditorAssetLibraryItemDescription::add_preview(int p_id, bool p_video, cons preview.button->set_flat(true); preview.button->set_icon(get_icon("ThumbnailWait", "EditorIcons")); preview.button->set_toggle_mode(true); - preview.button->connect("pressed", this, "_preview_click", varray(p_id)); + preview.button->connect_compat("pressed", this, "_preview_click", varray(p_id)); preview_hb->add_child(preview.button); if (!p_video) { preview.image = get_icon("ThumbnailWait", "EditorIcons"); @@ -290,7 +290,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { description = memnew(RichTextLabel); desc_vbox->add_child(description); description->set_v_size_flags(SIZE_EXPAND_FILL); - description->connect("meta_clicked", this, "_link_click"); + description->connect_compat("meta_clicked", this, "_link_click"); description->add_constant_override("line_separation", Math::round(5 * EDSCALE)); VBoxContainer *previews_vbox = memnew(VBoxContainer); @@ -526,7 +526,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { title->set_h_size_flags(SIZE_EXPAND_FILL); dismiss = memnew(TextureButton); - dismiss->connect("pressed", this, "_close"); + dismiss->connect_compat("pressed", this, "_close"); title_hb->add_child(dismiss); title->set_clip_text(true); @@ -546,11 +546,11 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { install = memnew(Button); install->set_text(TTR("Install...")); install->set_disabled(true); - install->connect("pressed", this, "_install"); + install->connect_compat("pressed", this, "_install"); retry = memnew(Button); retry->set_text(TTR("Retry")); - retry->connect("pressed", this, "_make_request"); + retry->connect_compat("pressed", this, "_make_request"); hb2->add_child(retry); hb2->add_child(install); @@ -558,7 +558,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { download = memnew(HTTPRequest); add_child(download); - download->connect("request_completed", this, "_http_download_completed"); + download->connect_compat("request_completed", this, "_http_download_completed"); download->set_use_threads(EDITOR_DEF("asset_library/use_threads", true)); download_error = memnew(AcceptDialog); @@ -567,7 +567,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { asset_installer = memnew(EditorAssetInstaller); add_child(asset_installer); - asset_installer->connect("confirmed", this, "_close"); + asset_installer->connect_compat("confirmed", this, "_close"); prev_status = -1; @@ -657,7 +657,7 @@ void EditorAssetLibrary::_install_asset() { if (templates_only) { download->set_external_install(true); - download->connect("install_asset", this, "_install_external_asset"); + download->connect_compat("install_asset", this, "_install_external_asset"); } } @@ -892,7 +892,7 @@ void EditorAssetLibrary::_request_image(ObjectID p_for, String p_image_url, Imag iq.queue_id = ++last_queue_id; iq.active = false; - iq.request->connect("request_completed", this, "_image_request_completed", varray(iq.queue_id)); + iq.request->connect_compat("request_completed", this, "_image_request_completed", varray(iq.queue_id)); image_queue[iq.queue_id] = iq; @@ -991,7 +991,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *first = memnew(Button); first->set_text(TTR("First")); if (p_page != 0) { - first->connect("pressed", this, "_search", varray(0)); + first->connect_compat("pressed", this, "_search", varray(0)); } else { first->set_disabled(true); first->set_focus_mode(Control::FOCUS_NONE); @@ -1001,7 +1001,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *prev = memnew(Button); prev->set_text(TTR("Previous")); if (p_page > 0) { - prev->connect("pressed", this, "_search", varray(p_page - 1)); + prev->connect_compat("pressed", this, "_search", varray(p_page - 1)); } else { prev->set_disabled(true); prev->set_focus_mode(Control::FOCUS_NONE); @@ -1023,7 +1023,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *current = memnew(Button); current->set_text(itos(i + 1)); - current->connect("pressed", this, "_search", varray(i)); + current->connect_compat("pressed", this, "_search", varray(i)); hbc->add_child(current); } @@ -1032,7 +1032,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *next = memnew(Button); next->set_text(TTR("Next")); if (p_page < p_page_count - 1) { - next->connect("pressed", this, "_search", varray(p_page + 1)); + next->connect_compat("pressed", this, "_search", varray(p_page + 1)); } else { next->set_disabled(true); next->set_focus_mode(Control::FOCUS_NONE); @@ -1043,7 +1043,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *last = memnew(Button); last->set_text(TTR("Last")); if (p_page != p_page_count - 1) { - last->connect("pressed", this, "_search", varray(p_page_count - 1)); + last->connect_compat("pressed", this, "_search", varray(p_page_count - 1)); } else { last->set_disabled(true); last->set_focus_mode(Control::FOCUS_NONE); @@ -1229,9 +1229,9 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const EditorAssetLibraryItem *item = memnew(EditorAssetLibraryItem); asset_items->add_child(item); item->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"]); - item->connect("asset_selected", this, "_select_asset"); - item->connect("author_selected", this, "_select_author"); - item->connect("category_selected", this, "_select_category"); + item->connect_compat("asset_selected", this, "_select_asset"); + item->connect_compat("author_selected", this, "_select_author"); + item->connect_compat("category_selected", this, "_select_category"); if (r.has("icon_url") && r["icon_url"] != "") { _request_image(item->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0); @@ -1262,7 +1262,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const description = memnew(EditorAssetLibraryItemDescription); add_child(description); description->popup_centered_minsize(); - description->connect("confirmed", this, "_install_asset"); + description->connect_compat("confirmed", this, "_install_asset"); description->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"], r["version"], r["version_string"], r["description"], r["download_url"], r["browse_url"], r["download_hash"]); @@ -1374,9 +1374,9 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { filter = memnew(LineEdit); search_hb->add_child(filter); filter->set_h_size_flags(SIZE_EXPAND_FILL); - filter->connect("text_entered", this, "_search_text_entered"); + filter->connect_compat("text_entered", this, "_search_text_entered"); search = memnew(Button(TTR("Search"))); - search->connect("pressed", this, "_search"); + search->connect_compat("pressed", this, "_search"); search_hb->add_child(search); if (!p_templates_only) @@ -1385,12 +1385,12 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { Button *open_asset = memnew(Button); open_asset->set_text(TTR("Import...")); search_hb->add_child(open_asset); - open_asset->connect("pressed", this, "_asset_open"); + open_asset->connect_compat("pressed", this, "_asset_open"); Button *plugins = memnew(Button); plugins->set_text(TTR("Plugins...")); search_hb->add_child(plugins); - plugins->connect("pressed", this, "_manage_plugins"); + plugins->connect_compat("pressed", this, "_manage_plugins"); if (p_templates_only) { open_asset->hide(); @@ -1409,7 +1409,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { search_hb2->add_child(sort); sort->set_h_size_flags(SIZE_EXPAND_FILL); - sort->connect("item_selected", this, "_rerun_search"); + sort->connect_compat("item_selected", this, "_rerun_search"); search_hb2->add_child(memnew(VSeparator)); @@ -1418,7 +1418,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { categories->add_item(TTR("All")); search_hb2->add_child(categories); categories->set_h_size_flags(SIZE_EXPAND_FILL); - categories->connect("item_selected", this, "_rerun_search"); + categories->connect_compat("item_selected", this, "_rerun_search"); search_hb2->add_child(memnew(VSeparator)); @@ -1430,7 +1430,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { repository->add_item("localhost"); repository->set_item_metadata(1, "http://127.0.0.1/asset-library/api"); - repository->connect("item_selected", this, "_repository_changed"); + repository->connect_compat("item_selected", this, "_repository_changed"); search_hb2->add_child(repository); repository->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1445,7 +1445,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { support->get_popup()->add_check_item(TTR("Testing"), SUPPORT_TESTING); support->get_popup()->set_item_checked(SUPPORT_OFFICIAL, true); support->get_popup()->set_item_checked(SUPPORT_COMMUNITY, true); - support->get_popup()->connect("id_pressed", this, "_support_toggled"); + support->get_popup()->connect_compat("id_pressed", this, "_support_toggled"); ///////// @@ -1501,7 +1501,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { request = memnew(HTTPRequest); add_child(request); request->set_use_threads(EDITOR_DEF("asset_library/use_threads", true)); - request->connect("request_completed", this, "_http_request_completed"); + request->connect_compat("request_completed", this, "_http_request_completed"); last_queue_id = 0; @@ -1534,7 +1534,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { asset_open->add_filter("*.zip ; " + TTR("Assets ZIP File")); asset_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); add_child(asset_open); - asset_open->connect("file_selected", this, "_asset_file_selected"); + asset_open->connect_compat("file_selected", this, "_asset_file_selected"); asset_installer = NULL; } diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index 60cb2ff54d..e4a9c38a99 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -39,7 +39,7 @@ void AudioStreamEditor::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { - AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", this, "_preview_changed"); + AudioStreamPreviewGenerator::get_singleton()->connect_compat("preview_updated", this, "_preview_changed"); } if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) { @@ -214,7 +214,7 @@ AudioStreamEditor::AudioStreamEditor() { _dragging = false; _player = memnew(AudioStreamPlayer); - _player->connect("finished", this, "_on_finished"); + _player->connect_compat("finished", this, "_on_finished"); add_child(_player); VBoxContainer *vbox = memnew(VBoxContainer); @@ -223,13 +223,13 @@ AudioStreamEditor::AudioStreamEditor() { _preview = memnew(ColorRect); _preview->set_v_size_flags(SIZE_EXPAND_FILL); - _preview->connect("draw", this, "_draw_preview"); + _preview->connect_compat("draw", this, "_draw_preview"); vbox->add_child(_preview); _indicator = memnew(Control); _indicator->set_anchors_and_margins_preset(PRESET_WIDE); - _indicator->connect("draw", this, "_draw_indicator"); - _indicator->connect("gui_input", this, "_on_input_indicator"); + _indicator->connect_compat("draw", this, "_draw_indicator"); + _indicator->connect_compat("gui_input", this, "_on_input_indicator"); _preview->add_child(_indicator); HBoxContainer *hbox = memnew(HBoxContainer); @@ -239,12 +239,12 @@ AudioStreamEditor::AudioStreamEditor() { _play_button = memnew(ToolButton); hbox->add_child(_play_button); _play_button->set_focus_mode(Control::FOCUS_NONE); - _play_button->connect("pressed", this, "_play"); + _play_button->connect_compat("pressed", this, "_play"); _stop_button = memnew(ToolButton); hbox->add_child(_stop_button); _stop_button->set_focus_mode(Control::FOCUS_NONE); - _stop_button->connect("pressed", this, "_stop"); + _stop_button->connect_compat("pressed", this, "_stop"); _current_label = memnew(Label); _current_label->set_align(Label::ALIGN_RIGHT); diff --git a/editor/plugins/camera_editor_plugin.cpp b/editor/plugins/camera_editor_plugin.cpp index 6f5bc69bd1..0440785eaf 100644 --- a/editor/plugins/camera_editor_plugin.cpp +++ b/editor/plugins/camera_editor_plugin.cpp @@ -81,7 +81,7 @@ CameraEditor::CameraEditor() { preview->set_margin(MARGIN_RIGHT, 0); preview->set_margin(MARGIN_TOP, 0); preview->set_margin(MARGIN_BOTTOM, 10); - preview->connect("pressed", this, "_pressed"); + preview->connect_compat("pressed", this, "_pressed"); } void CameraEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 3ab7fdb39c..f5cc0ccf2a 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -34,12 +34,12 @@ #include "core/os/keyboard.h" #include "core/print_string.h" #include "core/project_settings.h" +#include "editor/debugger/editor_debugger_node.h" #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" -#include "editor/script_editor_debugger.h" #include "scene/2d/light_2d.h" #include "scene/2d/particles_2d.h" #include "scene/2d/polygon_2d.h" @@ -3100,7 +3100,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { case DRAG_TOP_LEFT: case DRAG_BOTTOM_LEFT: _draw_margin_at_position(control->get_size().width, parent_transform.xform(Vector2((node_pos_in_parent[0] + node_pos_in_parent[2]) / 2, node_pos_in_parent[3])) + Vector2(0, 5), MARGIN_BOTTOM); - FALLTHROUGH; + [[fallthrough]]; case DRAG_MOVE: start = Vector2(node_pos_in_parent[0], Math::lerp(node_pos_in_parent[1], node_pos_in_parent[3], ratio)); end = start - Vector2(control->get_margin(MARGIN_LEFT), 0); @@ -3115,7 +3115,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { case DRAG_TOP_RIGHT: case DRAG_BOTTOM_RIGHT: _draw_margin_at_position(control->get_size().width, parent_transform.xform(Vector2((node_pos_in_parent[0] + node_pos_in_parent[2]) / 2, node_pos_in_parent[3])) + Vector2(0, 5), MARGIN_BOTTOM); - FALLTHROUGH; + [[fallthrough]]; case DRAG_MOVE: start = Vector2(node_pos_in_parent[2], Math::lerp(node_pos_in_parent[3], node_pos_in_parent[1], ratio)); end = start - Vector2(control->get_margin(MARGIN_RIGHT), 0); @@ -3130,7 +3130,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { case DRAG_TOP_LEFT: case DRAG_TOP_RIGHT: _draw_margin_at_position(control->get_size().height, parent_transform.xform(Vector2(node_pos_in_parent[2], (node_pos_in_parent[1] + node_pos_in_parent[3]) / 2)) + Vector2(5, 0), MARGIN_RIGHT); - FALLTHROUGH; + [[fallthrough]]; case DRAG_MOVE: start = Vector2(Math::lerp(node_pos_in_parent[0], node_pos_in_parent[2], ratio), node_pos_in_parent[1]); end = start - Vector2(0, control->get_margin(MARGIN_TOP)); @@ -3145,7 +3145,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { case DRAG_BOTTOM_LEFT: case DRAG_BOTTOM_RIGHT: _draw_margin_at_position(control->get_size().height, parent_transform.xform(Vector2(node_pos_in_parent[2], (node_pos_in_parent[1] + node_pos_in_parent[3]) / 2) + Vector2(5, 0)), MARGIN_RIGHT); - FALLTHROUGH; + [[fallthrough]]; case DRAG_MOVE: start = Vector2(Math::lerp(node_pos_in_parent[2], node_pos_in_parent[0], ratio), node_pos_in_parent[3]); end = start - Vector2(0, control->get_margin(MARGIN_BOTTOM)); @@ -3891,10 +3891,10 @@ void CanvasItemEditor::_notification(int p_what) { select_sb->set_default_margin(Margin(i), 4); } - AnimationPlayerEditor::singleton->get_track_editor()->connect("visibility_changed", this, "_keying_changed"); + AnimationPlayerEditor::singleton->get_track_editor()->connect_compat("visibility_changed", this, "_keying_changed"); _keying_changed(); - get_tree()->connect("node_added", this, "_tree_changed", varray()); - get_tree()->connect("node_removed", this, "_tree_changed", varray()); + get_tree()->connect_compat("node_added", this, "_tree_changed", varray()); + get_tree()->connect_compat("node_removed", this, "_tree_changed", varray()); } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { @@ -3902,8 +3902,8 @@ void CanvasItemEditor::_notification(int p_what) { } if (p_what == NOTIFICATION_EXIT_TREE) { - get_tree()->disconnect("node_added", this, "_tree_changed"); - get_tree()->disconnect("node_removed", this, "_tree_changed"); + get_tree()->disconnect_compat("node_added", this, "_tree_changed"); + get_tree()->disconnect_compat("node_removed", this, "_tree_changed"); } if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { @@ -3990,7 +3990,7 @@ void CanvasItemEditor::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (!is_visible() && override_camera_button->is_pressed()) { - ScriptEditorDebugger *debugger = ScriptEditor::get_singleton()->get_debugger(); + EditorDebuggerNode *debugger = EditorDebuggerNode::get_singleton(); debugger->set_camera_override(ScriptEditorDebugger::OVERRIDE_NONE); override_camera_button->set_pressed(false); @@ -4181,7 +4181,7 @@ void CanvasItemEditor::_popup_warning_temporarily(Control *p_control, const floa Timer *timer; if (!popup_temporarily_timers.has(p_control)) { timer = memnew(Timer); - timer->connect("timeout", this, "_popup_warning_depop", varray(p_control)); + timer->connect_compat("timeout", this, "_popup_warning_depop", varray(p_control)); timer->set_one_shot(true); add_child(timer); @@ -4345,7 +4345,7 @@ void CanvasItemEditor::_button_toggle_grid_snap(bool p_status) { viewport->update(); } void CanvasItemEditor::_button_override_camera(bool p_pressed) { - ScriptEditorDebugger *debugger = ScriptEditor::get_singleton()->get_debugger(); + EditorDebuggerNode *debugger = EditorDebuggerNode::get_singleton(); if (p_pressed) { debugger->set_camera_override(ScriptEditorDebugger::OVERRIDE_2D); @@ -5410,11 +5410,11 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { editor = p_editor; editor_selection = p_editor->get_editor_selection(); editor_selection->add_editor_plugin(this); - editor_selection->connect("selection_changed", this, "update"); - editor_selection->connect("selection_changed", this, "_selection_changed"); + editor_selection->connect_compat("selection_changed", this, "update"); + editor_selection->connect_compat("selection_changed", this, "_selection_changed"); - editor->call_deferred("connect", "play_pressed", this, "_update_override_camera_button", make_binds(true)); - editor->call_deferred("connect", "stop_pressed", this, "_update_override_camera_button", make_binds(false)); + editor->call_deferred("connect", make_binds("play_pressed", Callable(this, "_update_override_camera_button"), true)); + editor->call_deferred("connect", make_binds("stop_pressed", Callable(this, "_update_override_camera_button"), false)); hb = memnew(HBoxContainer); add_child(hb); @@ -5434,7 +5434,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport_scrollable->set_clip_contents(true); viewport_scrollable->set_v_size_flags(SIZE_EXPAND_FILL); viewport_scrollable->set_h_size_flags(SIZE_EXPAND_FILL); - viewport_scrollable->connect("draw", this, "_update_scrollbars"); + viewport_scrollable->connect_compat("draw", this, "_update_scrollbars"); ViewportContainer *scene_tree = memnew(ViewportContainer); viewport_scrollable->add_child(scene_tree); @@ -5456,8 +5456,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport->set_anchors_and_margins_preset(Control::PRESET_WIDE); viewport->set_clip_contents(true); viewport->set_focus_mode(FOCUS_ALL); - viewport->connect("draw", this, "_draw_viewport"); - viewport->connect("gui_input", this, "_gui_input_viewport"); + viewport->connect_compat("draw", this, "_draw_viewport"); + viewport->connect_compat("gui_input", this, "_gui_input_viewport"); info_overlay = memnew(VBoxContainer); info_overlay->set_anchors_and_margins_preset(Control::PRESET_BOTTOM_LEFT); @@ -5485,25 +5485,25 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { h_scroll = memnew(HScrollBar); viewport->add_child(h_scroll); - h_scroll->connect("value_changed", this, "_update_scroll"); + h_scroll->connect_compat("value_changed", this, "_update_scroll"); h_scroll->hide(); v_scroll = memnew(VScrollBar); viewport->add_child(v_scroll); - v_scroll->connect("value_changed", this, "_update_scroll"); + v_scroll->connect_compat("value_changed", this, "_update_scroll"); v_scroll->hide(); viewport->add_child(controls_vb); zoom_minus = memnew(ToolButton); zoom_hb->add_child(zoom_minus); - zoom_minus->connect("pressed", this, "_button_zoom_minus"); + zoom_minus->connect_compat("pressed", this, "_button_zoom_minus"); zoom_minus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_minus", TTR("Zoom Out"), KEY_MASK_CMD | KEY_MINUS)); zoom_minus->set_focus_mode(FOCUS_NONE); zoom_reset = memnew(ToolButton); zoom_hb->add_child(zoom_reset); - zoom_reset->connect("pressed", this, "_button_zoom_reset"); + zoom_reset->connect_compat("pressed", this, "_button_zoom_reset"); zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KEY_MASK_CMD | KEY_0)); zoom_reset->set_focus_mode(FOCUS_NONE); zoom_reset->set_text_align(Button::TextAlign::ALIGN_CENTER); @@ -5512,7 +5512,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { zoom_plus = memnew(ToolButton); zoom_hb->add_child(zoom_plus); - zoom_plus->connect("pressed", this, "_button_zoom_plus"); + zoom_plus->connect_compat("pressed", this, "_button_zoom_plus"); zoom_plus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_plus", TTR("Zoom In"), KEY_MASK_CMD | KEY_EQUAL)); // Usually direct access key for PLUS zoom_plus->set_focus_mode(FOCUS_NONE); @@ -5521,7 +5521,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { select_button = memnew(ToolButton); hb->add_child(select_button); select_button->set_toggle_mode(true); - select_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_SELECT)); + select_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_SELECT)); select_button->set_pressed(true); select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), KEY_Q)); select_button->set_tooltip(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate") + "\n" + TTR("Alt+Drag: Move") + "\n" + TTR("Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving).") + "\n" + TTR("Alt+RMB: Depth list selection")); @@ -5531,21 +5531,21 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { move_button = memnew(ToolButton); hb->add_child(move_button); move_button->set_toggle_mode(true); - move_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_MOVE)); + move_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_MOVE)); move_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/move_mode", TTR("Move Mode"), KEY_W)); move_button->set_tooltip(TTR("Move Mode")); rotate_button = memnew(ToolButton); hb->add_child(rotate_button); rotate_button->set_toggle_mode(true); - rotate_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_ROTATE)); + rotate_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_ROTATE)); rotate_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/rotate_mode", TTR("Rotate Mode"), KEY_E)); rotate_button->set_tooltip(TTR("Rotate Mode")); scale_button = memnew(ToolButton); hb->add_child(scale_button); scale_button->set_toggle_mode(true); - scale_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_SCALE)); + scale_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_SCALE)); scale_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/scale_mode", TTR("Scale Mode"), KEY_S)); scale_button->set_tooltip(TTR("Scale Mode")); @@ -5554,25 +5554,25 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { list_select_button = memnew(ToolButton); hb->add_child(list_select_button); list_select_button->set_toggle_mode(true); - list_select_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_LIST_SELECT)); + list_select_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_LIST_SELECT)); list_select_button->set_tooltip(TTR("Show a list of all objects at the position clicked\n(same as Alt+RMB in select mode).")); pivot_button = memnew(ToolButton); hb->add_child(pivot_button); pivot_button->set_toggle_mode(true); - pivot_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_EDIT_PIVOT)); + pivot_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_EDIT_PIVOT)); pivot_button->set_tooltip(TTR("Click to change object's rotation pivot.")); pan_button = memnew(ToolButton); hb->add_child(pan_button); pan_button->set_toggle_mode(true); - pan_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_PAN)); + pan_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_PAN)); pan_button->set_tooltip(TTR("Pan Mode")); ruler_button = memnew(ToolButton); hb->add_child(ruler_button); ruler_button->set_toggle_mode(true); - ruler_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_RULER)); + ruler_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_RULER)); ruler_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/ruler_mode", TTR("Ruler Mode"), KEY_R)); ruler_button->set_tooltip(TTR("Ruler Mode")); @@ -5581,14 +5581,14 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { smart_snap_button = memnew(ToolButton); hb->add_child(smart_snap_button); smart_snap_button->set_toggle_mode(true); - smart_snap_button->connect("toggled", this, "_button_toggle_smart_snap"); + smart_snap_button->connect_compat("toggled", this, "_button_toggle_smart_snap"); smart_snap_button->set_tooltip(TTR("Toggle smart snapping.")); smart_snap_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/use_smart_snap", TTR("Use Smart Snap"), KEY_MASK_SHIFT | KEY_S)); grid_snap_button = memnew(ToolButton); hb->add_child(grid_snap_button); grid_snap_button->set_toggle_mode(true); - grid_snap_button->connect("toggled", this, "_button_toggle_grid_snap"); + grid_snap_button->connect_compat("toggled", this, "_button_toggle_grid_snap"); grid_snap_button->set_tooltip(TTR("Toggle grid snapping.")); grid_snap_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/use_grid_snap", TTR("Use Grid Snap"), KEY_MASK_SHIFT | KEY_G)); @@ -5599,7 +5599,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { snap_config_menu->set_switch_on_hover(true); PopupMenu *p = snap_config_menu->get_popup(); - p->connect("id_pressed", this, "_popup_callback"); + p->connect_compat("id_pressed", this, "_popup_callback"); p->set_hide_on_checkable_item_selection(false); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_rotation_snap", TTR("Use Rotation Snap")), SNAP_USE_ROTATION); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_scale_snap", TTR("Use Scale Snap")), SNAP_USE_SCALE); @@ -5613,7 +5613,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { smartsnap_config_popup = memnew(PopupMenu); p->add_child(smartsnap_config_popup); smartsnap_config_popup->set_name("SmartSnapping"); - smartsnap_config_popup->connect("id_pressed", this, "_popup_callback"); + smartsnap_config_popup->connect_compat("id_pressed", this, "_popup_callback"); smartsnap_config_popup->set_hide_on_checkable_item_selection(false); smartsnap_config_popup->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_node_parent", TTR("Snap to Parent")), SNAP_USE_NODE_PARENT); smartsnap_config_popup->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_node_anchors", TTR("Snap to Node Anchor")), SNAP_USE_NODE_ANCHORS); @@ -5627,22 +5627,22 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { lock_button = memnew(ToolButton); hb->add_child(lock_button); - lock_button->connect("pressed", this, "_popup_callback", varray(LOCK_SELECTED)); + lock_button->connect_compat("pressed", this, "_popup_callback", varray(LOCK_SELECTED)); lock_button->set_tooltip(TTR("Lock the selected object in place (can't be moved).")); unlock_button = memnew(ToolButton); hb->add_child(unlock_button); - unlock_button->connect("pressed", this, "_popup_callback", varray(UNLOCK_SELECTED)); + unlock_button->connect_compat("pressed", this, "_popup_callback", varray(UNLOCK_SELECTED)); unlock_button->set_tooltip(TTR("Unlock the selected object (can be moved).")); group_button = memnew(ToolButton); hb->add_child(group_button); - group_button->connect("pressed", this, "_popup_callback", varray(GROUP_SELECTED)); + group_button->connect_compat("pressed", this, "_popup_callback", varray(GROUP_SELECTED)); group_button->set_tooltip(TTR("Makes sure the object's children are not selectable.")); ungroup_button = memnew(ToolButton); hb->add_child(ungroup_button); - ungroup_button->connect("pressed", this, "_popup_callback", varray(UNGROUP_SELECTED)); + ungroup_button->connect_compat("pressed", this, "_popup_callback", varray(UNGROUP_SELECTED)); ungroup_button->set_tooltip(TTR("Restores the object's children's ability to be selected.")); hb->add_child(memnew(VSeparator)); @@ -5661,13 +5661,13 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p->add_separator(); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Custom Bone(s) from Node(s)"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B), SKELETON_MAKE_BONES); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_bones", TTR("Clear Custom Bones")), SKELETON_CLEAR_BONES); - p->connect("id_pressed", this, "_popup_callback"); + p->connect_compat("id_pressed", this, "_popup_callback"); hb->add_child(memnew(VSeparator)); override_camera_button = memnew(ToolButton); hb->add_child(override_camera_button); - override_camera_button->connect("toggled", this, "_button_override_camera"); + override_camera_button->connect_compat("toggled", this, "_button_override_camera"); override_camera_button->set_toggle_mode(true); override_camera_button->set_disabled(true); _update_override_camera_button(false); @@ -5677,7 +5677,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { view_menu = memnew(MenuButton); view_menu->set_text(TTR("View")); hb->add_child(view_menu); - view_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); + view_menu->get_popup()->connect_compat("id_pressed", this, "_popup_callback"); view_menu->set_switch_on_hover(true); p = view_menu->get_popup(); @@ -5705,18 +5705,18 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { presets_menu->set_switch_on_hover(true); p = presets_menu->get_popup(); - p->connect("id_pressed", this, "_popup_callback"); + p->connect_compat("id_pressed", this, "_popup_callback"); anchors_popup = memnew(PopupMenu); p->add_child(anchors_popup); anchors_popup->set_name("Anchors"); - anchors_popup->connect("id_pressed", this, "_popup_callback"); + anchors_popup->connect_compat("id_pressed", this, "_popup_callback"); anchor_mode_button = memnew(ToolButton); hb->add_child(anchor_mode_button); anchor_mode_button->set_toggle_mode(true); anchor_mode_button->hide(); - anchor_mode_button->connect("toggled", this, "_button_toggle_anchor_mode"); + anchor_mode_button->connect_compat("toggled", this, "_button_toggle_anchor_mode"); animation_hb = memnew(HBoxContainer); hb->add_child(animation_hb); @@ -5728,7 +5728,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_loc_button->set_flat(true); key_loc_button->set_pressed(true); key_loc_button->set_focus_mode(FOCUS_NONE); - key_loc_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_POS)); + key_loc_button->connect_compat("pressed", this, "_popup_callback", varray(ANIM_INSERT_POS)); key_loc_button->set_tooltip(TTR("Translation mask for inserting keys.")); animation_hb->add_child(key_loc_button); key_rot_button = memnew(Button); @@ -5736,20 +5736,20 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_rot_button->set_flat(true); key_rot_button->set_pressed(true); key_rot_button->set_focus_mode(FOCUS_NONE); - key_rot_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_ROT)); + key_rot_button->connect_compat("pressed", this, "_popup_callback", varray(ANIM_INSERT_ROT)); key_rot_button->set_tooltip(TTR("Rotation mask for inserting keys.")); animation_hb->add_child(key_rot_button); key_scale_button = memnew(Button); key_scale_button->set_toggle_mode(true); key_scale_button->set_flat(true); key_scale_button->set_focus_mode(FOCUS_NONE); - key_scale_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_SCALE)); + key_scale_button->connect_compat("pressed", this, "_popup_callback", varray(ANIM_INSERT_SCALE)); key_scale_button->set_tooltip(TTR("Scale mask for inserting keys.")); animation_hb->add_child(key_scale_button); key_insert_button = memnew(Button); key_insert_button->set_flat(true); key_insert_button->set_focus_mode(FOCUS_NONE); - key_insert_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY)); + key_insert_button->connect_compat("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY)); key_insert_button->set_tooltip(TTR("Insert keys (based on mask).")); key_insert_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/anim_insert_key", TTR("Insert Key"), KEY_INSERT)); animation_hb->add_child(key_insert_button); @@ -5765,7 +5765,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { animation_menu = memnew(MenuButton); animation_menu->set_tooltip(TTR("Animation Key and Pose Options")); animation_hb->add_child(animation_menu); - animation_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); + animation_menu->get_popup()->connect_compat("id_pressed", this, "_popup_callback"); animation_menu->set_switch_on_hover(true); p = animation_menu->get_popup(); @@ -5778,7 +5778,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p->add_shortcut(ED_SHORTCUT("canvas_item_editor/anim_clear_pose", TTR("Clear Pose"), KEY_MASK_SHIFT | KEY_K), ANIM_CLEAR_POSE); snap_dialog = memnew(SnapDialog); - snap_dialog->connect("confirmed", this, "_snap_changed"); + snap_dialog->connect_compat("confirmed", this, "_snap_changed"); add_child(snap_dialog); select_sb = Ref<StyleBoxTexture>(memnew(StyleBoxTexture)); @@ -5786,8 +5786,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { selection_menu = memnew(PopupMenu); add_child(selection_menu); selection_menu->set_custom_minimum_size(Vector2(100, 0)); - selection_menu->connect("id_pressed", this, "_selection_result_pressed"); - selection_menu->connect("popup_hide", this, "_selection_menu_hide"); + selection_menu->connect_compat("id_pressed", this, "_selection_result_pressed"); + selection_menu->connect_compat("popup_hide", this, "_selection_menu_hide"); multiply_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/multiply_grid_step", TTR("Multiply grid step by 2"), KEY_KP_MULTIPLY); divide_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/divide_grid_step", TTR("Divide grid step by 2"), KEY_KP_DIVIDE); @@ -5960,9 +5960,9 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String & if (parent) { String new_name = parent->validate_child_name(child); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_create_node", editor->get_edited_scene()->get_path_to(parent), child->get_class(), new_name); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); + editor_data->get_undo_redo().add_do_method(ed, "live_debug_create_node", editor->get_edited_scene()->get_path_to(parent), child->get_class(), new_name); + editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); } // handle with different property for texture @@ -6030,9 +6030,9 @@ bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, cons editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instanced_scene); String new_name = parent->validate_child_name(instanced_scene); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_instance_node", editor->get_edited_scene()->get_path_to(parent), path, new_name); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); + editor_data->get_undo_redo().add_do_method(ed, "live_debug_instance_node", editor->get_edited_scene()->get_path_to(parent), path, new_name); + editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); CanvasItem *parent_ci = Object::cast_to<CanvasItem>(parent); if (parent_ci) { @@ -6234,11 +6234,11 @@ void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p void CanvasItemEditorViewport::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("mouse_exited", this, "_on_mouse_exit"); + connect_compat("mouse_exited", this, "_on_mouse_exit"); label->add_color_override("font_color", get_color("warning_color", "Editor")); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("mouse_exited", this, "_on_mouse_exit"); + disconnect_compat("mouse_exited", this, "_on_mouse_exit"); } break; default: break; @@ -6276,8 +6276,8 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte selector = memnew(AcceptDialog); editor->get_gui_base()->add_child(selector); selector->set_title(TTR("Change Default Type")); - selector->connect("confirmed", this, "_on_change_type_confirmed"); - selector->connect("popup_hide", this, "_on_change_type_closed"); + selector->connect_compat("confirmed", this, "_on_change_type_confirmed"); + selector->connect_compat("popup_hide", this, "_on_change_type_closed"); VBoxContainer *vbc = memnew(VBoxContainer); selector->add_child(vbc); @@ -6294,7 +6294,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte CheckBox *check = memnew(CheckBox); btn_group->add_child(check); check->set_text(types[i]); - check->connect("button_down", this, "_on_select_type", varray(check)); + check->connect_compat("button_down", this, "_on_select_type", varray(check)); check->set_button_group(button_group); } diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp index 9aa9b6cda5..59bbe031ed 100644 --- a/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_editor_plugin.cpp @@ -47,7 +47,7 @@ void Polygon3DEditor::_notification(int p_what) { button_create->set_icon(get_icon("Edit", "EditorIcons")); button_edit->set_icon(get_icon("MovePoint", "EditorIcons")); button_edit->set_pressed(true); - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); } break; case NOTIFICATION_PROCESS: { @@ -532,12 +532,12 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) { add_child(memnew(VSeparator)); button_create = memnew(ToolButton); add_child(button_create); - button_create->connect("pressed", this, "_menu_option", varray(MODE_CREATE)); + button_create->connect_compat("pressed", this, "_menu_option", varray(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(ToolButton); add_child(button_edit); - button_edit->connect("pressed", this, "_menu_option", varray(MODE_EDIT)); + button_edit->connect_compat("pressed", this, "_menu_option", varray(MODE_EDIT)); button_edit->set_toggle_mode(true); mode = MODE_EDIT; diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp index 80f5e26d48..ad3f01ec37 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp @@ -240,9 +240,9 @@ void CPUParticles2DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - menu->get_popup()->connect("id_pressed", this, "_menu_callback"); + menu->get_popup()->connect_compat("id_pressed", this, "_menu_callback"); menu->set_icon(menu->get_popup()->get_icon("Particles2D", "EditorIcons")); - file->connect("file_selected", this, "_file_selected"); + file->connect_compat("file_selected", this, "_file_selected"); } } @@ -305,7 +305,7 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(emission_mask); - emission_mask->connect("confirmed", this, "_generate_emission_mask"); + emission_mask->connect_compat("confirmed", this, "_generate_emission_mask"); } CPUParticles2DEditorPlugin::~CPUParticles2DEditorPlugin() { diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_editor_plugin.cpp index be3e9cd8e0..3d438226d2 100644 --- a/editor/plugins/cpu_particles_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_editor_plugin.cpp @@ -51,12 +51,6 @@ void CPUParticlesEditor::_menu_option(int p_option) { switch (p_option) { - case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH: { - - emission_file_dialog->popup_centered_ratio(); - - } break; - case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: { emission_tree_dialog->popup_centered_ratio(); @@ -112,11 +106,10 @@ CPUParticlesEditor::CPUParticlesEditor() { particles_editor_hb->hide(); options->set_text(TTR("CPUParticles")); - options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH); options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); } void CPUParticlesEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/cpu_particles_editor_plugin.h b/editor/plugins/cpu_particles_editor_plugin.h index deaced9ad9..4cf143fc0c 100644 --- a/editor/plugins/cpu_particles_editor_plugin.h +++ b/editor/plugins/cpu_particles_editor_plugin.h @@ -41,7 +41,6 @@ class CPUParticlesEditor : public ParticlesEditorBase { enum Menu { MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE, - MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH, MENU_OPTION_CLEAR_EMISSION_VOLUME, MENU_OPTION_RESTART diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 62a3ff9b58..5f4fb19d9e 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -49,7 +49,7 @@ CurveEditor::CurveEditor() { set_clip_contents(true); _context_menu = memnew(PopupMenu); - _context_menu->connect("id_pressed", this, "_on_context_menu_item_selected"); + _context_menu->connect_compat("id_pressed", this, "_on_context_menu_item_selected"); add_child(_context_menu); _presets_menu = memnew(PopupMenu); @@ -60,7 +60,7 @@ CurveEditor::CurveEditor() { _presets_menu->add_item(TTR("Ease In"), PRESET_EASE_IN); _presets_menu->add_item(TTR("Ease Out"), PRESET_EASE_OUT); _presets_menu->add_item(TTR("Smoothstep"), PRESET_SMOOTHSTEP); - _presets_menu->connect("id_pressed", this, "_on_preset_item_selected"); + _presets_menu->connect_compat("id_pressed", this, "_on_preset_item_selected"); _context_menu->add_child(_presets_menu); } @@ -70,15 +70,15 @@ void CurveEditor::set_curve(Ref<Curve> curve) { return; if (_curve_ref.is_valid()) { - _curve_ref->disconnect(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); - _curve_ref->disconnect(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); + _curve_ref->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); + _curve_ref->disconnect_compat(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); } _curve_ref = curve; if (_curve_ref.is_valid()) { - _curve_ref->connect(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); - _curve_ref->connect(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); + _curve_ref->connect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); + _curve_ref->connect_compat(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); } _selected_point = -1; diff --git a/editor/plugins/debugger_editor_plugin.cpp b/editor/plugins/debugger_editor_plugin.cpp new file mode 100644 index 0000000000..2534a2cc17 --- /dev/null +++ b/editor/plugins/debugger_editor_plugin.cpp @@ -0,0 +1,51 @@ +/*************************************************************************/ +/* debugger_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "debugger_editor_plugin.h" + +#include "core/os/keyboard.h" +#include "editor/debugger/editor_debugger_node.h" + +DebuggerEditorPlugin::DebuggerEditorPlugin(EditorNode *p_editor) { + ED_SHORTCUT("debugger/step_into", TTR("Step Into"), KEY_F11); + ED_SHORTCUT("debugger/step_over", TTR("Step Over"), KEY_F10); + ED_SHORTCUT("debugger/break", TTR("Break")); + ED_SHORTCUT("debugger/continue", TTR("Continue"), KEY_F12); + ED_SHORTCUT("debugger/keep_debugger_open", TTR("Keep Debugger Open")); + ED_SHORTCUT("debugger/debug_with_external_editor", TTR("Debug with External Editor")); + + EditorDebuggerNode *debugger = memnew(EditorDebuggerNode); + Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger); + debugger->set_tool_button(db); +} + +DebuggerEditorPlugin::~DebuggerEditorPlugin() { + // Should delete debugger? +} diff --git a/drivers/dummy/audio_driver_dummy.h b/editor/plugins/debugger_editor_plugin.h index 6e39df9e2f..05d6ece72d 100644 --- a/drivers/dummy/audio_driver_dummy.h +++ b/editor/plugins/debugger_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* audio_driver_dummy.h */ +/* debugger_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,31 +28,23 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef AUDIO_DRIVER_DUMMY_H -#define AUDIO_DRIVER_DUMMY_H +#ifndef DEBUGGER_EDITOR_PLUGIN_H +#define DEBUGGER_EDITOR_PLUGIN_H -#include "core/os/mutex.h" -#include "core/os/thread.h" -#include "servers/audio_server.h" +#include "editor/debugger/editor_debugger_node.h" +#include "editor/editor_node.h" +#include "editor/editor_plugin.h" -class AudioDriverDummy : public AudioDriver { -public: - const char *get_name() const { - return "Dummy"; - }; +class DebuggerEditorPlugin : public EditorPlugin { - virtual Error init() { return OK; } - virtual void start(){}; - virtual int get_mix_rate() const { return DEFAULT_MIX_RATE; }; - virtual SpeakerMode get_speaker_mode() const { return SPEAKER_MODE_STEREO; }; - virtual void lock(){}; - virtual void unlock(){}; - virtual void finish(){}; + GDCLASS(DebuggerEditorPlugin, EditorPlugin); - virtual float get_latency() { return 0; }; +public: + virtual String get_name() const { return "Debugger"; } + bool has_main_screen() const { return false; } - AudioDriverDummy(){}; - ~AudioDriverDummy(){}; + DebuggerEditorPlugin(EditorNode *p_node); + ~DebuggerEditorPlugin(); }; -#endif // AUDIO_DRIVER_DUMMY_H +#endif // DEBUGGER_EDITOR_PLUGIN_H diff --git a/editor/plugins/gi_probe_editor_plugin.cpp b/editor/plugins/gi_probe_editor_plugin.cpp index fe2c0d33b7..9231d38a02 100644 --- a/editor/plugins/gi_probe_editor_plugin.cpp +++ b/editor/plugins/gi_probe_editor_plugin.cpp @@ -147,7 +147,7 @@ GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { bake = memnew(ToolButton); bake->set_icon(editor->get_gui_base()->get_icon("Bake", "EditorIcons")); bake->set_text(TTR("Bake GI Probe")); - bake->connect("pressed", this, "_bake"); + bake->connect_compat("pressed", this, "_bake"); bake_hb->add_child(bake); bake_info = memnew(Label); bake_info->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -159,7 +159,7 @@ GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { probe_file = memnew(EditorFileDialog); probe_file->set_mode(EditorFileDialog::MODE_SAVE_FILE); probe_file->add_filter("*.res"); - probe_file->connect("file_selected", this, "_giprobe_save_path_and_bake"); + probe_file->connect_compat("file_selected", this, "_giprobe_save_path_and_bake"); get_editor_interface()->get_base_control()->add_child(probe_file); probe_file->set_title(TTR("Select path for GIProbe Data File")); diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index 0a3a994eb7..b36782ee14 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -69,8 +69,8 @@ void GradientEditor::_bind_methods() { void GradientEditor::set_gradient(const Ref<Gradient> &p_gradient) { gradient = p_gradient; - connect("ramp_changed", this, "_ramp_changed"); - gradient->connect("changed", this, "_gradient_changed"); + connect_compat("ramp_changed", this, "_ramp_changed"); + gradient->connect_compat("changed", this, "_gradient_changed"); set_points(gradient->get_points()); } diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp index b7dfe97081..b872a2d932 100644 --- a/editor/plugins/item_list_editor_plugin.cpp +++ b/editor/plugins/item_list_editor_plugin.cpp @@ -268,7 +268,7 @@ void ItemListEditor::_notification(int p_notification) { del_button->set_icon(get_icon("Remove", "EditorIcons")); } else if (p_notification == NOTIFICATION_READY) { - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); } } @@ -359,7 +359,7 @@ ItemListEditor::ItemListEditor() { toolbar_button = memnew(ToolButton); toolbar_button->set_text(TTR("Items")); add_child(toolbar_button); - toolbar_button->connect("pressed", this, "_edit_items"); + toolbar_button->connect_compat("pressed", this, "_edit_items"); dialog = memnew(AcceptDialog); dialog->set_title(TTR("Item List Editor")); @@ -376,14 +376,14 @@ ItemListEditor::ItemListEditor() { add_button = memnew(Button); add_button->set_text(TTR("Add")); hbc->add_child(add_button); - add_button->connect("pressed", this, "_add_button"); + add_button->connect_compat("pressed", this, "_add_button"); hbc->add_spacer(); del_button = memnew(Button); del_button->set_text(TTR("Delete")); hbc->add_child(del_button); - del_button->connect("pressed", this, "_delete_button"); + del_button->connect_compat("pressed", this, "_delete_button"); property_editor = memnew(EditorInspector); vbc->add_child(property_editor); diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 4e44082853..bca0bde441 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -171,13 +171,13 @@ MaterialEditor::MaterialEditor() { sphere_switch->set_toggle_mode(true); sphere_switch->set_pressed(true); vb_shape->add_child(sphere_switch); - sphere_switch->connect("pressed", this, "_button_pressed", varray(sphere_switch)); + sphere_switch->connect_compat("pressed", this, "_button_pressed", varray(sphere_switch)); box_switch = memnew(TextureButton); box_switch->set_toggle_mode(true); box_switch->set_pressed(false); vb_shape->add_child(box_switch); - box_switch->connect("pressed", this, "_button_pressed", varray(box_switch)); + box_switch->connect_compat("pressed", this, "_button_pressed", varray(box_switch)); hb->add_spacer(); @@ -187,12 +187,12 @@ MaterialEditor::MaterialEditor() { light_1_switch = memnew(TextureButton); light_1_switch->set_toggle_mode(true); vb_light->add_child(light_1_switch); - light_1_switch->connect("pressed", this, "_button_pressed", varray(light_1_switch)); + light_1_switch->connect_compat("pressed", this, "_button_pressed", varray(light_1_switch)); light_2_switch = memnew(TextureButton); light_2_switch->set_toggle_mode(true); vb_light->add_child(light_2_switch); - light_2_switch->connect("pressed", this, "_button_pressed", varray(light_2_switch)); + light_2_switch->connect_compat("pressed", this, "_button_pressed", varray(light_2_switch)); first_enter = true; } diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index d06e5b6349..2b25a2328c 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -157,12 +157,12 @@ MeshEditor::MeshEditor() { light_1_switch = memnew(TextureButton); light_1_switch->set_toggle_mode(true); vb_light->add_child(light_1_switch); - light_1_switch->connect("pressed", this, "_button_pressed", varray(light_1_switch)); + light_1_switch->connect_compat("pressed", this, "_button_pressed", varray(light_1_switch)); light_2_switch = memnew(TextureButton); light_2_switch->set_toggle_mode(true); vb_light->add_child(light_2_switch); - light_2_switch->connect("pressed", this, "_button_pressed", varray(light_2_switch)); + light_2_switch->connect_compat("pressed", this, "_button_pressed", varray(light_2_switch)); first_enter = true; diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp index 574646956e..37cf16de58 100644 --- a/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_editor_plugin.cpp @@ -455,7 +455,7 @@ MeshInstanceEditor::MeshInstanceEditor() { options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Create Trimesh Collision Sibling"), MENU_OPTION_CREATE_TRIMESH_COLLISION_SHAPE); options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a polygon-based collision shape.\nThis is the most accurate (but slowest) option for collision detection.")); - options->get_popup()->add_item(TTR("Create Single Convex Collision Siblings"), MENU_OPTION_CREATE_SINGLE_CONVEX_COLLISION_SHAPE); + options->get_popup()->add_item(TTR("Create Single Convex Collision Sibling"), MENU_OPTION_CREATE_SINGLE_CONVEX_COLLISION_SHAPE); options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a single convex collision shape.\nThis is the fastest (but least accurate) option for collision detection.")); options->get_popup()->add_item(TTR("Create Multiple Convex Collision Siblings"), MENU_OPTION_CREATE_MULTIPLE_CONVEX_COLLISION_SHAPES); options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a polygon-based collision shape.\nThis is a performance middle-ground between the two above options.")); @@ -469,7 +469,7 @@ MeshInstanceEditor::MeshInstanceEditor() { options->get_popup()->add_item(TTR("View UV2"), MENU_OPTION_DEBUG_UV2); options->get_popup()->add_item(TTR("Unwrap UV2 for Lightmap/AO"), MENU_OPTION_CREATE_UV2); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); outline_dialog = memnew(ConfirmationDialog); outline_dialog->set_title(TTR("Create Outline Mesh")); @@ -487,7 +487,7 @@ MeshInstanceEditor::MeshInstanceEditor() { outline_dialog_vbc->add_margin_child(TTR("Outline Size:"), outline_size); add_child(outline_dialog); - outline_dialog->connect("confirmed", this, "_create_outline_mesh"); + outline_dialog->connect_compat("confirmed", this, "_create_outline_mesh"); err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -497,7 +497,7 @@ MeshInstanceEditor::MeshInstanceEditor() { add_child(debug_uv_dialog); debug_uv = memnew(Control); debug_uv->set_custom_minimum_size(Size2(600, 600) * EDSCALE); - debug_uv->connect("draw", this, "_debug_uv_draw"); + debug_uv->connect_compat("draw", this, "_debug_uv_draw"); debug_uv_dialog->add_child(debug_uv); } diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index b77cb6453f..ea8842a56f 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -268,7 +268,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { file->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper()); } add_child(file); - file->connect("file_selected", this, "_import_scene_cbk"); + file->connect_compat("file_selected", this, "_import_scene_cbk"); menu = memnew(MenuButton); SpatialEditor::get_singleton()->add_control_to_menu_panel(menu); @@ -281,13 +281,13 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { menu->get_popup()->add_item(TTR("Import from Scene"), MENU_OPTION_IMPORT_FROM_SCENE); menu->get_popup()->add_item(TTR("Update from Scene"), MENU_OPTION_UPDATE_FROM_SCENE); menu->get_popup()->set_item_disabled(menu->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE), true); - menu->get_popup()->connect("id_pressed", this, "_menu_cbk"); + menu->get_popup()->connect_compat("id_pressed", this, "_menu_cbk"); menu->hide(); editor = p_editor; cd = memnew(ConfirmationDialog); add_child(cd); - cd->get_ok()->connect("pressed", this, "_menu_confirm"); + cd->get_ok()->connect_compat("pressed", this, "_menu_confirm"); } void MeshLibraryEditorPlugin::edit(Object *p_node) { diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index 4b7fd6399b..b2ce01b8d8 100644 --- a/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp @@ -295,7 +295,7 @@ MultiMeshEditor::MultiMeshEditor() { options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MultiMeshInstance", "EditorIcons")); options->get_popup()->add_item(TTR("Populate Surface")); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); populate_dialog = memnew(ConfirmationDialog); populate_dialog->set_title(TTR("Populate MultiMesh")); @@ -313,7 +313,7 @@ MultiMeshEditor::MultiMeshEditor() { Button *b = memnew(Button); hbc->add_child(b); b->set_text(".."); - b->connect("pressed", this, "_browse", make_binds(false)); + b->connect_compat("pressed", this, "_browse", make_binds(false)); vbc->add_margin_child(TTR("Target Surface:"), hbc); @@ -325,7 +325,7 @@ MultiMeshEditor::MultiMeshEditor() { hbc->add_child(b); b->set_text(".."); vbc->add_margin_child(TTR("Source Mesh:"), hbc); - b->connect("pressed", this, "_browse", make_binds(true)); + b->connect_compat("pressed", this, "_browse", make_binds(true)); populate_axis = memnew(OptionButton); populate_axis->add_item(TTR("X-Axis")); @@ -371,10 +371,10 @@ MultiMeshEditor::MultiMeshEditor() { populate_dialog->get_ok()->set_text(TTR("Populate")); - populate_dialog->get_ok()->connect("pressed", this, "_populate"); + populate_dialog->get_ok()->connect_compat("pressed", this, "_populate"); std = memnew(SceneTreeDialog); populate_dialog->add_child(std); - std->connect("selected", this, "_browsed"); + std->connect_compat("selected", this, "_browsed"); _last_pp_node = NULL; diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp index 2e149a0f65..ab23cb9054 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/particles_2d_editor_plugin.cpp @@ -349,9 +349,9 @@ void Particles2DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - menu->get_popup()->connect("id_pressed", this, "_menu_callback"); + menu->get_popup()->connect_compat("id_pressed", this, "_menu_callback"); menu->set_icon(menu->get_popup()->get_icon("Particles2D", "EditorIcons")); - file->connect("file_selected", this, "_file_selected"); + file->connect_compat("file_selected", this, "_file_selected"); } } @@ -416,7 +416,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(generate_visibility_rect); - generate_visibility_rect->connect("confirmed", this, "_generate_visibility_rect"); + generate_visibility_rect->connect_compat("confirmed", this, "_generate_visibility_rect"); emission_mask = memnew(ConfirmationDialog); emission_mask->set_title(TTR("Load Emission Mask")); @@ -433,7 +433,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(emission_mask); - emission_mask->connect("confirmed", this, "_generate_emission_mask"); + emission_mask->connect_compat("confirmed", this, "_generate_emission_mask"); } Particles2DEditorPlugin::~Particles2DEditorPlugin() { diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index 940874846f..7020abc301 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -229,25 +229,11 @@ ParticlesEditorBase::ParticlesEditorBase() { emd_vb->add_margin_child(TTR("Emission Source: "), emission_fill); emission_dialog->get_ok()->set_text(TTR("Create")); - emission_dialog->connect("confirmed", this, "_generate_emission_points"); + emission_dialog->connect_compat("confirmed", this, "_generate_emission_points"); - emission_file_dialog = memnew(EditorFileDialog); - add_child(emission_file_dialog); - emission_file_dialog->connect("file_selected", this, "_resource_seleted"); emission_tree_dialog = memnew(SceneTreeDialog); add_child(emission_tree_dialog); - emission_tree_dialog->connect("selected", this, "_node_selected"); - - List<String> extensions; - ResourceLoader::get_recognized_extensions_for_type("Mesh", &extensions); - - emission_file_dialog->clear_filters(); - for (int i = 0; i < extensions.size(); i++) { - - emission_file_dialog->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper()); - } - - emission_file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); + emission_tree_dialog->connect_compat("selected", this, "_node_selected"); } void ParticlesEditor::_node_removed(Node *p_node) { @@ -262,7 +248,7 @@ void ParticlesEditor::_notification(int p_notification) { if (p_notification == NOTIFICATION_ENTER_TREE) { options->set_icon(options->get_popup()->get_icon("Particles", "EditorIcons")); - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); } } @@ -279,17 +265,6 @@ void ParticlesEditor::_menu_option(int p_option) { generate_seconds->set_value(trunc(gen_time) + 1.0); generate_aabb->popup_centered_minsize(); } break; - case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH: { - - Ref<ParticlesMaterial> material = node->get_process_material(); - if (material.is_null()) { - EditorNode::get_singleton()->show_warning(TTR("A processor material of type 'ParticlesMaterial' is required.")); - return; - } - emission_file_dialog->popup_centered_ratio(); - - } break; - case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: { Ref<ParticlesMaterial> material = node->get_process_material(); if (material.is_null()) { @@ -467,14 +442,13 @@ ParticlesEditor::ParticlesEditor() { options->set_text(TTR("Particles")); options->get_popup()->add_item(TTR("Generate AABB"), MENU_OPTION_GENERATE_AABB); options->get_popup()->add_separator(); - options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH); options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); generate_aabb = memnew(ConfirmationDialog); generate_aabb->set_title(TTR("Generate Visibility AABB")); @@ -488,7 +462,7 @@ ParticlesEditor::ParticlesEditor() { add_child(generate_aabb); - generate_aabb->connect("confirmed", this, "_generate_aabb"); + generate_aabb->connect_compat("confirmed", this, "_generate_aabb"); } void ParticlesEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h index 5419b7d3d5..fb5ce17560 100644 --- a/editor/plugins/particles_editor_plugin.h +++ b/editor/plugins/particles_editor_plugin.h @@ -46,7 +46,6 @@ protected: MenuButton *options; HBoxContainer *particles_editor_hb; - EditorFileDialog *emission_file_dialog; SceneTreeDialog *emission_tree_dialog; ConfirmationDialog *emission_dialog; @@ -77,7 +76,6 @@ class ParticlesEditor : public ParticlesEditorBase { MENU_OPTION_GENERATE_AABB, MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE, - MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH, MENU_OPTION_CLEAR_EMISSION_VOLUME, MENU_OPTION_CONVERT_TO_CPU_PARTICLES, MENU_OPTION_RESTART, diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 383dada590..e642233c64 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -441,14 +441,14 @@ void Path2DEditor::edit(Node *p_path2d) { if (p_path2d) { node = Object::cast_to<Path2D>(p_path2d); - if (!node->is_connected("visibility_changed", this, "_node_visibility_changed")) - node->connect("visibility_changed", this, "_node_visibility_changed"); + if (!node->is_connected_compat("visibility_changed", this, "_node_visibility_changed")) + node->connect_compat("visibility_changed", this, "_node_visibility_changed"); } else { // node may have been deleted at this point - if (node && node->is_connected("visibility_changed", this, "_node_visibility_changed")) - node->disconnect("visibility_changed", this, "_node_visibility_changed"); + if (node && node->is_connected_compat("visibility_changed", this, "_node_visibility_changed")) + node->disconnect_compat("visibility_changed", this, "_node_visibility_changed"); node = NULL; } } @@ -555,34 +555,34 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { curve_edit->set_toggle_mode(true); curve_edit->set_focus_mode(Control::FOCUS_NONE); curve_edit->set_tooltip(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Click: Add Point") + "\n" + TTR("Left Click: Split Segment (in curve)") + "\n" + TTR("Right Click: Delete Point")); - curve_edit->connect("pressed", this, "_mode_selected", varray(MODE_EDIT)); + curve_edit->connect_compat("pressed", this, "_mode_selected", varray(MODE_EDIT)); base_hb->add_child(curve_edit); curve_edit_curve = memnew(ToolButton); curve_edit_curve->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCurve", "EditorIcons")); curve_edit_curve->set_toggle_mode(true); curve_edit_curve->set_focus_mode(Control::FOCUS_NONE); curve_edit_curve->set_tooltip(TTR("Select Control Points (Shift+Drag)")); - curve_edit_curve->connect("pressed", this, "_mode_selected", varray(MODE_EDIT_CURVE)); + curve_edit_curve->connect_compat("pressed", this, "_mode_selected", varray(MODE_EDIT_CURVE)); base_hb->add_child(curve_edit_curve); curve_create = memnew(ToolButton); curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate", "EditorIcons")); curve_create->set_toggle_mode(true); curve_create->set_focus_mode(Control::FOCUS_NONE); curve_create->set_tooltip(TTR("Add Point (in empty space)")); - curve_create->connect("pressed", this, "_mode_selected", varray(MODE_CREATE)); + curve_create->connect_compat("pressed", this, "_mode_selected", varray(MODE_CREATE)); base_hb->add_child(curve_create); curve_del = memnew(ToolButton); curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons")); curve_del->set_toggle_mode(true); curve_del->set_focus_mode(Control::FOCUS_NONE); curve_del->set_tooltip(TTR("Delete Point")); - curve_del->connect("pressed", this, "_mode_selected", varray(MODE_DELETE)); + curve_del->connect_compat("pressed", this, "_mode_selected", varray(MODE_DELETE)); base_hb->add_child(curve_del); curve_close = memnew(ToolButton); curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveClose", "EditorIcons")); curve_close->set_focus_mode(Control::FOCUS_NONE); curve_close->set_tooltip(TTR("Close Curve")); - curve_close->connect("pressed", this, "_mode_selected", varray(ACTION_CLOSE)); + curve_close->connect_compat("pressed", this, "_mode_selected", varray(ACTION_CLOSE)); base_hb->add_child(curve_close); PopupMenu *menu; @@ -596,7 +596,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { menu->set_item_checked(HANDLE_OPTION_ANGLE, mirror_handle_angle); menu->add_check_item(TTR("Mirror Handle Lengths")); menu->set_item_checked(HANDLE_OPTION_LENGTH, mirror_handle_length); - menu->connect("id_pressed", this, "_handle_option_pressed"); + menu->connect_compat("id_pressed", this, "_handle_option_pressed"); base_hb->hide(); diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp index 75c9776f0f..b955bf7f41 100644 --- a/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_editor_plugin.cpp @@ -543,10 +543,10 @@ void PathEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - curve_create->connect("pressed", this, "_mode_changed", make_binds(0)); - curve_edit->connect("pressed", this, "_mode_changed", make_binds(1)); - curve_del->connect("pressed", this, "_mode_changed", make_binds(2)); - curve_close->connect("pressed", this, "_close_curve"); + curve_create->connect_compat("pressed", this, "_mode_changed", make_binds(0)); + curve_edit->connect_compat("pressed", this, "_mode_changed", make_binds(1)); + curve_del->connect_compat("pressed", this, "_mode_changed", make_binds(2)); + curve_close->connect_compat("pressed", this, "_close_curve"); } } @@ -614,7 +614,7 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { menu->set_item_checked(HANDLE_OPTION_ANGLE, mirror_handle_angle); menu->add_check_item(TTR("Mirror Handle Lengths")); menu->set_item_checked(HANDLE_OPTION_LENGTH, mirror_handle_length); - menu->connect("id_pressed", this, "_handle_option_pressed"); + menu->connect_compat("id_pressed", this, "_handle_option_pressed"); curve_edit->set_pressed(true); /* diff --git a/editor/plugins/physical_bone_plugin.cpp b/editor/plugins/physical_bone_plugin.cpp index 28099a927b..4b63d82961 100644 --- a/editor/plugins/physical_bone_plugin.cpp +++ b/editor/plugins/physical_bone_plugin.cpp @@ -64,7 +64,7 @@ PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) : button_transform_joint->set_text(TTR("Move Joint")); button_transform_joint->set_icon(SpatialEditor::get_singleton()->get_icon("PhysicalBone", "EditorIcons")); button_transform_joint->set_toggle_mode(true); - button_transform_joint->connect("toggled", this, "_on_toggle_button_transform_joint"); + button_transform_joint->connect_compat("toggled", this, "_on_toggle_button_transform_joint"); hide(); } diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 8b0adbafa2..91c0222f6d 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -192,7 +192,7 @@ void Polygon2DEditor::_update_bone_list() { if (np == selected || bone_scroll_vb->get_child_count() < 2) cb->set_pressed(true); - cb->connect("pressed", this, "_bone_paint_selected", varray(i)); + cb->connect_compat("pressed", this, "_bone_paint_selected", varray(i)); } uv_edit_draw->update(); @@ -1273,14 +1273,14 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : button_uv = memnew(ToolButton); add_child(button_uv); button_uv->set_tooltip(TTR("Open Polygon 2D UV editor.")); - button_uv->connect("pressed", this, "_menu_option", varray(MODE_EDIT_UV)); + button_uv->connect_compat("pressed", this, "_menu_option", varray(MODE_EDIT_UV)); uv_mode = UV_MODE_EDIT_POINT; uv_edit = memnew(AcceptDialog); add_child(uv_edit); uv_edit->set_title(TTR("Polygon 2D UV Editor")); uv_edit->set_resizable(true); - uv_edit->connect("popup_hide", this, "_uv_edit_popup_hide"); + uv_edit->connect_compat("popup_hide", this, "_uv_edit_popup_hide"); VBoxContainer *uv_main_vb = memnew(VBoxContainer); uv_edit->add_child(uv_main_vb); @@ -1312,10 +1312,10 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_edit_mode[2]->set_button_group(uv_edit_group); uv_edit_mode[3]->set_button_group(uv_edit_group); - uv_edit_mode[0]->connect("pressed", this, "_uv_edit_mode_select", varray(0)); - uv_edit_mode[1]->connect("pressed", this, "_uv_edit_mode_select", varray(1)); - uv_edit_mode[2]->connect("pressed", this, "_uv_edit_mode_select", varray(2)); - uv_edit_mode[3]->connect("pressed", this, "_uv_edit_mode_select", varray(3)); + uv_edit_mode[0]->connect_compat("pressed", this, "_uv_edit_mode_select", varray(0)); + uv_edit_mode[1]->connect_compat("pressed", this, "_uv_edit_mode_select", varray(1)); + uv_edit_mode[2]->connect_compat("pressed", this, "_uv_edit_mode_select", varray(2)); + uv_edit_mode[3]->connect_compat("pressed", this, "_uv_edit_mode_select", varray(3)); uv_mode_hb->add_child(memnew(VSeparator)); @@ -1325,7 +1325,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_button[i] = memnew(ToolButton); uv_button[i]->set_toggle_mode(true); uv_mode_hb->add_child(uv_button[i]); - uv_button[i]->connect("pressed", this, "_uv_mode", varray(i)); + uv_button[i]->connect_compat("pressed", this, "_uv_mode", varray(i)); uv_button[i]->set_focus_mode(FOCUS_NONE); } @@ -1388,7 +1388,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_menu->get_popup()->add_item(TTR("Clear UV"), UVEDIT_UV_CLEAR); uv_menu->get_popup()->add_separator(); uv_menu->get_popup()->add_item(TTR("Grid Settings"), UVEDIT_GRID_SETTINGS); - uv_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + uv_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); uv_mode_hb->add_child(memnew(VSeparator)); @@ -1399,7 +1399,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : b_snap_enable->set_toggle_mode(true); b_snap_enable->set_pressed(use_snap); b_snap_enable->set_tooltip(TTR("Enable Snap")); - b_snap_enable->connect("toggled", this, "_set_use_snap"); + b_snap_enable->connect_compat("toggled", this, "_set_use_snap"); b_snap_grid = memnew(ToolButton); uv_mode_hb->add_child(b_snap_grid); @@ -1408,7 +1408,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : b_snap_grid->set_toggle_mode(true); b_snap_grid->set_pressed(snap_show_grid); b_snap_grid->set_tooltip(TTR("Show Grid")); - b_snap_grid->connect("toggled", this, "_set_show_grid"); + b_snap_grid->connect_compat("toggled", this, "_set_show_grid"); grid_settings = memnew(AcceptDialog); grid_settings->set_title(TTR("Configure Grid:")); @@ -1422,7 +1422,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sb_off_x->set_step(1); sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); - sb_off_x->connect("value_changed", this, "_set_snap_off_x"); + sb_off_x->connect_compat("value_changed", this, "_set_snap_off_x"); grid_settings_vb->add_margin_child(TTR("Grid Offset X:"), sb_off_x); SpinBox *sb_off_y = memnew(SpinBox); @@ -1431,7 +1431,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sb_off_y->set_step(1); sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); - sb_off_y->connect("value_changed", this, "_set_snap_off_y"); + sb_off_y->connect_compat("value_changed", this, "_set_snap_off_y"); grid_settings_vb->add_margin_child(TTR("Grid Offset Y:"), sb_off_y); SpinBox *sb_step_x = memnew(SpinBox); @@ -1440,7 +1440,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sb_step_x->set_step(1); sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); - sb_step_x->connect("value_changed", this, "_set_snap_step_x"); + sb_step_x->connect_compat("value_changed", this, "_set_snap_step_x"); grid_settings_vb->add_margin_child(TTR("Grid Step X:"), sb_step_x); SpinBox *sb_step_y = memnew(SpinBox); @@ -1449,7 +1449,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sb_step_y->set_step(1); sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); - sb_step_y->connect("value_changed", this, "_set_snap_step_y"); + sb_step_y->connect_compat("value_changed", this, "_set_snap_step_y"); grid_settings_vb->add_margin_child(TTR("Grid Step Y:"), sb_step_y); uv_mode_hb->add_child(memnew(VSeparator)); @@ -1469,16 +1469,16 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_zoom->share(uv_zoom_value); uv_zoom_value->set_custom_minimum_size(Size2(50, 0)); uv_mode_hb->add_child(uv_zoom_value); - uv_zoom->connect("value_changed", this, "_uv_scroll_changed"); + uv_zoom->connect_compat("value_changed", this, "_uv_scroll_changed"); uv_vscroll = memnew(VScrollBar); uv_vscroll->set_step(0.001); uv_edit_draw->add_child(uv_vscroll); - uv_vscroll->connect("value_changed", this, "_uv_scroll_changed"); + uv_vscroll->connect_compat("value_changed", this, "_uv_scroll_changed"); uv_hscroll = memnew(HScrollBar); uv_hscroll->set_step(0.001); uv_edit_draw->add_child(uv_hscroll); - uv_hscroll->connect("value_changed", this, "_uv_scroll_changed"); + uv_hscroll->connect_compat("value_changed", this, "_uv_scroll_changed"); bone_scroll_main_vb = memnew(VBoxContainer); bone_scroll_main_vb->hide(); @@ -1486,7 +1486,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sync_bones = memnew(Button(TTR("Sync Bones to Polygon"))); bone_scroll_main_vb->add_child(sync_bones); sync_bones->set_h_size_flags(0); - sync_bones->connect("pressed", this, "_sync_bones"); + sync_bones->connect_compat("pressed", this, "_sync_bones"); uv_main_hsc->add_child(bone_scroll_main_vb); bone_scroll = memnew(ScrollContainer); bone_scroll->set_v_scroll(true); @@ -1496,8 +1496,8 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : bone_scroll_vb = memnew(VBoxContainer); bone_scroll->add_child(bone_scroll_vb); - uv_edit_draw->connect("draw", this, "_uv_draw"); - uv_edit_draw->connect("gui_input", this, "_uv_input"); + uv_edit_draw->connect_compat("draw", this, "_uv_draw"); + uv_edit_draw->connect_compat("gui_input", this, "_uv_input"); uv_draw_zoom = 1.0; point_drag_index = -1; uv_drag = false; diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index fb04f50827..12b8ac9008 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -382,7 +382,7 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() { add_child(file); tree = memnew(Tree); - tree->connect("button_pressed", this, "_cell_button_pressed"); + tree->connect_compat("button_pressed", this, "_cell_button_pressed"); tree->set_columns(2); tree->set_column_min_width(0, 2); tree->set_column_min_width(1, 3); @@ -396,10 +396,10 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() { dialog = memnew(AcceptDialog); add_child(dialog); - load->connect("pressed", this, "_load_pressed"); - paste->connect("pressed", this, "_paste_pressed"); - file->connect("files_selected", this, "_files_load_request"); - tree->connect("item_edited", this, "_item_edited"); + load->connect_compat("pressed", this, "_load_pressed"); + paste->connect_compat("pressed", this, "_paste_pressed"); + file->connect_compat("files_selected", this, "_files_load_request"); + tree->connect_compat("item_edited", this, "_item_edited"); loading_scene = false; } diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp index 1349de5d8e..132ec40dd2 100644 --- a/editor/plugins/root_motion_editor_plugin.cpp +++ b/editor/plugins/root_motion_editor_plugin.cpp @@ -262,24 +262,24 @@ EditorPropertyRootMotion::EditorPropertyRootMotion() { assign->set_flat(true); assign->set_h_size_flags(SIZE_EXPAND_FILL); assign->set_clip_text(true); - assign->connect("pressed", this, "_node_assign"); + assign->connect_compat("pressed", this, "_node_assign"); hbc->add_child(assign); clear = memnew(Button); clear->set_flat(true); - clear->connect("pressed", this, "_node_clear"); + clear->connect_compat("pressed", this, "_node_clear"); hbc->add_child(clear); filter_dialog = memnew(ConfirmationDialog); add_child(filter_dialog); filter_dialog->set_title(TTR("Edit Filtered Tracks:")); - filter_dialog->connect("confirmed", this, "_confirmed"); + filter_dialog->connect_compat("confirmed", this, "_confirmed"); filters = memnew(Tree); filter_dialog->add_child(filters); filters->set_v_size_flags(SIZE_EXPAND_FILL); filters->set_hide_root(true); - filters->connect("item_activated", this, "_confirmed"); + filters->connect_compat("item_activated", this, "_confirmed"); //filters->connect("item_edited", this, "_filter_edited"); } ////////////////////////// diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 6b0056edd1..127b98c15b 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -36,6 +36,8 @@ #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/project_settings.h" +#include "editor/debugger/editor_debugger_node.h" +#include "editor/debugger/script_editor_debugger.h" #include "editor/editor_node.h" #include "editor/editor_run_script.h" #include "editor/editor_scale.h" @@ -44,7 +46,6 @@ #include "editor/find_in_files.h" #include "editor/node_dock.h" #include "editor/plugins/shader_editor_plugin.h" -#include "editor/script_editor_debugger.h" #include "scene/main/viewport.h" #include "scene/scene_string_names.h" #include "script_text_editor.h" @@ -210,16 +211,16 @@ void ScriptEditorQuickOpen::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_confirmed"); + connect_compat("confirmed", this, "_confirmed"); search_box->set_clear_button_enabled(true); - FALLTHROUGH; + [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { search_box->set_right_icon(get_icon("Search", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", this, "_confirmed"); + disconnect_compat("confirmed", this, "_confirmed"); } break; } } @@ -239,15 +240,15 @@ ScriptEditorQuickOpen::ScriptEditorQuickOpen() { add_child(vbc); search_box = memnew(LineEdit); vbc->add_margin_child(TTR("Search:"), search_box); - search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("gui_input", this, "_sbox_input"); + search_box->connect_compat("text_changed", this, "_text_changed"); + search_box->connect_compat("gui_input", this, "_sbox_input"); search_options = memnew(Tree); vbc->add_margin_child(TTR("Matches:"), search_options, true); get_ok()->set_text(TTR("Open")); get_ok()->set_disabled(true); register_text_enter(search_box); set_hide_on_ok(false); - search_options->connect("item_activated", this, "_confirmed"); + search_options->connect_compat("item_activated", this, "_confirmed"); search_options->set_hide_root(true); search_options->set_hide_folding(true); search_options->add_constant_override("draw_guides", 1); @@ -261,7 +262,7 @@ ScriptEditor *ScriptEditor::script_editor = NULL; String ScriptEditor::_get_debug_tooltip(const String &p_text, Node *_se) { - String val = debugger->get_var_value(p_text); + String val = EditorDebuggerNode::get_singleton()->get_var_value(p_text); if (val != String()) { return p_text + ": " + val; } else { @@ -276,11 +277,6 @@ void ScriptEditor::_breaked(bool p_breaked, bool p_can_debug) { return; } - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_NEXT), !(p_breaked && p_can_debug)); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_STEP), !(p_breaked && p_can_debug)); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_BREAK), p_breaked); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_CONTINUE), !p_breaked); - for (int i = 0; i < tab_container->get_child_count(); i++) { ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_child(i)); @@ -292,11 +288,6 @@ void ScriptEditor::_breaked(bool p_breaked, bool p_can_debug) { } } -void ScriptEditor::_show_debugger(bool p_show) { - - //debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), p_show); -} - void ScriptEditor::_script_created(Ref<Script> p_script) { editor->push_item(p_script.operator->()); } @@ -843,7 +834,7 @@ void ScriptEditor::_res_saved_callback(const Ref<Resource> &p_res) { void ScriptEditor::_live_auto_reload_running_scripts() { pending_auto_reload = false; - debugger->reload_scripts(); + EditorDebuggerNode::get_singleton()->reload_scripts(); } bool ScriptEditor::_test_script_times_on_disk(RES p_for_script) { @@ -909,7 +900,7 @@ void ScriptEditor::_file_dialog_action(String p_file) { } file->close(); memdelete(file); - FALLTHROUGH; + [[fallthrough]]; } case FILE_OPEN: { @@ -1123,27 +1114,6 @@ void ScriptEditor::_menu_option(int p_option) { _sort_list_on_update = true; _update_script_names(); } break; - case DEBUG_SHOW: { - if (debugger) { - bool visible = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_SHOW)); - debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_SHOW), !visible); - if (visible) - debugger->hide(); - else - debugger->show(); - } - } break; - case DEBUG_SHOW_KEEP_OPEN: { - bool visible = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_SHOW_KEEP_OPEN)); - if (debugger) - debugger->set_hide_on_stop(visible); - debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_SHOW_KEEP_OPEN), !visible); - } break; - case DEBUG_WITH_EXTERNAL_EDITOR: { - bool debug_with_external_editor = !debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR)); - debugger->set_debug_with_external_editor(debug_with_external_editor); - debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR), debug_with_external_editor); - } break; case TOGGLE_SCRIPTS_PANEL: { if (current) { ScriptTextEditor *editor = Object::cast_to<ScriptTextEditor>(current); @@ -1294,29 +1264,6 @@ void ScriptEditor::_menu_option(int p_option) { case CLOSE_ALL: { _close_all_tabs(); } break; - case DEBUG_NEXT: { - - if (debugger) - debugger->debug_next(); - } break; - case DEBUG_STEP: { - - if (debugger) - debugger->debug_step(); - - } break; - case DEBUG_BREAK: { - - if (debugger) - debugger->debug_break(); - - } break; - case DEBUG_CONTINUE: { - - if (debugger) - debugger->debug_continue(); - - } break; case WINDOW_MOVE_UP: { if (tab_container->get_current_tab() > 0) { @@ -1439,19 +1386,17 @@ void ScriptEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - editor->connect("play_pressed", this, "_editor_play"); - editor->connect("pause_pressed", this, "_editor_pause"); - editor->connect("stop_pressed", this, "_editor_stop"); - editor->connect("script_add_function_request", this, "_add_callback"); - editor->connect("resource_saved", this, "_res_saved_callback"); - script_list->connect("item_selected", this, "_script_selected"); + editor->connect_compat("stop_pressed", this, "_editor_stop"); + editor->connect_compat("script_add_function_request", this, "_add_callback"); + editor->connect_compat("resource_saved", this, "_res_saved_callback"); + script_list->connect_compat("item_selected", this, "_script_selected"); - members_overview->connect("item_selected", this, "_members_overview_selected"); - help_overview->connect("item_selected", this, "_help_overview_selected"); - script_split->connect("dragged", this, "_script_split_dragged"); + members_overview->connect_compat("item_selected", this, "_members_overview_selected"); + help_overview->connect_compat("item_selected", this, "_help_overview_selected"); + script_split->connect_compat("dragged", this, "_script_split_dragged"); - EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); - FALLTHROUGH; + EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_editor_settings_changed"); + [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { @@ -1474,16 +1419,14 @@ void ScriptEditor::_notification(int p_what) { case NOTIFICATION_READY: { - get_tree()->connect("tree_changed", this, "_tree_changed"); - editor->get_inspector_dock()->connect("request_help", this, "_request_help"); - editor->connect("request_help_search", this, "_help_search"); + get_tree()->connect_compat("tree_changed", this, "_tree_changed"); + editor->get_inspector_dock()->connect_compat("request_help", this, "_request_help"); + editor->connect_compat("request_help_search", this, "_help_search"); } break; case NOTIFICATION_EXIT_TREE: { - editor->disconnect("play_pressed", this, "_editor_play"); - editor->disconnect("pause_pressed", this, "_editor_pause"); - editor->disconnect("stop_pressed", this, "_editor_stop"); + editor->disconnect_compat("stop_pressed", this, "_editor_stop"); } break; case MainLoop::NOTIFICATION_WM_FOCUS_IN: { @@ -2062,7 +2005,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra return false; } - if ((debugger->get_dump_stack_script() != p_resource || debugger->get_debug_with_external_editor()) && + if ((EditorDebuggerNode::get_singleton()->get_dump_stack_script() != p_resource || EditorDebuggerNode::get_singleton()->get_debug_with_external_editor()) && p_resource->get_path().is_resource_file() && p_resource->get_class_name() != StringName("VisualScript") && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) { @@ -2194,14 +2137,14 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra _sort_list_on_update = true; _update_script_names(); _save_layout(); - se->connect("name_changed", this, "_update_script_names"); - se->connect("edited_script_changed", this, "_script_changed"); - se->connect("request_help", this, "_help_search"); - se->connect("request_open_script_at_line", this, "_goto_script_line"); - se->connect("go_to_help", this, "_help_class_goto"); - se->connect("request_save_history", this, "_save_history"); - se->connect("search_in_files_requested", this, "_on_find_in_files_requested"); - se->connect("replace_in_files_requested", this, "_on_replace_in_files_requested"); + se->connect_compat("name_changed", this, "_update_script_names"); + se->connect_compat("edited_script_changed", this, "_script_changed"); + se->connect_compat("request_help", this, "_help_search"); + se->connect_compat("request_open_script_at_line", this, "_goto_script_line"); + se->connect_compat("go_to_help", this, "_help_class_goto"); + se->connect_compat("request_save_history", this, "_save_history"); + se->connect_compat("search_in_files_requested", this, "_on_find_in_files_requested"); + se->connect_compat("replace_in_files_requested", this, "_on_replace_in_files_requested"); //test for modification, maybe the script was not edited but was loaded @@ -2277,26 +2220,7 @@ void ScriptEditor::open_script_create_dialog(const String &p_base_name, const St script_create_dialog->config(p_base_name, p_base_path); } -void ScriptEditor::_editor_play() { - - debugger->start(); - debug_menu->get_popup()->grab_focus(); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_STEP), true); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_BREAK), false); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_CONTINUE), true); -} - -void ScriptEditor::_editor_pause() { -} void ScriptEditor::_editor_stop() { - - debugger->stop(); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_STEP), true); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_BREAK), true); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_CONTINUE), true); - for (int i = 0; i < tab_container->get_child_count(); i++) { ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_child(i)); @@ -2813,7 +2737,7 @@ void ScriptEditor::_help_class_open(const String &p_class) { tab_container->add_child(eh); _go_to_tab(tab_container->get_tab_count() - 1); eh->go_to_class(p_class, 0); - eh->connect("go_to_help", this, "_help_class_goto"); + eh->connect_compat("go_to_help", this, "_help_class_goto"); _add_recent_script(p_class); _sort_list_on_update = true; _update_script_names(); @@ -2843,7 +2767,7 @@ void ScriptEditor::_help_class_goto(const String &p_desc) { tab_container->add_child(eh); _go_to_tab(tab_container->get_tab_count() - 1); eh->go_to_help(p_desc); - eh->connect("go_to_help", this, "_help_class_goto"); + eh->connect_compat("go_to_help", this, "_help_class_goto"); _add_recent_script(eh->get_class()); _sort_list_on_update = true; _update_script_names(); @@ -3125,8 +3049,6 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method("_close_other_tabs", &ScriptEditor::_close_other_tabs); ClassDB::bind_method("_open_recent_script", &ScriptEditor::_open_recent_script); ClassDB::bind_method("_theme_option", &ScriptEditor::_theme_option); - ClassDB::bind_method("_editor_play", &ScriptEditor::_editor_play); - ClassDB::bind_method("_editor_pause", &ScriptEditor::_editor_pause); ClassDB::bind_method("_editor_stop", &ScriptEditor::_editor_stop); ClassDB::bind_method("_add_callback", &ScriptEditor::_add_callback); ClassDB::bind_method("_reload_scripts", &ScriptEditor::_reload_scripts); @@ -3141,7 +3063,6 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method("_copy_script_path", &ScriptEditor::_copy_script_path); ClassDB::bind_method("_breaked", &ScriptEditor::_breaked); - ClassDB::bind_method("_show_debugger", &ScriptEditor::_show_debugger); ClassDB::bind_method("_get_debug_tooltip", &ScriptEditor::_get_debug_tooltip); ClassDB::bind_method("_autosave_scripts", &ScriptEditor::_autosave_scripts); ClassDB::bind_method("_update_autosave_timer", &ScriptEditor::_update_autosave_timer); @@ -3221,7 +3142,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { filter_scripts = memnew(LineEdit); filter_scripts->set_placeholder(TTR("Filter scripts")); filter_scripts->set_clear_button_enabled(true); - filter_scripts->connect("text_changed", this, "_filter_scripts_text_changed"); + filter_scripts->connect_compat("text_changed", this, "_filter_scripts_text_changed"); scripts_vbox->add_child(filter_scripts); script_list = memnew(ItemList); @@ -3230,13 +3151,13 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_list->set_v_size_flags(SIZE_EXPAND_FILL); script_split->set_split_offset(70 * EDSCALE); _sort_list_on_update = true; - script_list->connect("gui_input", this, "_script_list_gui_input", varray(), CONNECT_DEFERRED); + script_list->connect_compat("gui_input", this, "_script_list_gui_input", varray(), CONNECT_DEFERRED); script_list->set_allow_rmb_select(true); script_list->set_drag_forwarding(this); context_menu = memnew(PopupMenu); add_child(context_menu); - context_menu->connect("id_pressed", this, "_menu_option"); + context_menu->connect_compat("id_pressed", this, "_menu_option"); context_menu->set_hide_on_window_lose_focus(true); overview_vbox = memnew(VBoxContainer); @@ -3257,14 +3178,14 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { members_overview_alphabeta_sort_button->set_tooltip(TTR("Toggle alphabetical sorting of the method list.")); members_overview_alphabeta_sort_button->set_toggle_mode(true); members_overview_alphabeta_sort_button->set_pressed(EditorSettings::get_singleton()->get("text_editor/tools/sort_members_outline_alphabetically")); - members_overview_alphabeta_sort_button->connect("toggled", this, "_toggle_members_overview_alpha_sort"); + members_overview_alphabeta_sort_button->connect_compat("toggled", this, "_toggle_members_overview_alpha_sort"); buttons_hbox->add_child(members_overview_alphabeta_sort_button); filter_methods = memnew(LineEdit); filter_methods->set_placeholder(TTR("Filter methods")); filter_methods->set_clear_button_enabled(true); - filter_methods->connect("text_changed", this, "_filter_methods_text_changed"); + filter_methods->connect_compat("text_changed", this, "_filter_methods_text_changed"); overview_vbox->add_child(filter_methods); members_overview = memnew(ItemList); @@ -3308,7 +3229,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { recent_scripts = memnew(PopupMenu); recent_scripts->set_name("RecentScripts"); file_menu->get_popup()->add_child(recent_scripts); - recent_scripts->connect("id_pressed", this, "_open_recent_script"); + recent_scripts->connect_compat("id_pressed", this, "_open_recent_script"); _update_recent_scripts(); file_menu->get_popup()->add_separator(); @@ -3330,7 +3251,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { theme_submenu = memnew(PopupMenu); theme_submenu->set_name("Theme"); file_menu->get_popup()->add_child(theme_submenu); - theme_submenu->connect("id_pressed", this, "_theme_option"); + theme_submenu->connect_compat("id_pressed", this, "_theme_option"); theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/import_theme", TTR("Import Theme...")), THEME_IMPORT); theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/reload_theme", TTR("Reload Theme")), THEME_RELOAD); @@ -3349,35 +3270,25 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH), TOGGLE_SCRIPTS_PANEL); - file_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + file_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); script_search_menu = memnew(MenuButton); menu_hb->add_child(script_search_menu); script_search_menu->set_text(TTR("Search")); script_search_menu->set_switch_on_hover(true); script_search_menu->get_popup()->set_hide_on_window_lose_focus(true); - script_search_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + script_search_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); - debug_menu = memnew(MenuButton); + MenuButton *debug_menu = memnew(MenuButton); menu_hb->add_child(debug_menu); - debug_menu->set_text(TTR("Debug")); - debug_menu->set_switch_on_hover(true); - debug_menu->get_popup()->set_hide_on_window_lose_focus(true); - debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/step_into", TTR("Step Into"), KEY_F11), DEBUG_STEP); - debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/step_over", TTR("Step Over"), KEY_F10), DEBUG_NEXT); - debug_menu->get_popup()->add_separator(); - debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/break", TTR("Break")), DEBUG_BREAK); - debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/continue", TTR("Continue"), KEY_F12), DEBUG_CONTINUE); - debug_menu->get_popup()->add_separator(); - //debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW); - debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/keep_debugger_open", TTR("Keep Debugger Open")), DEBUG_SHOW_KEEP_OPEN); - debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/debug_with_external_editor", TTR("Debug with External Editor")), DEBUG_WITH_EXTERNAL_EDITOR); - debug_menu->get_popup()->connect("id_pressed", this, "_menu_option"); - - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_STEP), true); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_BREAK), true); - debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_CONTINUE), true); + debug_menu->hide(); // Handled by EditorDebuggerNode below. + + EditorDebuggerNode *debugger = EditorDebuggerNode::get_singleton(); + debugger->set_script_debug_button(debug_menu); + debugger->connect_compat("goto_script_line", this, "_goto_script_line"); + debugger->connect_compat("set_execution", this, "_set_execution"); + debugger->connect_compat("clear_execution", this, "_clear_execution"); + debugger->connect_compat("breaked", this, "_breaked"); menu_hb->add_spacer(); @@ -3393,64 +3304,58 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { site_search = memnew(ToolButton); site_search->set_text(TTR("Online Docs")); - site_search->connect("pressed", this, "_menu_option", varray(SEARCH_WEBSITE)); + site_search->connect_compat("pressed", this, "_menu_option", varray(SEARCH_WEBSITE)); menu_hb->add_child(site_search); site_search->set_tooltip(TTR("Open Godot online documentation.")); request_docs = memnew(ToolButton); request_docs->set_text(TTR("Request Docs")); - request_docs->connect("pressed", this, "_menu_option", varray(REQUEST_DOCS)); + request_docs->connect_compat("pressed", this, "_menu_option", varray(REQUEST_DOCS)); menu_hb->add_child(request_docs); request_docs->set_tooltip(TTR("Help improve the Godot documentation by giving feedback.")); help_search = memnew(ToolButton); help_search->set_text(TTR("Search Help")); - help_search->connect("pressed", this, "_menu_option", varray(SEARCH_HELP)); + help_search->connect_compat("pressed", this, "_menu_option", varray(SEARCH_HELP)); menu_hb->add_child(help_search); help_search->set_tooltip(TTR("Search the reference documentation.")); menu_hb->add_child(memnew(VSeparator)); script_back = memnew(ToolButton); - script_back->connect("pressed", this, "_history_back"); + script_back->connect_compat("pressed", this, "_history_back"); menu_hb->add_child(script_back); script_back->set_disabled(true); script_back->set_tooltip(TTR("Go to previous edited document.")); script_forward = memnew(ToolButton); - script_forward->connect("pressed", this, "_history_forward"); + script_forward->connect_compat("pressed", this, "_history_forward"); menu_hb->add_child(script_forward); script_forward->set_disabled(true); script_forward->set_tooltip(TTR("Go to next edited document.")); - tab_container->connect("tab_changed", this, "_tab_changed"); + tab_container->connect_compat("tab_changed", this, "_tab_changed"); erase_tab_confirm = memnew(ConfirmationDialog); erase_tab_confirm->get_ok()->set_text(TTR("Save")); erase_tab_confirm->add_button(TTR("Discard"), OS::get_singleton()->get_swap_ok_cancel(), "discard"); - erase_tab_confirm->connect("confirmed", this, "_close_current_tab"); - erase_tab_confirm->connect("custom_action", this, "_close_discard_current_tab"); + erase_tab_confirm->connect_compat("confirmed", this, "_close_current_tab"); + erase_tab_confirm->connect_compat("custom_action", this, "_close_discard_current_tab"); add_child(erase_tab_confirm); script_create_dialog = memnew(ScriptCreateDialog); script_create_dialog->set_title(TTR("Create Script")); add_child(script_create_dialog); - script_create_dialog->connect("script_created", this, "_script_created"); + script_create_dialog->connect_compat("script_created", this, "_script_created"); file_dialog_option = -1; file_dialog = memnew(EditorFileDialog); add_child(file_dialog); - file_dialog->connect("file_selected", this, "_file_dialog_action"); + file_dialog->connect_compat("file_selected", this, "_file_dialog_action"); error_dialog = memnew(AcceptDialog); add_child(error_dialog); - debugger = memnew(ScriptEditorDebugger(editor)); - debugger->connect("goto_script_line", this, "_goto_script_line"); - debugger->connect("set_execution", this, "_set_execution"); - debugger->connect("clear_execution", this, "_clear_execution"); - debugger->connect("show_debugger", this, "_show_debugger"); - disk_changed = memnew(ConfirmationDialog); { VBoxContainer *vbc = memnew(VBoxContainer); @@ -3464,48 +3369,42 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { vbc->add_child(disk_changed_list); disk_changed_list->set_v_size_flags(SIZE_EXPAND_FILL); - disk_changed->connect("confirmed", this, "_reload_scripts"); + disk_changed->connect_compat("confirmed", this, "_reload_scripts"); disk_changed->get_ok()->set_text(TTR("Reload")); disk_changed->add_button(TTR("Resave"), !OS::get_singleton()->get_swap_ok_cancel(), "resave"); - disk_changed->connect("custom_action", this, "_resave_scripts"); + disk_changed->connect_compat("custom_action", this, "_resave_scripts"); } add_child(disk_changed); script_editor = this; - Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger); - debugger->set_tool_button(db); - - debugger->connect("breaked", this, "_breaked"); - autosave_timer = memnew(Timer); autosave_timer->set_one_shot(false); - autosave_timer->connect(SceneStringNames::get_singleton()->tree_entered, this, "_update_autosave_timer"); - autosave_timer->connect("timeout", this, "_autosave_scripts"); + autosave_timer->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, "_update_autosave_timer"); + autosave_timer->connect_compat("timeout", this, "_autosave_scripts"); add_child(autosave_timer); grab_focus_block = false; help_search_dialog = memnew(EditorHelpSearch); add_child(help_search_dialog); - help_search_dialog->connect("go_to_help", this, "_help_class_goto"); + help_search_dialog->connect_compat("go_to_help", this, "_help_class_goto"); find_in_files_dialog = memnew(FindInFilesDialog); - find_in_files_dialog->connect(FindInFilesDialog::SIGNAL_FIND_REQUESTED, this, "_start_find_in_files", varray(false)); - find_in_files_dialog->connect(FindInFilesDialog::SIGNAL_REPLACE_REQUESTED, this, "_start_find_in_files", varray(true)); + find_in_files_dialog->connect_compat(FindInFilesDialog::SIGNAL_FIND_REQUESTED, this, "_start_find_in_files", varray(false)); + find_in_files_dialog->connect_compat(FindInFilesDialog::SIGNAL_REPLACE_REQUESTED, this, "_start_find_in_files", varray(true)); add_child(find_in_files_dialog); find_in_files = memnew(FindInFilesPanel); find_in_files_button = editor->add_bottom_panel_item(TTR("Search Results"), find_in_files); find_in_files->set_custom_minimum_size(Size2(0, 200) * EDSCALE); - find_in_files->connect(FindInFilesPanel::SIGNAL_RESULT_SELECTED, this, "_on_find_in_files_result_selected"); - find_in_files->connect(FindInFilesPanel::SIGNAL_FILES_MODIFIED, this, "_on_find_in_files_modified_files"); + find_in_files->connect_compat(FindInFilesPanel::SIGNAL_RESULT_SELECTED, this, "_on_find_in_files_result_selected"); + find_in_files->connect_compat(FindInFilesPanel::SIGNAL_FILES_MODIFIED, this, "_on_find_in_files_modified_files"); find_in_files->hide(); find_in_files_button->hide(); history_pos = -1; - //debugger_gui->hide(); edit_pass = 0; trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/files/trim_trailing_whitespace_on_save"); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index ec84bcb461..b4b4f33fc5 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -73,7 +73,7 @@ public: ScriptEditorQuickOpen(); }; -class ScriptEditorDebugger; +class EditorDebuggerNode; class ScriptEditorBase : public VBoxContainer { @@ -155,13 +155,6 @@ class ScriptEditor : public PanelContainer { FILE_COPY_PATH, FILE_TOOL_RELOAD, FILE_TOOL_RELOAD_SOFT, - DEBUG_NEXT, - DEBUG_STEP, - DEBUG_BREAK, - DEBUG_CONTINUE, - DEBUG_SHOW, - DEBUG_SHOW_KEEP_OPEN, - DEBUG_WITH_EXTERNAL_EDITOR, SEARCH_IN_FILES, REPLACE_IN_FILES, SEARCH_HELP, @@ -233,7 +226,6 @@ class ScriptEditor : public PanelContainer { AcceptDialog *error_dialog; ConfirmationDialog *erase_tab_confirm; ScriptCreateDialog *script_create_dialog; - ScriptEditorDebugger *debugger; ToolButton *scripts_visible; String current_theme; @@ -315,8 +307,6 @@ class ScriptEditor : public PanelContainer { EditorScriptCodeCompletionCache *completion_cache; - void _editor_play(); - void _editor_pause(); void _editor_stop(); int edit_pass; @@ -335,7 +325,6 @@ class ScriptEditor : public PanelContainer { void _set_execution(REF p_script, int p_line); void _clear_execution(REF p_script); void _breaked(bool p_breaked, bool p_can_debug); - void _show_debugger(bool p_show); void _update_window_menu(); void _script_created(Ref<Script> p_script); @@ -457,7 +446,6 @@ public: VSplitContainer *get_left_list_split() { return list_split; } - ScriptEditorDebugger *get_debugger() { return debugger; } void set_live_auto_reload_running_scripts(bool p_enabled); static void register_create_syntax_highlighter_function(CreateSyntaxHighlighterFunc p_func); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 9f1e2f0353..f4ebd7c3cc 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -32,10 +32,10 @@ #include "core/math/expression.h" #include "core/os/keyboard.h" +#include "editor/debugger/editor_debugger_node.h" #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" -#include "editor/script_editor_debugger.h" void ConnectionInfoDialog::ok_pressed() { } @@ -53,24 +53,24 @@ void ConnectionInfoDialog::popup_connections(String p_method, Vector<Node *> p_n for (List<Connection>::Element *E = all_connections.front(); E; E = E->next()) { Connection connection = E->get(); - if (connection.method != p_method) { + if (connection.callable.get_method() != p_method) { continue; } TreeItem *node_item = tree->create_item(root); - node_item->set_text(0, Object::cast_to<Node>(connection.source)->get_name()); - node_item->set_icon(0, EditorNode::get_singleton()->get_object_icon(connection.source, "Node")); + node_item->set_text(0, Object::cast_to<Node>(connection.signal.get_object())->get_name()); + node_item->set_icon(0, EditorNode::get_singleton()->get_object_icon(connection.signal.get_object(), "Node")); node_item->set_selectable(0, false); node_item->set_editable(0, false); - node_item->set_text(1, connection.signal); + node_item->set_text(1, connection.signal.get_name()); node_item->set_icon(1, get_parent_control()->get_icon("Slot", "EditorIcons")); node_item->set_selectable(1, false); node_item->set_editable(1, false); - node_item->set_text(2, Object::cast_to<Node>(connection.target)->get_name()); - node_item->set_icon(2, EditorNode::get_singleton()->get_object_icon(connection.target, "Node")); + node_item->set_text(2, Object::cast_to<Node>(connection.callable.get_object())->get_name()); + node_item->set_icon(2, EditorNode::get_singleton()->get_object_icon(connection.callable.get_object(), "Node")); node_item->set_selectable(2, false); node_item->set_editable(2, false); } @@ -292,23 +292,30 @@ void ScriptTextEditor::_set_theme_for_script() { const Color basetype_color = colors_cache.basetype_color; text_edit->add_keyword_color("String", basetype_color); text_edit->add_keyword_color("Vector2", basetype_color); + text_edit->add_keyword_color("Vector2i", basetype_color); text_edit->add_keyword_color("Rect2", basetype_color); - text_edit->add_keyword_color("Transform2D", basetype_color); + text_edit->add_keyword_color("Rect2i", basetype_color); text_edit->add_keyword_color("Vector3", basetype_color); + text_edit->add_keyword_color("Vector3i", basetype_color); + text_edit->add_keyword_color("Transform2D", basetype_color); + text_edit->add_keyword_color("Plane", basetype_color); + text_edit->add_keyword_color("Quat", basetype_color); text_edit->add_keyword_color("AABB", basetype_color); text_edit->add_keyword_color("Basis", basetype_color); - text_edit->add_keyword_color("Plane", basetype_color); text_edit->add_keyword_color("Transform", basetype_color); - text_edit->add_keyword_color("Quat", basetype_color); text_edit->add_keyword_color("Color", basetype_color); - text_edit->add_keyword_color("Object", basetype_color); + text_edit->add_keyword_color("StringName", basetype_color); text_edit->add_keyword_color("NodePath", basetype_color); text_edit->add_keyword_color("RID", basetype_color); + text_edit->add_keyword_color("Object", basetype_color); + text_edit->add_keyword_color("Callable", basetype_color); text_edit->add_keyword_color("Dictionary", basetype_color); text_edit->add_keyword_color("Array", basetype_color); text_edit->add_keyword_color("PackedByteArray", basetype_color); - text_edit->add_keyword_color("PackedIntArray", basetype_color); - text_edit->add_keyword_color("PackedRealArray", basetype_color); + text_edit->add_keyword_color("PackedInt32Array", basetype_color); + text_edit->add_keyword_color("PackedInt64Array", basetype_color); + text_edit->add_keyword_color("PackedFloat32Array", basetype_color); + text_edit->add_keyword_color("PackedFloat64Array", basetype_color); text_edit->add_keyword_color("PackedStringArray", basetype_color); text_edit->add_keyword_color("PackedVector2Array", basetype_color); text_edit->add_keyword_color("PackedVector3Array", basetype_color); @@ -603,12 +610,12 @@ void ScriptTextEditor::_validate_script() { Connection connection = E->get(); String base_path = base->get_name(); - String source_path = base == connection.source ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.source)); - String target_path = base == connection.target ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.target)); + String source_path = base == connection.signal.get_object() ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.signal.get_object())); + String target_path = base == connection.callable.get_object() ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.callable.get_object())); warnings_panel->push_cell(); warnings_panel->push_color(warnings_panel->get_color("warning_color", "Editor")); - warnings_panel->add_text(vformat(TTR("Missing connected method '%s' for signal '%s' from node '%s' to node '%s'."), connection.method, connection.signal, source_path, target_path)); + warnings_panel->add_text(vformat(TTR("Missing connected method '%s' for signal '%s' from node '%s' to node '%s'."), connection.callable.get_method(), connection.signal.get_name(), source_path, target_path)); warnings_panel->pop(); // Color. warnings_panel->pop(); // Cell. } @@ -870,7 +877,7 @@ void ScriptTextEditor::_breakpoint_item_pressed(int p_idx) { void ScriptTextEditor::_breakpoint_toggled(int p_row) { - ScriptEditor::get_singleton()->get_debugger()->set_breakpoint(script->get_path(), p_row + 1, code_editor->get_text_edit()->is_line_set_as_breakpoint(p_row)); + EditorDebuggerNode::get_singleton()->set_breakpoint(script->get_path(), p_row + 1, code_editor->get_text_edit()->is_line_set_as_breakpoint(p_row)); } void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_column) { @@ -1006,24 +1013,24 @@ void ScriptTextEditor::_update_connected_methods() { } // As deleted nodes are still accessible via the undo/redo system, check if they're still on the tree. - Node *source = Object::cast_to<Node>(connection.source); + Node *source = Object::cast_to<Node>(connection.signal.get_object()); if (source && !source->is_inside_tree()) { continue; } - if (methods_found.has(connection.method)) { + if (methods_found.has(connection.callable.get_method())) { continue; } - if (!ClassDB::has_method(script->get_instance_base_type(), connection.method)) { + if (!ClassDB::has_method(script->get_instance_base_type(), connection.callable.get_method())) { int line = -1; for (int j = 0; j < functions.size(); j++) { String name = functions[j].get_slice(":", 0); - if (name == connection.method) { + if (name == connection.callable.get_method()) { line = functions[j].get_slice(":", 1).to_int(); - text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.method); - methods_found.insert(connection.method); + text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.callable.get_method()); + methods_found.insert(connection.callable.get_method()); break; } } @@ -1036,7 +1043,7 @@ void ScriptTextEditor::_update_connected_methods() { bool found_inherited_function = false; Ref<Script> inherited_script = script->get_base_script(); while (!inherited_script.is_null()) { - if (inherited_script->has_method(connection.method)) { + if (inherited_script->has_method(connection.callable.get_method())) { found_inherited_function = true; break; } @@ -1294,7 +1301,7 @@ void ScriptTextEditor::_edit_option(int p_op) { int line = tx->cursor_get_line(); bool dobreak = !tx->is_line_set_as_breakpoint(line); tx->set_line_as_breakpoint(line, dobreak); - ScriptEditor::get_singleton()->get_debugger()->set_breakpoint(script->get_path(), line + 1, dobreak); + EditorDebuggerNode::get_singleton()->set_breakpoint(script->get_path(), line + 1, dobreak); } break; case DEBUG_REMOVE_ALL_BREAKPOINTS: { @@ -1305,7 +1312,7 @@ void ScriptTextEditor::_edit_option(int p_op) { int line = E->get(); bool dobreak = !tx->is_line_set_as_breakpoint(line); tx->set_line_as_breakpoint(line, dobreak); - ScriptEditor::get_singleton()->get_debugger()->set_breakpoint(script->get_path(), line + 1, dobreak); + EditorDebuggerNode::get_singleton()->set_breakpoint(script->get_path(), line + 1, dobreak); } } break; case DEBUG_GOTO_NEXT_BREAKPOINT: { @@ -1774,12 +1781,12 @@ ScriptTextEditor::ScriptTextEditor() { editor_box->add_child(code_editor); code_editor->add_constant_override("separation", 2); code_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); - code_editor->connect("validate_script", this, "_validate_script"); - code_editor->connect("load_theme_settings", this, "_load_theme_settings"); + code_editor->connect_compat("validate_script", this, "_validate_script"); + code_editor->connect_compat("load_theme_settings", this, "_load_theme_settings"); code_editor->set_code_complete_func(_code_complete_scripts, this); - code_editor->get_text_edit()->connect("breakpoint_toggled", this, "_breakpoint_toggled"); - code_editor->get_text_edit()->connect("symbol_lookup", this, "_lookup_symbol"); - code_editor->get_text_edit()->connect("info_clicked", this, "_lookup_connections"); + code_editor->get_text_edit()->connect_compat("breakpoint_toggled", this, "_breakpoint_toggled"); + code_editor->get_text_edit()->connect_compat("symbol_lookup", this, "_lookup_symbol"); + code_editor->get_text_edit()->connect_compat("info_clicked", this, "_lookup_connections"); code_editor->set_v_size_flags(SIZE_EXPAND_FILL); code_editor->show_toggle_scripts_button(); @@ -1792,9 +1799,9 @@ ScriptTextEditor::ScriptTextEditor() { warnings_panel->set_focus_mode(FOCUS_CLICK); warnings_panel->hide(); - code_editor->connect("error_pressed", this, "_error_pressed"); - code_editor->connect("show_warnings_panel", this, "_show_warnings_panel"); - warnings_panel->connect("meta_clicked", this, "_warning_clicked"); + code_editor->connect_compat("error_pressed", this, "_error_pressed"); + code_editor->connect_compat("show_warnings_panel", this, "_show_warnings_panel"); + warnings_panel->connect_compat("meta_clicked", this, "_warning_clicked"); update_settings(); @@ -1804,11 +1811,11 @@ ScriptTextEditor::ScriptTextEditor() { code_editor->get_text_edit()->set_select_identifiers_on_hover(true); code_editor->get_text_edit()->set_context_menu_enabled(false); - code_editor->get_text_edit()->connect("gui_input", this, "_text_edit_gui_input"); + code_editor->get_text_edit()->connect_compat("gui_input", this, "_text_edit_gui_input"); context_menu = memnew(PopupMenu); add_child(context_menu); - context_menu->connect("id_pressed", this, "_edit_option"); + context_menu->connect_compat("id_pressed", this, "_edit_option"); context_menu->set_hide_on_window_lose_focus(true); color_panel = memnew(PopupPanel); @@ -1816,7 +1823,7 @@ ScriptTextEditor::ScriptTextEditor() { color_picker = memnew(ColorPicker); color_picker->set_deferred_mode(true); color_panel->add_child(color_picker); - color_picker->connect("color_changed", this, "_color_changed"); + color_picker->connect_compat("color_changed", this, "_color_changed"); // get default color picker mode from editor settings int default_color_mode = EDITOR_GET("interface/inspector/default_color_picker_mode"); @@ -1857,7 +1864,7 @@ ScriptTextEditor::ScriptTextEditor() { edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_spaces"), EDIT_CONVERT_INDENT_TO_SPACES); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_tabs"), EDIT_CONVERT_INDENT_TO_TABS); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/auto_indent"), EDIT_AUTO_INDENT); - edit_menu->get_popup()->connect("id_pressed", this, "_edit_option"); + edit_menu->get_popup()->connect_compat("id_pressed", this, "_edit_option"); edit_menu->get_popup()->add_separator(); PopupMenu *convert_case = memnew(PopupMenu); @@ -1867,7 +1874,7 @@ ScriptTextEditor::ScriptTextEditor() { convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_uppercase", TTR("Uppercase"), KEY_MASK_SHIFT | KEY_F4), EDIT_TO_UPPERCASE); convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_lowercase", TTR("Lowercase"), KEY_MASK_SHIFT | KEY_F5), EDIT_TO_LOWERCASE); convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize"), KEY_MASK_SHIFT | KEY_F6), EDIT_CAPITALIZE); - convert_case->connect("id_pressed", this, "_edit_option"); + convert_case->connect_compat("id_pressed", this, "_edit_option"); highlighters[TTR("Standard")] = NULL; highlighter_menu = memnew(PopupMenu); @@ -1875,7 +1882,7 @@ ScriptTextEditor::ScriptTextEditor() { edit_menu->get_popup()->add_child(highlighter_menu); edit_menu->get_popup()->add_submenu_item(TTR("Syntax Highlighter"), "highlighter_menu"); highlighter_menu->add_radio_check_item(TTR("Standard")); - highlighter_menu->connect("id_pressed", this, "_change_syntax_highlighter"); + highlighter_menu->connect_compat("id_pressed", this, "_change_syntax_highlighter"); search_menu = memnew(MenuButton); edit_hb->add_child(search_menu); @@ -1891,7 +1898,7 @@ ScriptTextEditor::ScriptTextEditor() { search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace_in_files"), REPLACE_IN_FILES); search_menu->get_popup()->add_separator(); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/contextual_help"), HELP_CONTEXTUAL); - search_menu->get_popup()->connect("id_pressed", this, "_edit_option"); + search_menu->get_popup()->connect_compat("id_pressed", this, "_edit_option"); edit_hb->add_child(edit_menu); @@ -1899,7 +1906,7 @@ ScriptTextEditor::ScriptTextEditor() { edit_hb->add_child(goto_menu); goto_menu->set_text(TTR("Go To")); goto_menu->set_switch_on_hover(true); - goto_menu->get_popup()->connect("id_pressed", this, "_edit_option"); + goto_menu->get_popup()->connect_compat("id_pressed", this, "_edit_option"); goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_function"), SEARCH_LOCATE_FUNCTION); goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); @@ -1910,20 +1917,20 @@ ScriptTextEditor::ScriptTextEditor() { goto_menu->get_popup()->add_child(bookmarks_menu); goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks"); _update_bookmark_list(); - bookmarks_menu->connect("about_to_show", this, "_update_bookmark_list"); - bookmarks_menu->connect("index_pressed", this, "_bookmark_item_pressed"); + bookmarks_menu->connect_compat("about_to_show", this, "_update_bookmark_list"); + bookmarks_menu->connect_compat("index_pressed", this, "_bookmark_item_pressed"); breakpoints_menu = memnew(PopupMenu); breakpoints_menu->set_name("Breakpoints"); goto_menu->get_popup()->add_child(breakpoints_menu); goto_menu->get_popup()->add_submenu_item(TTR("Breakpoints"), "Breakpoints"); _update_breakpoint_list(); - breakpoints_menu->connect("about_to_show", this, "_update_breakpoint_list"); - breakpoints_menu->connect("index_pressed", this, "_breakpoint_item_pressed"); + breakpoints_menu->connect_compat("about_to_show", this, "_update_breakpoint_list"); + breakpoints_menu->connect_compat("index_pressed", this, "_breakpoint_item_pressed"); quick_open = memnew(ScriptEditorQuickOpen); add_child(quick_open); - quick_open->connect("goto_line", this, "_goto_line"); + quick_open->connect_compat("goto_line", this, "_goto_line"); goto_line_dialog = memnew(GotoLineDialog); add_child(goto_line_dialog); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index a19f0b4975..6c20483cf6 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -607,8 +607,8 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { shader_editor->add_constant_override("separation", 0); shader_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); - shader_editor->connect("script_changed", this, "apply_shaders"); - EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); + shader_editor->connect_compat("script_changed", this, "apply_shaders"); + EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_editor_settings_changed"); shader_editor->get_text_edit()->set_callhint_settings( EditorSettings::get_singleton()->get("text_editor/completion/put_callhint_tooltip_below_current_line"), @@ -616,13 +616,13 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { shader_editor->get_text_edit()->set_select_identifiers_on_hover(true); shader_editor->get_text_edit()->set_context_menu_enabled(false); - shader_editor->get_text_edit()->connect("gui_input", this, "_text_edit_gui_input"); + shader_editor->get_text_edit()->connect_compat("gui_input", this, "_text_edit_gui_input"); shader_editor->update_editor_settings(); context_menu = memnew(PopupMenu); add_child(context_menu); - context_menu->connect("id_pressed", this, "_menu_option"); + context_menu->connect_compat("id_pressed", this, "_menu_option"); context_menu->set_hide_on_window_lose_focus(true); VBoxContainer *main_container = memnew(VBoxContainer); @@ -650,7 +650,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE); - edit_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + edit_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); search_menu = memnew(MenuButton); search_menu->set_text(TTR("Search")); @@ -660,12 +660,12 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE); - search_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + search_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); MenuButton *goto_menu = memnew(MenuButton); goto_menu->set_text(TTR("Go To")); goto_menu->set_switch_on_hover(true); - goto_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + goto_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); goto_menu->get_popup()->add_separator(); @@ -675,14 +675,14 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { goto_menu->get_popup()->add_child(bookmarks_menu); goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks"); _update_bookmark_list(); - bookmarks_menu->connect("about_to_show", this, "_update_bookmark_list"); - bookmarks_menu->connect("index_pressed", this, "_bookmark_item_pressed"); + bookmarks_menu->connect_compat("about_to_show", this, "_update_bookmark_list"); + bookmarks_menu->connect_compat("index_pressed", this, "_bookmark_item_pressed"); help_menu = memnew(MenuButton); help_menu->set_text(TTR("Help")); help_menu->set_switch_on_hover(true); help_menu->get_popup()->add_icon_item(p_node->get_gui_base()->get_icon("Instance", "EditorIcons"), TTR("Online Docs"), HELP_DOCS); - help_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + help_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); add_child(main_container); main_container->add_child(hbc); @@ -705,11 +705,11 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { dl->set_text(TTR("This shader has been modified on on disk.\nWhat action should be taken?")); vbc->add_child(dl); - disk_changed->connect("confirmed", this, "_reload_shader_from_disk"); + disk_changed->connect_compat("confirmed", this, "_reload_shader_from_disk"); disk_changed->get_ok()->set_text(TTR("Reload")); disk_changed->add_button(TTR("Resave"), !OS::get_singleton()->get_swap_ok_cancel(), "resave"); - disk_changed->connect("custom_action", this, "save_external_data"); + disk_changed->connect_compat("custom_action", this, "save_external_data"); add_child(disk_changed); diff --git a/editor/plugins/skeleton_2d_editor_plugin.cpp b/editor/plugins/skeleton_2d_editor_plugin.cpp index dbe64f202d..d83a8ddf2d 100644 --- a/editor/plugins/skeleton_2d_editor_plugin.cpp +++ b/editor/plugins/skeleton_2d_editor_plugin.cpp @@ -110,7 +110,7 @@ Skeleton2DEditor::Skeleton2DEditor() { options->get_popup()->add_item(TTR("Set Bones to Rest Pose"), MENU_OPTION_SET_REST); options->set_switch_on_hover(true); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); err_dialog = memnew(AcceptDialog); add_child(err_dialog); diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp index 9101c64eab..43ba99317e 100644 --- a/editor/plugins/skeleton_editor_plugin.cpp +++ b/editor/plugins/skeleton_editor_plugin.cpp @@ -137,7 +137,7 @@ void SkeletonEditor::edit(Skeleton *p_node) { void SkeletonEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); } } @@ -164,7 +164,7 @@ SkeletonEditor::SkeletonEditor() { options->get_popup()->add_item(TTR("Create physical skeleton"), MENU_OPTION_CREATE_PHYSICAL_SKELETON); - options->get_popup()->connect("id_pressed", this, "_on_click_option"); + options->get_popup()->connect_compat("id_pressed", this, "_on_click_option"); options->hide(); } diff --git a/editor/plugins/skeleton_ik_editor_plugin.cpp b/editor/plugins/skeleton_ik_editor_plugin.cpp index eb6ad9498d..a09dcca279 100644 --- a/editor/plugins/skeleton_ik_editor_plugin.cpp +++ b/editor/plugins/skeleton_ik_editor_plugin.cpp @@ -93,7 +93,7 @@ SkeletonIKEditorPlugin::SkeletonIKEditorPlugin(EditorNode *p_node) { play_btn->set_text(TTR("Play IK")); play_btn->set_toggle_mode(true); play_btn->hide(); - play_btn->connect("pressed", this, "_play"); + play_btn->connect_compat("pressed", this, "_play"); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, play_btn); skeleton_ik = NULL; } diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 88b4f011ee..4c8a0590fd 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -36,12 +36,12 @@ #include "core/print_string.h" #include "core/project_settings.h" #include "core/sort_array.h" +#include "editor/debugger/editor_debugger_node.h" #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" -#include "editor/script_editor_debugger.h" #include "editor/spatial_editor_gizmos.h" #include "scene/3d/camera.h" #include "scene/3d/collision_shape.h" @@ -2147,6 +2147,8 @@ void SpatialEditorViewport::_notification(int p_what) { set_process(visible); if (visible) { + orthogonal = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_ORTHOGONAL)); + _update_name(); _update_camera(0); } else { set_freelook_active(false); @@ -2185,10 +2187,10 @@ void SpatialEditorViewport::_notification(int p_what) { if (cam != NULL && cam != previewing) { //then switch the viewport's camera to the scene's viewport camera if (previewing != NULL) { - previewing->disconnect("tree_exited", this, "_preview_exited_scene"); + previewing->disconnect_compat("tree_exited", this, "_preview_exited_scene"); } previewing = cam; - previewing->connect("tree_exited", this, "_preview_exited_scene"); + previewing->connect_compat("tree_exited", this, "_preview_exited_scene"); VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), cam->get_camera()); surface->update(); } @@ -2329,12 +2331,12 @@ void SpatialEditorViewport::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - surface->connect("draw", this, "_draw"); - surface->connect("gui_input", this, "_sinput"); - surface->connect("mouse_entered", this, "_surface_mouse_enter"); - surface->connect("mouse_exited", this, "_surface_mouse_exit"); - surface->connect("focus_entered", this, "_surface_focus_enter"); - surface->connect("focus_exited", this, "_surface_focus_exit"); + surface->connect_compat("draw", this, "_draw"); + surface->connect_compat("gui_input", this, "_sinput"); + surface->connect_compat("mouse_entered", this, "_surface_mouse_enter"); + surface->connect_compat("mouse_exited", this, "_surface_mouse_exit"); + surface->connect_compat("focus_entered", this, "_surface_focus_enter"); + surface->connect_compat("focus_exited", this, "_surface_focus_exit"); _init_gizmo_instance(index); } @@ -2835,10 +2837,10 @@ void SpatialEditorViewport::_menu_option(int p_option) { void SpatialEditorViewport::_preview_exited_scene() { - preview_camera->disconnect("toggled", this, "_toggle_camera_preview"); + preview_camera->disconnect_compat("toggled", this, "_toggle_camera_preview"); preview_camera->set_pressed(false); _toggle_camera_preview(false); - preview_camera->connect("toggled", this, "_toggle_camera_preview"); + preview_camera->connect_compat("toggled", this, "_toggle_camera_preview"); view_menu->show(); } @@ -2901,7 +2903,7 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) { if (!p_activate) { - previewing->disconnect("tree_exiting", this, "_preview_exited_scene"); + previewing->disconnect_compat("tree_exiting", this, "_preview_exited_scene"); previewing = NULL; VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore if (!preview) @@ -2912,7 +2914,7 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) { } else { previewing = preview; - previewing->connect("tree_exiting", this, "_preview_exited_scene"); + previewing->connect_compat("tree_exiting", this, "_preview_exited_scene"); VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace view_menu->set_disabled(true); surface->update(); @@ -2923,7 +2925,7 @@ void SpatialEditorViewport::_toggle_cinema_preview(bool p_activate) { previewing_cinema = p_activate; if (!previewing_cinema) { if (previewing != NULL) - previewing->disconnect("tree_exited", this, "_preview_exited_scene"); + previewing->disconnect_compat("tree_exited", this, "_preview_exited_scene"); previewing = NULL; VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore @@ -3108,14 +3110,14 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { view_menu->get_popup()->set_item_checked(idx, previewing_cinema); } - if (preview_camera->is_connected("toggled", this, "_toggle_camera_preview")) { - preview_camera->disconnect("toggled", this, "_toggle_camera_preview"); + if (preview_camera->is_connected_compat("toggled", this, "_toggle_camera_preview")) { + preview_camera->disconnect_compat("toggled", this, "_toggle_camera_preview"); } if (p_state.has("previewing")) { Node *pv = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["previewing"]); if (Object::cast_to<Camera>(pv)) { previewing = Object::cast_to<Camera>(pv); - previewing->connect("tree_exiting", this, "_preview_exited_scene"); + previewing->connect_compat("tree_exiting", this, "_preview_exited_scene"); VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace view_menu->set_disabled(true); surface->update(); @@ -3123,7 +3125,7 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { preview_camera->show(); } } - preview_camera->connect("toggled", this, "_toggle_camera_preview"); + preview_camera->connect_compat("toggled", this, "_toggle_camera_preview"); } Dictionary SpatialEditorViewport::get_state() const { @@ -3419,9 +3421,9 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instanced_scene); String new_name = parent->validate_child_name(instanced_scene); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_instance_node", editor->get_edited_scene()->get_path_to(parent), path, new_name); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); + editor_data->get_undo_redo().add_do_method(ed, "live_debug_instance_node", editor->get_edited_scene()->get_path_to(parent), path, new_name); + editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); Transform global_transform; Spatial *parent_spatial = Object::cast_to<Spatial>(parent); @@ -3682,8 +3684,8 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_selection"), VIEW_CENTER_TO_SELECTION); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_transform_with_view"), VIEW_ALIGN_TRANSFORM_WITH_VIEW); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_rotation_with_view"), VIEW_ALIGN_ROTATION_WITH_VIEW); - view_menu->get_popup()->connect("id_pressed", this, "_menu_option"); - display_submenu->connect("id_pressed", this, "_menu_option"); + view_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); + display_submenu->connect_compat("id_pressed", this, "_menu_option"); view_menu->set_disable_shortcuts(true); if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) { @@ -3718,7 +3720,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed vbox->add_child(preview_camera); preview_camera->set_h_size_flags(0); preview_camera->hide(); - preview_camera->connect("toggled", this, "_toggle_camera_preview"); + preview_camera->connect_compat("toggled", this, "_toggle_camera_preview"); previewing = NULL; gizmo_scale = 1.0; @@ -3771,8 +3773,8 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed selection_menu = memnew(PopupMenu); add_child(selection_menu); selection_menu->set_custom_minimum_size(Size2(100, 0) * EDSCALE); - selection_menu->connect("id_pressed", this, "_selection_result_pressed"); - selection_menu->connect("popup_hide", this, "_selection_menu_hide"); + selection_menu->connect_compat("id_pressed", this, "_selection_result_pressed"); + selection_menu->connect_compat("popup_hide", this, "_selection_menu_hide"); if (p_index == 0) { view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUDIO_LISTENER), true); @@ -3782,7 +3784,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed name = ""; _update_name(); - EditorSettings::get_singleton()->connect("settings_changed", this, "update_transform_gizmo_view"); + EditorSettings::get_singleton()->connect_compat("settings_changed", this, "update_transform_gizmo_view"); } ////////////////////////////////////////////////////////////// @@ -4495,7 +4497,7 @@ void SpatialEditor::_menu_item_toggled(bool pressed, int p_option) { } break; case MENU_TOOL_OVERRIDE_CAMERA: { - ScriptEditorDebugger *const debugger = ScriptEditor::get_singleton()->get_debugger(); + EditorDebuggerNode *const debugger = EditorDebuggerNode::get_singleton(); if (pressed) { using Override = ScriptEditorDebugger::CameraOverride; @@ -4552,7 +4554,7 @@ void SpatialEditor::_update_camera_override_viewport(Object *p_viewport) { if (!current_viewport) return; - ScriptEditorDebugger *const debugger = ScriptEditor::get_singleton()->get_debugger(); + EditorDebuggerNode *const debugger = EditorDebuggerNode::get_singleton(); camera_override_viewport_id = current_viewport->index; if (debugger->get_camera_override() >= ScriptEditorDebugger::OVERRIDE_3D_1) { @@ -5469,12 +5471,12 @@ void SpatialEditor::_notification(int p_what) { _refresh_menu_icons(); - get_tree()->connect("node_removed", this, "_node_removed"); - EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", this, "_refresh_menu_icons"); - editor_selection->connect("selection_changed", this, "_refresh_menu_icons"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); + EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect_compat("node_changed", this, "_refresh_menu_icons"); + editor_selection->connect_compat("selection_changed", this, "_refresh_menu_icons"); - editor->connect("stop_pressed", this, "_update_camera_override_button", make_binds(false)); - editor->connect("play_pressed", this, "_update_camera_override_button", make_binds(true)); + editor->connect_compat("stop_pressed", this, "_update_camera_override_button", make_binds(false)); + editor->connect_compat("play_pressed", this, "_update_camera_override_button", make_binds(true)); } else if (p_what == NOTIFICATION_ENTER_TREE) { _register_all_gizmos(); @@ -5511,7 +5513,7 @@ void SpatialEditor::_notification(int p_what) { _init_grid(); } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (!is_visible() && tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->is_pressed()) { - ScriptEditorDebugger *debugger = ScriptEditor::get_singleton()->get_debugger(); + EditorDebuggerNode *debugger = EditorDebuggerNode::get_singleton(); debugger->set_camera_override(ScriptEditorDebugger::OVERRIDE_NONE); tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_pressed(false); @@ -5730,7 +5732,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_SELECT]->set_flat(true); tool_button[TOOL_MODE_SELECT]->set_pressed(true); button_binds.write[0] = MENU_TOOL_SELECT; - tool_button[TOOL_MODE_SELECT]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_MODE_SELECT]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), KEY_Q)); tool_button[TOOL_MODE_SELECT]->set_tooltip(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection")); @@ -5741,7 +5743,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_MOVE]->set_toggle_mode(true); tool_button[TOOL_MODE_MOVE]->set_flat(true); button_binds.write[0] = MENU_TOOL_MOVE; - tool_button[TOOL_MODE_MOVE]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_MODE_MOVE]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_MODE_MOVE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_move", TTR("Move Mode"), KEY_W)); tool_button[TOOL_MODE_ROTATE] = memnew(ToolButton); @@ -5749,7 +5751,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_ROTATE]->set_toggle_mode(true); tool_button[TOOL_MODE_ROTATE]->set_flat(true); button_binds.write[0] = MENU_TOOL_ROTATE; - tool_button[TOOL_MODE_ROTATE]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_MODE_ROTATE]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_MODE_ROTATE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Rotate Mode"), KEY_E)); tool_button[TOOL_MODE_SCALE] = memnew(ToolButton); @@ -5757,7 +5759,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_SCALE]->set_toggle_mode(true); tool_button[TOOL_MODE_SCALE]->set_flat(true); button_binds.write[0] = MENU_TOOL_SCALE; - tool_button[TOOL_MODE_SCALE]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_MODE_SCALE]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTR("Scale Mode"), KEY_R)); hbc_menu->add_child(memnew(VSeparator)); @@ -5767,31 +5769,31 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_LIST_SELECT]->set_toggle_mode(true); tool_button[TOOL_MODE_LIST_SELECT]->set_flat(true); button_binds.write[0] = MENU_TOOL_LIST_SELECT; - tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_MODE_LIST_SELECT]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip(TTR("Show a list of all objects at the position clicked\n(same as Alt+RMB in select mode).")); tool_button[TOOL_LOCK_SELECTED] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_LOCK_SELECTED]); button_binds.write[0] = MENU_LOCK_SELECTED; - tool_button[TOOL_LOCK_SELECTED]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_LOCK_SELECTED]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_LOCK_SELECTED]->set_tooltip(TTR("Lock the selected object in place (can't be moved).")); tool_button[TOOL_UNLOCK_SELECTED] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_UNLOCK_SELECTED]); button_binds.write[0] = MENU_UNLOCK_SELECTED; - tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_UNLOCK_SELECTED]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip(TTR("Unlock the selected object (can be moved).")); tool_button[TOOL_GROUP_SELECTED] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_GROUP_SELECTED]); button_binds.write[0] = MENU_GROUP_SELECTED; - tool_button[TOOL_GROUP_SELECTED]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_GROUP_SELECTED]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_GROUP_SELECTED]->set_tooltip(TTR("Makes sure the object's children are not selectable.")); tool_button[TOOL_UNGROUP_SELECTED] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_UNGROUP_SELECTED]); button_binds.write[0] = MENU_UNGROUP_SELECTED; - tool_button[TOOL_UNGROUP_SELECTED]->connect("pressed", this, "_menu_item_pressed", button_binds); + tool_button[TOOL_UNGROUP_SELECTED]->connect_compat("pressed", this, "_menu_item_pressed", button_binds); tool_button[TOOL_UNGROUP_SELECTED]->set_tooltip(TTR("Restores the object's children's ability to be selected.")); hbc_menu->add_child(memnew(VSeparator)); @@ -5801,7 +5803,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_toggle_mode(true); tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_flat(true); button_binds.write[0] = MENU_TOOL_LOCAL_COORDS; - tool_option_button[TOOL_OPT_LOCAL_COORDS]->connect("toggled", this, "_menu_item_toggled", button_binds); + tool_option_button[TOOL_OPT_LOCAL_COORDS]->connect_compat("toggled", this, "_menu_item_toggled", button_binds); tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_shortcut(ED_SHORTCUT("spatial_editor/local_coords", TTR("Use Local Space"), KEY_T)); tool_option_button[TOOL_OPT_USE_SNAP] = memnew(ToolButton); @@ -5809,7 +5811,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_option_button[TOOL_OPT_USE_SNAP]->set_toggle_mode(true); tool_option_button[TOOL_OPT_USE_SNAP]->set_flat(true); button_binds.write[0] = MENU_TOOL_USE_SNAP; - tool_option_button[TOOL_OPT_USE_SNAP]->connect("toggled", this, "_menu_item_toggled", button_binds); + tool_option_button[TOOL_OPT_USE_SNAP]->connect_compat("toggled", this, "_menu_item_toggled", button_binds); tool_option_button[TOOL_OPT_USE_SNAP]->set_shortcut(ED_SHORTCUT("spatial_editor/snap", TTR("Use Snap"), KEY_Y)); hbc_menu->add_child(memnew(VSeparator)); @@ -5820,7 +5822,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_flat(true); tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_disabled(true); button_binds.write[0] = MENU_TOOL_OVERRIDE_CAMERA; - tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->connect("toggled", this, "_menu_item_toggled", button_binds); + tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->connect_compat("toggled", this, "_menu_item_toggled", button_binds); _update_camera_override_button(false); hbc_menu->add_child(memnew(VSeparator)); @@ -5857,7 +5859,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->add_separator(); p->add_shortcut(ED_SHORTCUT("spatial_editor/configure_snap", TTR("Configure Snap...")), MENU_TRANSFORM_CONFIGURE_SNAP); - p->connect("id_pressed", this, "_menu_item_pressed"); + p->connect_compat("id_pressed", this, "_menu_item_pressed"); view_menu = memnew(MenuButton); view_menu->set_text(TTR("View")); @@ -5889,13 +5891,13 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->set_item_checked(p->get_item_index(MENU_VIEW_ORIGIN), true); p->set_item_checked(p->get_item_index(MENU_VIEW_GRID), true); - p->connect("id_pressed", this, "_menu_item_pressed"); + p->connect_compat("id_pressed", this, "_menu_item_pressed"); gizmos_menu = memnew(PopupMenu); p->add_child(gizmos_menu); gizmos_menu->set_name("GizmosMenu"); gizmos_menu->set_hide_on_checkable_item_selection(false); - gizmos_menu->connect("id_pressed", this, "_menu_gizmo_toggled"); + gizmos_menu->connect_compat("id_pressed", this, "_menu_gizmo_toggled"); /* REST OF MENU */ @@ -5912,8 +5914,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { viewports[i] = memnew(SpatialEditorViewport(this, editor, i)); - viewports[i]->connect("toggle_maximize_view", this, "_toggle_maximize_view"); - viewports[i]->connect("clicked", this, "_update_camera_override_viewport"); + viewports[i]->connect_compat("toggle_maximize_view", this, "_toggle_maximize_view"); + viewports[i]->connect_compat("clicked", this, "_update_camera_override_viewport"); viewports[i]->assign_pending_data_pointers(preview_node, &preview_bounds, accept); viewport_base->add_child(viewports[i]); } @@ -6028,7 +6030,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { xform_type->add_item(TTR("Post")); xform_vbc->add_child(xform_type); - xform_dialog->connect("confirmed", this, "_xform_dialog_action"); + xform_dialog->connect_compat("confirmed", this, "_xform_dialog_action"); scenario_debug = VisualServer::SCENARIO_DEBUG_DISABLED; @@ -6040,7 +6042,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { EDITOR_DEF("editors/3d/manipulator_gizmo_size", 80); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/3d/manipulator_gizmo_size", PROPERTY_HINT_RANGE, "16,1024,1")); EDITOR_DEF("editors/3d/manipulator_gizmo_opacity", 0.4); - EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::REAL, "editors/3d/manipulator_gizmo_opacity", PROPERTY_HINT_RANGE, "0,1,0.01")); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::FLOAT, "editors/3d/manipulator_gizmo_opacity", PROPERTY_HINT_RANGE, "0,1,0.01")); over_gizmo_handle = -1; } @@ -6182,7 +6184,7 @@ SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *p_node) { editor->get_viewport()->add_child(spatial_editor); spatial_editor->hide(); - spatial_editor->connect("transform_key_request", editor->get_inspector_dock(), "_transform_keyed"); + spatial_editor->connect_compat("transform_key_request", editor->get_inspector_dock(), "_transform_keyed"); } SpatialEditorPlugin::~SpatialEditorPlugin() { diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp index e69440b5bb..c35afa0644 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_editor_plugin.cpp @@ -376,7 +376,7 @@ void SpriteEditor::_convert_to_polygon_2d_node() { Vector<Vector2> outline = computed_outline_lines[i]; Vector<Vector2> uv_outline = outline_lines[i]; - PackedIntArray pia; + PackedInt32Array pia; pia.resize(outline.size()); int *pia_write = pia.ptrw(); @@ -526,7 +526,7 @@ SpriteEditor::SpriteEditor() { options->get_popup()->add_item(TTR("Create LightOccluder2D Sibling"), MENU_OPTION_CREATE_LIGHT_OCCLUDER_2D); options->set_switch_on_hover(true); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -542,9 +542,9 @@ SpriteEditor::SpriteEditor() { scroll->set_enable_v_scroll(true); vb->add_margin_child(TTR("Preview:"), scroll, true); debug_uv = memnew(Control); - debug_uv->connect("draw", this, "_debug_uv_draw"); + debug_uv->connect_compat("draw", this, "_debug_uv_draw"); scroll->add_child(debug_uv); - debug_uv_dialog->connect("confirmed", this, "_create_node"); + debug_uv_dialog->connect_compat("confirmed", this, "_create_node"); HBoxContainer *hb = memnew(HBoxContainer); hb->add_child(memnew(Label(TTR("Simplification: ")))); @@ -573,7 +573,7 @@ SpriteEditor::SpriteEditor() { hb->add_spacer(); update_preview = memnew(Button); update_preview->set_text(TTR("Update Preview")); - update_preview->connect("pressed", this, "_update_mesh_data"); + update_preview->connect_compat("pressed", this, "_update_mesh_data"); hb->add_child(update_preview); vb->add_margin_child(TTR("Settings:"), hb); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 9e8ce7ac4a..c80ba873fb 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -234,7 +234,7 @@ void SpriteFramesEditor::_notification(int p_what) { _delete->set_icon(get_icon("Remove", "EditorIcons")); new_anim->set_icon(get_icon("New", "EditorIcons")); remove_anim->set_icon(get_icon("Remove", "EditorIcons")); - FALLTHROUGH; + [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { splite_sheet_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); @@ -905,19 +905,19 @@ SpriteFramesEditor::SpriteFramesEditor() { new_anim = memnew(ToolButton); new_anim->set_tooltip(TTR("New Animation")); hbc_animlist->add_child(new_anim); - new_anim->connect("pressed", this, "_animation_add"); + new_anim->connect_compat("pressed", this, "_animation_add"); remove_anim = memnew(ToolButton); remove_anim->set_tooltip(TTR("Remove Animation")); hbc_animlist->add_child(remove_anim); - remove_anim->connect("pressed", this, "_animation_remove"); + remove_anim->connect_compat("pressed", this, "_animation_remove"); animations = memnew(Tree); sub_vb->add_child(animations); animations->set_v_size_flags(SIZE_EXPAND_FILL); animations->set_hide_root(true); - animations->connect("cell_selected", this, "_animation_select"); - animations->connect("item_edited", this, "_animation_name_edited"); + animations->connect_compat("cell_selected", this, "_animation_select"); + animations->connect_compat("item_edited", this, "_animation_name_edited"); animations->set_allow_reselect(true); anim_speed = memnew(SpinBox); @@ -925,12 +925,12 @@ SpriteFramesEditor::SpriteFramesEditor() { anim_speed->set_min(0); anim_speed->set_max(100); anim_speed->set_step(0.01); - anim_speed->connect("value_changed", this, "_animation_fps_changed"); + anim_speed->connect_compat("value_changed", this, "_animation_fps_changed"); anim_loop = memnew(CheckButton); anim_loop->set_text(TTR("Loop")); vbc_animlist->add_child(anim_loop); - anim_loop->connect("pressed", this, "_animation_loop_changed"); + anim_loop->connect_compat("pressed", this, "_animation_loop_changed"); VBoxContainer *vbc = memnew(VBoxContainer); add_child(vbc); @@ -1004,16 +1004,16 @@ SpriteFramesEditor::SpriteFramesEditor() { dialog = memnew(AcceptDialog); add_child(dialog); - load->connect("pressed", this, "_load_pressed"); - load_sheet->connect("pressed", this, "_open_sprite_sheet"); - _delete->connect("pressed", this, "_delete_pressed"); - copy->connect("pressed", this, "_copy_pressed"); - paste->connect("pressed", this, "_paste_pressed"); - empty->connect("pressed", this, "_empty_pressed"); - empty2->connect("pressed", this, "_empty2_pressed"); - move_up->connect("pressed", this, "_up_pressed"); - move_down->connect("pressed", this, "_down_pressed"); - file->connect("files_selected", this, "_file_load_request"); + load->connect_compat("pressed", this, "_load_pressed"); + load_sheet->connect_compat("pressed", this, "_open_sprite_sheet"); + _delete->connect_compat("pressed", this, "_delete_pressed"); + copy->connect_compat("pressed", this, "_copy_pressed"); + paste->connect_compat("pressed", this, "_paste_pressed"); + empty->connect_compat("pressed", this, "_empty_pressed"); + empty2->connect_compat("pressed", this, "_empty2_pressed"); + move_up->connect_compat("pressed", this, "_up_pressed"); + move_down->connect_compat("pressed", this, "_down_pressed"); + file->connect_compat("files_selected", this, "_file_load_request"); loading_scene = false; sel = -1; @@ -1023,14 +1023,14 @@ SpriteFramesEditor::SpriteFramesEditor() { delete_dialog = memnew(ConfirmationDialog); add_child(delete_dialog); - delete_dialog->connect("confirmed", this, "_animation_remove_confirmed"); + delete_dialog->connect_compat("confirmed", this, "_animation_remove_confirmed"); split_sheet_dialog = memnew(ConfirmationDialog); add_child(split_sheet_dialog); VBoxContainer *split_sheet_vb = memnew(VBoxContainer); split_sheet_dialog->add_child(split_sheet_vb); split_sheet_dialog->set_title(TTR("Select Frames")); - split_sheet_dialog->connect("confirmed", this, "_sheet_add_frames"); + split_sheet_dialog->connect_compat("confirmed", this, "_sheet_add_frames"); HBoxContainer *split_sheet_hb = memnew(HBoxContainer); @@ -1041,7 +1041,7 @@ SpriteFramesEditor::SpriteFramesEditor() { split_sheet_h->set_max(128); split_sheet_h->set_step(1); split_sheet_hb->add_child(split_sheet_h); - split_sheet_h->connect("value_changed", this, "_sheet_spin_changed"); + split_sheet_h->connect_compat("value_changed", this, "_sheet_spin_changed"); ss_label = memnew(Label(TTR("Vertical:"))); split_sheet_hb->add_child(ss_label); @@ -1050,13 +1050,13 @@ SpriteFramesEditor::SpriteFramesEditor() { split_sheet_v->set_max(128); split_sheet_v->set_step(1); split_sheet_hb->add_child(split_sheet_v); - split_sheet_v->connect("value_changed", this, "_sheet_spin_changed"); + split_sheet_v->connect_compat("value_changed", this, "_sheet_spin_changed"); split_sheet_hb->add_spacer(); Button *select_clear_all = memnew(Button); select_clear_all->set_text(TTR("Select/Clear All Frames")); - select_clear_all->connect("pressed", this, "_sheet_select_clear_all_frames"); + select_clear_all->connect_compat("pressed", this, "_sheet_select_clear_all_frames"); split_sheet_hb->add_child(select_clear_all); split_sheet_vb->add_child(split_sheet_hb); @@ -1064,8 +1064,8 @@ SpriteFramesEditor::SpriteFramesEditor() { split_sheet_preview = memnew(TextureRect); split_sheet_preview->set_expand(false); split_sheet_preview->set_mouse_filter(MOUSE_FILTER_PASS); - split_sheet_preview->connect("draw", this, "_sheet_preview_draw"); - split_sheet_preview->connect("gui_input", this, "_sheet_preview_input"); + split_sheet_preview->connect_compat("draw", this, "_sheet_preview_draw"); + split_sheet_preview->connect_compat("gui_input", this, "_sheet_preview_input"); splite_sheet_scroll = memnew(ScrollContainer); splite_sheet_scroll->set_enable_h_scroll(true); @@ -1083,7 +1083,7 @@ SpriteFramesEditor::SpriteFramesEditor() { file_split_sheet->set_title(TTR("Create Frames from Sprite Sheet")); file_split_sheet->set_mode(EditorFileDialog::MODE_OPEN_FILE); add_child(file_split_sheet); - file_split_sheet->connect("file_selected", this, "_prepare_sprite_sheet"); + file_split_sheet->connect_compat("file_selected", this, "_prepare_sprite_sheet"); } void SpriteFramesEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index eebcd567a4..a9936658c3 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -54,11 +54,11 @@ void EditorInspectorPluginStyleBox::parse_end() { void StyleBoxPreview::edit(const Ref<StyleBox> &p_stylebox) { if (stylebox.is_valid()) - stylebox->disconnect("changed", this, "_sb_changed"); + stylebox->disconnect_compat("changed", this, "_sb_changed"); stylebox = p_stylebox; if (p_stylebox.is_valid()) { preview->add_style_override("panel", stylebox); - stylebox->connect("changed", this, "_sb_changed"); + stylebox->connect_compat("changed", this, "_sb_changed"); } _sb_changed(); } @@ -91,7 +91,7 @@ StyleBoxPreview::StyleBoxPreview() { preview = memnew(Control); preview->set_custom_minimum_size(Size2(0, 150 * EDSCALE)); preview->set_clip_contents(true); - preview->connect("draw", this, "_redraw"); + preview->connect_compat("draw", this, "_redraw"); add_margin_child(TTR("Preview:"), preview); } diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 357af5ecd8..a8b6d74c1f 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -633,19 +633,19 @@ TextEditor::TextEditor() { code_editor = memnew(CodeTextEditor); add_child(code_editor); code_editor->add_constant_override("separation", 0); - code_editor->connect("load_theme_settings", this, "_load_theme_settings"); - code_editor->connect("validate_script", this, "_validate_script"); + code_editor->connect_compat("load_theme_settings", this, "_load_theme_settings"); + code_editor->connect_compat("validate_script", this, "_validate_script"); code_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); code_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); update_settings(); code_editor->get_text_edit()->set_context_menu_enabled(false); - code_editor->get_text_edit()->connect("gui_input", this, "_text_edit_gui_input"); + code_editor->get_text_edit()->connect_compat("gui_input", this, "_text_edit_gui_input"); context_menu = memnew(PopupMenu); add_child(context_menu); - context_menu->connect("id_pressed", this, "_edit_option"); + context_menu->connect_compat("id_pressed", this, "_edit_option"); edit_hb = memnew(HBoxContainer); @@ -653,7 +653,7 @@ TextEditor::TextEditor() { edit_hb->add_child(search_menu); search_menu->set_text(TTR("Search")); search_menu->set_switch_on_hover(true); - search_menu->get_popup()->connect("id_pressed", this, "_edit_option"); + search_menu->get_popup()->connect_compat("id_pressed", this, "_edit_option"); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT); @@ -667,7 +667,7 @@ TextEditor::TextEditor() { edit_hb->add_child(edit_menu); edit_menu->set_text(TTR("Edit")); edit_menu->set_switch_on_hover(true); - edit_menu->get_popup()->connect("id_pressed", this, "_edit_option"); + edit_menu->get_popup()->connect_compat("id_pressed", this, "_edit_option"); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); @@ -700,7 +700,7 @@ TextEditor::TextEditor() { convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_uppercase", TTR("Uppercase")), EDIT_TO_UPPERCASE); convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_lowercase", TTR("Lowercase")), EDIT_TO_LOWERCASE); convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize")), EDIT_CAPITALIZE); - convert_case->connect("id_pressed", this, "_edit_option"); + convert_case->connect_compat("id_pressed", this, "_edit_option"); highlighters["Standard"] = NULL; highlighter_menu = memnew(PopupMenu); @@ -708,13 +708,13 @@ TextEditor::TextEditor() { edit_menu->get_popup()->add_child(highlighter_menu); edit_menu->get_popup()->add_submenu_item(TTR("Syntax Highlighter"), "highlighter_menu"); highlighter_menu->add_radio_check_item(TTR("Standard")); - highlighter_menu->connect("id_pressed", this, "_change_syntax_highlighter"); + highlighter_menu->connect_compat("id_pressed", this, "_change_syntax_highlighter"); MenuButton *goto_menu = memnew(MenuButton); edit_hb->add_child(goto_menu); goto_menu->set_text(TTR("Go To")); goto_menu->set_switch_on_hover(true); - goto_menu->get_popup()->connect("id_pressed", this, "_edit_option"); + goto_menu->get_popup()->connect_compat("id_pressed", this, "_edit_option"); goto_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); goto_menu->get_popup()->add_separator(); @@ -724,8 +724,8 @@ TextEditor::TextEditor() { goto_menu->get_popup()->add_child(bookmarks_menu); goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks"); _update_bookmark_list(); - bookmarks_menu->connect("about_to_show", this, "_update_bookmark_list"); - bookmarks_menu->connect("index_pressed", this, "_bookmark_item_pressed"); + bookmarks_menu->connect_compat("about_to_show", this, "_update_bookmark_list"); + bookmarks_menu->connect_compat("index_pressed", this, "_bookmark_item_pressed"); goto_line_dialog = memnew(GotoLineDialog); add_child(goto_line_dialog); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 2350c20cb7..065833fd2b 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -935,7 +935,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { snap_mode_button->add_item(TTR("Grid Snap"), 2); snap_mode_button->add_item(TTR("Auto Slice"), 3); snap_mode_button->select(0); - snap_mode_button->connect("item_selected", this, "_set_snap_mode"); + snap_mode_button->connect_compat("item_selected", this, "_set_snap_mode"); hb_grid = memnew(HBoxContainer); hb_tools->add_child(hb_grid); @@ -949,7 +949,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { sb_off_x->set_step(1); sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); - sb_off_x->connect("value_changed", this, "_set_snap_off_x"); + sb_off_x->connect_compat("value_changed", this, "_set_snap_off_x"); hb_grid->add_child(sb_off_x); sb_off_y = memnew(SpinBox); @@ -958,7 +958,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { sb_off_y->set_step(1); sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); - sb_off_y->connect("value_changed", this, "_set_snap_off_y"); + sb_off_y->connect_compat("value_changed", this, "_set_snap_off_y"); hb_grid->add_child(sb_off_y); hb_grid->add_child(memnew(VSeparator)); @@ -970,7 +970,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { sb_step_x->set_step(1); sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); - sb_step_x->connect("value_changed", this, "_set_snap_step_x"); + sb_step_x->connect_compat("value_changed", this, "_set_snap_step_x"); hb_grid->add_child(sb_step_x); sb_step_y = memnew(SpinBox); @@ -979,7 +979,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { sb_step_y->set_step(1); sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); - sb_step_y->connect("value_changed", this, "_set_snap_step_y"); + sb_step_y->connect_compat("value_changed", this, "_set_snap_step_y"); hb_grid->add_child(sb_step_y); hb_grid->add_child(memnew(VSeparator)); @@ -991,7 +991,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { sb_sep_x->set_step(1); sb_sep_x->set_value(snap_separation.x); sb_sep_x->set_suffix("px"); - sb_sep_x->connect("value_changed", this, "_set_snap_sep_x"); + sb_sep_x->connect_compat("value_changed", this, "_set_snap_sep_x"); hb_grid->add_child(sb_sep_x); sb_sep_y = memnew(SpinBox); @@ -1000,7 +1000,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { sb_sep_y->set_step(1); sb_sep_y->set_value(snap_separation.y); sb_sep_y->set_suffix("px"); - sb_sep_y->connect("value_changed", this, "_set_snap_sep_y"); + sb_sep_y->connect_compat("value_changed", this, "_set_snap_sep_y"); hb_grid->add_child(sb_sep_y); hb_grid->hide(); @@ -1008,8 +1008,8 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { edit_draw = memnew(Panel); add_child(edit_draw); edit_draw->set_v_size_flags(SIZE_EXPAND_FILL); - edit_draw->connect("draw", this, "_region_draw"); - edit_draw->connect("gui_input", this, "_region_input"); + edit_draw->connect_compat("draw", this, "_region_draw"); + edit_draw->connect_compat("gui_input", this, "_region_input"); draw_zoom = 1.0; edit_draw->set_clip_contents(true); @@ -1020,27 +1020,27 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { zoom_out = memnew(ToolButton); zoom_out->set_tooltip(TTR("Zoom Out")); - zoom_out->connect("pressed", this, "_zoom_out"); + zoom_out->connect_compat("pressed", this, "_zoom_out"); zoom_hb->add_child(zoom_out); zoom_reset = memnew(ToolButton); zoom_reset->set_tooltip(TTR("Zoom Reset")); - zoom_reset->connect("pressed", this, "_zoom_reset"); + zoom_reset->connect_compat("pressed", this, "_zoom_reset"); zoom_hb->add_child(zoom_reset); zoom_in = memnew(ToolButton); zoom_in->set_tooltip(TTR("Zoom In")); - zoom_in->connect("pressed", this, "_zoom_in"); + zoom_in->connect_compat("pressed", this, "_zoom_in"); zoom_hb->add_child(zoom_in); vscroll = memnew(VScrollBar); vscroll->set_step(0.001); edit_draw->add_child(vscroll); - vscroll->connect("value_changed", this, "_scroll_changed"); + vscroll->connect_compat("value_changed", this, "_scroll_changed"); hscroll = memnew(HScrollBar); hscroll->set_step(0.001); edit_draw->add_child(hscroll); - hscroll->connect("value_changed", this, "_scroll_changed"); + hscroll->connect_compat("value_changed", this, "_scroll_changed"); updating_scroll = false; } @@ -1125,7 +1125,7 @@ TextureRegionEditorPlugin::TextureRegionEditorPlugin(EditorNode *p_node) { region_editor = memnew(TextureRegionEditor(p_node)); region_editor->set_custom_minimum_size(Size2(0, 200) * EDSCALE); region_editor->hide(); - region_editor->connect("visibility_changed", this, "_editor_visiblity_changed"); + region_editor->connect_compat("visibility_changed", this, "_editor_visiblity_changed"); texture_region_button = p_node->add_bottom_panel_item(TTR("TextureRegion"), region_editor); texture_region_button->hide(); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 48d80a0017..717c9adad3 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -629,7 +629,7 @@ ThemeEditor::ThemeEditor() { theme_menu->get_popup()->add_item(TTR("Create Empty Editor Template"), POPUP_CREATE_EDITOR_EMPTY); theme_menu->get_popup()->add_item(TTR("Create From Current Editor Theme"), POPUP_IMPORT_EDITOR_THEME); top_menu->add_child(theme_menu); - theme_menu->get_popup()->connect("id_pressed", this, "_theme_menu_cbk"); + theme_menu->get_popup()->connect_compat("id_pressed", this, "_theme_menu_cbk"); ScrollContainer *scroll = memnew(ScrollContainer); add_child(scroll); @@ -835,7 +835,7 @@ ThemeEditor::ThemeEditor() { type_menu->set_text(".."); type_hbc->add_child(type_menu); - type_menu->get_popup()->connect("id_pressed", this, "_type_menu_cbk"); + type_menu->get_popup()->connect_compat("id_pressed", this, "_type_menu_cbk"); l = memnew(Label); l->set_text(TTR("Name:")); @@ -853,8 +853,8 @@ ThemeEditor::ThemeEditor() { name_menu->set_text(".."); name_hbc->add_child(name_menu); - name_menu->get_popup()->connect("about_to_show", this, "_name_menu_about_to_show"); - name_menu->get_popup()->connect("id_pressed", this, "_name_menu_cbk"); + name_menu->get_popup()->connect_compat("about_to_show", this, "_name_menu_about_to_show"); + name_menu->get_popup()->connect_compat("id_pressed", this, "_name_menu_cbk"); type_select_label = memnew(Label); type_select_label->set_text(TTR("Data Type:")); @@ -869,12 +869,12 @@ ThemeEditor::ThemeEditor() { dialog_vbc->add_child(type_select); - add_del_dialog->get_ok()->connect("pressed", this, "_dialog_cbk"); + add_del_dialog->get_ok()->connect_compat("pressed", this, "_dialog_cbk"); file_dialog = memnew(EditorFileDialog); file_dialog->add_filter("*.theme ; " + TTR("Theme File")); add_child(file_dialog); - file_dialog->connect("file_selected", this, "_save_template_cbk"); + file_dialog->connect_compat("file_selected", this, "_save_template_cbk"); } void ThemeEditorPlugin::edit(Object *p_node) { diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 145263a5ab..10d00b2a1d 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -55,7 +55,7 @@ void TileMapEditor::_notification(int p_what) { if (is_visible_in_tree()) { _update_palette(); } - FALLTHROUGH; + [[fallthrough]]; } case NOTIFICATION_ENTER_TREE: { @@ -1761,30 +1761,30 @@ void TileMapEditor::edit(Node *p_tile_map) { } if (node) - node->disconnect("settings_changed", this, "_tileset_settings_changed"); + node->disconnect_compat("settings_changed", this, "_tileset_settings_changed"); if (p_tile_map) { node = Object::cast_to<TileMap>(p_tile_map); - if (!canvas_item_editor_viewport->is_connected("mouse_entered", this, "_canvas_mouse_enter")) - canvas_item_editor_viewport->connect("mouse_entered", this, "_canvas_mouse_enter"); - if (!canvas_item_editor_viewport->is_connected("mouse_exited", this, "_canvas_mouse_exit")) - canvas_item_editor_viewport->connect("mouse_exited", this, "_canvas_mouse_exit"); + if (!canvas_item_editor_viewport->is_connected_compat("mouse_entered", this, "_canvas_mouse_enter")) + canvas_item_editor_viewport->connect_compat("mouse_entered", this, "_canvas_mouse_enter"); + if (!canvas_item_editor_viewport->is_connected_compat("mouse_exited", this, "_canvas_mouse_exit")) + canvas_item_editor_viewport->connect_compat("mouse_exited", this, "_canvas_mouse_exit"); _update_palette(); } else { node = NULL; - if (canvas_item_editor_viewport->is_connected("mouse_entered", this, "_canvas_mouse_enter")) - canvas_item_editor_viewport->disconnect("mouse_entered", this, "_canvas_mouse_enter"); - if (canvas_item_editor_viewport->is_connected("mouse_exited", this, "_canvas_mouse_exit")) - canvas_item_editor_viewport->disconnect("mouse_exited", this, "_canvas_mouse_exit"); + if (canvas_item_editor_viewport->is_connected_compat("mouse_entered", this, "_canvas_mouse_enter")) + canvas_item_editor_viewport->disconnect_compat("mouse_entered", this, "_canvas_mouse_enter"); + if (canvas_item_editor_viewport->is_connected_compat("mouse_exited", this, "_canvas_mouse_exit")) + canvas_item_editor_viewport->disconnect_compat("mouse_exited", this, "_canvas_mouse_exit"); _update_palette(); } if (node) - node->connect("settings_changed", this, "_tileset_settings_changed"); + node->connect_compat("settings_changed", this, "_tileset_settings_changed"); _clear_bucket_cache(); } @@ -1939,20 +1939,20 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { manual_button = memnew(CheckBox); manual_button->set_text(TTR("Disable Autotile")); - manual_button->connect("toggled", this, "_manual_toggled"); + manual_button->connect_compat("toggled", this, "_manual_toggled"); add_child(manual_button); priority_button = memnew(CheckBox); priority_button->set_text(TTR("Enable Priority")); - priority_button->connect("toggled", this, "_priority_toggled"); + priority_button->connect_compat("toggled", this, "_priority_toggled"); add_child(priority_button); search_box = memnew(LineEdit); search_box->set_placeholder(TTR("Filter tiles")); search_box->set_h_size_flags(SIZE_EXPAND_FILL); - search_box->connect("text_entered", this, "_text_entered"); - search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("gui_input", this, "_sbox_input"); + search_box->connect_compat("text_entered", this, "_text_entered"); + search_box->connect_compat("text_changed", this, "_text_changed"); + search_box->connect_compat("gui_input", this, "_sbox_input"); add_child(search_box); size_slider = memnew(HSlider); @@ -1961,7 +1961,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { size_slider->set_max(4.0f); size_slider->set_step(0.1f); size_slider->set_value(1.0f); - size_slider->connect("value_changed", this, "_icon_size_changed"); + size_slider->connect_compat("value_changed", this, "_icon_size_changed"); add_child(size_slider); int mw = EDITOR_DEF("editors/tile_map/palette_min_width", 80); @@ -1980,8 +1980,8 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { palette->set_max_text_lines(2); palette->set_select_mode(ItemList::SELECT_MULTI); palette->add_constant_override("vseparation", 8 * EDSCALE); - palette->connect("item_selected", this, "_palette_selected"); - palette->connect("multi_selected", this, "_palette_multi_selected"); + palette->connect_compat("item_selected", this, "_palette_selected"); + palette->connect_compat("multi_selected", this, "_palette_multi_selected"); palette_container->add_child(palette); // Add message for when no texture is selected. @@ -2015,25 +2015,25 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { paint_button = memnew(ToolButton); paint_button->set_shortcut(ED_SHORTCUT("tile_map_editor/paint_tile", TTR("Paint Tile"), KEY_P)); paint_button->set_tooltip(TTR("Shift+LMB: Line Draw\nShift+Ctrl+LMB: Rectangle Paint")); - paint_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_NONE)); + paint_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_NONE)); paint_button->set_toggle_mode(true); toolbar->add_child(paint_button); bucket_fill_button = memnew(ToolButton); bucket_fill_button->set_shortcut(ED_SHORTCUT("tile_map_editor/bucket_fill", TTR("Bucket Fill"), KEY_G)); - bucket_fill_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_BUCKET)); + bucket_fill_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_BUCKET)); bucket_fill_button->set_toggle_mode(true); toolbar->add_child(bucket_fill_button); picker_button = memnew(ToolButton); picker_button->set_shortcut(ED_SHORTCUT("tile_map_editor/pick_tile", TTR("Pick Tile"), KEY_I)); - picker_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_PICKING)); + picker_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_PICKING)); picker_button->set_toggle_mode(true); toolbar->add_child(picker_button); select_button = memnew(ToolButton); select_button->set_shortcut(ED_SHORTCUT("tile_map_editor/select", TTR("Select"), KEY_M)); - select_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_SELECTING)); + select_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_SELECTING)); select_button->set_toggle_mode(true); toolbar->add_child(select_button); @@ -2068,40 +2068,40 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { p->add_shortcut(ED_GET_SHORTCUT("tile_map_editor/erase_selection"), OPTION_ERASE_SELECTION); p->add_separator(); p->add_item(TTR("Fix Invalid Tiles"), OPTION_FIX_INVALID); - p->connect("id_pressed", this, "_menu_option"); + p->connect_compat("id_pressed", this, "_menu_option"); rotate_left_button = memnew(ToolButton); rotate_left_button->set_tooltip(TTR("Rotate Left")); rotate_left_button->set_focus_mode(FOCUS_NONE); - rotate_left_button->connect("pressed", this, "_rotate", varray(-1)); + rotate_left_button->connect_compat("pressed", this, "_rotate", varray(-1)); rotate_left_button->set_shortcut(ED_SHORTCUT("tile_map_editor/rotate_left", TTR("Rotate Left"), KEY_A)); tool_hb->add_child(rotate_left_button); rotate_right_button = memnew(ToolButton); rotate_right_button->set_tooltip(TTR("Rotate Right")); rotate_right_button->set_focus_mode(FOCUS_NONE); - rotate_right_button->connect("pressed", this, "_rotate", varray(1)); + rotate_right_button->connect_compat("pressed", this, "_rotate", varray(1)); rotate_right_button->set_shortcut(ED_SHORTCUT("tile_map_editor/rotate_right", TTR("Rotate Right"), KEY_S)); tool_hb->add_child(rotate_right_button); flip_horizontal_button = memnew(ToolButton); flip_horizontal_button->set_tooltip(TTR("Flip Horizontally")); flip_horizontal_button->set_focus_mode(FOCUS_NONE); - flip_horizontal_button->connect("pressed", this, "_flip_horizontal"); + flip_horizontal_button->connect_compat("pressed", this, "_flip_horizontal"); flip_horizontal_button->set_shortcut(ED_SHORTCUT("tile_map_editor/flip_horizontal", TTR("Flip Horizontally"), KEY_X)); tool_hb->add_child(flip_horizontal_button); flip_vertical_button = memnew(ToolButton); flip_vertical_button->set_tooltip(TTR("Flip Vertically")); flip_vertical_button->set_focus_mode(FOCUS_NONE); - flip_vertical_button->connect("pressed", this, "_flip_vertical"); + flip_vertical_button->connect_compat("pressed", this, "_flip_vertical"); flip_vertical_button->set_shortcut(ED_SHORTCUT("tile_map_editor/flip_vertical", TTR("Flip Vertically"), KEY_Z)); tool_hb->add_child(flip_vertical_button); clear_transform_button = memnew(ToolButton); clear_transform_button->set_tooltip(TTR("Clear Transform")); clear_transform_button->set_focus_mode(FOCUS_NONE); - clear_transform_button->connect("pressed", this, "_clear_transform"); + clear_transform_button->connect_compat("pressed", this, "_clear_transform"); clear_transform_button->set_shortcut(ED_SHORTCUT("tile_map_editor/clear_transform", TTR("Clear Transform"), KEY_W)); tool_hb->add_child(clear_transform_button); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 4fea504f7d..a61b291029 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -358,19 +358,19 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { left_container->add_child(texture_list); texture_list->set_v_size_flags(SIZE_EXPAND_FILL); texture_list->set_custom_minimum_size(Size2(200, 0)); - texture_list->connect("item_selected", this, "_on_texture_list_selected"); + texture_list->connect_compat("item_selected", this, "_on_texture_list_selected"); texture_list->set_drag_forwarding(this); HBoxContainer *tileset_toolbar_container = memnew(HBoxContainer); left_container->add_child(tileset_toolbar_container); tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE] = memnew(ToolButton); - tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->connect("pressed", this, "_on_tileset_toolbar_button_pressed", varray(TOOL_TILESET_ADD_TEXTURE)); + tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->connect_compat("pressed", this, "_on_tileset_toolbar_button_pressed", varray(TOOL_TILESET_ADD_TEXTURE)); tileset_toolbar_container->add_child(tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]); tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->set_tooltip(TTR("Add Texture(s) to TileSet.")); tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE] = memnew(ToolButton); - tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->connect("pressed", this, "_on_tileset_toolbar_button_pressed", varray(TOOL_TILESET_REMOVE_TEXTURE)); + tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->connect_compat("pressed", this, "_on_tileset_toolbar_button_pressed", varray(TOOL_TILESET_REMOVE_TEXTURE)); tileset_toolbar_container->add_child(tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]); tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->set_tooltip(TTR("Remove selected Texture from TileSet.")); @@ -383,7 +383,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tileset_toolbar_tools->get_popup()->add_item(TTR("Create from Scene"), TOOL_TILESET_CREATE_SCENE); tileset_toolbar_tools->get_popup()->add_item(TTR("Merge from Scene"), TOOL_TILESET_MERGE_SCENE); - tileset_toolbar_tools->get_popup()->connect("id_pressed", this, "_on_tileset_toolbar_button_pressed"); + tileset_toolbar_tools->get_popup()->connect_compat("id_pressed", this, "_on_tileset_toolbar_button_pressed"); tileset_toolbar_container->add_child(tileset_toolbar_tools); //--------------- @@ -416,7 +416,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tool_workspacemode[i]->set_text(workspace_label[i]); tool_workspacemode[i]->set_toggle_mode(true); tool_workspacemode[i]->set_button_group(g); - tool_workspacemode[i]->connect("pressed", this, "_on_workspace_mode_changed", varray(i)); + tool_workspacemode[i]->connect_compat("pressed", this, "_on_workspace_mode_changed", varray(i)); tool_hb->add_child(tool_workspacemode[i]); } @@ -429,14 +429,14 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tool_hb->add_child(tools[SELECT_NEXT]); tool_hb->move_child(tools[SELECT_NEXT], WORKSPACE_CREATE_SINGLE); tools[SELECT_NEXT]->set_shortcut(ED_SHORTCUT("tileset_editor/next_shape", TTR("Next Coordinate"), KEY_PAGEDOWN)); - tools[SELECT_NEXT]->connect("pressed", this, "_on_tool_clicked", varray(SELECT_NEXT)); + tools[SELECT_NEXT]->connect_compat("pressed", this, "_on_tool_clicked", varray(SELECT_NEXT)); tools[SELECT_NEXT]->set_tooltip(TTR("Select the next shape, subtile, or Tile.")); tools[SELECT_PREVIOUS] = memnew(ToolButton); tool_hb->add_child(tools[SELECT_PREVIOUS]); tool_hb->move_child(tools[SELECT_PREVIOUS], WORKSPACE_CREATE_SINGLE); tools[SELECT_PREVIOUS]->set_shortcut(ED_SHORTCUT("tileset_editor/previous_shape", TTR("Previous Coordinate"), KEY_PAGEUP)); tools[SELECT_PREVIOUS]->set_tooltip(TTR("Select the previous shape, subtile, or Tile.")); - tools[SELECT_PREVIOUS]->connect("pressed", this, "_on_tool_clicked", varray(SELECT_PREVIOUS)); + tools[SELECT_PREVIOUS]->connect_compat("pressed", this, "_on_tool_clicked", varray(SELECT_PREVIOUS)); VSeparator *separator_shape_selection = memnew(VSeparator); tool_hb->add_child(separator_shape_selection); @@ -466,7 +466,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tool_editmode[i]->set_text(label[i]); tool_editmode[i]->set_toggle_mode(true); tool_editmode[i]->set_button_group(g); - tool_editmode[i]->connect("pressed", this, "_on_edit_mode_changed", varray(i)); + tool_editmode[i]->connect_compat("pressed", this, "_on_edit_mode_changed", varray(i)); tool_hb->add_child(tool_editmode[i]); } tool_editmode[EDITMODE_COLLISION]->set_pressed(true); @@ -493,21 +493,21 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tools[TOOL_SELECT]->set_toggle_mode(true); tools[TOOL_SELECT]->set_button_group(tg); tools[TOOL_SELECT]->set_pressed(true); - tools[TOOL_SELECT]->connect("pressed", this, "_on_tool_clicked", varray(TOOL_SELECT)); + tools[TOOL_SELECT]->connect_compat("pressed", this, "_on_tool_clicked", varray(TOOL_SELECT)); separator_bitmask = memnew(VSeparator); toolbar->add_child(separator_bitmask); tools[BITMASK_COPY] = memnew(ToolButton); tools[BITMASK_COPY]->set_tooltip(TTR("Copy bitmask.")); - tools[BITMASK_COPY]->connect("pressed", this, "_on_tool_clicked", varray(BITMASK_COPY)); + tools[BITMASK_COPY]->connect_compat("pressed", this, "_on_tool_clicked", varray(BITMASK_COPY)); toolbar->add_child(tools[BITMASK_COPY]); tools[BITMASK_PASTE] = memnew(ToolButton); tools[BITMASK_PASTE]->set_tooltip(TTR("Paste bitmask.")); - tools[BITMASK_PASTE]->connect("pressed", this, "_on_tool_clicked", varray(BITMASK_PASTE)); + tools[BITMASK_PASTE]->connect_compat("pressed", this, "_on_tool_clicked", varray(BITMASK_PASTE)); toolbar->add_child(tools[BITMASK_PASTE]); tools[BITMASK_CLEAR] = memnew(ToolButton); tools[BITMASK_CLEAR]->set_tooltip(TTR("Erase bitmask.")); - tools[BITMASK_CLEAR]->connect("pressed", this, "_on_tool_clicked", varray(BITMASK_CLEAR)); + tools[BITMASK_CLEAR]->connect_compat("pressed", this, "_on_tool_clicked", varray(BITMASK_CLEAR)); toolbar->add_child(tools[BITMASK_CLEAR]); tools[SHAPE_NEW_RECTANGLE] = memnew(ToolButton); @@ -525,13 +525,13 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { separator_shape_toggle = memnew(VSeparator); toolbar->add_child(separator_shape_toggle); tools[SHAPE_TOGGLE_TYPE] = memnew(ToolButton); - tools[SHAPE_TOGGLE_TYPE]->connect("pressed", this, "_on_tool_clicked", varray(SHAPE_TOGGLE_TYPE)); + tools[SHAPE_TOGGLE_TYPE]->connect_compat("pressed", this, "_on_tool_clicked", varray(SHAPE_TOGGLE_TYPE)); toolbar->add_child(tools[SHAPE_TOGGLE_TYPE]); separator_delete = memnew(VSeparator); toolbar->add_child(separator_delete); tools[SHAPE_DELETE] = memnew(ToolButton); - tools[SHAPE_DELETE]->connect("pressed", this, "_on_tool_clicked", varray(SHAPE_DELETE)); + tools[SHAPE_DELETE]->connect_compat("pressed", this, "_on_tool_clicked", varray(SHAPE_DELETE)); toolbar->add_child(tools[SHAPE_DELETE]); spin_priority = memnew(SpinBox); @@ -539,7 +539,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { spin_priority->set_max(255); spin_priority->set_step(1); spin_priority->set_custom_minimum_size(Size2(100, 0)); - spin_priority->connect("value_changed", this, "_on_priority_changed"); + spin_priority->connect_compat("value_changed", this, "_on_priority_changed"); spin_priority->hide(); toolbar->add_child(spin_priority); @@ -548,7 +548,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { spin_z_index->set_max(VS::CANVAS_ITEM_Z_MAX); spin_z_index->set_step(1); spin_z_index->set_custom_minimum_size(Size2(100, 0)); - spin_z_index->connect("value_changed", this, "_on_z_index_changed"); + spin_z_index->connect_compat("value_changed", this, "_on_z_index_changed"); spin_z_index->hide(); toolbar->add_child(spin_z_index); @@ -562,7 +562,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tools[TOOL_GRID_SNAP] = memnew(ToolButton); tools[TOOL_GRID_SNAP]->set_toggle_mode(true); tools[TOOL_GRID_SNAP]->set_tooltip(TTR("Enable snap and show grid (configurable via the Inspector).")); - tools[TOOL_GRID_SNAP]->connect("toggled", this, "_on_grid_snap_toggled"); + tools[TOOL_GRID_SNAP]->connect_compat("toggled", this, "_on_grid_snap_toggled"); toolbar->add_child(tools[TOOL_GRID_SNAP]); Control *separator = memnew(Control); @@ -570,15 +570,15 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { toolbar->add_child(separator); tools[ZOOM_OUT] = memnew(ToolButton); - tools[ZOOM_OUT]->connect("pressed", this, "_zoom_out"); + tools[ZOOM_OUT]->connect_compat("pressed", this, "_zoom_out"); toolbar->add_child(tools[ZOOM_OUT]); tools[ZOOM_OUT]->set_tooltip(TTR("Zoom Out")); tools[ZOOM_1] = memnew(ToolButton); - tools[ZOOM_1]->connect("pressed", this, "_zoom_reset"); + tools[ZOOM_1]->connect_compat("pressed", this, "_zoom_reset"); toolbar->add_child(tools[ZOOM_1]); tools[ZOOM_1]->set_tooltip(TTR("Zoom Reset")); tools[ZOOM_IN] = memnew(ToolButton); - tools[ZOOM_IN]->connect("pressed", this, "_zoom_in"); + tools[ZOOM_IN]->connect_compat("pressed", this, "_zoom_in"); toolbar->add_child(tools[ZOOM_IN]); tools[ZOOM_IN]->set_tooltip(TTR("Zoom In")); @@ -607,13 +607,13 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { scroll->add_child(workspace_container); workspace_overlay = memnew(Control); - workspace_overlay->connect("draw", this, "_on_workspace_overlay_draw"); + workspace_overlay->connect_compat("draw", this, "_on_workspace_overlay_draw"); workspace_container->add_child(workspace_overlay); workspace = memnew(Control); workspace->set_focus_mode(FOCUS_ALL); - workspace->connect("draw", this, "_on_workspace_draw"); - workspace->connect("gui_input", this, "_on_workspace_input"); + workspace->connect_compat("draw", this, "_on_workspace_draw"); + workspace->connect_compat("gui_input", this, "_on_workspace_input"); workspace->set_draw_behind_parent(true); workspace_overlay->add_child(workspace); @@ -626,7 +626,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { //--------------- cd = memnew(ConfirmationDialog); add_child(cd); - cd->connect("confirmed", this, "_on_tileset_toolbar_confirm"); + cd->connect_compat("confirmed", this, "_on_tileset_toolbar_confirm"); //--------------- err_dialog = memnew(AcceptDialog); @@ -645,7 +645,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { texture_dialog->add_filter("*." + E->get() + " ; " + E->get().to_upper()); } add_child(texture_dialog); - texture_dialog->connect("files_selected", this, "_on_textures_added"); + texture_dialog->connect_compat("files_selected", this, "_on_textures_added"); //--------------- helper = memnew(TilesetEditorContext(this)); @@ -3507,7 +3507,7 @@ void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class())); if (tileset_editor->edited_collision_shape.is_valid()) { p_list->push_back(PropertyInfo(Variant::BOOL, "selected_collision_one_way", PROPERTY_HINT_NONE)); - p_list->push_back(PropertyInfo(Variant::REAL, "selected_collision_one_way_margin", PROPERTY_HINT_NONE)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "selected_collision_one_way_margin", PROPERTY_HINT_NONE)); } } if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_NAVIGATION && tileset_editor->edited_navigation_shape.is_valid()) { @@ -3548,11 +3548,11 @@ void TileSetEditorPlugin::make_visible(bool p_visible) { if (p_visible) { tileset_editor_button->show(); editor->make_bottom_panel_item_visible(tileset_editor); - get_tree()->connect("idle_frame", tileset_editor, "_on_workspace_process"); + get_tree()->connect_compat("idle_frame", tileset_editor, "_on_workspace_process"); } else { editor->hide_bottom_panel(); tileset_editor_button->hide(); - get_tree()->disconnect("idle_frame", tileset_editor, "_on_workspace_process"); + get_tree()->disconnect_compat("idle_frame", tileset_editor, "_on_workspace_process"); } } diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index e17e6a9d16..cfa10488ab 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -127,7 +127,7 @@ void VersionControlEditorPlugin::_initialize_vcs() { vcs_interface->set_script_and_instance(script, addon_script_instance); EditorVCSInterface::set_singleton(vcs_interface); - EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_refresh_stage_area"); + EditorFileSystem::get_singleton()->connect_compat("filesystem_changed", this, "_refresh_stage_area"); String res_dir = OS::get_singleton()->get_resource_dir(); @@ -388,8 +388,8 @@ void VersionControlEditorPlugin::clear_stage_area() { void VersionControlEditorPlugin::shut_down() { if (EditorVCSInterface::get_singleton()) { - if (EditorFileSystem::get_singleton()->is_connected("filesystem_changed", this, "_refresh_stage_area")) { - EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "_refresh_stage_area"); + if (EditorFileSystem::get_singleton()->is_connected_compat("filesystem_changed", this, "_refresh_stage_area")) { + EditorFileSystem::get_singleton()->disconnect_compat("filesystem_changed", this, "_refresh_stage_area"); } EditorVCSInterface::get_singleton()->shut_down(); memdelete(EditorVCSInterface::get_singleton()); @@ -444,14 +444,14 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { set_up_choice = memnew(OptionButton); set_up_choice->set_h_size_flags(HBoxContainer::SIZE_EXPAND_FILL); - set_up_choice->connect("item_selected", this, "_selected_a_vcs"); + set_up_choice->connect_compat("item_selected", this, "_selected_a_vcs"); set_up_hbc->add_child(set_up_choice); set_up_init_settings = NULL; set_up_init_button = memnew(Button); set_up_init_button->set_text(TTR("Initialize")); - set_up_init_button->connect("pressed", this, "_initialize_vcs"); + set_up_init_button->connect_compat("pressed", this, "_initialize_vcs"); set_up_vbc->add_child(set_up_init_button); version_control_actions->set_v_size_flags(PopupMenu::SIZE_EXPAND_FILL); @@ -479,7 +479,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { refresh_button->set_tooltip(TTR("Detect new changes")); refresh_button->set_text(TTR("Refresh")); refresh_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Reload", "EditorIcons")); - refresh_button->connect("pressed", this, "_refresh_stage_area"); + refresh_button->connect_compat("pressed", this, "_refresh_stage_area"); stage_tools->add_child(refresh_button); stage_files = memnew(Tree); @@ -492,7 +492,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { stage_files->set_allow_rmb_select(true); stage_files->set_select_mode(Tree::SelectMode::SELECT_MULTI); stage_files->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); - stage_files->connect("cell_selected", this, "_view_file_diff"); + stage_files->connect_compat("cell_selected", this, "_view_file_diff"); stage_files->create_item(); stage_files->set_hide_root(true); commit_box_vbc->add_child(stage_files); @@ -516,12 +516,12 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { stage_selected_button = memnew(Button); stage_selected_button->set_h_size_flags(Button::SIZE_EXPAND_FILL); stage_selected_button->set_text(TTR("Stage Selected")); - stage_selected_button->connect("pressed", this, "_stage_selected"); + stage_selected_button->connect_compat("pressed", this, "_stage_selected"); stage_buttons->add_child(stage_selected_button); stage_all_button = memnew(Button); stage_all_button->set_text(TTR("Stage All")); - stage_all_button->connect("pressed", this, "_stage_all"); + stage_all_button->connect_compat("pressed", this, "_stage_all"); stage_buttons->add_child(stage_all_button); commit_box_vbc->add_child(memnew(HSeparator)); @@ -537,7 +537,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { commit_button = memnew(Button); commit_button->set_text(TTR("Commit Changes")); - commit_button->connect("pressed", this, "_send_commit_msg"); + commit_button->connect_compat("pressed", this, "_send_commit_msg"); commit_box_vbc->add_child(commit_button); commit_status = memnew(Label); @@ -571,7 +571,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { diff_refresh_button = memnew(Button); diff_refresh_button->set_tooltip(TTR("Detect changes in file diff")); diff_refresh_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Reload", "EditorIcons")); - diff_refresh_button->connect("pressed", this, "_refresh_file_diff"); + diff_refresh_button->connect_compat("pressed", this, "_refresh_file_diff"); diff_hbc->add_child(diff_refresh_button); diff = memnew(RichTextLabel); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 6c8c1b44dc..2fb23f6a84 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -35,6 +35,7 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" +#include "core/version.h" #include "editor/editor_log.h" #include "editor/editor_properties.h" #include "editor/editor_scale.h" @@ -72,14 +73,20 @@ void VisualShaderEditor::edit(VisualShader *p_visual_shader) { } } visual_shader = Ref<VisualShader>(p_visual_shader); - if (!visual_shader->is_connected("changed", this, "_update_preview")) { - visual_shader->connect("changed", this, "_update_preview"); + if (!visual_shader->is_connected_compat("changed", this, "_update_preview")) { + visual_shader->connect_compat("changed", this, "_update_preview"); } +#ifndef DISABLE_DEPRECATED + String version = VERSION_BRANCH; + if (visual_shader->get_version() != version) { + visual_shader->update_version(version); + } +#endif visual_shader->set_graph_offset(graph->get_scroll_ofs() / EDSCALE); } else { if (visual_shader.is_valid()) { - if (visual_shader->is_connected("changed", this, "")) { - visual_shader->disconnect("changed", this, "_update_preview"); + if (visual_shader->is_connected_compat("changed", this, "")) { + visual_shader->disconnect_compat("changed", this, "_update_preview"); } } visual_shader.unref(); @@ -116,7 +123,7 @@ void VisualShaderEditor::clear_custom_types() { } } -void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_subcategory, bool p_highend) { +void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, bool p_highend) { ERR_FAIL_COND(!p_name.is_valid_identifier()); ERR_FAIL_COND(!p_script.is_valid()); @@ -134,15 +141,15 @@ void VisualShaderEditor::add_custom_type(const String &p_name, const Ref<Script> ao.return_type = p_return_icon_type; ao.description = p_description; ao.category = p_category; - ao.sub_category = p_subcategory; ao.highend = p_highend; ao.is_custom = true; bool begin = false; + String root = p_category.split("/")[0]; for (int i = 0; i < add_options.size(); i++) { if (add_options[i].is_custom) { - if (add_options[i].category == p_category) { + if (add_options[i].category == root) { if (!begin) { begin = true; } @@ -239,9 +246,6 @@ void VisualShaderEditor::update_custom_nodes() { if (ref->has_method("_get_category")) { category = (String)ref->call("_get_category"); } - if (category == "") { - category = "Custom"; - } String subcategory = ""; if (ref->has_method("_get_subcategory")) { @@ -258,18 +262,19 @@ void VisualShaderEditor::update_custom_nodes() { dict["script"] = script; dict["description"] = description; dict["return_icon_type"] = return_icon_type; + + category = category.rstrip("/"); + category = category.lstrip("/"); + category = "Addons/" + category; + if (subcategory != "") { + category += "/" + subcategory; + } + dict["category"] = category; - dict["subcategory"] = subcategory; dict["highend"] = highend; String key; - key = category; - key += "/"; - if (subcategory != "") { - key += subcategory; - key += "/"; - } - key += name; + key = category + "/" + name; added[key] = dict; } @@ -284,7 +289,7 @@ void VisualShaderEditor::update_custom_nodes() { const Dictionary &value = (Dictionary)added[key]; - add_custom_type(value["name"], value["script"], value["description"], value["return_icon_type"], value["category"], value["subcategory"], value["highend"]); + add_custom_type(value["name"], value["script"], value["description"], value["return_icon_type"], value["category"], value["highend"]); } _update_options_menu(); @@ -299,22 +304,12 @@ void VisualShaderEditor::_update_options_menu() { node_desc->set_text(""); members_dialog->get_ok()->set_disabled(true); - String prev_category; - String prev_sub_category; - members->clear(); TreeItem *root = members->create_item(); - TreeItem *category = NULL; - TreeItem *sub_category = NULL; String filter = node_filter->get_text().strip_edges(); bool use_filter = !filter.empty(); - Vector<String> categories; - Vector<String> sub_categories; - - int item_count = 0; - int item_count2 = 0; bool is_first_item = true; Color unsupported_color = get_color("error_color", "Editor"); @@ -322,111 +317,95 @@ void VisualShaderEditor::_update_options_menu() { static bool low_driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES2"; + Map<String, TreeItem *> folders; + int current_func = -1; if (!visual_shader.is_null()) { current_func = visual_shader->get_mode(); } - for (int i = 0; i < add_options.size() + 1; i++) { + Vector<AddOption> custom_options; + Vector<AddOption> embedded_options; - if (i == add_options.size()) { - if (sub_category != NULL && item_count2 == 0) { - memdelete(sub_category); - --item_count; + for (int i = 0; i < add_options.size(); i++) { + if (!use_filter || add_options[i].name.findn(filter) != -1) { + if ((add_options[i].func != current_func && add_options[i].func != -1) || !_is_available(add_options[i].mode)) { + continue; } - if (category != NULL && item_count == 0) { - memdelete(category); + const_cast<AddOption &>(add_options[i]).temp_idx = i; // save valid id + if (add_options[i].is_custom) { + custom_options.push_back(add_options[i]); + } else { + embedded_options.push_back(add_options[i]); } - break; } + } + Vector<AddOption> options; + SortArray<AddOption, _OptionComparator> sorter; + sorter.sort(custom_options.ptrw(), custom_options.size()); - if (!use_filter || add_options[i].name.findn(filter) != -1) { - - if ((add_options[i].func != current_func && add_options[i].func != -1) || !_is_available(add_options[i].mode)) - continue; + options.append_array(custom_options); + options.append_array(embedded_options); - if (prev_category != add_options[i].category) { - if (category != NULL && item_count == 0) { - memdelete(category); - } + for (int i = 0; i < options.size(); i++) { + String path = options[i].category; + Vector<String> subfolders = path.split("/"); + TreeItem *category = NULL; - item_count = 0; - prev_sub_category = ""; - category = members->create_item(root); - category->set_text(0, add_options[i].category); - category->set_selectable(0, false); - if (!use_filter) - category->set_collapsed(true); - } - - if (add_options[i].sub_category != "") { - if (prev_sub_category != add_options[i].sub_category) { - if (category != NULL) { - if (sub_category != NULL && item_count2 == 0) { - memdelete(sub_category); - --item_count; - } - ++item_count; - item_count2 = 0; - sub_category = members->create_item(category); - sub_category->set_text(0, add_options[i].sub_category); - sub_category->set_selectable(0, false); - if (!use_filter) - sub_category->set_collapsed(true); - } - } - } else { - sub_category = NULL; - } - - TreeItem *p_category = NULL; - - if (sub_category != NULL) { - p_category = sub_category; - ++item_count2; - } else if (category != NULL) { - p_category = category; - ++item_count; - } - - if (p_category != NULL) { - TreeItem *item = members->create_item(p_category); - if (add_options[i].highend && low_driver) - item->set_custom_color(0, unsupported_color); - else if (add_options[i].highend) - item->set_custom_color(0, supported_color); - item->set_text(0, add_options[i].name); - if (is_first_item && use_filter) { - item->select(0); - node_desc->set_text(_get_description(i)); - is_first_item = false; - } - switch (add_options[i].return_type) { - case VisualShaderNode::PORT_TYPE_SCALAR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_VECTOR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_BOOLEAN: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_TRANSFORM: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons")); - break; - case VisualShaderNode::PORT_TYPE_SAMPLER: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("ImageTexture", "EditorIcons")); - break; - default: - break; + if (!folders.has(path)) { + category = root; + String path_temp = ""; + for (int j = 0; j < subfolders.size(); j++) { + path_temp += subfolders[j]; + if (!folders.has(path_temp)) { + category = members->create_item(category); + category->set_selectable(0, false); + category->set_collapsed(!use_filter); + category->set_text(0, subfolders[j]); + folders.insert(path_temp, category); + } else { + category = folders[path_temp]; } - item->set_meta("id", i); } - - prev_sub_category = add_options[i].sub_category; - prev_category = add_options[i].category; + } else { + category = folders[path]; + } + + TreeItem *item = members->create_item(category); + if (options[i].highend && low_driver) + item->set_custom_color(0, unsupported_color); + else if (options[i].highend) + item->set_custom_color(0, supported_color); + item->set_text(0, options[i].name); + if (is_first_item && use_filter) { + item->select(0); + node_desc->set_text(options[i].description); + is_first_item = false; + } + switch (options[i].return_type) { + case VisualShaderNode::PORT_TYPE_SCALAR: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_SCALAR_INT: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("int", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_VECTOR: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_BOOLEAN: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_TRANSFORM: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons")); + break; + case VisualShaderNode::PORT_TYPE_SAMPLER: + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("ImageTexture", "EditorIcons")); + break; + default: + break; } + item->set_meta("id", options[i].temp_idx); } } @@ -459,14 +438,22 @@ void VisualShaderEditor::_update_created_node(GraphNode *node) { if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { Ref<StyleBoxFlat> sb = node->get_stylebox("frame", "GraphNode"); Color c = sb->get_border_color(); - Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0); + Color ic; + Color mono_color; + if (((c.r + c.g + c.b) / 3) < 0.7) { + mono_color = Color(1.0, 1.0, 1.0); + ic = Color(0.0, 0.0, 0.0, 0.7); + } else { + mono_color = Color(0.0, 0.0, 0.0); + ic = Color(1.0, 1.0, 1.0, 0.7); + } mono_color.a = 0.85; c = mono_color; node->add_color_override("title_color", c); c.a = 0.7; node->add_color_override("close_color", c); - node->add_color_override("resizer_color", c); + node->add_color_override("resizer_color", ic); } } @@ -493,12 +480,13 @@ void VisualShaderEditor::_update_graph() { } } - static const Color type_color[5] = { - Color(0.38, 0.85, 0.96), // scalar + static const Color type_color[6] = { + Color(0.38, 0.85, 0.96), // scalar (float) + Color(0.49, 0.78, 0.94), // scalar (int) Color(0.84, 0.49, 0.93), // vector Color(0.55, 0.65, 0.94), // boolean Color(0.96, 0.66, 0.43), // transform - Color(1.0, 1.0, 0.0) // sampler + Color(1.0, 1.0, 0.0), // sampler }; List<VisualShader::Connection> connections; @@ -529,7 +517,7 @@ void VisualShaderEditor::_update_graph() { size = group_node->get_size(); node->set_resizable(true); - node->connect("resize_request", this, "_node_resized", varray((int)type, nodes[n_i])); + node->connect_compat("resize_request", this, "_node_resized", varray((int)type, nodes[n_i])); } if (is_expression) { expression = expression_node->get_expression(); @@ -546,10 +534,10 @@ void VisualShaderEditor::_update_graph() { if (nodes[n_i] >= 2) { node->set_show_close_button(true); - node->connect("close_request", this, "_delete_request", varray(nodes[n_i]), CONNECT_DEFERRED); + node->connect_compat("close_request", this, "_delete_request", varray(nodes[n_i]), CONNECT_DEFERRED); } - node->connect("dragged", this, "_node_dragged", varray(nodes[n_i])); + node->connect_compat("dragged", this, "_node_dragged", varray(nodes[n_i])); Control *custom_editor = NULL; int port_offset = 0; @@ -559,7 +547,8 @@ void VisualShaderEditor::_update_graph() { } Ref<VisualShaderNodeUniform> uniform = vsnode; - Ref<VisualShaderNodeScalarUniform> scalar_uniform = vsnode; + Ref<VisualShaderNodeFloatUniform> float_uniform = vsnode; + Ref<VisualShaderNodeIntUniform> int_uniform = vsnode; if (uniform.is_valid()) { graph->add_child(node); _update_created_node(node); @@ -567,14 +556,14 @@ void VisualShaderEditor::_update_graph() { LineEdit *uniform_name = memnew(LineEdit); uniform_name->set_text(uniform->get_uniform_name()); node->add_child(uniform_name); - uniform_name->connect("text_entered", this, "_line_edit_changed", varray(uniform_name, nodes[n_i])); - uniform_name->connect("focus_exited", this, "_line_edit_focus_out", varray(uniform_name, nodes[n_i])); + uniform_name->connect_compat("text_entered", this, "_line_edit_changed", varray(uniform_name, nodes[n_i])); + uniform_name->connect_compat("focus_exited", this, "_line_edit_focus_out", varray(uniform_name, nodes[n_i])); if (vsnode->get_input_port_count() == 0 && vsnode->get_output_port_count() == 1 && vsnode->get_output_port_name(0) == "") { //shortcut VisualShaderNode::PortType port_right = vsnode->get_output_port_type(0); node->set_slot(0, false, VisualShaderNode::PORT_TYPE_SCALAR, Color(), true, port_right, type_color[port_right]); - if (!scalar_uniform.is_valid()) { + if (!float_uniform.is_valid() && !int_uniform.is_valid()) { continue; } } @@ -588,13 +577,13 @@ void VisualShaderEditor::_update_graph() { } } - if (custom_editor && !scalar_uniform.is_valid() && vsnode->get_output_port_count() > 0 && vsnode->get_output_port_name(0) == "" && (vsnode->get_input_port_count() == 0 || vsnode->get_input_port_name(0) == "")) { + if (custom_editor && !float_uniform.is_valid() && !int_uniform.is_valid() && vsnode->get_output_port_count() > 0 && vsnode->get_output_port_name(0) == "" && (vsnode->get_input_port_count() == 0 || vsnode->get_input_port_name(0) == "")) { //will be embedded in first port } else if (custom_editor) { port_offset++; node->add_child(custom_editor); - if (scalar_uniform.is_valid()) { + if (float_uniform.is_valid() || int_uniform.is_valid()) { custom_editor->call_deferred("_show_prop_names", true); continue; } @@ -612,14 +601,14 @@ void VisualShaderEditor::_update_graph() { Button *add_input_btn = memnew(Button); add_input_btn->set_text(TTR("Add Input")); - add_input_btn->connect("pressed", this, "_add_input_port", varray(nodes[n_i], group_node->get_free_input_port_id(), VisualShaderNode::PORT_TYPE_VECTOR, "input" + itos(group_node->get_free_input_port_id())), CONNECT_DEFERRED); + add_input_btn->connect_compat("pressed", this, "_add_input_port", varray(nodes[n_i], group_node->get_free_input_port_id(), VisualShaderNode::PORT_TYPE_VECTOR, "input" + itos(group_node->get_free_input_port_id())), CONNECT_DEFERRED); hb2->add_child(add_input_btn); hb2->add_spacer(); Button *add_output_btn = memnew(Button); add_output_btn->set_text(TTR("Add Output")); - add_output_btn->connect("pressed", this, "_add_output_port", varray(nodes[n_i], group_node->get_free_output_port_id(), VisualShaderNode::PORT_TYPE_VECTOR, "output" + itos(group_node->get_free_output_port_id())), CONNECT_DEFERRED); + add_output_btn->connect_compat("pressed", this, "_add_output_port", varray(nodes[n_i], group_node->get_free_output_port_id(), VisualShaderNode::PORT_TYPE_VECTOR, "output" + itos(group_node->get_free_output_port_id())), CONNECT_DEFERRED); hb2->add_child(add_output_btn); node->add_child(hb2); @@ -667,19 +656,19 @@ void VisualShaderEditor::_update_graph() { if (default_value.get_type() != Variant::NIL) { // only a label Button *button = memnew(Button); hb->add_child(button); - button->connect("pressed", this, "_edit_port_default_input", varray(button, nodes[n_i], i)); + button->connect_compat("pressed", this, "_edit_port_default_input", varray(button, nodes[n_i], i)); switch (default_value.get_type()) { case Variant::COLOR: { button->set_custom_minimum_size(Size2(30, 0) * EDSCALE); - button->connect("draw", this, "_draw_color_over_button", varray(button, default_value)); + button->connect_compat("draw", this, "_draw_color_over_button", varray(button, default_value)); } break; case Variant::BOOL: { button->set_text(((bool)default_value) ? "true" : "false"); } break; case Variant::INT: - case Variant::REAL: { + case Variant::FLOAT: { button->set_text(String::num(default_value, 4)); } break; case Variant::VECTOR3: { @@ -701,27 +690,28 @@ void VisualShaderEditor::_update_graph() { if (is_group) { OptionButton *type_box = memnew(OptionButton); hb->add_child(type_box); - type_box->add_item(TTR("Scalar")); + type_box->add_item(TTR("Float")); + type_box->add_item(TTR("Int")); type_box->add_item(TTR("Vector")); type_box->add_item(TTR("Boolean")); type_box->add_item(TTR("Transform")); type_box->add_item(TTR("Sampler")); type_box->select(group_node->get_input_port_type(i)); type_box->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - type_box->connect("item_selected", this, "_change_input_port_type", varray(nodes[n_i], i), CONNECT_DEFERRED); + type_box->connect_compat("item_selected", this, "_change_input_port_type", varray(nodes[n_i], i), CONNECT_DEFERRED); LineEdit *name_box = memnew(LineEdit); hb->add_child(name_box); name_box->set_custom_minimum_size(Size2(65 * EDSCALE, 0)); name_box->set_h_size_flags(SIZE_EXPAND_FILL); name_box->set_text(name_left); - name_box->connect("text_entered", this, "_change_input_port_name", varray(name_box, nodes[n_i], i)); - name_box->connect("focus_exited", this, "_port_name_focus_out", varray(name_box, nodes[n_i], i, false)); + name_box->connect_compat("text_entered", this, "_change_input_port_name", varray(name_box, nodes[n_i], i)); + name_box->connect_compat("focus_exited", this, "_port_name_focus_out", varray(name_box, nodes[n_i], i, false)); Button *remove_btn = memnew(Button); remove_btn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); remove_btn->set_tooltip(TTR("Remove") + " " + name_left); - remove_btn->connect("pressed", this, "_remove_input_port", varray(nodes[n_i], i), CONNECT_DEFERRED); + remove_btn->connect_compat("pressed", this, "_remove_input_port", varray(nodes[n_i], i), CONNECT_DEFERRED); hb->add_child(remove_btn); } else { @@ -750,7 +740,7 @@ void VisualShaderEditor::_update_graph() { Button *remove_btn = memnew(Button); remove_btn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); remove_btn->set_tooltip(TTR("Remove") + " " + name_left); - remove_btn->connect("pressed", this, "_remove_output_port", varray(nodes[n_i], i), CONNECT_DEFERRED); + remove_btn->connect_compat("pressed", this, "_remove_output_port", varray(nodes[n_i], i), CONNECT_DEFERRED); hb->add_child(remove_btn); LineEdit *name_box = memnew(LineEdit); @@ -758,18 +748,19 @@ void VisualShaderEditor::_update_graph() { name_box->set_custom_minimum_size(Size2(65 * EDSCALE, 0)); name_box->set_h_size_flags(SIZE_EXPAND_FILL); name_box->set_text(name_right); - name_box->connect("text_entered", this, "_change_output_port_name", varray(name_box, nodes[n_i], i)); - name_box->connect("focus_exited", this, "_port_name_focus_out", varray(name_box, nodes[n_i], i, true)); + name_box->connect_compat("text_entered", this, "_change_output_port_name", varray(name_box, nodes[n_i], i)); + name_box->connect_compat("focus_exited", this, "_port_name_focus_out", varray(name_box, nodes[n_i], i, true)); OptionButton *type_box = memnew(OptionButton); hb->add_child(type_box); - type_box->add_item(TTR("Scalar")); + type_box->add_item(TTR("Float")); + type_box->add_item(TTR("Int")); type_box->add_item(TTR("Vector")); type_box->add_item(TTR("Boolean")); type_box->add_item(TTR("Transform")); type_box->select(group_node->get_output_port_type(i)); type_box->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - type_box->connect("item_selected", this, "_change_output_port_type", varray(nodes[n_i], i), CONNECT_DEFERRED); + type_box->connect_compat("item_selected", this, "_change_output_port_type", varray(nodes[n_i], i), CONNECT_DEFERRED); } else { Label *label = memnew(Label); label->set_text(name_right); @@ -790,7 +781,7 @@ void VisualShaderEditor::_update_graph() { preview->set_pressed(true); } - preview->connect("pressed", this, "_preview_select_port", varray(nodes[n_i], i), CONNECT_DEFERRED); + preview->connect_compat("pressed", this, "_preview_select_port", varray(nodes[n_i], i), CONNECT_DEFERRED); hb->add_child(preview); } @@ -863,7 +854,7 @@ void VisualShaderEditor::_update_graph() { expression_box->set_context_menu_enabled(false); expression_box->set_show_line_numbers(true); - expression_box->connect("focus_exited", this, "_expression_focus_out", varray(expression_box, nodes[n_i])); + expression_box->connect_compat("focus_exited", this, "_expression_focus_out", varray(expression_box, nodes[n_i])); } if (!uniform.is_valid()) { @@ -1326,7 +1317,7 @@ VisualShaderNode *VisualShaderEditor::_add_node(int p_idx, int p_op_idx) { VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instance(add_options[p_idx].type)); ERR_FAIL_COND_V(!vsn, NULL); - VisualShaderNodeScalarConstant *constant = Object::cast_to<VisualShaderNodeScalarConstant>(vsn); + VisualShaderNodeFloatConstant *constant = Object::cast_to<VisualShaderNodeFloatConstant>(vsn); if (constant) { if ((int)add_options[p_idx].value != -1) @@ -1365,16 +1356,28 @@ VisualShaderNode *VisualShaderEditor::_add_node(int p_idx, int p_op_idx) { colorFunc->set_function((VisualShaderNodeColorFunc::Function)p_op_idx); } - VisualShaderNodeScalarOp *scalarOp = Object::cast_to<VisualShaderNodeScalarOp>(vsn); + VisualShaderNodeFloatOp *floatOp = Object::cast_to<VisualShaderNodeFloatOp>(vsn); + + if (floatOp) { + floatOp->set_operator((VisualShaderNodeFloatOp::Operator)p_op_idx); + } + + VisualShaderNodeIntOp *intOp = Object::cast_to<VisualShaderNodeIntOp>(vsn); + + if (intOp) { + intOp->set_operator((VisualShaderNodeIntOp::Operator)p_op_idx); + } + + VisualShaderNodeFloatFunc *floatFunc = Object::cast_to<VisualShaderNodeFloatFunc>(vsn); - if (scalarOp) { - scalarOp->set_operator((VisualShaderNodeScalarOp::Operator)p_op_idx); + if (floatFunc) { + floatFunc->set_function((VisualShaderNodeFloatFunc::Function)p_op_idx); } - VisualShaderNodeScalarFunc *scalarFunc = Object::cast_to<VisualShaderNodeScalarFunc>(vsn); + VisualShaderNodeIntFunc *intFunc = Object::cast_to<VisualShaderNodeIntFunc>(vsn); - if (scalarFunc) { - scalarFunc->set_function((VisualShaderNodeScalarFunc::Function)p_op_idx); + if (intFunc) { + intFunc->set_function((VisualShaderNodeIntFunc::Function)p_op_idx); } VisualShaderNodeVectorOp *vecOp = Object::cast_to<VisualShaderNodeVectorOp>(vsn); @@ -1606,8 +1609,29 @@ void VisualShaderEditor::_graph_gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> mb = p_event; - if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT) - _show_members_dialog(true); + if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT) { + List<int> to_change; + for (int i = 0; i < graph->get_child_count(); i++) { + GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i)); + if (gn) { + if (gn->is_selected() && gn->is_close_button_visible()) { + to_change.push_back(gn->get_name().operator String().to_int()); + } + } + } + if (to_change.empty() && copy_nodes_buffer.empty()) { + _show_members_dialog(true); + } else { + popup_menu->set_item_disabled(NodeMenuOptions::COPY, to_change.empty()); + popup_menu->set_item_disabled(NodeMenuOptions::PASTE, copy_nodes_buffer.empty()); + popup_menu->set_item_disabled(NodeMenuOptions::DELETE, to_change.empty()); + popup_menu->set_item_disabled(NodeMenuOptions::DUPLICATE, to_change.empty()); + menu_point = graph->get_local_mouse_position(); + Point2 gpos = Input::get_singleton()->get_mouse_position(); + popup_menu->set_position(gpos); + popup_menu->popup(); + } + } } void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos) { @@ -1905,7 +1929,7 @@ void VisualShaderEditor::_copy_nodes() { _dup_copy_nodes(copy_type, copy_nodes_buffer, copy_nodes_excluded_buffer); } -void VisualShaderEditor::_paste_nodes() { +void VisualShaderEditor::_paste_nodes(bool p_use_custom_position, const Vector2 &p_custom_position) { if (copy_nodes_buffer.empty()) return; @@ -1916,12 +1940,19 @@ void VisualShaderEditor::_paste_nodes() { float scale = graph->get_zoom(); - _dup_paste_nodes(type, copy_type, copy_nodes_buffer, copy_nodes_excluded_buffer, (graph->get_scroll_ofs() / scale + graph->get_local_mouse_position() / scale - selection_center), false); + Vector2 mpos; + if (p_use_custom_position) { + mpos = p_custom_position; + } else { + mpos = graph->get_local_mouse_position(); + } + + _dup_paste_nodes(type, copy_type, copy_nodes_buffer, copy_nodes_excluded_buffer, (graph->get_scroll_ofs() / scale + mpos / scale - selection_center), false); _dup_update_excluded(type, copy_nodes_excluded_buffer); // to prevent selection of previous copies at new paste } -void VisualShaderEditor::_on_nodes_delete() { +void VisualShaderEditor::_delete_nodes() { VisualShader::Type type = VisualShader::Type(edit_type->get_selected()); List<int> to_erase; @@ -2107,6 +2138,26 @@ void VisualShaderEditor::_tools_menu_option(int p_idx) { } } +void VisualShaderEditor::_node_menu_id_pressed(int p_idx) { + switch (p_idx) { + case NodeMenuOptions::ADD: + _show_members_dialog(true); + break; + case NodeMenuOptions::COPY: + _copy_nodes(); + break; + case NodeMenuOptions::PASTE: + _paste_nodes(true, menu_point); + break; + case NodeMenuOptions::DELETE: + _delete_nodes(); + break; + case NodeMenuOptions::DUPLICATE: + _duplicate_nodes(); + break; + } +} + Variant VisualShaderEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { if (p_from == members) { @@ -2245,7 +2296,7 @@ void VisualShaderEditor::_bind_methods() { ClassDB::bind_method("_node_selected", &VisualShaderEditor::_node_selected); ClassDB::bind_method("_scroll_changed", &VisualShaderEditor::_scroll_changed); ClassDB::bind_method("_delete_request", &VisualShaderEditor::_delete_request); - ClassDB::bind_method("_on_nodes_delete", &VisualShaderEditor::_on_nodes_delete); + ClassDB::bind_method("_delete_nodes", &VisualShaderEditor::_delete_nodes); ClassDB::bind_method("_node_changed", &VisualShaderEditor::_node_changed); ClassDB::bind_method("_edit_port_default_input", &VisualShaderEditor::_edit_port_default_input); ClassDB::bind_method("_port_edited", &VisualShaderEditor::_port_edited); @@ -2288,6 +2339,8 @@ void VisualShaderEditor::_bind_methods() { ClassDB::bind_method("_member_unselected", &VisualShaderEditor::_member_unselected); ClassDB::bind_method("_member_create", &VisualShaderEditor::_member_create); ClassDB::bind_method("_member_cancel", &VisualShaderEditor::_member_cancel); + + ClassDB::bind_method("_node_menu_id_pressed", &VisualShaderEditor::_node_menu_id_pressed); } VisualShaderEditor *VisualShaderEditor::singleton = NULL; @@ -2321,30 +2374,38 @@ VisualShaderEditor::VisualShaderEditor() { main_box->add_child(graph); graph->set_drag_forwarding(this); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR); + graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR_INT); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_BOOLEAN); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_VECTOR); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_TRANSFORM); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SAMPLER); //graph->add_valid_left_disconnect_type(0); graph->set_v_size_flags(SIZE_EXPAND_FILL); - graph->connect("connection_request", this, "_connection_request", varray(), CONNECT_DEFERRED); - graph->connect("disconnection_request", this, "_disconnection_request", varray(), CONNECT_DEFERRED); - graph->connect("node_selected", this, "_node_selected"); - graph->connect("scroll_offset_changed", this, "_scroll_changed"); - graph->connect("duplicate_nodes_request", this, "_duplicate_nodes"); - graph->connect("copy_nodes_request", this, "_copy_nodes"); - graph->connect("paste_nodes_request", this, "_paste_nodes"); - graph->connect("delete_nodes_request", this, "_on_nodes_delete"); - graph->connect("gui_input", this, "_graph_gui_input"); - graph->connect("connection_to_empty", this, "_connection_to_empty"); - graph->connect("connection_from_empty", this, "_connection_from_empty"); + graph->connect_compat("connection_request", this, "_connection_request", varray(), CONNECT_DEFERRED); + graph->connect_compat("disconnection_request", this, "_disconnection_request", varray(), CONNECT_DEFERRED); + graph->connect_compat("node_selected", this, "_node_selected"); + graph->connect_compat("scroll_offset_changed", this, "_scroll_changed"); + graph->connect_compat("duplicate_nodes_request", this, "_duplicate_nodes"); + graph->connect_compat("copy_nodes_request", this, "_copy_nodes"); + graph->connect_compat("paste_nodes_request", this, "_paste_nodes"); + graph->connect_compat("delete_nodes_request", this, "_delete_nodes"); + graph->connect_compat("gui_input", this, "_graph_gui_input"); + graph->connect_compat("connection_to_empty", this, "_connection_to_empty"); + graph->connect_compat("connection_from_empty", this, "_connection_from_empty"); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR, VisualShaderNode::PORT_TYPE_SCALAR); + graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR, VisualShaderNode::PORT_TYPE_SCALAR_INT); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR, VisualShaderNode::PORT_TYPE_VECTOR); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR, VisualShaderNode::PORT_TYPE_BOOLEAN); + graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR_INT, VisualShaderNode::PORT_TYPE_SCALAR_INT); + graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR_INT, VisualShaderNode::PORT_TYPE_SCALAR); + graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR_INT, VisualShaderNode::PORT_TYPE_VECTOR); + graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_SCALAR_INT, VisualShaderNode::PORT_TYPE_BOOLEAN); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_VECTOR, VisualShaderNode::PORT_TYPE_SCALAR); + graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_VECTOR, VisualShaderNode::PORT_TYPE_SCALAR_INT); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_VECTOR, VisualShaderNode::PORT_TYPE_VECTOR); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_VECTOR, VisualShaderNode::PORT_TYPE_BOOLEAN); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShaderNode::PORT_TYPE_SCALAR); + graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShaderNode::PORT_TYPE_SCALAR_INT); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShaderNode::PORT_TYPE_VECTOR); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShaderNode::PORT_TYPE_BOOLEAN); graph->add_valid_connection_type(VisualShaderNode::PORT_TYPE_TRANSFORM, VisualShaderNode::PORT_TYPE_TRANSFORM); @@ -2359,7 +2420,7 @@ VisualShaderEditor::VisualShaderEditor() { edit_type->add_item(TTR("Fragment")); edit_type->add_item(TTR("Light")); edit_type->select(1); - edit_type->connect("item_selected", this, "_mode_selected"); + edit_type->connect_compat("item_selected", this, "_mode_selected"); graph->get_zoom_hbox()->add_child(edit_type); graph->get_zoom_hbox()->move_child(edit_type, 0); @@ -2367,13 +2428,13 @@ VisualShaderEditor::VisualShaderEditor() { graph->get_zoom_hbox()->add_child(add_node); add_node->set_text(TTR("Add Node...")); graph->get_zoom_hbox()->move_child(add_node, 0); - add_node->connect("pressed", this, "_show_members_dialog", varray(false)); + add_node->connect_compat("pressed", this, "_show_members_dialog", varray(false)); preview_shader = memnew(ToolButton); preview_shader->set_toggle_mode(true); preview_shader->set_tooltip(TTR("Show resulted shader code.")); graph->get_zoom_hbox()->add_child(preview_shader); - preview_shader->connect("pressed", this, "_show_preview_text"); + preview_shader->connect_compat("pressed", this, "_show_preview_text"); /////////////////////////////////////// // PREVIEW PANEL @@ -2396,6 +2457,20 @@ VisualShaderEditor::VisualShaderEditor() { error_text->set_visible(false); /////////////////////////////////////// + // POPUP MENU + /////////////////////////////////////// + + popup_menu = memnew(PopupMenu); + add_child(popup_menu); + popup_menu->add_item("Add Node", NodeMenuOptions::ADD); + popup_menu->add_separator(); + popup_menu->add_item("Copy", NodeMenuOptions::COPY); + popup_menu->add_item("Paste", NodeMenuOptions::PASTE); + popup_menu->add_item("Delete", NodeMenuOptions::DELETE); + popup_menu->add_item("Duplicate", NodeMenuOptions::DUPLICATE); + popup_menu->connect_compat("id_pressed", this, "_node_menu_id_pressed"); + + /////////////////////////////////////// // SHADER NODES TREE /////////////////////////////////////// @@ -2407,15 +2482,15 @@ VisualShaderEditor::VisualShaderEditor() { node_filter = memnew(LineEdit); filter_hb->add_child(node_filter); - node_filter->connect("text_changed", this, "_member_filter_changed"); - node_filter->connect("gui_input", this, "_sbox_input"); + node_filter->connect_compat("text_changed", this, "_member_filter_changed"); + node_filter->connect_compat("gui_input", this, "_sbox_input"); node_filter->set_h_size_flags(SIZE_EXPAND_FILL); node_filter->set_placeholder(TTR("Search")); tools = memnew(MenuButton); filter_hb->add_child(tools); tools->set_tooltip(TTR("Options")); - tools->get_popup()->connect("id_pressed", this, "_tools_menu_option"); + tools->get_popup()->connect_compat("id_pressed", this, "_tools_menu_option"); tools->get_popup()->add_item(TTR("Expand All"), EXPAND_ALL); tools->get_popup()->add_item(TTR("Collapse All"), COLLAPSE_ALL); @@ -2428,9 +2503,9 @@ VisualShaderEditor::VisualShaderEditor() { members->set_allow_reselect(true); members->set_hide_folding(false); members->set_custom_minimum_size(Size2(180 * EDSCALE, 200 * EDSCALE)); - members->connect("item_activated", this, "_member_create"); - members->connect("item_selected", this, "_member_selected"); - members->connect("nothing_selected", this, "_member_unselected"); + members->connect_compat("item_activated", this, "_member_create"); + members->connect_compat("item_selected", this, "_member_selected"); + members->connect_compat("nothing_selected", this, "_member_unselected"); HBoxContainer *desc_hbox = memnew(HBoxContainer); members_vb->add_child(desc_hbox); @@ -2458,11 +2533,11 @@ VisualShaderEditor::VisualShaderEditor() { members_dialog->set_title(TTR("Create Shader Node")); members_dialog->add_child(members_vb); members_dialog->get_ok()->set_text(TTR("Create")); - members_dialog->get_ok()->connect("pressed", this, "_member_create"); + members_dialog->get_ok()->connect_compat("pressed", this, "_member_create"); members_dialog->get_ok()->set_disabled(true); members_dialog->set_resizable(true); members_dialog->set_as_minsize(); - members_dialog->connect("hide", this, "_member_cancel"); + members_dialog->connect_compat("hide", this, "_member_cancel"); add_child(members_dialog); alert = memnew(AcceptDialog); @@ -2633,7 +2708,7 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("CustomAlpha", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "custom_alpha"), "custom_alpha", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); add_options.push_back(AddOption("Delta", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "delta"), "delta", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); add_options.push_back(AddOption("EmissionTransform", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "emission_transform"), "emission_transform", VisualShaderNode::PORT_TYPE_TRANSFORM, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Index", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "index"), "index", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Index", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "index"), "index", VisualShaderNode::PORT_TYPE_SCALAR_INT, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); add_options.push_back(AddOption("LifeTime", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "lifetime"), "lifetime", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); add_options.push_back(AddOption("Restart", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "restart"), "restart", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); add_options.push_back(AddOption("Time", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "time"), "time", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); @@ -2642,71 +2717,84 @@ VisualShaderEditor::VisualShaderEditor() { // SCALAR - add_options.push_back(AddOption("ScalarFunc", "Scalar", "Common", "VisualShaderNodeScalarFunc", TTR("Scalar function."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ScalarOp", "Scalar", "Common", "VisualShaderNodeScalarOp", TTR("Scalar operator."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("FloatFunc", "Scalar", "Common", "VisualShaderNodeFloatFunc", TTR("Float function."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("IntFunc", "Scalar", "Common", "VisualShaderNodeIntFunc", TTR("Integer function."), -1, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("FloatOp", "Scalar", "Common", "VisualShaderNodeFloatOp", TTR("Float operator."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("IntOp", "Scalar", "Common", "VisualShaderNodeIntOp", TTR("Integer operator."), -1, VisualShaderNode::PORT_TYPE_SCALAR_INT)); //CONSTANTS - add_options.push_back(AddOption("E", "Scalar", "Constants", "VisualShaderNodeScalarConstant", TTR("E constant (2.718282). Represents the base of the natural logarithm."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_E)); - add_options.push_back(AddOption("Epsilon", "Scalar", "Constants", "VisualShaderNodeScalarConstant", TTR("Epsilon constant (0.00001). Smallest possible scalar number."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, CMP_EPSILON)); - add_options.push_back(AddOption("Phi", "Scalar", "Constants", "VisualShaderNodeScalarConstant", TTR("Phi constant (1.618034). Golden ratio."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, 1.618034f)); - add_options.push_back(AddOption("Pi/4", "Scalar", "Constants", "VisualShaderNodeScalarConstant", TTR("Pi/4 constant (0.785398) or 45 degrees."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_PI / 4)); - add_options.push_back(AddOption("Pi/2", "Scalar", "Constants", "VisualShaderNodeScalarConstant", TTR("Pi/2 constant (1.570796) or 90 degrees."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_PI / 2)); - add_options.push_back(AddOption("Pi", "Scalar", "Constants", "VisualShaderNodeScalarConstant", TTR("Pi constant (3.141593) or 180 degrees."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_PI)); - add_options.push_back(AddOption("Tau", "Scalar", "Constants", "VisualShaderNodeScalarConstant", TTR("Tau constant (6.283185) or 360 degrees."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_TAU)); - add_options.push_back(AddOption("Sqrt2", "Scalar", "Constants", "VisualShaderNodeScalarConstant", TTR("Sqrt2 constant (1.414214). Square root of 2."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_SQRT2)); + add_options.push_back(AddOption("E", "Scalar", "Constants", "VisualShaderNodeFloatConstant", TTR("E constant (2.718282). Represents the base of the natural logarithm."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_E)); + add_options.push_back(AddOption("Epsilon", "Scalar", "Constants", "VisualShaderNodeFloatConstant", TTR("Epsilon constant (0.00001). Smallest possible scalar number."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, CMP_EPSILON)); + add_options.push_back(AddOption("Phi", "Scalar", "Constants", "VisualShaderNodeFloatConstant", TTR("Phi constant (1.618034). Golden ratio."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, 1.618034f)); + add_options.push_back(AddOption("Pi/4", "Scalar", "Constants", "VisualShaderNodeFloatConstant", TTR("Pi/4 constant (0.785398) or 45 degrees."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_PI / 4)); + add_options.push_back(AddOption("Pi/2", "Scalar", "Constants", "VisualShaderNodeFloatConstant", TTR("Pi/2 constant (1.570796) or 90 degrees."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_PI / 2)); + add_options.push_back(AddOption("Pi", "Scalar", "Constants", "VisualShaderNodeFloatConstant", TTR("Pi constant (3.141593) or 180 degrees."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_PI)); + add_options.push_back(AddOption("Tau", "Scalar", "Constants", "VisualShaderNodeFloatConstant", TTR("Tau constant (6.283185) or 360 degrees."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_TAU)); + add_options.push_back(AddOption("Sqrt2", "Scalar", "Constants", "VisualShaderNodeFloatConstant", TTR("Sqrt2 constant (1.414214). Square root of 2."), -1, VisualShaderNode::PORT_TYPE_SCALAR, -1, -1, Math_SQRT2)); // FUNCTIONS - add_options.push_back(AddOption("Abs", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the absolute value of the parameter."), VisualShaderNodeScalarFunc::FUNC_ABS, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ACos", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the arc-cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ACOS, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ACosH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the inverse hyperbolic cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ACOSH, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ASin", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the arc-sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ASIN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ASinH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the inverse hyperbolic sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_ASINH, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ATan", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the arc-tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_ATAN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ATan2", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Returns the arc-tangent of the parameters."), VisualShaderNodeScalarOp::OP_ATAN2, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ATanH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the inverse hyperbolic tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_ATANH, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Ceil", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), VisualShaderNodeScalarFunc::FUNC_CEIL, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Abs", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the absolute value of the parameter."), VisualShaderNodeFloatFunc::FUNC_ABS, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Abs", "Scalar", "Functions", "VisualShaderNodeIntFunc", TTR("Returns the absolute value of the parameter."), VisualShaderNodeIntFunc::FUNC_ABS, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("ACos", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the arc-cosine of the parameter."), VisualShaderNodeFloatFunc::FUNC_ACOS, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ACosH", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the inverse hyperbolic cosine of the parameter."), VisualShaderNodeFloatFunc::FUNC_ACOSH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ASin", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the arc-sine of the parameter."), VisualShaderNodeFloatFunc::FUNC_ASIN, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ASinH", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the inverse hyperbolic sine of the parameter."), VisualShaderNodeFloatFunc::FUNC_ASINH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ATan", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the arc-tangent of the parameter."), VisualShaderNodeFloatFunc::FUNC_ATAN, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ATan2", "Scalar", "Functions", "VisualShaderNodeFloatOp", TTR("Returns the arc-tangent of the parameters."), VisualShaderNodeFloatOp::OP_ATAN2, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("ATanH", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the inverse hyperbolic tangent of the parameter."), VisualShaderNodeFloatFunc::FUNC_ATANH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Ceil", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), VisualShaderNodeFloatFunc::FUNC_CEIL, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Clamp", "Scalar", "Functions", "VisualShaderNodeScalarClamp", TTR("Constrains a value to lie between two further values."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Cos", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_COS, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("CosH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the hyperbolic cosine of the parameter."), VisualShaderNodeScalarFunc::FUNC_COSH, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Degrees", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Converts a quantity in radians to degrees."), VisualShaderNodeScalarFunc::FUNC_DEGREES, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Exp", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Base-e Exponential."), VisualShaderNodeScalarFunc::FUNC_EXP, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Exp2", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Base-2 Exponential."), VisualShaderNodeScalarFunc::FUNC_EXP2, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Floor", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the nearest integer less than or equal to the parameter."), VisualShaderNodeScalarFunc::FUNC_FLOOR, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Fract", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Computes the fractional part of the argument."), VisualShaderNodeScalarFunc::FUNC_FRAC, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("InverseSqrt", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the inverse of the square root of the parameter."), VisualShaderNodeScalarFunc::FUNC_INVERSE_SQRT, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Log", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Natural logarithm."), VisualShaderNodeScalarFunc::FUNC_LOG, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Log2", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Base-2 logarithm."), VisualShaderNodeScalarFunc::FUNC_LOG2, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Max", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Returns the greater of two values."), VisualShaderNodeScalarOp::OP_MAX, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Min", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Returns the lesser of two values."), VisualShaderNodeScalarOp::OP_MIN, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Clamp", "Scalar", "Functions", "VisualShaderNodeIntFunc", TTR("Constrains a value to lie between two further values."), VisualShaderNodeIntFunc::FUNC_CLAMP, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("Cos", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the cosine of the parameter."), VisualShaderNodeFloatFunc::FUNC_COS, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("CosH", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the hyperbolic cosine of the parameter."), VisualShaderNodeFloatFunc::FUNC_COSH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Degrees", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Converts a quantity in radians to degrees."), VisualShaderNodeFloatFunc::FUNC_DEGREES, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Exp", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Base-e Exponential."), VisualShaderNodeFloatFunc::FUNC_EXP, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Exp2", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Base-2 Exponential."), VisualShaderNodeFloatFunc::FUNC_EXP2, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Floor", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Finds the nearest integer less than or equal to the parameter."), VisualShaderNodeFloatFunc::FUNC_FLOOR, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Fract", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Computes the fractional part of the argument."), VisualShaderNodeFloatFunc::FUNC_FRAC, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("InverseSqrt", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the inverse of the square root of the parameter."), VisualShaderNodeFloatFunc::FUNC_INVERSE_SQRT, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Log", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Natural logarithm."), VisualShaderNodeFloatFunc::FUNC_LOG, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Log2", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Base-2 logarithm."), VisualShaderNodeFloatFunc::FUNC_LOG2, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Max", "Scalar", "Functions", "VisualShaderNodeFloatOp", TTR("Returns the greater of two values."), VisualShaderNodeFloatOp::OP_MAX, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Min", "Scalar", "Functions", "VisualShaderNodeFloatOp", TTR("Returns the lesser of two values."), VisualShaderNodeFloatOp::OP_MIN, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Mix", "Scalar", "Functions", "VisualShaderNodeScalarInterp", TTR("Linear interpolation between two scalars."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Negate", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the opposite value of the parameter."), VisualShaderNodeScalarFunc::FUNC_NEGATE, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("OneMinus", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("1.0 - scalar"), VisualShaderNodeScalarFunc::FUNC_ONEMINUS, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Pow", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Returns the value of the first parameter raised to the power of the second."), VisualShaderNodeScalarOp::OP_POW, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Radians", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Converts a quantity in degrees to radians."), VisualShaderNodeScalarFunc::FUNC_RADIANS, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Reciprocal", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("1.0 / scalar"), VisualShaderNodeScalarFunc::FUNC_RECIPROCAL, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Round", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the nearest integer to the parameter."), VisualShaderNodeScalarFunc::FUNC_ROUND, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("RoundEven", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the nearest even integer to the parameter."), VisualShaderNodeScalarFunc::FUNC_ROUNDEVEN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Saturate", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Clamps the value between 0.0 and 1.0."), VisualShaderNodeScalarFunc::FUNC_SATURATE, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Sign", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Extracts the sign of the parameter."), VisualShaderNodeScalarFunc::FUNC_SIGN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Sin", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_SIN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("SinH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the hyperbolic sine of the parameter."), VisualShaderNodeScalarFunc::FUNC_SINH, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Sqrt", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the square root of the parameter."), VisualShaderNodeScalarFunc::FUNC_SQRT, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Negate", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the opposite value of the parameter."), VisualShaderNodeFloatFunc::FUNC_NEGATE, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Negate", "Scalar", "Functions", "VisualShaderNodeIntFunc", TTR("Returns the opposite value of the parameter."), VisualShaderNodeIntFunc::FUNC_NEGATE, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("OneMinus", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("1.0 - scalar"), VisualShaderNodeFloatFunc::FUNC_ONEMINUS, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Pow", "Scalar", "Functions", "VisualShaderNodeFloatOp", TTR("Returns the value of the first parameter raised to the power of the second."), VisualShaderNodeFloatOp::OP_POW, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Radians", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Converts a quantity in degrees to radians."), VisualShaderNodeFloatFunc::FUNC_RADIANS, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Reciprocal", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("1.0 / scalar"), VisualShaderNodeFloatFunc::FUNC_RECIPROCAL, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Round", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Finds the nearest integer to the parameter."), VisualShaderNodeFloatFunc::FUNC_ROUND, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("RoundEven", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Finds the nearest even integer to the parameter."), VisualShaderNodeFloatFunc::FUNC_ROUNDEVEN, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Saturate", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Clamps the value between 0.0 and 1.0."), VisualShaderNodeFloatFunc::FUNC_SATURATE, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Sign", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Extracts the sign of the parameter."), VisualShaderNodeFloatFunc::FUNC_SIGN, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Sign", "Scalar", "Functions", "VisualShaderNodeIntFunc", TTR("Extracts the sign of the parameter."), VisualShaderNodeIntFunc::FUNC_SIGN, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("Sin", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the sine of the parameter."), VisualShaderNodeFloatFunc::FUNC_SIN, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("SinH", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the hyperbolic sine of the parameter."), VisualShaderNodeFloatFunc::FUNC_SINH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Sqrt", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the square root of the parameter."), VisualShaderNodeFloatFunc::FUNC_SQRT, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("SmoothStep", "Scalar", "Functions", "VisualShaderNodeScalarSmoothStep", TTR("SmoothStep function( scalar(edge0), scalar(edge1), scalar(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge0' and 1.0 if x is larger than 'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 using Hermite polynomials."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Step", "Scalar", "Functions", "VisualShaderNodeScalarOp", TTR("Step function( scalar(edge), scalar(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0."), VisualShaderNodeScalarOp::OP_STEP, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Tan", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_TAN, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("TanH", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Returns the hyperbolic tangent of the parameter."), VisualShaderNodeScalarFunc::FUNC_TANH, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Trunc", "Scalar", "Functions", "VisualShaderNodeScalarFunc", TTR("Finds the truncated value of the parameter."), VisualShaderNodeScalarFunc::FUNC_TRUNC, VisualShaderNode::PORT_TYPE_SCALAR)); - - add_options.push_back(AddOption("Add", "Scalar", "Operators", "VisualShaderNodeScalarOp", TTR("Adds scalar to scalar."), VisualShaderNodeScalarOp::OP_ADD, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Divide", "Scalar", "Operators", "VisualShaderNodeScalarOp", TTR("Divides scalar by scalar."), VisualShaderNodeScalarOp::OP_DIV, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Multiply", "Scalar", "Operators", "VisualShaderNodeScalarOp", TTR("Multiplies scalar by scalar."), VisualShaderNodeScalarOp::OP_MUL, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Remainder", "Scalar", "Operators", "VisualShaderNodeScalarOp", TTR("Returns the remainder of the two scalars."), VisualShaderNodeScalarOp::OP_MOD, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("Subtract", "Scalar", "Operators", "VisualShaderNodeScalarOp", TTR("Subtracts scalar from scalar."), VisualShaderNodeScalarOp::OP_SUB, VisualShaderNode::PORT_TYPE_SCALAR)); - - add_options.push_back(AddOption("ScalarConstant", "Scalar", "Variables", "VisualShaderNodeScalarConstant", TTR("Scalar constant."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); - add_options.push_back(AddOption("ScalarUniform", "Scalar", "Variables", "VisualShaderNodeScalarUniform", TTR("Scalar uniform."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Step", "Scalar", "Functions", "VisualShaderNodeFloatOp", TTR("Step function( scalar(edge), scalar(x) ).\n\nReturns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0."), VisualShaderNodeFloatOp::OP_STEP, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Tan", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the tangent of the parameter."), VisualShaderNodeFloatFunc::FUNC_TAN, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("TanH", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the hyperbolic tangent of the parameter."), VisualShaderNodeFloatFunc::FUNC_TANH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Trunc", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Finds the truncated value of the parameter."), VisualShaderNodeFloatFunc::FUNC_TRUNC, VisualShaderNode::PORT_TYPE_SCALAR)); + + add_options.push_back(AddOption("Add", "Scalar", "Operators", "VisualShaderNodeFloatOp", TTR("Sums two floating-point scalars."), VisualShaderNodeFloatOp::OP_ADD, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Add", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Sums two integer scalars."), VisualShaderNodeIntOp::OP_ADD, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("Divide", "Scalar", "Operators", "VisualShaderNodeFloatOp", TTR("Divides two floating-point scalars."), VisualShaderNodeFloatOp::OP_DIV, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Divide", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Divides two integer scalars."), VisualShaderNodeIntOp::OP_DIV, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("Multiply", "Scalar", "Operators", "VisualShaderNodeFloatOp", TTR("Multiplies two floating-point scalars."), VisualShaderNodeFloatOp::OP_MUL, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Multiply", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Multiplies two integer scalars."), VisualShaderNodeIntOp::OP_MUL, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("Remainder", "Scalar", "Operators", "VisualShaderNodeFloatOp", TTR("Returns the remainder of the two floating-point scalars."), VisualShaderNodeFloatOp::OP_MOD, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Remainder", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Returns the remainder of the two integer scalars."), VisualShaderNodeIntOp::OP_MOD, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("Subtract", "Scalar", "Operators", "VisualShaderNodeFloatOp", TTR("Subtracts two floating-point scalars."), VisualShaderNodeFloatOp::OP_SUB, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("Subtract", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Subtracts two integer scalars."), VisualShaderNodeIntOp::OP_SUB, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + + add_options.push_back(AddOption("FloatConstant", "Scalar", "Variables", "VisualShaderNodeFloatConstant", TTR("Scalar floating-point constant."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("IntConstant", "Scalar", "Variables", "VisualShaderNodeIntConstant", TTR("Scalar integer constant."), -1, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("FloatUniform", "Scalar", "Variables", "VisualShaderNodeFloatUniform", TTR("Scalar floating-point uniform."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("IntUniform", "Scalar", "Variables", "VisualShaderNodeIntUniform", TTR("Scalar integer uniform."), -1, VisualShaderNode::PORT_TYPE_SCALAR_INT)); // TEXTURES @@ -2841,7 +2929,7 @@ VisualShaderEditor::VisualShaderEditor() { property_editor = memnew(CustomPropertyEditor); add_child(property_editor); - property_editor->connect("variant_changed", this, "_port_edited"); + property_editor->connect_compat("variant_changed", this, "_port_edited"); } void VisualShaderEditorPlugin::edit(Object *p_object) { @@ -2902,7 +2990,7 @@ protected: public: void _notification(int p_what) { if (p_what == NOTIFICATION_READY) { - connect("item_selected", this, "_item_selected"); + connect_compat("item_selected", this, "_item_selected"); } } @@ -2912,8 +3000,9 @@ public: void setup(const Ref<VisualShaderNodeInput> &p_input) { input = p_input; - Ref<Texture2D> type_icon[5] = { + Ref<Texture2D> type_icon[6] = { EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons"), + EditorNode::get_singleton()->get_gui_base()->get_icon("int", "EditorIcons"), EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons"), EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons"), EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons"), @@ -3031,16 +3120,16 @@ public: bool res_prop = Object::cast_to<EditorPropertyResource>(p_properties[i]); if (res_prop) { - p_properties[i]->connect("resource_selected", this, "_resource_selected"); + p_properties[i]->connect_compat("resource_selected", this, "_resource_selected"); } - properties[i]->connect("property_changed", this, "_property_changed"); + properties[i]->connect_compat("property_changed", this, "_property_changed"); properties[i]->set_object_and_property(node.ptr(), p_names[i]); properties[i]->update_property(); properties[i]->set_name_split_ratio(0); } - node->connect("changed", this, "_node_changed"); - node->connect("editor_refresh_request", this, "_refresh_request", varray(), CONNECT_DEFERRED); + node->connect_compat("changed", this, "_node_changed"); + node->connect_compat("editor_refresh_request", this, "_refresh_request", varray(), CONNECT_DEFERRED); } static void _bind_methods() { @@ -3206,7 +3295,7 @@ EditorPropertyShaderMode::EditorPropertyShaderMode() { options->set_clip_text(true); add_child(options); add_focusable(options); - options->connect("item_selected", this, "_option_selected"); + options->connect_compat("item_selected", this, "_option_selected"); } bool EditorInspectorShaderModePlugin::can_handle(Object *p_object) { @@ -3279,7 +3368,7 @@ void VisualShaderNodePortPreview::_shader_changed() { void VisualShaderNodePortPreview::setup(const Ref<VisualShader> &p_shader, VisualShader::Type p_type, int p_node, int p_port) { shader = p_shader; - shader->connect("changed", this, "_shader_changed"); + shader->connect_compat("changed", this, "_shader_changed"); type = p_type; port = p_port; node = p_node; diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index 150cf16167..8756fe9fe9 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -81,6 +81,7 @@ class VisualShaderEditor : public VBoxContainer { bool saved_node_pos_dirty; ConfirmationDialog *members_dialog; + PopupMenu *popup_menu; MenuButton *tools; bool preview_showed; @@ -90,6 +91,15 @@ class VisualShaderEditor : public VBoxContainer { COLLAPSE_ALL }; + enum NodeMenuOptions { + ADD, + SEPARATOR, // ignore + COPY, + PASTE, + DELETE, + DUPLICATE, + }; + Tree *members; AcceptDialog *alert; LineEdit *node_filter; @@ -104,7 +114,6 @@ class VisualShaderEditor : public VBoxContainer { struct AddOption { String name; String category; - String sub_category; String type; String description; int sub_func; @@ -116,12 +125,12 @@ class VisualShaderEditor : public VBoxContainer { float value; bool highend; bool is_custom; + int temp_idx; AddOption(const String &p_name = String(), const String &p_category = String(), const String &p_sub_category = String(), const String &p_type = String(), const String &p_description = String(), int p_sub_func = -1, int p_return_type = -1, int p_mode = -1, int p_func = -1, float p_value = -1, bool p_highend = false) { name = p_name; type = p_type; - category = p_category; - sub_category = p_sub_category; + category = p_category + "/" + p_sub_category; description = p_description; sub_func = p_sub_func; return_type = p_return_type; @@ -135,8 +144,7 @@ class VisualShaderEditor : public VBoxContainer { AddOption(const String &p_name, const String &p_category, const String &p_sub_category, const String &p_type, const String &p_description, const String &p_sub_func, int p_return_type = -1, int p_mode = -1, int p_func = -1, float p_value = -1, bool p_highend = false) { name = p_name; type = p_type; - category = p_category; - sub_category = p_sub_category; + category = p_category + "/" + p_sub_category; description = p_description; sub_func = 0; sub_func_str = p_sub_func; @@ -148,6 +156,12 @@ class VisualShaderEditor : public VBoxContainer { is_custom = false; } }; + struct _OptionComparator { + + _FORCE_INLINE_ bool operator()(const AddOption &a, const AddOption &b) const { + return a.category.count("/") > b.category.count("/") || (a.category + "/" + a.name).naturalnocasecmp_to(b.category + "/" + b.name) < 0; + } + }; Vector<AddOption> add_options; int texture_node_option_idx; @@ -177,7 +191,7 @@ class VisualShaderEditor : public VBoxContainer { void _node_selected(Object *p_node); void _delete_request(int); - void _on_nodes_delete(); + void _delete_nodes(); void _removed_from_graph(); @@ -212,7 +226,7 @@ class VisualShaderEditor : public VBoxContainer { void _clear_buffer(); void _copy_nodes(); - void _paste_nodes(); + void _paste_nodes(bool p_use_custom_position = false, const Vector2 &p_custom_position = Vector2()); Vector<Ref<VisualShaderNodePlugin> > plugins; @@ -246,6 +260,9 @@ class VisualShaderEditor : public VBoxContainer { void _member_create(); void _member_cancel(); + Vector2 menu_point; + void _node_menu_id_pressed(int p_idx); + Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); @@ -265,7 +282,7 @@ public: static VisualShaderEditor *get_singleton() { return singleton; } void clear_custom_types(); - void add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, const String &p_subcategory, bool p_highend); + void add_custom_type(const String &p_name, const Ref<Script> &p_script, const String &p_description, int p_return_icon_type, const String &p_category, bool p_highend); virtual Size2 get_minimum_size() const; void edit(VisualShader *p_visual_shader); diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index 0665b1d013..59db531581 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -264,5 +264,5 @@ ProgressDialog::ProgressDialog() { cancel_hb->add_child(cancel); cancel->set_text(TTR("Cancel")); cancel_hb->add_spacer(); - cancel->connect("pressed", this, "_cancel_pressed"); + cancel->connect_compat("pressed", this, "_cancel_pressed"); } diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 3c8fef6233..753125eb03 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -53,7 +53,7 @@ void ProjectExportDialog::_notification(int p_what) { case NOTIFICATION_READY: { duplicate_preset->set_icon(get_icon("Duplicate", "EditorIcons")); delete_preset->set_icon(get_icon("Remove", "EditorIcons")); - connect("confirmed", this, "_export_pck_zip"); + connect_compat("confirmed", this, "_export_pck_zip"); custom_feature_display->get_parent_control()->add_style_override("panel", get_stylebox("bg", "Tree")); } break; case NOTIFICATION_POPUP_HIDE: { @@ -913,10 +913,10 @@ void ProjectExportDialog::_validate_export_path(const String &p_path) { if (invalid_path) { export_project->get_ok()->set_disabled(true); - export_project->get_line_edit()->disconnect("text_entered", export_project, "_file_entered"); + export_project->get_line_edit()->disconnect_compat("text_entered", export_project, "_file_entered"); } else { export_project->get_ok()->set_disabled(false); - export_project->get_line_edit()->connect("text_entered", export_project, "_file_entered"); + export_project->get_line_edit()->connect_compat("text_entered", export_project, "_file_entered"); } } @@ -946,9 +946,9 @@ void ProjectExportDialog::_export_project() { } // Ensure that signal is connected if previous attempt left it disconnected with _validate_export_path - if (!export_project->get_line_edit()->is_connected("text_entered", export_project, "_file_entered")) { + if (!export_project->get_line_edit()->is_connected_compat("text_entered", export_project, "_file_entered")) { export_project->get_ok()->set_disabled(false); - export_project->get_line_edit()->connect("text_entered", export_project, "_file_entered"); + export_project->get_line_edit()->connect_compat("text_entered", export_project, "_file_entered"); } export_project->set_mode(EditorFileDialog::MODE_SAVE_FILE); @@ -1085,7 +1085,7 @@ ProjectExportDialog::ProjectExportDialog() { add_preset = memnew(MenuButton); add_preset->set_text(TTR("Add...")); - add_preset->get_popup()->connect("index_pressed", this, "_add_preset"); + add_preset->get_popup()->connect_compat("index_pressed", this, "_add_preset"); preset_hb->add_child(add_preset); MarginContainer *mc = memnew(MarginContainer); preset_vb->add_child(mc); @@ -1093,13 +1093,13 @@ ProjectExportDialog::ProjectExportDialog() { presets = memnew(ItemList); presets->set_drag_forwarding(this); mc->add_child(presets); - presets->connect("item_selected", this, "_edit_preset"); + presets->connect_compat("item_selected", this, "_edit_preset"); duplicate_preset = memnew(ToolButton); preset_hb->add_child(duplicate_preset); - duplicate_preset->connect("pressed", this, "_duplicate_preset"); + duplicate_preset->connect_compat("pressed", this, "_duplicate_preset"); delete_preset = memnew(ToolButton); preset_hb->add_child(delete_preset); - delete_preset->connect("pressed", this, "_delete_preset"); + delete_preset->connect_compat("pressed", this, "_delete_preset"); // Preset settings. @@ -1109,11 +1109,11 @@ ProjectExportDialog::ProjectExportDialog() { name = memnew(LineEdit); settings_vb->add_margin_child(TTR("Name:"), name); - name->connect("text_changed", this, "_name_changed"); + name->connect_compat("text_changed", this, "_name_changed"); runnable = memnew(CheckButton); runnable->set_text(TTR("Runnable")); runnable->set_tooltip(TTR("If checked, the preset will be available for use in one-click deploy.\nOnly one preset per platform may be marked as runnable.")); - runnable->connect("pressed", this, "_runnable_pressed"); + runnable->connect_compat("pressed", this, "_runnable_pressed"); settings_vb->add_child(runnable); export_path = memnew(EditorPropertyPath); @@ -1121,7 +1121,7 @@ ProjectExportDialog::ProjectExportDialog() { export_path->set_label(TTR("Export Path")); export_path->set_object_and_property(this, "export_path"); export_path->set_save_mode(); - export_path->connect("property_changed", this, "_export_path_changed"); + export_path->connect_compat("property_changed", this, "_export_path_changed"); // Subsections. @@ -1137,7 +1137,7 @@ ProjectExportDialog::ProjectExportDialog() { sections->add_child(parameters); parameters->set_name(TTR("Options")); parameters->set_v_size_flags(SIZE_EXPAND_FILL); - parameters->connect("property_edited", this, "_update_parameters"); + parameters->connect_compat("property_edited", this, "_update_parameters"); // Resources export parameters. @@ -1150,7 +1150,7 @@ ProjectExportDialog::ProjectExportDialog() { export_filter->add_item(TTR("Export selected scenes (and dependencies)")); export_filter->add_item(TTR("Export selected resources (and dependencies)")); resources_vb->add_margin_child(TTR("Export Mode:"), export_filter); - export_filter->connect("item_selected", this, "_export_type_changed"); + export_filter->connect_compat("item_selected", this, "_export_type_changed"); include_label = memnew(Label); include_label->set_text(TTR("Resources to export:")); @@ -1161,19 +1161,19 @@ ProjectExportDialog::ProjectExportDialog() { include_files = memnew(Tree); include_margin->add_child(include_files); - include_files->connect("item_edited", this, "_tree_changed"); + include_files->connect_compat("item_edited", this, "_tree_changed"); include_filters = memnew(LineEdit); resources_vb->add_margin_child( TTR("Filters to export non-resource files/folders\n(comma-separated, e.g: *.json, *.txt, docs/*)"), include_filters); - include_filters->connect("text_changed", this, "_filter_changed"); + include_filters->connect_compat("text_changed", this, "_filter_changed"); exclude_filters = memnew(LineEdit); resources_vb->add_margin_child( TTR("Filters to exclude files/folders from project\n(comma-separated, e.g: *.json, *.txt, docs/*)"), exclude_filters); - exclude_filters->connect("text_changed", this, "_filter_changed"); + exclude_filters->connect_compat("text_changed", this, "_filter_changed"); // Patch packages. @@ -1190,8 +1190,8 @@ ProjectExportDialog::ProjectExportDialog() { patch_vb->add_child(patches); patches->set_v_size_flags(SIZE_EXPAND_FILL); patches->set_hide_root(true); - patches->connect("button_pressed", this, "_patch_button_pressed"); - patches->connect("item_edited", this, "_patch_edited"); + patches->connect_compat("button_pressed", this, "_patch_button_pressed"); + patches->connect_compat("item_edited", this, "_patch_edited"); patches->set_drag_forwarding(this); patches->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); @@ -1206,12 +1206,12 @@ ProjectExportDialog::ProjectExportDialog() { patch_dialog = memnew(EditorFileDialog); patch_dialog->add_filter("*.pck ; " + TTR("Pack File")); patch_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); - patch_dialog->connect("file_selected", this, "_patch_selected"); + patch_dialog->connect_compat("file_selected", this, "_patch_selected"); add_child(patch_dialog); patch_erase = memnew(ConfirmationDialog); patch_erase->get_ok()->set_text(TTR("Delete")); - patch_erase->connect("confirmed", this, "_patch_deleted"); + patch_erase->connect_compat("confirmed", this, "_patch_deleted"); add_child(patch_erase); // Feature tags. @@ -1219,7 +1219,7 @@ ProjectExportDialog::ProjectExportDialog() { VBoxContainer *feature_vb = memnew(VBoxContainer); feature_vb->set_name(TTR("Features")); custom_features = memnew(LineEdit); - custom_features->connect("text_changed", this, "_custom_features_changed"); + custom_features->connect_compat("text_changed", this, "_custom_features_changed"); feature_vb->add_margin_child(TTR("Custom (comma-separated):"), custom_features); Panel *features_panel = memnew(Panel); custom_feature_display = memnew(RichTextLabel); @@ -1240,9 +1240,9 @@ ProjectExportDialog::ProjectExportDialog() { script_mode->add_item(TTR("Text"), (int)EditorExportPreset::MODE_SCRIPT_TEXT); script_mode->add_item(TTR("Compiled"), (int)EditorExportPreset::MODE_SCRIPT_COMPILED); script_mode->add_item(TTR("Encrypted (Provide Key Below)"), (int)EditorExportPreset::MODE_SCRIPT_ENCRYPTED); - script_mode->connect("item_selected", this, "_script_export_mode_changed"); + script_mode->connect_compat("item_selected", this, "_script_export_mode_changed"); script_key = memnew(LineEdit); - script_key->connect("text_changed", this, "_script_encryption_key_changed"); + script_key->connect_compat("text_changed", this, "_script_encryption_key_changed"); script_key_error = memnew(Label); script_key_error->set_text("- " + TTR("Invalid Encryption Key (must be 64 characters long)")); script_key_error->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); @@ -1250,7 +1250,7 @@ ProjectExportDialog::ProjectExportDialog() { script_vb->add_child(script_key_error); sections->add_child(script_vb); - sections->connect("tab_changed", this, "_tab_changed"); + sections->connect_compat("tab_changed", this, "_tab_changed"); // Disable by default. name->set_editable(false); @@ -1267,7 +1267,7 @@ ProjectExportDialog::ProjectExportDialog() { delete_confirm = memnew(ConfirmationDialog); add_child(delete_confirm); delete_confirm->get_ok()->set_text(TTR("Delete")); - delete_confirm->connect("confirmed", this, "_delete_preset_confirm"); + delete_confirm->connect_compat("confirmed", this, "_delete_preset_confirm"); // Export buttons, dialogs and errors. @@ -1276,7 +1276,7 @@ ProjectExportDialog::ProjectExportDialog() { get_cancel()->set_text(TTR("Close")); get_ok()->set_text(TTR("Export PCK/Zip")); export_button = add_button(TTR("Export Project"), !OS::get_singleton()->get_swap_ok_cancel(), "export"); - export_button->connect("pressed", this, "_export_project"); + export_button->connect_compat("pressed", this, "_export_project"); // Disable initially before we select a valid preset export_button->set_disabled(true); get_ok()->set_disabled(true); @@ -1288,10 +1288,10 @@ ProjectExportDialog::ProjectExportDialog() { export_all_dialog->get_ok()->hide(); export_all_dialog->add_button(TTR("Debug"), true, "debug"); export_all_dialog->add_button(TTR("Release"), true, "release"); - export_all_dialog->connect("custom_action", this, "_export_all_dialog_action"); + export_all_dialog->connect_compat("custom_action", this, "_export_all_dialog_action"); export_all_button = add_button(TTR("Export All"), !OS::get_singleton()->get_swap_ok_cancel(), "export"); - export_all_button->connect("pressed", this, "_export_all_dialog"); + export_all_button->connect_compat("pressed", this, "_export_all_dialog"); export_all_button->set_disabled(true); export_pck_zip = memnew(EditorFileDialog); @@ -1300,7 +1300,7 @@ ProjectExportDialog::ProjectExportDialog() { export_pck_zip->set_access(EditorFileDialog::ACCESS_FILESYSTEM); export_pck_zip->set_mode(EditorFileDialog::MODE_SAVE_FILE); add_child(export_pck_zip); - export_pck_zip->connect("file_selected", this, "_export_pck_zip_selected"); + export_pck_zip->connect_compat("file_selected", this, "_export_pck_zip_selected"); export_error = memnew(Label); main_vb->add_child(export_error); @@ -1326,13 +1326,13 @@ ProjectExportDialog::ProjectExportDialog() { download_templates->set_text(TTR("Manage Export Templates")); download_templates->set_v_size_flags(SIZE_SHRINK_CENTER); export_templates_error->add_child(download_templates); - download_templates->connect("pressed", this, "_open_export_template_manager"); + download_templates->connect_compat("pressed", this, "_open_export_template_manager"); export_project = memnew(EditorFileDialog); export_project->set_access(EditorFileDialog::ACCESS_FILESYSTEM); add_child(export_project); - export_project->connect("file_selected", this, "_export_project_to_path"); - export_project->get_line_edit()->connect("text_changed", this, "_validate_export_path"); + export_project->connect_compat("file_selected", this, "_export_project_to_path"); + export_project->get_line_edit()->connect_compat("text_changed", this, "_validate_export_path"); export_debug = memnew(CheckBox); export_debug->set_text(TTR("Export With Debug")); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 1dbd7f46d7..23a7628eeb 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -811,7 +811,7 @@ public: create_dir = memnew(Button); pnhb->add_child(create_dir); create_dir->set_text(TTR("Create Folder")); - create_dir->connect("pressed", this, "_create_folder"); + create_dir->connect_compat("pressed", this, "_create_folder"); path_container = memnew(VBoxContainer); vb->add_child(path_container); @@ -848,7 +848,7 @@ public: browse = memnew(Button); browse->set_text(TTR("Browse")); - browse->connect("pressed", this, "_browse_path"); + browse->connect_compat("pressed", this, "_browse_path"); pphb->add_child(browse); // install status icon @@ -858,7 +858,7 @@ public: install_browse = memnew(Button); install_browse->set_text(TTR("Browse")); - install_browse->connect("pressed", this, "_browse_install_path"); + install_browse->connect_compat("pressed", this, "_browse_install_path"); iphb->add_child(install_browse); msg = memnew(Label); @@ -928,13 +928,13 @@ public: fdialog_install->set_access(FileDialog::ACCESS_FILESYSTEM); add_child(fdialog); add_child(fdialog_install); - project_name->connect("text_changed", this, "_text_changed"); - project_path->connect("text_changed", this, "_path_text_changed"); - install_path->connect("text_changed", this, "_path_text_changed"); - fdialog->connect("dir_selected", this, "_path_selected"); - fdialog->connect("file_selected", this, "_file_selected"); - fdialog_install->connect("dir_selected", this, "_install_path_selected"); - fdialog_install->connect("file_selected", this, "_install_path_selected"); + project_name->connect_compat("text_changed", this, "_text_changed"); + project_path->connect_compat("text_changed", this, "_path_text_changed"); + install_path->connect_compat("text_changed", this, "_path_text_changed"); + fdialog->connect_compat("dir_selected", this, "_path_selected"); + fdialog->connect_compat("file_selected", this, "_file_selected"); + fdialog_install->connect_compat("dir_selected", this, "_install_path_selected"); + fdialog_install->connect_compat("file_selected", this, "_install_path_selected"); set_hide_on_ok(false); mode = MODE_NEW; @@ -1320,8 +1320,8 @@ void ProjectList::create_project_item_control(int p_index) { Color font_color = get_color("font_color", "Tree"); ProjectListItemControl *hb = memnew(ProjectListItemControl); - hb->connect("draw", this, "_panel_draw", varray(hb)); - hb->connect("gui_input", this, "_panel_input", varray(hb)); + hb->connect_compat("draw", this, "_panel_draw", varray(hb)); + hb->connect_compat("gui_input", this, "_panel_input", varray(hb)); hb->add_constant_override("separation", 10 * EDSCALE); hb->set_tooltip(item.description); @@ -1332,7 +1332,7 @@ void ProjectList::create_project_item_control(int p_index) { favorite->set_normal_texture(favorite_icon); // This makes the project's "hover" style display correctly when hovering the favorite icon favorite->set_mouse_filter(MOUSE_FILTER_PASS); - favorite->connect("pressed", this, "_favorite_pressed", varray(hb)); + favorite->connect_compat("pressed", this, "_favorite_pressed", varray(hb)); favorite_box->add_child(favorite); favorite_box->set_alignment(BoxContainer::ALIGN_CENTER); hb->add_child(favorite_box); @@ -1380,7 +1380,7 @@ void ProjectList::create_project_item_control(int p_index) { path_hb->add_child(show); if (!item.missing) { - show->connect("pressed", this, "_show_project", varray(item.path)); + show->connect_compat("pressed", this, "_show_project", varray(item.path)); show->set_tooltip(TTR("Show in File Manager")); } else { show->set_tooltip(TTR("Error: Project is missing on the filesystem.")); @@ -2358,8 +2358,8 @@ void ProjectManager::_files_dropped(PackedStringArray p_files, int p_screen) { memdelete(dir); } if (confirm) { - multi_scan_ask->get_ok()->disconnect("pressed", this, "_scan_multiple_folders"); - multi_scan_ask->get_ok()->connect("pressed", this, "_scan_multiple_folders", varray(folders)); + multi_scan_ask->get_ok()->disconnect_compat("pressed", this, "_scan_multiple_folders"); + multi_scan_ask->get_ok()->connect_compat("pressed", this, "_scan_multiple_folders", varray(folders)); multi_scan_ask->set_text( vformat(TTR("Are you sure to scan %s folders for existing Godot projects?\nThis could take a while."), folders.size())); multi_scan_ask->popup_centered_minsize(); @@ -2524,7 +2524,7 @@ ProjectManager::ProjectManager() { project_order_filter->_setup_filters(sort_filter_titles); project_order_filter->set_filter_size(150); sort_filters->add_child(project_order_filter); - project_order_filter->connect("filter_changed", this, "_on_order_option_changed"); + project_order_filter->connect_compat("filter_changed", this, "_on_order_option_changed"); project_order_filter->set_custom_minimum_size(Size2(180, 10) * EDSCALE); int projects_sorting_order = (int)EditorSettings::get_singleton()->get("project_manager/sorting_order"); @@ -2534,7 +2534,7 @@ ProjectManager::ProjectManager() { project_filter = memnew(ProjectListFilter); project_filter->add_search_box(); - project_filter->connect("filter_changed", this, "_on_filter_option_changed"); + project_filter->connect_compat("filter_changed", this, "_on_filter_option_changed"); project_filter->set_custom_minimum_size(Size2(280, 10) * EDSCALE); sort_filters->add_child(project_filter); @@ -2546,8 +2546,8 @@ ProjectManager::ProjectManager() { pc->set_v_size_flags(SIZE_EXPAND_FILL); _project_list = memnew(ProjectList); - _project_list->connect(ProjectList::SIGNAL_SELECTION_CHANGED, this, "_update_project_buttons"); - _project_list->connect(ProjectList::SIGNAL_PROJECT_ASK_OPEN, this, "_open_selected_projects_ask"); + _project_list->connect_compat(ProjectList::SIGNAL_SELECTION_CHANGED, this, "_update_project_buttons"); + _project_list->connect_compat(ProjectList::SIGNAL_PROJECT_ASK_OPEN, this, "_open_selected_projects_ask"); pc->add_child(_project_list); _project_list->set_enable_h_scroll(false); @@ -2557,13 +2557,13 @@ ProjectManager::ProjectManager() { Button *open = memnew(Button); open->set_text(TTR("Edit")); tree_vb->add_child(open); - open->connect("pressed", this, "_open_selected_projects_ask"); + open->connect_compat("pressed", this, "_open_selected_projects_ask"); open_btn = open; Button *run = memnew(Button); run->set_text(TTR("Run")); tree_vb->add_child(run); - run->connect("pressed", this, "_run_project"); + run->connect_compat("pressed", this, "_run_project"); run_btn = run; tree_vb->add_child(memnew(HSeparator)); @@ -2571,7 +2571,7 @@ ProjectManager::ProjectManager() { Button *scan = memnew(Button); scan->set_text(TTR("Scan")); tree_vb->add_child(scan); - scan->connect("pressed", this, "_scan_projects"); + scan->connect_compat("pressed", this, "_scan_projects"); tree_vb->add_child(memnew(HSeparator)); @@ -2581,34 +2581,34 @@ ProjectManager::ProjectManager() { scan_dir->set_title(TTR("Select a Folder to Scan")); // must be after mode or it's overridden scan_dir->set_current_dir(EditorSettings::get_singleton()->get("filesystem/directories/default_project_path")); gui_base->add_child(scan_dir); - scan_dir->connect("dir_selected", this, "_scan_begin"); + scan_dir->connect_compat("dir_selected", this, "_scan_begin"); Button *create = memnew(Button); create->set_text(TTR("New Project")); tree_vb->add_child(create); - create->connect("pressed", this, "_new_project"); + create->connect_compat("pressed", this, "_new_project"); Button *import = memnew(Button); import->set_text(TTR("Import")); tree_vb->add_child(import); - import->connect("pressed", this, "_import_project"); + import->connect_compat("pressed", this, "_import_project"); Button *rename = memnew(Button); rename->set_text(TTR("Rename")); tree_vb->add_child(rename); - rename->connect("pressed", this, "_rename_project"); + rename->connect_compat("pressed", this, "_rename_project"); rename_btn = rename; Button *erase = memnew(Button); erase->set_text(TTR("Remove")); tree_vb->add_child(erase); - erase->connect("pressed", this, "_erase_project"); + erase->connect_compat("pressed", this, "_erase_project"); erase_btn = erase; Button *erase_missing = memnew(Button); erase_missing->set_text(TTR("Remove Missing")); tree_vb->add_child(erase_missing); - erase_missing->connect("pressed", this, "_erase_missing_projects"); + erase_missing->connect_compat("pressed", this, "_erase_missing_projects"); erase_missing_btn = erase_missing; tree_vb->add_spacer(); @@ -2617,7 +2617,7 @@ ProjectManager::ProjectManager() { asset_library = memnew(EditorAssetLibrary(true)); asset_library->set_name(TTR("Templates")); tabs->add_child(asset_library); - asset_library->connect("install_asset", this, "_install_project"); + asset_library->connect_compat("install_asset", this, "_install_project"); } else { WARN_PRINT("Asset Library not available, as it requires SSL to work."); } @@ -2664,7 +2664,7 @@ ProjectManager::ProjectManager() { language_btn->set_icon(get_icon("Environment", "EditorIcons")); settings_hb->add_child(language_btn); - language_btn->connect("item_selected", this, "_language_selected"); + language_btn->connect_compat("item_selected", this, "_language_selected"); center_box->add_child(settings_hb); settings_hb->set_anchors_and_margins_preset(Control::PRESET_TOP_RIGHT); @@ -2673,28 +2673,28 @@ ProjectManager::ProjectManager() { language_restart_ask = memnew(ConfirmationDialog); language_restart_ask->get_ok()->set_text(TTR("Restart Now")); - language_restart_ask->get_ok()->connect("pressed", this, "_restart_confirm"); + language_restart_ask->get_ok()->connect_compat("pressed", this, "_restart_confirm"); language_restart_ask->get_cancel()->set_text(TTR("Continue")); gui_base->add_child(language_restart_ask); erase_missing_ask = memnew(ConfirmationDialog); erase_missing_ask->get_ok()->set_text(TTR("Remove All")); - erase_missing_ask->get_ok()->connect("pressed", this, "_erase_missing_projects_confirm"); + erase_missing_ask->get_ok()->connect_compat("pressed", this, "_erase_missing_projects_confirm"); gui_base->add_child(erase_missing_ask); erase_ask = memnew(ConfirmationDialog); erase_ask->get_ok()->set_text(TTR("Remove")); - erase_ask->get_ok()->connect("pressed", this, "_erase_project_confirm"); + erase_ask->get_ok()->connect_compat("pressed", this, "_erase_project_confirm"); gui_base->add_child(erase_ask); multi_open_ask = memnew(ConfirmationDialog); multi_open_ask->get_ok()->set_text(TTR("Edit")); - multi_open_ask->get_ok()->connect("pressed", this, "_open_selected_projects"); + multi_open_ask->get_ok()->connect_compat("pressed", this, "_open_selected_projects"); gui_base->add_child(multi_open_ask); multi_run_ask = memnew(ConfirmationDialog); multi_run_ask->get_ok()->set_text(TTR("Run")); - multi_run_ask->get_ok()->connect("pressed", this, "_run_project_confirm"); + multi_run_ask->get_ok()->connect_compat("pressed", this, "_run_project_confirm"); gui_base->add_child(multi_run_ask); multi_scan_ask = memnew(ConfirmationDialog); @@ -2702,7 +2702,7 @@ ProjectManager::ProjectManager() { gui_base->add_child(multi_scan_ask); ask_update_settings = memnew(ConfirmationDialog); - ask_update_settings->get_ok()->connect("pressed", this, "_confirm_update_settings"); + ask_update_settings->get_ok()->connect_compat("pressed", this, "_confirm_update_settings"); gui_base->add_child(ask_update_settings); OS::get_singleton()->set_low_processor_usage_mode(true); @@ -2710,8 +2710,8 @@ ProjectManager::ProjectManager() { npdialog = memnew(ProjectDialog); gui_base->add_child(npdialog); - npdialog->connect("projects_updated", this, "_on_projects_updated"); - npdialog->connect("project_created", this, "_on_project_created"); + npdialog->connect_compat("projects_updated", this, "_on_projects_updated"); + npdialog->connect_compat("project_created", this, "_on_project_created"); _load_recent_projects(); @@ -2719,8 +2719,8 @@ ProjectManager::ProjectManager() { _scan_begin(EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path")); } - SceneTree::get_singleton()->connect("files_dropped", this, "_files_dropped"); - SceneTree::get_singleton()->connect("global_menu_action", this, "_global_menu_action"); + SceneTree::get_singleton()->connect_compat("files_dropped", this, "_files_dropped"); + SceneTree::get_singleton()->connect_compat("global_menu_action", this, "_global_menu_action"); run_error_diag = memnew(AcceptDialog); gui_base->add_child(run_error_diag); @@ -2732,7 +2732,7 @@ ProjectManager::ProjectManager() { open_templates = memnew(ConfirmationDialog); open_templates->set_text(TTR("You currently don't have any projects.\nWould you like to explore official example projects in the Asset Library?")); open_templates->get_ok()->set_text(TTR("Open Asset Library")); - open_templates->connect("confirmed", this, "_open_asset_library"); + open_templates->connect_compat("confirmed", this, "_open_asset_library"); add_child(open_templates); } @@ -2793,14 +2793,14 @@ void ProjectListFilter::_bind_methods() { void ProjectListFilter::add_filter_option() { filter_option = memnew(OptionButton); filter_option->set_clip_text(true); - filter_option->connect("item_selected", this, "_filter_option_selected"); + filter_option->connect_compat("item_selected", this, "_filter_option_selected"); add_child(filter_option); } void ProjectListFilter::add_search_box() { search_box = memnew(LineEdit); search_box->set_placeholder(TTR("Search")); - search_box->connect("text_changed", this, "_search_text_changed"); + search_box->connect_compat("text_changed", this, "_search_text_changed"); search_box->set_h_size_flags(SIZE_EXPAND_FILL); add_child(search_box); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 83593477c7..9bee84b482 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -108,7 +108,7 @@ void ProjectSettingsEditor::_notification(int p_what) { action_add_error->add_color_override("font_color", get_color("error_color", "Editor")); - translation_list->connect("button_pressed", this, "_translation_delete"); + translation_list->connect_compat("button_pressed", this, "_translation_delete"); _update_actions(); popup_add->add_icon_item(get_icon("Keyboard", "EditorIcons"), TTR("Key "), INPUT_KEY); //"Key " - because the word 'key' has already been used as a key animation popup_add->add_icon_item(get_icon("JoyButton", "EditorIcons"), TTR("Joy Button"), INPUT_JOY_BUTTON); @@ -847,7 +847,7 @@ void ProjectSettingsEditor::_item_add() { // Initialize the property with the default value for the given type. // The type list starts at 1 (as we exclude Nil), so add 1 to the selected value. - Variant::CallError ce; + Callable::CallError ce; const Variant value = Variant::construct(Variant::Type(type->get_selected() + 1), NULL, 0, ce); String catname = category->get_text().strip_edges(); @@ -1805,7 +1805,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { search_button->set_pressed(false); search_button->set_text(TTR("Search")); hbc->add_child(search_button); - search_button->connect("toggled", this, "_toggle_search_bar"); + search_button->connect_compat("toggled", this, "_toggle_search_bar"); hbc->add_child(memnew(VSeparator)); @@ -1820,7 +1820,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { category = memnew(LineEdit); category->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_prop_bar->add_child(category); - category->connect("text_entered", this, "_item_adds"); + category->connect_compat("text_entered", this, "_item_adds"); l = memnew(Label); add_prop_bar->add_child(l); @@ -1829,7 +1829,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { property = memnew(LineEdit); property->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_prop_bar->add_child(property); - property->connect("text_entered", this, "_item_adds"); + property->connect_compat("text_entered", this, "_item_adds"); l = memnew(Label); add_prop_bar->add_child(l); @@ -1847,7 +1847,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { Button *add = memnew(Button); add_prop_bar->add_child(add); add->set_text(TTR("Add")); - add->connect("pressed", this, "_item_add"); + add->connect_compat("pressed", this, "_item_add"); search_bar = memnew(HBoxContainer); search_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -1863,14 +1863,14 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { globals_editor->get_inspector()->set_undo_redo(EditorNode::get_singleton()->get_undo_redo()); globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); globals_editor->register_search_box(search_box); - globals_editor->get_inspector()->connect("property_selected", this, "_item_selected"); - globals_editor->get_inspector()->connect("property_edited", this, "_settings_prop_edited"); - globals_editor->get_inspector()->connect("restart_requested", this, "_editor_restart_request"); + globals_editor->get_inspector()->connect_compat("property_selected", this, "_item_selected"); + globals_editor->get_inspector()->connect_compat("property_edited", this, "_settings_prop_edited"); + globals_editor->get_inspector()->connect_compat("restart_requested", this, "_editor_restart_request"); Button *del = memnew(Button); hbc->add_child(del); del->set_text(TTR("Delete")); - del->connect("pressed", this, "_item_del"); + del->connect_compat("pressed", this, "_item_del"); add_prop_bar->add_child(memnew(VSeparator)); @@ -1879,8 +1879,8 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { popup_copy_to_feature->set_disabled(true); add_prop_bar->add_child(popup_copy_to_feature); - popup_copy_to_feature->get_popup()->connect("id_pressed", this, "_copy_to_platform"); - popup_copy_to_feature->get_popup()->connect("about_to_show", this, "_copy_to_platform_about_to_show"); + popup_copy_to_feature->get_popup()->connect_compat("id_pressed", this, "_copy_to_platform"); + popup_copy_to_feature->get_popup()->connect_compat("about_to_show", this, "_copy_to_platform_about_to_show"); get_ok()->set_text(TTR("Close")); set_hide_on_ok(true); @@ -1897,11 +1897,11 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { restart_hb->add_child(restart_label); restart_hb->add_spacer(); Button *restart_button = memnew(Button); - restart_button->connect("pressed", this, "_editor_restart"); + restart_button->connect_compat("pressed", this, "_editor_restart"); restart_hb->add_child(restart_button); restart_button->set_text(TTR("Save & Restart")); restart_close_button = memnew(ToolButton); - restart_close_button->connect("pressed", this, "_editor_restart_close"); + restart_close_button->connect_compat("pressed", this, "_editor_restart_close"); restart_hb->add_child(restart_close_button); restart_container->hide(); @@ -1929,8 +1929,8 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { action_name = memnew(LineEdit); action_name->set_h_size_flags(SIZE_EXPAND_FILL); hbc->add_child(action_name); - action_name->connect("text_entered", this, "_action_adds"); - action_name->connect("text_changed", this, "_action_check"); + action_name->connect_compat("text_entered", this, "_action_adds"); + action_name->connect_compat("text_changed", this, "_action_check"); action_add_error = memnew(Label); hbc->add_child(action_add_error); @@ -1940,7 +1940,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { hbc->add_child(add); add->set_text(TTR("Add")); add->set_disabled(true); - add->connect("pressed", this, "_action_add"); + add->connect_compat("pressed", this, "_action_add"); action_add = add; input_editor = memnew(Tree); @@ -1954,15 +1954,15 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { input_editor->set_column_min_width(1, 80 * EDSCALE); input_editor->set_column_expand(2, false); input_editor->set_column_min_width(2, 50 * EDSCALE); - input_editor->connect("item_edited", this, "_action_edited"); - input_editor->connect("item_activated", this, "_action_activated"); - input_editor->connect("cell_selected", this, "_action_selected"); - input_editor->connect("button_pressed", this, "_action_button_pressed"); + input_editor->connect_compat("item_edited", this, "_action_edited"); + input_editor->connect_compat("item_activated", this, "_action_activated"); + input_editor->connect_compat("cell_selected", this, "_action_selected"); + input_editor->connect_compat("button_pressed", this, "_action_button_pressed"); input_editor->set_drag_forwarding(this); popup_add = memnew(PopupMenu); add_child(popup_add); - popup_add->connect("id_pressed", this, "_add_item"); + popup_add->connect_compat("id_pressed", this, "_add_item"); press_a_key = memnew(ConfirmationDialog); press_a_key->set_focus_mode(FOCUS_ALL); @@ -1977,13 +1977,13 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { press_a_key->get_ok()->set_disabled(true); press_a_key_label = l; press_a_key->add_child(l); - press_a_key->connect("gui_input", this, "_wait_for_key"); - press_a_key->connect("confirmed", this, "_press_a_key_confirm"); + press_a_key->connect_compat("gui_input", this, "_wait_for_key"); + press_a_key->connect_compat("confirmed", this, "_press_a_key_confirm"); device_input = memnew(ConfirmationDialog); add_child(device_input); device_input->get_ok()->set_text(TTR("Add")); - device_input->connect("confirmed", this, "_device_input_add"); + device_input->connect_compat("confirmed", this, "_device_input_add"); hbc = memnew(HBoxContainer); device_input->add_child(hbc); @@ -2034,7 +2034,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { thb->add_child(memnew(Label(TTR("Translations:")))); thb->add_spacer(); Button *addtr = memnew(Button(TTR("Add..."))); - addtr->connect("pressed", this, "_translation_file_open"); + addtr->connect_compat("pressed", this, "_translation_file_open"); thb->add_child(addtr); VBoxContainer *tmc = memnew(VBoxContainer); tvb->add_child(tmc); @@ -2046,7 +2046,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { translation_file_open = memnew(EditorFileDialog); add_child(translation_file_open); translation_file_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); - translation_file_open->connect("file_selected", this, "_translation_add"); + translation_file_open->connect_compat("file_selected", this, "_translation_add"); } { @@ -2058,28 +2058,28 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { thb->add_child(memnew(Label(TTR("Resources:")))); thb->add_spacer(); Button *addtr = memnew(Button(TTR("Add..."))); - addtr->connect("pressed", this, "_translation_res_file_open"); + addtr->connect_compat("pressed", this, "_translation_res_file_open"); thb->add_child(addtr); VBoxContainer *tmc = memnew(VBoxContainer); tvb->add_child(tmc); tmc->set_v_size_flags(SIZE_EXPAND_FILL); translation_remap = memnew(Tree); translation_remap->set_v_size_flags(SIZE_EXPAND_FILL); - translation_remap->connect("cell_selected", this, "_translation_res_select"); + translation_remap->connect_compat("cell_selected", this, "_translation_res_select"); tmc->add_child(translation_remap); - translation_remap->connect("button_pressed", this, "_translation_res_delete"); + translation_remap->connect_compat("button_pressed", this, "_translation_res_delete"); translation_res_file_open = memnew(EditorFileDialog); add_child(translation_res_file_open); translation_res_file_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); - translation_res_file_open->connect("file_selected", this, "_translation_res_add"); + translation_res_file_open->connect_compat("file_selected", this, "_translation_res_add"); thb = memnew(HBoxContainer); tvb->add_child(thb); thb->add_child(memnew(Label(TTR("Remaps by Locale:")))); thb->add_spacer(); addtr = memnew(Button(TTR("Add..."))); - addtr->connect("pressed", this, "_translation_res_option_file_open"); + addtr->connect_compat("pressed", this, "_translation_res_option_file_open"); translation_res_option_add_button = addtr; thb->add_child(addtr); tmc = memnew(VBoxContainer); @@ -2096,13 +2096,13 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { translation_remap_options->set_column_expand(0, true); translation_remap_options->set_column_expand(1, false); translation_remap_options->set_column_min_width(1, 200); - translation_remap_options->connect("item_edited", this, "_translation_res_option_changed"); - translation_remap_options->connect("button_pressed", this, "_translation_res_option_delete"); + translation_remap_options->connect_compat("item_edited", this, "_translation_res_option_changed"); + translation_remap_options->connect_compat("button_pressed", this, "_translation_res_option_delete"); translation_res_option_file_open = memnew(EditorFileDialog); add_child(translation_res_option_file_open); translation_res_option_file_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); - translation_res_option_file_open->connect("file_selected", this, "_translation_res_option_add"); + translation_res_option_file_open->connect_compat("file_selected", this, "_translation_res_option_add"); } { @@ -2118,20 +2118,20 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { translation_locale_filter_mode->add_item(TTR("Show Selected Locales Only"), SHOW_ONLY_SELECTED_LOCALES); translation_locale_filter_mode->select(0); tmc->add_margin_child(TTR("Filter mode:"), translation_locale_filter_mode); - translation_locale_filter_mode->connect("item_selected", this, "_translation_filter_mode_changed"); + translation_locale_filter_mode->connect_compat("item_selected", this, "_translation_filter_mode_changed"); translation_filter = memnew(Tree); translation_filter->set_v_size_flags(SIZE_EXPAND_FILL); translation_filter->set_columns(1); tmc->add_child(memnew(Label(TTR("Locales:")))); tmc->add_child(translation_filter); - translation_filter->connect("item_edited", this, "_translation_filter_option_changed"); + translation_filter->connect_compat("item_edited", this, "_translation_filter_option_changed"); } autoload_settings = memnew(EditorAutoloadSettings); autoload_settings->set_name(TTR("AutoLoad")); tab_container->add_child(autoload_settings); - autoload_settings->connect("autoload_changed", this, "_settings_changed"); + autoload_settings->connect_compat("autoload_changed", this, "_settings_changed"); plugin_settings = memnew(EditorPluginSettings); plugin_settings->set_name(TTR("Plugins")); @@ -2139,7 +2139,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { timer = memnew(Timer); timer->set_wait_time(1.5); - timer->connect("timeout", ProjectSettings::get_singleton(), "save"); + timer->connect_compat("timeout", ProjectSettings::get_singleton(), "save"); timer->set_one_shot(true); add_child(timer); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index cf4b83922d..2bcf2c3b44 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -393,12 +393,12 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: } break; case Variant::INT: - case Variant::REAL: { + case Variant::FLOAT: { if (hint == PROPERTY_HINT_RANGE) { int c = hint_text.get_slice_count(","); - float min = 0, max = 100, step = type == Variant::REAL ? .01 : 1; + float min = 0, max = 100, step = type == Variant::FLOAT ? .01 : 1; if (c >= 1) { if (!hint_text.get_slice(",", 0).empty()) @@ -589,7 +589,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: if (!create_dialog) { create_dialog = memnew(CreateDialog); - create_dialog->connect("create", this, "_create_dialog_callback"); + create_dialog->connect_compat("create", this, "_create_dialog_callback"); add_child(create_dialog); } @@ -605,12 +605,12 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: return false; } else if (hint == PROPERTY_HINT_METHOD_OF_VARIANT_TYPE) { -#define MAKE_PROPSELECT \ - if (!property_select) { \ - property_select = memnew(PropertySelector); \ - property_select->connect("selected", this, "_create_selected_property"); \ - add_child(property_select); \ - } \ +#define MAKE_PROPSELECT \ + if (!property_select) { \ + property_select = memnew(PropertySelector); \ + property_select->connect_compat("selected", this, "_create_selected_property"); \ + add_child(property_select); \ + } \ hide(); MAKE_PROPSELECT; @@ -865,7 +865,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: color_picker->set_deferred_mode(true); add_child(color_picker); color_picker->hide(); - color_picker->connect("color_changed", this, "_color_changed"); + color_picker->connect_compat("color_changed", this, "_color_changed"); // get default color picker mode from editor settings int default_color_mode = EDITOR_GET("interface/inspector/default_color_picker_mode"); @@ -1048,10 +1048,16 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: case Variant::PACKED_BYTE_ARRAY: { } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_FLOAT32_ARRAY: { + + } break; + case Variant::PACKED_INT64_ARRAY: { + + } break; + case Variant::PACKED_FLOAT64_ARRAY: { } break; case Variant::PACKED_STRING_ARRAY: { @@ -1113,7 +1119,7 @@ void CustomPropertyEditor::_file_selected(String p_file) { void CustomPropertyEditor::_type_create_selected(int p_idx) { - if (type == Variant::INT || type == Variant::REAL) { + if (type == Variant::INT || type == Variant::FLOAT) { float newval = 0; switch (p_idx) { @@ -1563,7 +1569,7 @@ void CustomPropertyEditor::_modified(String p_string) { emit_signal("variant_changed"); } break; - case Variant::REAL: { + case Variant::FLOAT: { if (hint != PROPERTY_HINT_EXP_EASING) { String text = value_editor[0]->get_text(); @@ -1700,10 +1706,10 @@ void CustomPropertyEditor::_modified(String p_string) { case Variant::PACKED_BYTE_ARRAY: { } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_FLOAT32_ARRAY: { } break; case Variant::PACKED_STRING_ARRAY: { @@ -1751,7 +1757,7 @@ void CustomPropertyEditor::_range_modified(double p_value) { void CustomPropertyEditor::_focus_enter() { switch (type) { - case Variant::REAL: + case Variant::FLOAT: case Variant::STRING: case Variant::VECTOR2: case Variant::RECT2: @@ -1777,7 +1783,7 @@ void CustomPropertyEditor::_focus_enter() { void CustomPropertyEditor::_focus_exit() { switch (type) { - case Variant::REAL: + case Variant::FLOAT: case Variant::STRING: case Variant::VECTOR2: case Variant::RECT2: @@ -1902,9 +1908,9 @@ CustomPropertyEditor::CustomPropertyEditor() { add_child(value_label[i]); value_editor[i]->hide(); value_label[i]->hide(); - value_editor[i]->connect("text_entered", this, "_modified"); - value_editor[i]->connect("focus_entered", this, "_focus_enter"); - value_editor[i]->connect("focus_exited", this, "_focus_exit"); + value_editor[i]->connect_compat("text_entered", this, "_modified"); + value_editor[i]->connect_compat("focus_entered", this, "_focus_enter"); + value_editor[i]->connect_compat("focus_exited", this, "_focus_exit"); } focused_value_editor = -1; @@ -1934,7 +1940,7 @@ CustomPropertyEditor::CustomPropertyEditor() { checks20[i]->set_focus_mode(FOCUS_NONE); checks20gc->add_child(checks20[i]); checks20[i]->hide(); - checks20[i]->connect("pressed", this, "_action_pressed", make_binds(i)); + checks20[i]->connect_compat("pressed", this, "_action_pressed", make_binds(i)); checks20[i]->set_tooltip(vformat(TTR("Bit %d, val %d."), i, 1 << i)); } @@ -1944,7 +1950,7 @@ CustomPropertyEditor::CustomPropertyEditor() { text_edit->set_margin(MARGIN_BOTTOM, -30); text_edit->hide(); - text_edit->connect("text_changed", this, "_text_edit_changed"); + text_edit->connect_compat("text_changed", this, "_text_edit_changed"); for (int i = 0; i < MAX_ACTION_BUTTONS; i++) { @@ -1953,7 +1959,7 @@ CustomPropertyEditor::CustomPropertyEditor() { add_child(action_buttons[i]); Vector<Variant> binds; binds.push_back(i); - action_buttons[i]->connect("pressed", this, "_action_pressed", binds); + action_buttons[i]->connect_compat("pressed", this, "_action_pressed", binds); action_buttons[i]->set_flat(true); } @@ -1964,8 +1970,8 @@ CustomPropertyEditor::CustomPropertyEditor() { add_child(file); file->hide(); - file->connect("file_selected", this, "_file_selected"); - file->connect("dir_selected", this, "_file_selected"); + file->connect_compat("file_selected", this, "_file_selected"); + file->connect_compat("dir_selected", this, "_file_selected"); error = memnew(ConfirmationDialog); error->set_title(TTR("Error!")); @@ -1973,7 +1979,7 @@ CustomPropertyEditor::CustomPropertyEditor() { scene_tree = memnew(SceneTreeDialog); add_child(scene_tree); - scene_tree->connect("selected", this, "_node_path_selected"); + scene_tree->connect_compat("selected", this, "_node_path_selected"); scene_tree->get_scene_tree()->set_show_enabled_subscene(true); texture_preview = memnew(TextureRect); @@ -1983,31 +1989,31 @@ CustomPropertyEditor::CustomPropertyEditor() { easing_draw = memnew(Control); add_child(easing_draw); easing_draw->hide(); - easing_draw->connect("draw", this, "_draw_easing"); - easing_draw->connect("gui_input", this, "_drag_easing"); + easing_draw->connect_compat("draw", this, "_draw_easing"); + easing_draw->connect_compat("gui_input", this, "_drag_easing"); easing_draw->set_default_cursor_shape(Control::CURSOR_MOVE); type_button = memnew(MenuButton); add_child(type_button); type_button->hide(); - type_button->get_popup()->connect("id_pressed", this, "_type_create_selected"); + type_button->get_popup()->connect_compat("id_pressed", this, "_type_create_selected"); menu = memnew(PopupMenu); menu->set_pass_on_modal_close_click(false); add_child(menu); - menu->connect("id_pressed", this, "_menu_option"); + menu->connect_compat("id_pressed", this, "_menu_option"); evaluator = NULL; spinbox = memnew(SpinBox); add_child(spinbox); spinbox->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5); - spinbox->connect("value_changed", this, "_range_modified"); + spinbox->connect_compat("value_changed", this, "_range_modified"); slider = memnew(HSlider); add_child(slider); slider->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5); - slider->connect("value_changed", this, "_range_modified"); + slider->connect_compat("value_changed", this, "_range_modified"); create_dialog = NULL; property_select = NULL; diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index 8cc1448b7a..416ffb3fd0 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -95,7 +95,7 @@ void PropertySelector::_update_search() { instance->get_property_list(&props, true); } else if (type != Variant::NIL) { Variant v; - Variant::CallError ce; + Callable::CallError ce; v = Variant::construct(type, NULL, 0, ce); v.get_property_list(&props); @@ -142,8 +142,8 @@ void PropertySelector::_update_search() { Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedIntArray", "EditorIcons"), - Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedInt32Array", "EditorIcons"), + Control::get_icon("PackedFloat32Array", "EditorIcons"), Control::get_icon("PackedStringArray", "EditorIcons"), Control::get_icon("PackedVector2Array", "EditorIcons"), Control::get_icon("PackedVector3Array", "EditorIcons"), @@ -200,7 +200,7 @@ void PropertySelector::_update_search() { if (type != Variant::NIL) { Variant v; - Variant::CallError ce; + Callable::CallError ce; v = Variant::construct(type, NULL, 0, ce); v.get_method_list(&methods); } else { @@ -393,9 +393,9 @@ void PropertySelector::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - connect("confirmed", this, "_confirmed"); + connect_compat("confirmed", this, "_confirmed"); } else if (p_what == NOTIFICATION_EXIT_TREE) { - disconnect("confirmed", this, "_confirmed"); + disconnect_compat("confirmed", this, "_confirmed"); } } @@ -557,21 +557,21 @@ PropertySelector::PropertySelector() { //set_child_rect(vbc); search_box = memnew(LineEdit); vbc->add_margin_child(TTR("Search:"), search_box); - search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("gui_input", this, "_sbox_input"); + search_box->connect_compat("text_changed", this, "_text_changed"); + search_box->connect_compat("gui_input", this, "_sbox_input"); search_options = memnew(Tree); vbc->add_margin_child(TTR("Matches:"), search_options, true); get_ok()->set_text(TTR("Open")); get_ok()->set_disabled(true); register_text_enter(search_box); set_hide_on_ok(false); - search_options->connect("item_activated", this, "_confirmed"); - search_options->connect("cell_selected", this, "_item_selected"); + search_options->connect_compat("item_activated", this, "_confirmed"); + search_options->connect_compat("cell_selected", this, "_item_selected"); search_options->set_hide_root(true); search_options->set_hide_folding(true); virtuals_only = false; help_bit = memnew(EditorHelpBit); vbc->add_margin_child(TTR("Description:"), help_bit); - help_bit->connect("request_hide", this, "_closed"); + help_bit->connect_compat("request_hide", this, "_closed"); } diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index ea92e6407c..57e3c1da70 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -257,16 +257,16 @@ void EditorQuickOpen::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_confirmed"); + connect_compat("confirmed", this, "_confirmed"); search_box->set_clear_button_enabled(true); - FALLTHROUGH; + [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { search_box->set_right_icon(get_icon("Search", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", this, "_confirmed"); + disconnect_compat("confirmed", this, "_confirmed"); } break; } } @@ -291,15 +291,15 @@ EditorQuickOpen::EditorQuickOpen() { add_child(vbc); search_box = memnew(LineEdit); vbc->add_margin_child(TTR("Search:"), search_box); - search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("gui_input", this, "_sbox_input"); + search_box->connect_compat("text_changed", this, "_text_changed"); + search_box->connect_compat("gui_input", this, "_sbox_input"); search_options = memnew(Tree); vbc->add_margin_child(TTR("Matches:"), search_options, true); get_ok()->set_text(TTR("Open")); get_ok()->set_disabled(true); register_text_enter(search_box); set_hide_on_ok(false); - search_options->connect("item_activated", this, "_confirmed"); + search_options->connect_compat("item_activated", this, "_confirmed"); search_options->set_hide_root(true); search_options->set_hide_folding(true); search_options->add_constant_override("draw_guides", 1); diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index 317be309a3..aa8352aa25 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -144,7 +144,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_name->set_text("NAME"); but_insert_name->set_tooltip(String("${NAME}\n") + TTR("Node name")); but_insert_name->set_focus_mode(FOCUS_NONE); - but_insert_name->connect("pressed", this, "_insert_text", make_binds("${NAME}")); + but_insert_name->connect_compat("pressed", this, "_insert_text", make_binds("${NAME}")); but_insert_name->set_h_size_flags(SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_name); @@ -154,7 +154,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_parent->set_text("PARENT"); but_insert_parent->set_tooltip(String("${PARENT}\n") + TTR("Node's parent name, if available")); but_insert_parent->set_focus_mode(FOCUS_NONE); - but_insert_parent->connect("pressed", this, "_insert_text", make_binds("${PARENT}")); + but_insert_parent->connect_compat("pressed", this, "_insert_text", make_binds("${PARENT}")); but_insert_parent->set_h_size_flags(SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_parent); @@ -164,7 +164,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_type->set_text("TYPE"); but_insert_type->set_tooltip(String("${TYPE}\n") + TTR("Node type")); but_insert_type->set_focus_mode(FOCUS_NONE); - but_insert_type->connect("pressed", this, "_insert_text", make_binds("${TYPE}")); + but_insert_type->connect_compat("pressed", this, "_insert_text", make_binds("${TYPE}")); but_insert_type->set_h_size_flags(SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_type); @@ -174,7 +174,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_scene->set_text("SCENE"); but_insert_scene->set_tooltip(String("${SCENE}\n") + TTR("Current scene name")); but_insert_scene->set_focus_mode(FOCUS_NONE); - but_insert_scene->connect("pressed", this, "_insert_text", make_binds("${SCENE}")); + but_insert_scene->connect_compat("pressed", this, "_insert_text", make_binds("${SCENE}")); but_insert_scene->set_h_size_flags(SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_scene); @@ -184,7 +184,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_root->set_text("ROOT"); but_insert_root->set_tooltip(String("${ROOT}\n") + TTR("Root node name")); but_insert_root->set_focus_mode(FOCUS_NONE); - but_insert_root->connect("pressed", this, "_insert_text", make_binds("${ROOT}")); + but_insert_root->connect_compat("pressed", this, "_insert_text", make_binds("${ROOT}")); but_insert_root->set_h_size_flags(SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_root); @@ -194,7 +194,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_count->set_text("COUNTER"); but_insert_count->set_tooltip(String("${COUNTER}\n") + TTR("Sequential integer counter.\nCompare counter options.")); but_insert_count->set_focus_mode(FOCUS_NONE); - but_insert_count->connect("pressed", this, "_insert_text", make_binds("${COUNTER}")); + but_insert_count->connect_compat("pressed", this, "_insert_text", make_binds("${COUNTER}")); but_insert_count->set_h_size_flags(SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_count); @@ -306,35 +306,35 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und // ---- Connections - cbut_collapse_features->connect("toggled", this, "_features_toggled"); + cbut_collapse_features->connect_compat("toggled", this, "_features_toggled"); // Substitite Buttons - lne_search->connect("focus_entered", this, "_update_substitute"); - lne_search->connect("focus_exited", this, "_update_substitute"); - lne_replace->connect("focus_entered", this, "_update_substitute"); - lne_replace->connect("focus_exited", this, "_update_substitute"); - lne_prefix->connect("focus_entered", this, "_update_substitute"); - lne_prefix->connect("focus_exited", this, "_update_substitute"); - lne_suffix->connect("focus_entered", this, "_update_substitute"); - lne_suffix->connect("focus_exited", this, "_update_substitute"); + lne_search->connect_compat("focus_entered", this, "_update_substitute"); + lne_search->connect_compat("focus_exited", this, "_update_substitute"); + lne_replace->connect_compat("focus_entered", this, "_update_substitute"); + lne_replace->connect_compat("focus_exited", this, "_update_substitute"); + lne_prefix->connect_compat("focus_entered", this, "_update_substitute"); + lne_prefix->connect_compat("focus_exited", this, "_update_substitute"); + lne_suffix->connect_compat("focus_entered", this, "_update_substitute"); + lne_suffix->connect_compat("focus_exited", this, "_update_substitute"); // Preview - lne_prefix->connect("text_changed", this, "_update_preview"); - lne_suffix->connect("text_changed", this, "_update_preview"); - lne_search->connect("text_changed", this, "_update_preview"); - lne_replace->connect("text_changed", this, "_update_preview"); - spn_count_start->connect("value_changed", this, "_update_preview_int"); - spn_count_step->connect("value_changed", this, "_update_preview_int"); - spn_count_padding->connect("value_changed", this, "_update_preview_int"); - opt_style->connect("item_selected", this, "_update_preview_int"); - opt_case->connect("item_selected", this, "_update_preview_int"); - cbut_substitute->connect("pressed", this, "_update_preview", varray("")); - cbut_regex->connect("pressed", this, "_update_preview", varray("")); - cbut_process->connect("pressed", this, "_update_preview", varray("")); - - but_reset->connect("pressed", this, "reset"); + lne_prefix->connect_compat("text_changed", this, "_update_preview"); + lne_suffix->connect_compat("text_changed", this, "_update_preview"); + lne_search->connect_compat("text_changed", this, "_update_preview"); + lne_replace->connect_compat("text_changed", this, "_update_preview"); + spn_count_start->connect_compat("value_changed", this, "_update_preview_int"); + spn_count_step->connect_compat("value_changed", this, "_update_preview_int"); + spn_count_padding->connect_compat("value_changed", this, "_update_preview_int"); + opt_style->connect_compat("item_selected", this, "_update_preview_int"); + opt_case->connect_compat("item_selected", this, "_update_preview_int"); + cbut_substitute->connect_compat("pressed", this, "_update_preview", varray("")); + cbut_regex->connect_compat("pressed", this, "_update_preview", varray("")); + cbut_process->connect_compat("pressed", this, "_update_preview", varray("")); + + but_reset->connect_compat("pressed", this, "reset"); reset(); _features_toggled(false); diff --git a/editor/reparent_dialog.cpp b/editor/reparent_dialog.cpp index dd35f41b7a..7c99f5d520 100644 --- a/editor/reparent_dialog.cpp +++ b/editor/reparent_dialog.cpp @@ -38,12 +38,12 @@ void ReparentDialog::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - connect("confirmed", this, "_reparent"); + connect_compat("confirmed", this, "_reparent"); } if (p_what == NOTIFICATION_EXIT_TREE) { - disconnect("confirmed", this, "_reparent"); + disconnect_compat("confirmed", this, "_reparent"); } if (p_what == NOTIFICATION_DRAW) { @@ -93,7 +93,7 @@ ReparentDialog::ReparentDialog() { vbc->add_margin_child(TTR("Reparent Location (Select new Parent):"), tree, true); - tree->get_scene_tree()->connect("item_activated", this, "_reparent"); + tree->get_scene_tree()->connect_compat("item_activated", this, "_reparent"); //Label *label = memnew( Label ); //label->set_position( Point2( 15,8) ); diff --git a/editor/run_settings_dialog.cpp b/editor/run_settings_dialog.cpp index 3a8d17b54e..0c7ee8d807 100644 --- a/editor/run_settings_dialog.cpp +++ b/editor/run_settings_dialog.cpp @@ -81,7 +81,7 @@ RunSettingsDialog::RunSettingsDialog() { vbc->add_margin_child(TTR("Run Mode:"), run_mode); run_mode->add_item(TTR("Current Scene")); run_mode->add_item(TTR("Main Scene")); - run_mode->connect("item_selected", this, "_run_mode_changed"); + run_mode->connect_compat("item_selected", this, "_run_mode_changed"); arguments = memnew(LineEdit); vbc->add_margin_child(TTR("Main Scene Arguments:"), arguments); arguments->set_editable(false); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 4b91f6178e..ebc7d56b24 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -35,6 +35,7 @@ #include "core/os/keyboard.h" #include "core/project_settings.h" +#include "editor/debugger/editor_debugger_node.h" #include "editor/editor_feature_profile.h" #include "editor/editor_node.h" #include "editor/editor_scale.h" @@ -44,7 +45,6 @@ #include "editor/plugins/canvas_item_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" #include "editor/plugins/spatial_editor_plugin.h" -#include "editor/script_editor_debugger.h" #include "scene/main/viewport.h" #include "scene/resources/packed_scene.h" @@ -229,9 +229,9 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instanced_scene); String new_name = parent->validate_child_name(instanced_scene); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_instance_node", edited_scene->get_path_to(parent), p_files[i], new_name); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(parent)).plus_file(new_name))); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); + editor_data->get_undo_redo().add_do_method(ed, "live_debug_instance_node", edited_scene->get_path_to(parent), p_files[i], new_name); + editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(parent)).plus_file(new_name))); } editor_data->get_undo_redo().commit_action(); @@ -591,10 +591,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { editor_data->get_undo_redo().add_undo_method(parent, "remove_child", dup); editor_data->get_undo_redo().add_do_reference(dup); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_duplicate_node", edited_scene->get_path_to(node), dup->get_name()); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(parent)).plus_file(dup->get_name()))); + editor_data->get_undo_redo().add_do_method(ed, "live_debug_duplicate_node", edited_scene->get_path_to(node), dup->get_name()); + editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(parent)).plus_file(dup->get_name()))); } editor_data->get_undo_redo().commit_action(); @@ -1046,18 +1046,18 @@ void SceneTreeDock::_notification(int p_what) { break; first_enter = false; - EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", this, "_feature_profile_changed"); + EditorFeatureProfileManager::get_singleton()->connect_compat("current_feature_profile_changed", this, "_feature_profile_changed"); CanvasItemEditorPlugin *canvas_item_plugin = Object::cast_to<CanvasItemEditorPlugin>(editor_data->get_editor("2D")); if (canvas_item_plugin) { - canvas_item_plugin->get_canvas_item_editor()->connect("item_lock_status_changed", scene_tree, "_update_tree"); - canvas_item_plugin->get_canvas_item_editor()->connect("item_group_status_changed", scene_tree, "_update_tree"); - scene_tree->connect("node_changed", canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), "update"); + canvas_item_plugin->get_canvas_item_editor()->connect_compat("item_lock_status_changed", scene_tree, "_update_tree"); + canvas_item_plugin->get_canvas_item_editor()->connect_compat("item_group_status_changed", scene_tree, "_update_tree"); + scene_tree->connect_compat("node_changed", canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), "update"); } SpatialEditorPlugin *spatial_editor_plugin = Object::cast_to<SpatialEditorPlugin>(editor_data->get_editor("3D")); - spatial_editor_plugin->get_spatial_editor()->connect("item_lock_status_changed", scene_tree, "_update_tree"); - spatial_editor_plugin->get_spatial_editor()->connect("item_group_status_changed", scene_tree, "_update_tree"); + spatial_editor_plugin->get_spatial_editor()->connect_compat("item_lock_status_changed", scene_tree, "_update_tree"); + spatial_editor_plugin->get_spatial_editor()->connect_compat("item_group_status_changed", scene_tree, "_update_tree"); button_add->set_icon(get_icon("Add", "EditorIcons")); button_instance->set_icon(get_icon("Instance", "EditorIcons")); @@ -1067,8 +1067,8 @@ void SceneTreeDock::_notification(int p_what) { filter->set_right_icon(get_icon("Search", "EditorIcons")); filter->set_clear_button_enabled(true); - EditorNode::get_singleton()->get_editor_selection()->connect("selection_changed", this, "_selection_changed"); - scene_tree->get_scene_tree()->connect("item_collapsed", this, "_node_collapsed"); + EditorNode::get_singleton()->get_editor_selection()->connect_compat("selection_changed", this, "_selection_changed"); + scene_tree->get_scene_tree()->connect_compat("item_collapsed", this, "_node_collapsed"); // create_root_dialog HBoxContainer *top_row = memnew(HBoxContainer); @@ -1083,7 +1083,7 @@ void SceneTreeDock::_notification(int p_what) { node_shortcuts_toggle->set_toggle_mode(true); node_shortcuts_toggle->set_pressed(EDITOR_GET("_use_favorites_root_selection")); node_shortcuts_toggle->set_anchors_and_margins_preset(Control::PRESET_CENTER_RIGHT); - node_shortcuts_toggle->connect("pressed", this, "_update_create_root_dialog"); + node_shortcuts_toggle->connect_compat("pressed", this, "_update_create_root_dialog"); top_row->add_child(node_shortcuts_toggle); create_root_dialog->add_child(top_row); @@ -1099,18 +1099,18 @@ void SceneTreeDock::_notification(int p_what) { beginner_node_shortcuts->add_child(button_2d); button_2d->set_text(TTR("2D Scene")); button_2d->set_icon(get_icon("Node2D", "EditorIcons")); - button_2d->connect("pressed", this, "_tool_selected", make_binds(TOOL_CREATE_2D_SCENE, false)); + button_2d->connect_compat("pressed", this, "_tool_selected", make_binds(TOOL_CREATE_2D_SCENE, false)); button_3d = memnew(Button); beginner_node_shortcuts->add_child(button_3d); button_3d->set_text(TTR("3D Scene")); button_3d->set_icon(get_icon("Spatial", "EditorIcons")); - button_3d->connect("pressed", this, "_tool_selected", make_binds(TOOL_CREATE_3D_SCENE, false)); + button_3d->connect_compat("pressed", this, "_tool_selected", make_binds(TOOL_CREATE_3D_SCENE, false)); Button *button_ui = memnew(Button); beginner_node_shortcuts->add_child(button_ui); button_ui->set_text(TTR("User Interface")); button_ui->set_icon(get_icon("Control", "EditorIcons")); - button_ui->connect("pressed", this, "_tool_selected", make_binds(TOOL_CREATE_USER_INTERFACE, false)); + button_ui->connect_compat("pressed", this, "_tool_selected", make_binds(TOOL_CREATE_USER_INTERFACE, false)); VBoxContainer *favorite_node_shortcuts = memnew(VBoxContainer); favorite_node_shortcuts->set_name("FavoriteNodeShortcuts"); @@ -1120,7 +1120,7 @@ void SceneTreeDock::_notification(int p_what) { node_shortcuts->add_child(button_custom); button_custom->set_text(TTR("Other Node")); button_custom->set_icon(get_icon("Add", "EditorIcons")); - button_custom->connect("pressed", this, "_tool_selected", make_binds(TOOL_NEW, false)); + button_custom->connect_compat("pressed", this, "_tool_selected", make_binds(TOOL_NEW, false)); node_shortcuts->add_spacer(); create_root_dialog->add_child(node_shortcuts); @@ -1128,11 +1128,11 @@ void SceneTreeDock::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - clear_inherit_confirm->connect("confirmed", this, "_tool_selected", varray(TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM)); + clear_inherit_confirm->connect_compat("confirmed", this, "_tool_selected", varray(TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM)); } break; case NOTIFICATION_EXIT_TREE: { - clear_inherit_confirm->disconnect("confirmed", this, "_tool_selected"); + clear_inherit_confirm->disconnect_compat("confirmed", this, "_tool_selected"); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { button_add->set_icon(get_icon("Add", "EditorIcons")); @@ -1584,7 +1584,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V if (p_position_in_parent >= 0) editor_data->get_undo_redo().add_do_method(new_parent, "move_child", node, p_position_in_parent + inc); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); String old_name = former_names[ni]; String new_name = new_parent->validate_child_name(node); @@ -1609,8 +1609,8 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V path_renames[ni].second = fixed_node_path; } - editor_data->get_undo_redo().add_do_method(sed, "live_debug_reparent_node", edited_scene->get_path_to(node), edited_scene->get_path_to(new_parent), new_name, p_position_in_parent + inc); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_reparent_node", NodePath(String(edited_scene->get_path_to(new_parent)).plus_file(new_name)), edited_scene->get_path_to(node->get_parent()), node->get_name(), node->get_index()); + editor_data->get_undo_redo().add_do_method(ed, "live_debug_reparent_node", edited_scene->get_path_to(node), edited_scene->get_path_to(new_parent), new_name, p_position_in_parent + inc); + editor_data->get_undo_redo().add_undo_method(ed, "live_debug_reparent_node", NodePath(String(edited_scene->get_path_to(new_parent)).plus_file(new_name)), edited_scene->get_path_to(node->get_parent()), node->get_name(), node->get_index()); if (p_keep_global_xform) { if (Object::cast_to<Node2D>(node)) @@ -1738,7 +1738,7 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) { } void SceneTreeDock::_script_creation_closed() { - script_create_dialog->disconnect("script_created", this, "_script_created"); + script_create_dialog->disconnect_compat("script_created", this, "_script_created"); } void SceneTreeDock::_toggle_editable_children_from_selection() { @@ -1849,9 +1849,9 @@ void SceneTreeDock::_delete_confirm() { editor_data->get_undo_redo().add_undo_method(this, "_set_owners", edited_scene, owners); editor_data->get_undo_redo().add_undo_reference(n); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_remove_and_keep_node", edited_scene->get_path_to(n), n->get_instance_id()); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_restore_node", n->get_instance_id(), edited_scene->get_path_to(n->get_parent()), n->get_index()); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); + editor_data->get_undo_redo().add_do_method(ed, "live_debug_remove_and_keep_node", edited_scene->get_path_to(n), n->get_instance_id()); + editor_data->get_undo_redo().add_undo_method(ed, "live_debug_restore_node", n->get_instance_id(), edited_scene->get_path_to(n->get_parent()), n->get_index()); } } editor_data->get_undo_redo().commit_action(); @@ -1950,9 +1950,9 @@ void SceneTreeDock::_do_create(Node *p_parent) { editor_data->get_undo_redo().add_undo_method(p_parent, "remove_child", child); String new_name = p_parent->validate_child_name(child); - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_create_node", edited_scene->get_path_to(p_parent), child->get_class(), new_name); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(p_parent)).plus_file(new_name))); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); + editor_data->get_undo_redo().add_do_method(ed, "live_debug_create_node", edited_scene->get_path_to(p_parent), child->get_class(), new_name); + editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(p_parent)).plus_file(new_name))); } else { @@ -2113,7 +2113,7 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop Object::Connection &c = F->get(); if (!(c.flags & Object::CONNECT_PERSIST)) continue; - newnode->connect(c.signal, c.target, c.method, c.binds, Object::CONNECT_PERSIST); + newnode->connect_compat(c.signal.get_name(), c.callable.get_object(), c.callable.get_method(), c.binds, Object::CONNECT_PERSIST); } } @@ -2616,8 +2616,8 @@ void SceneTreeDock::attach_script_to_selected(bool p_extend) { } } - script_create_dialog->connect("script_created", this, "_script_created"); - script_create_dialog->connect("popup_hide", this, "_script_creation_closed", varray(), CONNECT_ONESHOT); + script_create_dialog->connect_compat("script_created", this, "_script_created"); + script_create_dialog->connect_compat("popup_hide", this, "_script_creation_closed", varray(), CONNECT_ONESHOT); script_create_dialog->set_inheritance_base_type("Node"); script_create_dialog->config(inherits, path); script_create_dialog->popup_centered(); @@ -2719,7 +2719,7 @@ void SceneTreeDock::_update_create_root_dialog() { if (ScriptServer::is_global_class(name)) name = ScriptServer::get_global_class_native_base(name); button->set_icon(EditorNode::get_singleton()->get_class_icon(name)); - button->connect("pressed", this, "_favorite_root_selected", make_binds(l)); + button->connect_compat("pressed", this, "_favorite_root_selected", make_binds(l)); } } @@ -2850,13 +2850,13 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel ED_SHORTCUT("scene_tree/delete", TTR("Delete"), KEY_DELETE); button_add = memnew(ToolButton); - button_add->connect("pressed", this, "_tool_selected", make_binds(TOOL_NEW, false)); + button_add->connect_compat("pressed", this, "_tool_selected", make_binds(TOOL_NEW, false)); button_add->set_tooltip(TTR("Add/Create a New Node.")); button_add->set_shortcut(ED_GET_SHORTCUT("scene_tree/add_child_node")); filter_hbc->add_child(button_add); button_instance = memnew(ToolButton); - button_instance->connect("pressed", this, "_tool_selected", make_binds(TOOL_INSTANCE, false)); + button_instance->connect_compat("pressed", this, "_tool_selected", make_binds(TOOL_INSTANCE, false)); button_instance->set_tooltip(TTR("Instance a scene file as a Node. Creates an inherited scene if no root node exists.")); button_instance->set_shortcut(ED_GET_SHORTCUT("scene_tree/instance_scene")); filter_hbc->add_child(button_instance); @@ -2867,17 +2867,17 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel filter->set_placeholder(TTR("Filter nodes")); filter_hbc->add_child(filter); filter->add_constant_override("minimum_spaces", 0); - filter->connect("text_changed", this, "_filter_changed"); + filter->connect_compat("text_changed", this, "_filter_changed"); button_create_script = memnew(ToolButton); - button_create_script->connect("pressed", this, "_tool_selected", make_binds(TOOL_ATTACH_SCRIPT, false)); + button_create_script->connect_compat("pressed", this, "_tool_selected", make_binds(TOOL_ATTACH_SCRIPT, false)); button_create_script->set_tooltip(TTR("Attach a new or existing script for the selected node.")); button_create_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/attach_script")); filter_hbc->add_child(button_create_script); button_create_script->hide(); button_clear_script = memnew(ToolButton); - button_clear_script->connect("pressed", this, "_tool_selected", make_binds(TOOL_CLEAR_SCRIPT, false)); + button_clear_script->connect_compat("pressed", this, "_tool_selected", make_binds(TOOL_CLEAR_SCRIPT, false)); button_clear_script->set_tooltip(TTR("Clear a script for the selected node.")); button_clear_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/clear_script")); filter_hbc->add_child(button_clear_script); @@ -2891,14 +2891,14 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel edit_remote->set_h_size_flags(SIZE_EXPAND_FILL); edit_remote->set_text(TTR("Remote")); edit_remote->set_toggle_mode(true); - edit_remote->connect("pressed", this, "_remote_tree_selected"); + edit_remote->connect_compat("pressed", this, "_remote_tree_selected"); edit_local = memnew(ToolButton); button_hb->add_child(edit_local); edit_local->set_h_size_flags(SIZE_EXPAND_FILL); edit_local->set_text(TTR("Local")); edit_local->set_toggle_mode(true); - edit_local->connect("pressed", this, "_local_tree_selected"); + edit_local->connect_compat("pressed", this, "_local_tree_selected"); remote_tree = NULL; button_hb->hide(); @@ -2911,19 +2911,19 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel vbc->add_child(scene_tree); scene_tree->set_v_size_flags(SIZE_EXPAND | SIZE_FILL); - scene_tree->connect("rmb_pressed", this, "_tree_rmb"); + scene_tree->connect_compat("rmb_pressed", this, "_tree_rmb"); - scene_tree->connect("node_selected", this, "_node_selected", varray(), CONNECT_DEFERRED); - scene_tree->connect("node_renamed", this, "_node_renamed", varray(), CONNECT_DEFERRED); - scene_tree->connect("node_prerename", this, "_node_prerenamed"); - scene_tree->connect("open", this, "_load_request"); - scene_tree->connect("open_script", this, "_script_open_request"); - scene_tree->connect("nodes_rearranged", this, "_nodes_dragged"); - scene_tree->connect("files_dropped", this, "_files_dropped"); - scene_tree->connect("script_dropped", this, "_script_dropped"); - scene_tree->connect("nodes_dragged", this, "_nodes_drag_begin"); + scene_tree->connect_compat("node_selected", this, "_node_selected", varray(), CONNECT_DEFERRED); + scene_tree->connect_compat("node_renamed", this, "_node_renamed", varray(), CONNECT_DEFERRED); + scene_tree->connect_compat("node_prerename", this, "_node_prerenamed"); + scene_tree->connect_compat("open", this, "_load_request"); + scene_tree->connect_compat("open_script", this, "_script_open_request"); + scene_tree->connect_compat("nodes_rearranged", this, "_nodes_dragged"); + scene_tree->connect_compat("files_dropped", this, "_files_dropped"); + scene_tree->connect_compat("script_dropped", this, "_script_dropped"); + scene_tree->connect_compat("nodes_dragged", this, "_nodes_drag_begin"); - scene_tree->get_scene_tree()->connect("item_double_clicked", this, "_focus_node"); + scene_tree->get_scene_tree()->connect_compat("item_double_clicked", this, "_focus_node"); scene_tree->set_undo_redo(&editor_data->get_undo_redo()); scene_tree->set_editor_selection(editor_selection); @@ -2931,8 +2931,8 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel create_dialog = memnew(CreateDialog); create_dialog->set_base_type("Node"); add_child(create_dialog); - create_dialog->connect("create", this, "_create"); - create_dialog->connect("favorites_updated", this, "_update_create_root_dialog"); + create_dialog->connect_compat("create", this, "_create"); + create_dialog->connect_compat("favorites_updated", this, "_update_create_root_dialog"); rename_dialog = memnew(RenameDialog(scene_tree, &editor_data->get_undo_redo())); add_child(rename_dialog); @@ -2943,44 +2943,44 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel reparent_dialog = memnew(ReparentDialog); add_child(reparent_dialog); - reparent_dialog->connect("reparent", this, "_node_reparent"); + reparent_dialog->connect_compat("reparent", this, "_node_reparent"); accept = memnew(AcceptDialog); add_child(accept); quick_open = memnew(EditorQuickOpen); add_child(quick_open); - quick_open->connect("quick_open", this, "_quick_open"); + quick_open->connect_compat("quick_open", this, "_quick_open"); set_process_unhandled_key_input(true); delete_dialog = memnew(ConfirmationDialog); add_child(delete_dialog); - delete_dialog->connect("confirmed", this, "_delete_confirm"); + delete_dialog->connect_compat("confirmed", this, "_delete_confirm"); editable_instance_remove_dialog = memnew(ConfirmationDialog); add_child(editable_instance_remove_dialog); - editable_instance_remove_dialog->connect("confirmed", this, "_toggle_editable_children_from_selection"); + editable_instance_remove_dialog->connect_compat("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"); + placeholder_editable_instance_remove_dialog->connect_compat("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"); + import_subscene_dialog->connect_compat("subscene_selected", this, "_import_subscene"); new_scene_from_dialog = memnew(EditorFileDialog); new_scene_from_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); add_child(new_scene_from_dialog); - new_scene_from_dialog->connect("file_selected", this, "_new_scene_from"); + new_scene_from_dialog->connect_compat("file_selected", this, "_new_scene_from"); menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_tool_selected"); + menu->connect_compat("id_pressed", this, "_tool_selected"); menu->set_hide_on_window_lose_focus(true); menu_subresources = memnew(PopupMenu); menu_subresources->set_name("Sub-Resources"); - menu_subresources->connect("id_pressed", this, "_tool_selected"); + menu_subresources->connect_compat("id_pressed", this, "_tool_selected"); menu->add_child(menu_subresources); first_enter = true; restore_script_editor_on_drag = false; diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index ecaef4fb0f..ff8eaa8897 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -323,8 +323,8 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (can_open_instance && undo_redo) { //Show buttons only when necessary(SceneTreeDock) to avoid crashes - if (!p_node->is_connected("script_changed", this, "_node_script_changed")) - p_node->connect("script_changed", this, "_node_script_changed", varray(p_node)); + if (!p_node->is_connected_compat("script_changed", this, "_node_script_changed")) + p_node->connect_compat("script_changed", this, "_node_script_changed", varray(p_node)); Ref<Script> script = p_node->get_script(); if (!script.is_null()) { @@ -350,8 +350,8 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { else item->add_button(0, get_icon("GuiVisibilityHidden", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); - if (!p_node->is_connected("visibility_changed", this, "_node_visibility_changed")) - p_node->connect("visibility_changed", this, "_node_visibility_changed", varray(p_node)); + if (!p_node->is_connected_compat("visibility_changed", this, "_node_visibility_changed")) + p_node->connect_compat("visibility_changed", this, "_node_visibility_changed", varray(p_node)); _update_visibility_color(p_node, item); } else if (p_node->is_class("Spatial")) { @@ -370,8 +370,8 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { else item->add_button(0, get_icon("GuiVisibilityHidden", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); - if (!p_node->is_connected("visibility_changed", this, "_node_visibility_changed")) - p_node->connect("visibility_changed", this, "_node_visibility_changed", varray(p_node)); + if (!p_node->is_connected_compat("visibility_changed", this, "_node_visibility_changed")) + p_node->connect_compat("visibility_changed", this, "_node_visibility_changed", varray(p_node)); _update_visibility_color(p_node, item); } else if (p_node->is_class("AnimationPlayer")) { @@ -495,12 +495,12 @@ void SceneTreeEditor::_node_removed(Node *p_node) { if (EditorNode::get_singleton()->is_exiting()) return; //speed up exit - if (p_node->is_connected("script_changed", this, "_node_script_changed")) - p_node->disconnect("script_changed", this, "_node_script_changed"); + if (p_node->is_connected_compat("script_changed", this, "_node_script_changed")) + p_node->disconnect_compat("script_changed", this, "_node_script_changed"); if (p_node->is_class("Spatial") || p_node->is_class("CanvasItem")) { - if (p_node->is_connected("visibility_changed", this, "_node_visibility_changed")) - p_node->disconnect("visibility_changed", this, "_node_visibility_changed"); + if (p_node->is_connected_compat("visibility_changed", this, "_node_visibility_changed")) + p_node->disconnect_compat("visibility_changed", this, "_node_visibility_changed"); } if (p_node == selected) { @@ -640,22 +640,22 @@ void SceneTreeEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - get_tree()->connect("tree_changed", this, "_tree_changed"); - get_tree()->connect("node_removed", this, "_node_removed"); - get_tree()->connect("node_renamed", this, "_node_renamed"); - get_tree()->connect("node_configuration_warning_changed", this, "_warning_changed"); + get_tree()->connect_compat("tree_changed", this, "_tree_changed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_renamed", this, "_node_renamed"); + get_tree()->connect_compat("node_configuration_warning_changed", this, "_warning_changed"); - tree->connect("item_collapsed", this, "_cell_collapsed"); + tree->connect_compat("item_collapsed", this, "_cell_collapsed"); _update_tree(); } break; case NOTIFICATION_EXIT_TREE: { - get_tree()->disconnect("tree_changed", this, "_tree_changed"); - get_tree()->disconnect("node_removed", this, "_node_removed"); - get_tree()->disconnect("node_renamed", this, "_node_renamed"); - tree->disconnect("item_collapsed", this, "_cell_collapsed"); - get_tree()->disconnect("node_configuration_warning_changed", this, "_warning_changed"); + get_tree()->disconnect_compat("tree_changed", this, "_tree_changed"); + get_tree()->disconnect_compat("node_removed", this, "_node_removed"); + get_tree()->disconnect_compat("node_renamed", this, "_node_renamed"); + tree->disconnect_compat("item_collapsed", this, "_cell_collapsed"); + get_tree()->disconnect_compat("node_configuration_warning_changed", this, "_warning_changed"); } break; case NOTIFICATION_THEME_CHANGED: { @@ -836,7 +836,7 @@ void SceneTreeEditor::set_editor_selection(EditorSelection *p_selection) { editor_selection = p_selection; tree->set_select_mode(Tree::SELECT_MULTI); tree->set_cursor_can_exit_tree(false); - editor_selection->connect("selection_changed", this, "_selection_changed"); + editor_selection->connect_compat("selection_changed", this, "_selection_changed"); } void SceneTreeEditor::_update_selection(TreeItem *item) { @@ -1163,15 +1163,15 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope tree->set_drag_forwarding(this); if (p_can_rename) { tree->set_allow_rmb_select(true); - tree->connect("item_rmb_selected", this, "_rmb_select"); - tree->connect("empty_tree_rmb_selected", this, "_rmb_select"); + tree->connect_compat("item_rmb_selected", this, "_rmb_select"); + tree->connect_compat("empty_tree_rmb_selected", this, "_rmb_select"); } - tree->connect("cell_selected", this, "_selected_changed"); - tree->connect("item_edited", this, "_renamed", varray(), CONNECT_DEFERRED); - tree->connect("multi_selected", this, "_cell_multi_selected"); - tree->connect("button_pressed", this, "_cell_button_pressed"); - tree->connect("nothing_selected", this, "_deselect_items"); + tree->connect_compat("cell_selected", this, "_selected_changed"); + tree->connect_compat("item_edited", this, "_renamed", varray(), CONNECT_DEFERRED); + tree->connect_compat("multi_selected", this, "_cell_multi_selected"); + tree->connect_compat("button_pressed", this, "_cell_button_pressed"); + tree->connect_compat("nothing_selected", this, "_deselect_items"); //tree->connect("item_edited", this,"_renamed",Vector<Variant>(),true); error = memnew(AcceptDialog); @@ -1189,7 +1189,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope blocked = 0; update_timer = memnew(Timer); - update_timer->connect("timeout", this, "_update_tree"); + update_timer->connect_compat("timeout", this, "_update_tree"); update_timer->set_one_shot(true); update_timer->set_wait_time(0.5); add_child(update_timer); @@ -1209,12 +1209,12 @@ void SceneTreeDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_select"); + connect_compat("confirmed", this, "_select"); filter->set_right_icon(get_icon("Search", "EditorIcons")); filter->set_clear_button_enabled(true); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", this, "_select"); + disconnect_compat("confirmed", this, "_select"); } break; case NOTIFICATION_VISIBILITY_CHANGED: { if (is_visible_in_tree()) @@ -1259,12 +1259,12 @@ SceneTreeDialog::SceneTreeDialog() { filter->set_h_size_flags(SIZE_EXPAND_FILL); filter->set_placeholder(TTR("Filter nodes")); filter->add_constant_override("minimum_spaces", 0); - filter->connect("text_changed", this, "_filter_changed"); + filter->connect_compat("text_changed", this, "_filter_changed"); vbc->add_child(filter); tree = memnew(SceneTreeEditor(false, false, true)); tree->set_v_size_flags(SIZE_EXPAND_FILL); - tree->get_scene_tree()->connect("item_activated", this, "_select"); + tree->get_scene_tree()->connect_compat("item_activated", this, "_select"); vbc->add_child(tree); } diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 959bb67e12..ca4baffe84 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -804,7 +804,7 @@ ScriptCreateDialog::ScriptCreateDialog() { language_menu->select(default_language); current_language = default_language; - language_menu->connect("item_selected", this, "_lang_changed"); + language_menu->connect_compat("item_selected", this, "_lang_changed"); /* Inherits */ @@ -813,16 +813,16 @@ ScriptCreateDialog::ScriptCreateDialog() { hb = memnew(HBoxContainer); hb->set_h_size_flags(SIZE_EXPAND_FILL); parent_name = memnew(LineEdit); - parent_name->connect("text_changed", this, "_parent_name_changed"); + parent_name->connect_compat("text_changed", this, "_parent_name_changed"); parent_name->set_h_size_flags(SIZE_EXPAND_FILL); hb->add_child(parent_name); parent_search_button = memnew(Button); parent_search_button->set_flat(true); - parent_search_button->connect("pressed", this, "_browse_class_in_tree"); + parent_search_button->connect_compat("pressed", this, "_browse_class_in_tree"); hb->add_child(parent_search_button); parent_browse_button = memnew(Button); parent_browse_button->set_flat(true); - parent_browse_button->connect("pressed", this, "_browse_path", varray(true, false)); + parent_browse_button->connect_compat("pressed", this, "_browse_path", varray(true, false)); hb->add_child(parent_browse_button); gc->add_child(memnew(Label(TTR("Inherits:")))); gc->add_child(hb); @@ -831,7 +831,7 @@ ScriptCreateDialog::ScriptCreateDialog() { /* Class Name */ class_name = memnew(LineEdit); - class_name->connect("text_changed", this, "_class_name_changed"); + class_name->connect_compat("text_changed", this, "_class_name_changed"); class_name->set_h_size_flags(SIZE_EXPAND_FILL); gc->add_child(memnew(Label(TTR("Class Name:")))); gc->add_child(class_name); @@ -841,28 +841,28 @@ ScriptCreateDialog::ScriptCreateDialog() { template_menu = memnew(OptionButton); gc->add_child(memnew(Label(TTR("Template:")))); gc->add_child(template_menu); - template_menu->connect("item_selected", this, "_template_changed"); + template_menu->connect_compat("item_selected", this, "_template_changed"); /* Built-in Script */ internal = memnew(CheckBox); internal->set_text(TTR("On")); - internal->connect("pressed", this, "_built_in_pressed"); + internal->connect_compat("pressed", this, "_built_in_pressed"); gc->add_child(memnew(Label(TTR("Built-in Script:")))); gc->add_child(internal); /* Path */ hb = memnew(HBoxContainer); - hb->connect("sort_children", this, "_path_hbox_sorted"); + hb->connect_compat("sort_children", this, "_path_hbox_sorted"); file_path = memnew(LineEdit); - file_path->connect("text_changed", this, "_path_changed"); - file_path->connect("text_entered", this, "_path_entered"); + file_path->connect_compat("text_changed", this, "_path_changed"); + file_path->connect_compat("text_entered", this, "_path_entered"); file_path->set_h_size_flags(SIZE_EXPAND_FILL); hb->add_child(file_path); path_button = memnew(Button); path_button->set_flat(true); - path_button->connect("pressed", this, "_browse_path", varray(false, true)); + path_button->connect_compat("pressed", this, "_browse_path", varray(false, true)); hb->add_child(path_button); gc->add_child(memnew(Label(TTR("Path:")))); gc->add_child(hb); @@ -871,11 +871,11 @@ ScriptCreateDialog::ScriptCreateDialog() { /* Dialog Setup */ select_class = memnew(CreateDialog); - select_class->connect("create", this, "_create"); + select_class->connect_compat("create", this, "_create"); add_child(select_class); file_browse = memnew(EditorFileDialog); - file_browse->connect("file_selected", this, "_file_selected"); + file_browse->connect_compat("file_selected", this, "_file_selected"); file_browse->set_mode(EditorFileDialog::MODE_OPEN_FILE); add_child(file_browse); get_ok()->set_text(TTR("Create")); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 44962323e5..9f8a531762 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -32,13 +32,13 @@ #include "core/os/keyboard.h" #include "core/project_settings.h" +#include "editor/debugger/editor_debugger_node.h" #include "editor_file_system.h" #include "editor_log.h" #include "editor_node.h" #include "editor_scale.h" #include "editor_settings.h" #include "scene/gui/margin_container.h" -#include "script_editor_debugger.h" void EditorSettingsDialog::ok_pressed() { @@ -119,9 +119,8 @@ void EditorSettingsDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - undo_redo->set_method_notify_callback(sed->_method_changeds, sed); - undo_redo->set_property_notify_callback(sed->_property_changeds, sed); + undo_redo->set_method_notify_callback(EditorDebuggerNode::_method_changeds, NULL); + undo_redo->set_property_notify_callback(EditorDebuggerNode::_property_changeds, NULL); undo_redo->set_commit_notify_callback(_undo_redo_callback, this); } break; case NOTIFICATION_ENTER_TREE: { @@ -412,7 +411,7 @@ EditorSettingsDialog::EditorSettingsDialog() { tabs = memnew(TabContainer); tabs->set_tab_align(TabContainer::ALIGN_LEFT); - tabs->connect("tab_changed", this, "_tabs_tab_changed"); + tabs->connect_compat("tab_changed", this, "_tabs_tab_changed"); add_child(tabs); // General Tab @@ -435,8 +434,8 @@ EditorSettingsDialog::EditorSettingsDialog() { inspector->set_v_size_flags(Control::SIZE_EXPAND_FILL); inspector->get_inspector()->set_undo_redo(undo_redo); tab_general->add_child(inspector); - inspector->get_inspector()->connect("property_edited", this, "_settings_property_edited"); - inspector->get_inspector()->connect("restart_requested", this, "_editor_restart_request"); + inspector->get_inspector()->connect_compat("property_edited", this, "_settings_property_edited"); + inspector->get_inspector()->connect_compat("restart_requested", this, "_editor_restart_request"); restart_container = memnew(PanelContainer); tab_general->add_child(restart_container); @@ -450,11 +449,11 @@ EditorSettingsDialog::EditorSettingsDialog() { restart_hb->add_child(restart_label); restart_hb->add_spacer(); Button *restart_button = memnew(Button); - restart_button->connect("pressed", this, "_editor_restart"); + restart_button->connect_compat("pressed", this, "_editor_restart"); restart_hb->add_child(restart_button); restart_button->set_text(TTR("Save & Restart")); restart_close_button = memnew(ToolButton); - restart_close_button->connect("pressed", this, "_editor_restart_close"); + restart_close_button->connect_compat("pressed", this, "_editor_restart_close"); restart_hb->add_child(restart_close_button); restart_container->hide(); @@ -471,7 +470,7 @@ EditorSettingsDialog::EditorSettingsDialog() { shortcut_search_box = memnew(LineEdit); shortcut_search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->add_child(shortcut_search_box); - shortcut_search_box->connect("text_changed", this, "_filter_shortcuts"); + shortcut_search_box->connect_compat("text_changed", this, "_filter_shortcuts"); shortcuts = memnew(Tree); tab_shortcuts->add_child(shortcuts, true); @@ -481,7 +480,7 @@ EditorSettingsDialog::EditorSettingsDialog() { shortcuts->set_column_titles_visible(true); shortcuts->set_column_title(0, TTR("Name")); shortcuts->set_column_title(1, TTR("Binding")); - shortcuts->connect("button_pressed", this, "_shortcut_button_pressed"); + shortcuts->connect_compat("button_pressed", this, "_shortcut_button_pressed"); press_a_key = memnew(ConfirmationDialog); press_a_key->set_focus_mode(FOCUS_ALL); @@ -495,17 +494,17 @@ EditorSettingsDialog::EditorSettingsDialog() { l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30); press_a_key_label = l; press_a_key->add_child(l); - press_a_key->connect("gui_input", this, "_wait_for_key"); - press_a_key->connect("confirmed", this, "_press_a_key_confirm"); + press_a_key->connect_compat("gui_input", this, "_wait_for_key"); + press_a_key->connect_compat("confirmed", this, "_press_a_key_confirm"); set_hide_on_ok(true); timer = memnew(Timer); timer->set_wait_time(1.5); - timer->connect("timeout", this, "_settings_save"); + timer->connect_compat("timeout", this, "_settings_save"); timer->set_one_shot(true); add_child(timer); - EditorSettings::get_singleton()->connect("settings_changed", this, "_settings_changed"); + EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_settings_changed"); get_ok()->set_text(TTR("Close")); updating = false; diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 12a879edb8..40e1be665c 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -1238,7 +1238,6 @@ CameraSpatialGizmoPlugin::CameraSpatialGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/camera", Color(0.8, 0.4, 0.8)); create_material("camera_material", gizmo_color); - create_icon_material("camera_icon", SpatialEditor::get_singleton()->get_icon("GizmoCamera", "EditorIcons")); create_handle_material("handles"); } @@ -1350,7 +1349,6 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Vector<Vector3> handles; Ref<Material> material = get_material("camera_material", p_gizmo); - Ref<Material> icon = get_material("camera_icon", p_gizmo); #define ADD_TRIANGLE(m_a, m_b, m_c) \ { \ @@ -1445,7 +1443,6 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { #undef ADD_QUAD p_gizmo->add_lines(lines, material); - p_gizmo->add_unscaled_billboard(icon, 0.05); p_gizmo->add_handles(handles, get_material("handles")); ClippedCamera *clipcam = Object::cast_to<ClippedCamera>(camera); @@ -3450,7 +3447,7 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Vector<Vector3> points; - Vector3 d(0, 0, height * 0.5); + Vector3 d(0, height * 0.5, 0); for (int i = 0; i < 360; i++) { float ra = Math::deg2rad((float)i); @@ -3458,24 +3455,24 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * radius; Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * radius; - points.push_back(Vector3(a.x, a.y, 0) + d); - points.push_back(Vector3(b.x, b.y, 0) + d); + points.push_back(Vector3(a.x, 0, a.y) + d); + points.push_back(Vector3(b.x, 0, b.y) + d); - points.push_back(Vector3(a.x, a.y, 0) - d); - points.push_back(Vector3(b.x, b.y, 0) - d); + points.push_back(Vector3(a.x, 0, a.y) - d); + points.push_back(Vector3(b.x, 0, b.y) - d); if (i % 90 == 0) { - points.push_back(Vector3(a.x, a.y, 0) + d); - points.push_back(Vector3(a.x, a.y, 0) - d); + points.push_back(Vector3(a.x, 0, a.y) + d); + points.push_back(Vector3(a.x, 0, a.y) - d); } Vector3 dud = i < 180 ? d : -d; - points.push_back(Vector3(0, a.y, a.x) + dud); - points.push_back(Vector3(0, b.y, b.x) + dud); - points.push_back(Vector3(a.y, 0, a.x) + dud); - points.push_back(Vector3(b.y, 0, b.x) + dud); + points.push_back(Vector3(0, a.x, a.y) + dud); + points.push_back(Vector3(0, b.x, b.y) + dud); + points.push_back(Vector3(a.y, a.x, 0) + dud); + points.push_back(Vector3(b.y, b.x, 0) + dud); } p_gizmo->add_lines(points, material); @@ -3489,31 +3486,31 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * radius; Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * radius; - collision_segments.push_back(Vector3(a.x, a.y, 0) + d); - collision_segments.push_back(Vector3(b.x, b.y, 0) + d); + collision_segments.push_back(Vector3(a.x, 0, a.y) + d); + collision_segments.push_back(Vector3(b.x, 0, b.y) + d); - collision_segments.push_back(Vector3(a.x, a.y, 0) - d); - collision_segments.push_back(Vector3(b.x, b.y, 0) - d); + collision_segments.push_back(Vector3(a.x, 0, a.y) - d); + collision_segments.push_back(Vector3(b.x, 0, b.y) - d); if (i % 16 == 0) { - collision_segments.push_back(Vector3(a.x, a.y, 0) + d); - collision_segments.push_back(Vector3(a.x, a.y, 0) - d); + collision_segments.push_back(Vector3(a.x, 0, a.y) + d); + collision_segments.push_back(Vector3(a.x, 0, a.y) - d); } Vector3 dud = i < 32 ? d : -d; - collision_segments.push_back(Vector3(0, a.y, a.x) + dud); - collision_segments.push_back(Vector3(0, b.y, b.x) + dud); - collision_segments.push_back(Vector3(a.y, 0, a.x) + dud); - collision_segments.push_back(Vector3(b.y, 0, b.x) + dud); + collision_segments.push_back(Vector3(0, a.x, a.y) + dud); + collision_segments.push_back(Vector3(0, b.x, b.y) + dud); + collision_segments.push_back(Vector3(a.y, a.x, 0) + dud); + collision_segments.push_back(Vector3(b.y, b.x, 0) + dud); } p_gizmo->add_collision_segments(collision_segments); Vector<Vector3> handles; handles.push_back(Vector3(cs2->get_radius(), 0, 0)); - handles.push_back(Vector3(0, 0, cs2->get_height() * 0.5 + cs2->get_radius())); + handles.push_back(Vector3(0, cs2->get_height() * 0.5 + cs2->get_radius(), 0)); p_gizmo->add_handles(handles, handles_material); } diff --git a/editor/translations/af.po b/editor/translations/af.po index a08a21a49a..eab0005cb1 100644 --- a/editor/translations/af.po +++ b/editor/translations/af.po @@ -4010,15 +4010,16 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" -msgstr "" +#, fuzzy +msgid "%d Files" +msgstr "Vind" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/ar.po b/editor/translations/ar.po index 292dadc047..c9520d2669 100644 --- a/editor/translations/ar.po +++ b/editor/translations/ar.po @@ -4070,6 +4070,11 @@ msgid "Saving..." msgstr "جاري الØÙظ..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " ملÙات" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Øدد كإÙتراضي من أجل '%s'" @@ -4078,10 +4083,6 @@ msgid "Clear Default for '%s'" msgstr "إخلاء الإÙتراضي لـ '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " ملÙات" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "إستيراد كـ:" diff --git a/editor/translations/bg.po b/editor/translations/bg.po index 977652e70e..2281de6a8e 100644 --- a/editor/translations/bg.po +++ b/editor/translations/bg.po @@ -3816,6 +3816,10 @@ msgid "Saving..." msgstr "Запазване..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Файлове" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Задаване по подразбиране за „%s“" @@ -3824,10 +3828,6 @@ msgid "Clear Default for '%s'" msgstr "ИзчиÑтване на подразбирането за „%s“" #: editor/import_dock.cpp -msgid " Files" -msgstr " Файлове" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "ВнаÑÑне като:" diff --git a/editor/translations/bn.po b/editor/translations/bn.po index d07fe4caef..a7f287be62 100644 --- a/editor/translations/bn.po +++ b/editor/translations/bn.po @@ -4259,6 +4259,11 @@ msgid "Saving..." msgstr "সংরকà§à¦·à¦¿à¦¤ হচà§à¦›à§‡..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr "ফাইল" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "'%s' à¦à¦° জনà§à¦¯ ডিফলà§à¦Ÿ হিসাবে সেট করà§à¦¨" @@ -4268,11 +4273,6 @@ msgstr "'%s' à¦à¦° জনà§à¦¯ ডিফলà§à¦Ÿ কà§à¦²à¦¿à§Ÿà¦¾à¦° কঠ#: editor/import_dock.cpp #, fuzzy -msgid " Files" -msgstr "ফাইল" - -#: editor/import_dock.cpp -#, fuzzy msgid "Import As:" msgstr "ইমà§à¦ªà§‹à¦°à§à¦Ÿ" diff --git a/editor/translations/ca.po b/editor/translations/ca.po index 95643d82df..fb0a3af30c 100644 --- a/editor/translations/ca.po +++ b/editor/translations/ca.po @@ -3999,6 +3999,10 @@ msgid "Saving..." msgstr "Desant..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Fitxers" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Establir com a valor Predeterminat per a '%s'" @@ -4007,10 +4011,6 @@ msgid "Clear Default for '%s'" msgstr "Neteja el valor Predeterminat de '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Fitxers" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importar com a:" diff --git a/editor/translations/cs.po b/editor/translations/cs.po index 5dfe84f0f0..39bcef5430 100644 --- a/editor/translations/cs.po +++ b/editor/translations/cs.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-14 03:19+0000\n" +"PO-Revision-Date: 2020-02-19 08:56+0000\n" "Last-Translator: VojtÄ›ch Å amla <auzkok@seznam.cz>\n" "Language-Team: Czech <https://hosted.weblate.org/projects/godot-engine/godot/" "cs/>\n" @@ -31,7 +31,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 3.11-dev\n" +"X-Generator: Weblate 3.11\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -3973,6 +3973,11 @@ msgid "Saving..." msgstr "UkládánÃ..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Soubory" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Nastavit jako výchozà pro '%s'" @@ -3981,10 +3986,6 @@ msgid "Clear Default for '%s'" msgstr "VyÄistit výchozà pro '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Soubory" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importovat jako:" @@ -5137,7 +5138,6 @@ msgid "Scale Step:" msgstr "ZvÄ›tÅ¡enÃ:" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Move Vertical Guide" msgstr "PÅ™esunout svislé vodÃtko" @@ -5799,12 +5799,10 @@ msgid "Load Curve Preset" msgstr "" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Add Point" msgstr "PÅ™idat bod" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Remove Point" msgstr "Odstranit bod" @@ -6654,9 +6652,8 @@ msgid "Error writing TextFile:" msgstr "Chyba pÅ™i zápisu textového souboru:" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Could not load file at:" -msgstr "Chyba: nelze naÄÃst soubor." +msgstr "Nelze naÄÃst soubor:" #: editor/plugins/script_editor_plugin.cpp msgid "Error saving file!" @@ -6679,7 +6676,6 @@ msgid "Error Importing" msgstr "Chyba importu" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "New Text File..." msgstr "Nový textový soubor..." @@ -6725,9 +6721,8 @@ msgid "Save Theme As..." msgstr "Uložit motiv jako..." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "%s Class Reference" -msgstr " Reference tÅ™Ãdy" +msgstr "Reference tÅ™Ãdy %s" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp @@ -6740,18 +6735,16 @@ msgid "Find Previous" msgstr "NajÃt pÅ™edchozÃ" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter scripts" -msgstr "Filtrovat vlastnosti" +msgstr "Filtrovat skripty" #: editor/plugins/script_editor_plugin.cpp msgid "Toggle alphabetical sorting of the method list." msgstr "PÅ™epnout abecednà řazenà seznamu metod." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Filter methods" -msgstr "Režim filtru:" +msgstr "Filtrovat metody" #: editor/plugins/script_editor_plugin.cpp msgid "Sort" @@ -6786,9 +6779,8 @@ msgid "Open..." msgstr "OtevÅ™Ãt..." #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Reopen Closed Script" -msgstr "OtevÅ™Ãt skript" +msgstr "Znovu otevÅ™Ãt zavÅ™ený skript" #: editor/plugins/script_editor_plugin.cpp msgid "Save All" @@ -6803,7 +6795,6 @@ msgid "Copy Script Path" msgstr "ZkopÃrovat cestu ke skriptu" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "History Previous" msgstr "Historie pÅ™edchozÃ" @@ -6841,9 +6832,8 @@ msgid "Run" msgstr "Spustit" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp -#, fuzzy msgid "Step Into" -msgstr "Vstoupit" +msgstr "Vstoupit do" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Step Over" @@ -6867,9 +6857,8 @@ msgid "Debug with External Editor" msgstr "Debugovat v externÃm editoru" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Open Godot online documentation." -msgstr "OtevÅ™Ãt Godot online dokumentaci" +msgstr "OtevÅ™Ãt online dokumentaci Godotu." #: editor/plugins/script_editor_plugin.cpp msgid "Request Docs" @@ -6922,9 +6911,8 @@ msgid "Search Results" msgstr "Výsledky hledánÃ" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Clear Recent Scripts" -msgstr "Vymazat nedávné scény" +msgstr "Vymazat nedávné skripty" #: editor/plugins/script_text_editor.cpp #, fuzzy @@ -6932,9 +6920,8 @@ msgid "Connections to method:" msgstr "PÅ™ipojit k uzlu:" #: editor/plugins/script_text_editor.cpp editor/script_editor_debugger.cpp -#, fuzzy msgid "Source" -msgstr "Zdroj:" +msgstr "Zdroj" #: editor/plugins/script_text_editor.cpp msgid "Target" @@ -8605,17 +8592,15 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" -msgstr "" +msgstr "(Pouze GLES3)" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Output" -msgstr "PÅ™idat vstup" +msgstr "PÅ™idat výstup" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar" -msgstr "ZvÄ›tÅ¡enÃ:" +msgstr "Skalár" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vector" @@ -8623,7 +8608,7 @@ msgstr "Vektor" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" -msgstr "" +msgstr "Boolean" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Sampler" @@ -9120,9 +9105,8 @@ msgid "Returns the tangent of the parameter." msgstr "Vrátà tangens parametru." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Returns the hyperbolic tangent of the parameter." -msgstr "(Pouze GLES3) Vrátà hyperbolický tangens parametru." +msgstr "Vrátà hyperbolický tangens parametru." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy diff --git a/editor/translations/da.po b/editor/translations/da.po index bfd4d71cdc..e575e1a015 100644 --- a/editor/translations/da.po +++ b/editor/translations/da.po @@ -4103,6 +4103,10 @@ msgid "Saving..." msgstr "Gemmer..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Filer" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Sæt som Standard for '%s'" @@ -4111,10 +4115,6 @@ msgid "Clear Default for '%s'" msgstr "Fjern Standard for '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Filer" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importer Som:" diff --git a/editor/translations/de.po b/editor/translations/de.po index c0ac945e57..3e8c61025a 100644 --- a/editor/translations/de.po +++ b/editor/translations/de.po @@ -52,7 +52,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-01-28 07:51+0000\n" +"PO-Revision-Date: 2020-02-16 15:20+0000\n" "Last-Translator: So Wieso <sowieso@dukun.de>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/" "godot/de/>\n" @@ -734,9 +734,8 @@ msgid "Line Number:" msgstr "Zeilennummer:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "Ersetzen..." +msgstr "%d ersetzt." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -4023,6 +4022,10 @@ msgid "Saving..." msgstr "Speichere..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Dateien" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Als Standard für ‚%s‘ setzen" @@ -4031,10 +4034,6 @@ msgid "Clear Default for '%s'" msgstr "Standard für ‚%s‘ löschen" #: editor/import_dock.cpp -msgid " Files" -msgstr " Dateien" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importiere als:" @@ -5914,9 +5913,8 @@ msgid "Mesh is empty!" msgstr "Mesh ist leer!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Trimesh-Kollisionselement erzeugen" +msgstr "Konnte Trimesh-Kollisionselement nicht erzeugen." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5933,29 +5931,30 @@ msgstr "Trimesh-Statische-Form erzeugen" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." msgstr "" +"Aus der Szenenwurzel kann ein einzelnes konvexes Kollisionselement nicht " +"erzeugt werden." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Ein einzelnes konvexes Kollisionselement konnte nicht erzeugt werden." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Konvexe Form(en) erstellen" +msgstr "Einzelne konvexe Form erstellen" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." msgstr "" +"Aus der Szenenwurzel konnten mehrere konvexe Kollisionselemente nicht " +"erzeugt werden." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "Ordner konnte nicht erstellt werden." +msgstr "Konnte kein einziges Kollisionselement erzeugen." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Konvexe Form(en) erstellen" +msgstr "Mehrere konvexe Formen erstellen" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -6012,6 +6011,9 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Erstellt einen StaticBody und weist ein polygon-basiertes Kollisionselement " +"automatisch zu.\n" +"Dies ist die präziseste (aber langsamste) Methode für Kollisionsberechnungen." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -6022,28 +6024,32 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Erstellt ein polygon-basiertes Kollisionselement.\n" +"Dies ist die präziseste (aber langsamste) Methode für Kollisionsberechnungen." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "Konvexe(s) Kollisionselement(e) erzeugen" +msgstr "Ein einzelnes konvexes Kollisionsunterelement erzeugen" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"Erstellt ein einzelnes konvexes Kollisionselement.\n" +"Dies ist die schnellste (aber ungenauste) Methode für Kollisionsberechnungen." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "Konvexe(s) Kollisionselement(e) erzeugen" +msgstr "Mehrere konvexe Kollisionsunterelemente erzeugen" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"Erstellt ein polygon-basiertes Kollisionselement.\n" +"Dies liegt von der Geschwindigkeit in der Mitte der beiden anderen Methoden." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -6056,6 +6062,10 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"Erstellt ein statisches Outline-Mesh. Outline-Meshes haben ihre " +"Normalenvektoren automatisch invertiert.\n" +"Dies kann als Ersatz für die SpatialMaterial-Grow-Eigenschaft genutzt werden " +"wenn sie nicht verfügbar ist." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -9651,34 +9661,29 @@ msgid "Export With Debug" msgstr "Exportiere mit Debuginformationen" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "Dieser Pfad existiert nicht." +msgstr "Der angegebene Pfad existiert nicht." #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "Fehler beim Öffnen der Paketdatei, kein ZIP-Format." +msgstr "Fehler beim Öffnen der Paketdatei (kein ZIP-Format)." #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." -msgstr "Ungültige Projekt-Zipdatei, enthält keine ‚project.godot‘-Datei." +msgstr "Ungültige „.zip“-Projektdatei, enthält keine „project.godot“-Datei." #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "Bitte einen leeren Ordner auswählen." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "Eine ‚project.godot‘-Datei oder Zipdatei auswählen." +msgstr "Eine „project.godot†oder „.zip“-Datei auswählen." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "Das Verzeichnis beinhaltet bereits ein Godot-Projekt." +msgstr "Dieses Verzeichnis beinhaltet bereits ein Godot-Projekt." #: editor/project_manager.cpp msgid "New Game Project" @@ -10381,9 +10386,8 @@ msgid "Suffix" msgstr "Suffix" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "Reguläre Ausdrücke" +msgstr "Reguläre Ausdrücke verwenden" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10422,7 +10426,6 @@ msgstr "" "Zahleroptionen vergleichen." #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" msgstr "Pro-Ebene-Zähler" @@ -10464,12 +10467,10 @@ msgid "Keep" msgstr "Behalten" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" msgstr "CamelCase zu unter_strich" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" msgstr "unter_strich zu CamelCase" @@ -10490,14 +10491,12 @@ msgid "Reset" msgstr "Zurücksetzen" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Reguläre Ausdrücke" +msgstr "Fehler in regulärem Ausdruck" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "Gültige Zeichen:" +msgstr "Bei Zeichen %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10965,9 +10964,8 @@ msgid "Invalid inherited parent name or path." msgstr "Ungültiger geerbter Name oder Pfad." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "Skript ist gültig." +msgstr "Skript-Pfad oder -Name ist gültig." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -11058,9 +11056,8 @@ msgid "Copy Error" msgstr "Fehlermeldung kopieren" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" -msgstr "Grafikspeicher" +msgstr "Video RAM" #: editor/script_editor_debugger.cpp msgid "Skip Breakpoints" diff --git a/editor/translations/de_CH.po b/editor/translations/de_CH.po index 3579069f14..f4db15a122 100644 --- a/editor/translations/de_CH.po +++ b/editor/translations/de_CH.po @@ -3961,6 +3961,10 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Dateien" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "" @@ -3969,11 +3973,6 @@ msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp -#, fuzzy -msgid " Files" -msgstr "Datei(en) öffnen" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "" diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot index a8bde3c192..1db40e52cb 100644 --- a/editor/translations/editor.pot +++ b/editor/translations/editor.pot @@ -3797,15 +3797,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/el.po b/editor/translations/el.po index b82c0fbff8..6aa7a07f5d 100644 --- a/editor/translations/el.po +++ b/editor/translations/el.po @@ -3986,6 +3986,10 @@ msgid "Saving..." msgstr "Αποθήκευση..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d αÏχεία" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "ΟÏισμός ως Ï€Ïοεπιλογής για '%s'" @@ -3994,10 +3998,6 @@ msgid "Clear Default for '%s'" msgstr "ΕκκαθάÏιση Ï€Ïοεπιλογής για '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " ΑÏχεία" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Εισαγωγή ÏŽÏ‚:" diff --git a/editor/translations/eo.po b/editor/translations/eo.po index 96ee7aea8d..37f49a4908 100644 --- a/editor/translations/eo.po +++ b/editor/translations/eo.po @@ -3900,15 +3900,16 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" -msgstr "" +#, fuzzy +msgid "%d Files" +msgstr "Trovi en dosierojn" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/es.po b/editor/translations/es.po index 6bf8a88ad6..80e0f9240c 100644 --- a/editor/translations/es.po +++ b/editor/translations/es.po @@ -4024,6 +4024,10 @@ msgid "Saving..." msgstr "Guardando..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d archivos" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Establecer como predeterminado para '%s'" @@ -4032,10 +4036,6 @@ msgid "Clear Default for '%s'" msgstr "Restablecer Predeterminado para '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Archivos" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importar como:" diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po index 5a9515ee87..e7aa5cb780 100644 --- a/editor/translations/es_AR.po +++ b/editor/translations/es_AR.po @@ -18,8 +18,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-02 08:52+0000\n" -"Last-Translator: roger <616steam@gmail.com>\n" +"PO-Revision-Date: 2020-02-18 15:09+0000\n" +"Last-Translator: Lisandro Lorea <lisandrolorea@gmail.com>\n" "Language-Team: Spanish (Argentina) <https://hosted.weblate.org/projects/" "godot-engine/godot/es_AR/>\n" "Language: es_AR\n" @@ -27,7 +27,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.11-dev\n" +"X-Generator: Weblate 3.11\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -681,7 +681,7 @@ msgstr "Cambiar Offset Final de Clip de Pista de Audio" #: editor/array_property_edit.cpp msgid "Resize Array" -msgstr "Redimencionar Array" +msgstr "Redimensionar Array" #: editor/array_property_edit.cpp msgid "Change Array Value Type" @@ -700,9 +700,8 @@ msgid "Line Number:" msgstr "Numero de LÃnea:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "Reemplazar..." +msgstr "%d reemplazadas." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -3988,6 +3987,10 @@ msgid "Saving..." msgstr "Guardando..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Archivos" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Asignar como Predeterminado para '%s'" @@ -3996,10 +3999,6 @@ msgid "Clear Default for '%s'" msgstr "Restablecer Predeterminados para '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Archivos" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importar Como:" @@ -5879,9 +5878,8 @@ msgid "Mesh is empty!" msgstr "¡El Mesh está vacÃo!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Crear Collider Triangular Hermano" +msgstr "No se pudo crear una forma de colisión Trimersh." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5898,29 +5896,29 @@ msgstr "Crear Trimesh Static Shape" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." msgstr "" +"No se pudo crear una única forma de colisión convexa para la raÃz de escena." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "No se pudo crear una forma de colisión única." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Crear Shape(s) Convexo(s)" +msgstr "Crear Forma Convexa Unica" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." msgstr "" +"No se pudo crear múltiples formas de colisión convexas para la raÃz de " +"escena." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "No se pudo crear la carpeta." +msgstr "No se pudo crear ninguna forma de colisión." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Crear Shape(s) Convexo(s)" +msgstr "Crear Múltiples Formas Convexas" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5976,6 +5974,9 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Crea un StaticBody y le asigna automáticamente una forma de colisión basada " +"en polÃgonos .\n" +"Esta es la opción mas exacta (pero más lenta) de detección de colisiones." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -5986,28 +5987,32 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Crea una forma de colisión basada en polÃgonos.\n" +"Esta es la opción mas exacta (pero más lenta) de detección de colisiones." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "Crear Collider Convexo Hermano(s)" +msgstr "Crear Colisión Convexa Unica como Nodo Hermano" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"Crear forma de colisión convexa única.\n" +"Esta es la opción mas rápida (pero menos exacta) para detectar colisiones." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "Crear Collider Convexo Hermano(s)" +msgstr "Crear Múltiples Colisiones Convexas como Nodos Hermanos" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"Crea una forma de colisión basada en polÃgonos.\n" +"Esto está en un punto medio de rendimiento entre las dos opciones de arriba." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -6020,6 +6025,10 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"Crea un mesh de contorno estático. Este mesh de contorno tendrá sus normales " +"invertidas automáticamente.\n" +"Esto puede ser usado en vez de la propiedad Grow del SpatialMaterial cuando " +"no sea posible usar dicha propiedad." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -9603,33 +9612,29 @@ msgid "Export With Debug" msgstr "Exportar Con Depuración" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "La ruta no existe." +msgstr "La ruta especificada no existe." #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "Error al abrir el archivo comprimido, no está en formato ZIP." +msgstr "Error al abrir el archivo de paquete (no esta en formato ZIP)." #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." msgstr "" -"Archivo de projecto '.zip' inválido, no contiene un archivo 'project.godot'." +"Archivo de projecto \".zip\" inválido; no contiene un archivo \"project.godot" +"\"." #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "Por favor elegà una carpeta vacÃa." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "Por favor elegà un archivo 'project.godot' o '.zip'." +msgstr "Por favor elegà un archivo \"project.godot\" o \".zip\"." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." msgstr "El directorio ya contiene un proyecto de Godot." @@ -10331,9 +10336,8 @@ msgid "Suffix" msgstr "Sufijo" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "Expresiones Regulares" +msgstr "Usar Expresiones Regulares" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10372,9 +10376,8 @@ msgstr "" "Comparar opciones de contador." #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" -msgstr "Contador por nivel" +msgstr "Contador Por Nivel" #: editor/rename_dialog.cpp msgid "If set the counter restarts for each group of child nodes" @@ -10413,14 +10416,12 @@ msgid "Keep" msgstr "Conservar" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" -msgstr "CamelCase a under_scored" +msgstr "PascalCase a snake_case" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" -msgstr "under_scored a CamelCase" +msgstr "snake_case a PascalCase" #: editor/rename_dialog.cpp msgid "Case" @@ -10439,14 +10440,12 @@ msgid "Reset" msgstr "Resetear" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Expresiones Regulares" +msgstr "Error de Expresión Regular" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "Caracteres válidos:" +msgstr "En el caracter %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10914,9 +10913,8 @@ msgid "Invalid inherited parent name or path." msgstr "Ruta o nombre del padre heredado inválido." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "El script es válido." +msgstr "La ruta/nombre del script es inválida." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -11007,7 +11005,6 @@ msgid "Copy Error" msgstr "Copiar Error" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" msgstr "Mem. de Video" diff --git a/editor/translations/et.po b/editor/translations/et.po index ff0a3d9535..059a200138 100644 --- a/editor/translations/et.po +++ b/editor/translations/et.po @@ -3810,15 +3810,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/eu.po b/editor/translations/eu.po index bf4634ba8d..2829912826 100644 --- a/editor/translations/eu.po +++ b/editor/translations/eu.po @@ -3802,15 +3802,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/fa.po b/editor/translations/fa.po index 295a94d322..377bbfbb67 100644 --- a/editor/translations/fa.po +++ b/editor/translations/fa.po @@ -4040,6 +4040,11 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " پوشه ها" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "" @@ -4048,10 +4053,6 @@ msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" -msgstr " پوشه ها" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "" diff --git a/editor/translations/fi.po b/editor/translations/fi.po index 644271f3ec..d8fa02de0f 100644 --- a/editor/translations/fi.po +++ b/editor/translations/fi.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-02 08:51+0000\n" +"PO-Revision-Date: 2020-02-16 15:21+0000\n" "Last-Translator: Tapani Niemi <tapani.niemi@kapsi.fi>\n" "Language-Team: Finnish <https://hosted.weblate.org/projects/godot-engine/" "godot/fi/>\n" @@ -687,9 +687,8 @@ msgid "Line Number:" msgstr "Rivinumero:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "Korvaa..." +msgstr "%d korvattu." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -3949,6 +3948,11 @@ msgid "Saving..." msgstr "Tallennetaan..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Tiedostot" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Aseta oletus valinnalle '%s'" @@ -3957,10 +3961,6 @@ msgid "Clear Default for '%s'" msgstr "Poista oletus valinnalta '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Tiedostot" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Tuo nimellä:" @@ -5836,9 +5836,8 @@ msgid "Mesh is empty!" msgstr "Mesh on tyhjä!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Luo konkaavi törmäysmuoto sisareksi" +msgstr "Ei voitu luoda konkaavia törmäysmuotoa." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5854,30 +5853,27 @@ msgstr "Luo staattinen konkaavi muoto" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." -msgstr "" +msgstr "Ei voida luoda yksittäistä konveksia törmäysmuotoa skenen juurelle." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Ei voitu luoda yksittäistä konveksia törmäysmuotoa." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Luo konvekseja muotoja" +msgstr "Luo yksittäinen konveksi muoto" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." -msgstr "" +msgstr "Ei voi luoda useata konveksia törmäysmuotoa skenen juurelle." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "Kansiota ei voitu luoda." +msgstr "Yhtään törmäysmuotoa ei voitu luoda." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Luo konvekseja muotoja" +msgstr "Luo useita konvekseja muotoja" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5933,6 +5929,9 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Luo StaticBody solmun ja asettaa sille automaattisesti polygonipohjaisen " +"törmäysmuodon.\n" +"Tämä on tarkin (mutta hitain) vaihtoehto törmäystunnistukselle." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -5943,28 +5942,32 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Luo polygonipohjaisen törmäysmuodon.\n" +"Tämä on tarkin (mutta hitain) vaihtoehto törmäystunnistukselle." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "Luo konvekseja törmäysmuotoja sisariksi" +msgstr "Luo yksittäisen konveksin törmäysmuodon sisaret" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"Luo yksittäisen konveksin törmäysmuodon.\n" +"Tämä on nopein (mutta epätarkin) vaihtoehto törmäystunnistukselle." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "Luo konvekseja törmäysmuotoja sisariksi" +msgstr "Luo useita konvekseja törmäysmuotojen sisaria" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"Luo polygonipohjaisen törmäysmuodon.\n" +"Tämä on suorituskyvyltään välimaastoa kahdelle yllä olevalle vaihtoehdolle." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -5977,6 +5980,10 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"Luo staattisen ääriviiva-meshin. Ääriviiva-meshin normaalit on käännetty " +"automaattisesti.\n" +"Tätä voidaan käyttää SpatialMaterial Grow ominaisuuden sijaan silloin, kun " +"tuon ominaisuuden käyttäminen ei ole mahdollista." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -9556,21 +9563,18 @@ msgid "Export With Debug" msgstr "Vie debugaten" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "Polkua ei ole olemassa." +msgstr "Määritelty polku ei ole olemassa." #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "Virhe avattaessa pakettitiedostoa, ei ZIP-muodossa." +msgstr "Virhe avattaessa pakettitiedostoa (se ei ole ZIP-muodossa)." #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." msgstr "" -"Virheellinen '.zip' projektitiedosto; se ei sisällä 'project.godot' " +"Virheellinen \".zip\" projektitiedosto; se ei sisällä \"project.godot\" " "tiedostoa." #: editor/project_manager.cpp @@ -9578,14 +9582,12 @@ msgid "Please choose an empty folder." msgstr "Ole hyvä ja valitse tyhjä kansio." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "Ole hyvä ja valitse 'project.godot' tai '.zip' tiedosto." +msgstr "Ole hyvä ja valitse \"project.godot\"- tai \".zip\"-tiedosto." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "Hakemisto sisältää jo Godot-projektin." +msgstr "Tämä hakemisto sisältää jo Godot-projektin." #: editor/project_manager.cpp msgid "New Game Project" @@ -10280,9 +10282,8 @@ msgid "Suffix" msgstr "Pääte" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "Säännölliset lausekkeet" +msgstr "Käytä säännöllisiä lausekkeita" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10321,7 +10322,6 @@ msgstr "" "Vertaa laskurin valintoja." #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" msgstr "Per taso -laskuri" @@ -10362,14 +10362,12 @@ msgid "Keep" msgstr "Pidä" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" -msgstr "CamelCase ala_viivoiksi" +msgstr "PascalCase ala_viivoiksi" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" -msgstr "ala_viivat CamelCaseksi" +msgstr "ala_viivat PascalCaseksi" #: editor/rename_dialog.cpp msgid "Case" @@ -10388,14 +10386,12 @@ msgid "Reset" msgstr "Palauta" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Säännölliset lausekkeet" +msgstr "Säännöllisen lausekkeen virhe" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "Kelvolliset merkit:" +msgstr "Merkissä %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10863,9 +10859,8 @@ msgid "Invalid inherited parent name or path." msgstr "Virheellinen peritty isännän nimi tai polku." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "Skripti kelpaa." +msgstr "Skriptin polku/nimi kelpaa." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -10956,7 +10951,6 @@ msgid "Copy Error" msgstr "Kopioi virhe" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" msgstr "Näyttömuisti" diff --git a/editor/translations/fil.po b/editor/translations/fil.po index 89cd86eefd..9616bfc1be 100644 --- a/editor/translations/fil.po +++ b/editor/translations/fil.po @@ -3813,15 +3813,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/fr.po b/editor/translations/fr.po index 9e930d28d3..8cbba6643c 100644 --- a/editor/translations/fr.po +++ b/editor/translations/fr.po @@ -74,7 +74,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-09 19:05+0000\n" +"PO-Revision-Date: 2020-02-18 15:09+0000\n" "Last-Translator: Pierre Caye <pierrecaye@laposte.net>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot/fr/>\n" @@ -83,7 +83,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 3.11-dev\n" +"X-Generator: Weblate 3.11\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -760,9 +760,8 @@ msgid "Line Number:" msgstr "Numéro de ligne :" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "Remplacer…" +msgstr "%d remplacé." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -4058,6 +4057,10 @@ msgid "Saving..." msgstr "Enregistrement…" #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d fichiers" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Définir comme défaut pour « %s »" @@ -4066,10 +4069,6 @@ msgid "Clear Default for '%s'" msgstr "Effacer le préréglage par défaut pour « %s »" #: editor/import_dock.cpp -msgid " Files" -msgstr " Fichiers" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importer comme :" @@ -5953,9 +5952,8 @@ msgid "Mesh is empty!" msgstr "Le maillage est vide !" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Créer une collision Trimesh" +msgstr "Impossible de créer une forme de collision Trimesh." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5972,29 +5970,30 @@ msgstr "Créer une forme Trimesh statique" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." msgstr "" +"Impossible de créer une forme de collision convexe unique pour la racine de " +"la scène." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Impossible de créer une forme de collision convexe unique." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Créer une(des) forme(s) convexe(s)" +msgstr "Créer une forme convexe unique" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." msgstr "" +"Impossible de créer des formes de collision convexes multiples pour la " +"racine de la scène." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "Impossible de créer le dossier." +msgstr "Impossible de créer des formes de collision." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Créer une(des) forme(s) convexe(s)" +msgstr "Créer des formes convexes multiples" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -6053,6 +6052,10 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Crée un StaticBody et lui attribue automatiquement une forme de collision " +"basée sur les polygones.\n" +"C'est l'option la plus précise (mais la plus lente) pour la détection des " +"collisions." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -6063,28 +6066,34 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Crée une forme de collision basée sur les polygones.\n" +"C'est l'option la plus précise (mais la plus lente) pour la détection des " +"collisions." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "Créer une(des) collision(s) convexe(s) sÅ“ur(s)" +msgstr "Créer une(des) collision(s) convexe(s) unique(s) sÅ“ur(s)" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"Crée une forme de collision convexe unique.\n" +"C'est l'option la plus rapide (mais la moins précise) pour la détection des " +"collisions." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "Créer une(des) collision(s) convexe(s) sÅ“ur(s)" +msgstr "Créer une(des) collision(s) convexe(s) multiple(s) sÅ“ur(s)" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"Crée une forme de collision basée sur les polygones.\n" +"Il s'agit d'une performance à mi-chemin entre les deux options ci-dessus." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -6097,6 +6106,10 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"Crée un maillage de contour statique. Le maillage de contour verra ses " +"normales inversées automatiquement.\n" +"Cela peut être utilisé à la place de la propriété SpatialMaterial Grow " +"lorsque l'utilisation de cette propriété n'est pas possible." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -9696,36 +9709,32 @@ msgid "Export With Debug" msgstr "Exporter avec debug" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "Le chemin vers ce fichier n'existe pas." +msgstr "Le chemin spécifié n'existe pas." #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "Erreur d'ouverture de paquetage, pas au format ZIP." +msgstr "" +"Erreur lors de l'ouverture du fichier package (il n'est pas au format ZIP)." #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." msgstr "" -"Fichier de projet « .zip » invalide, il ne contient pas de fichier « project." -"godot »." +"Fichier de projet \".zip\" invalide ; il ne contient pas de fichier \"projet." +"godot\"." #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "Veuillez choisir un dossier vide." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "Veuillez choisir un fichier « project.godot » ou « .zip »." +msgstr "Veuillez choisir un fichier \"project.godot\" ou \".zip\"." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "Le répertoire contient déjà un projet Godot." +msgstr "Ce répertoire contient déjà un projet Godot." #: editor/project_manager.cpp msgid "New Game Project" @@ -10426,9 +10435,8 @@ msgid "Suffix" msgstr "Suffixe" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "Expressions régulières" +msgstr "Utiliser des expressions régulières" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10467,7 +10475,6 @@ msgstr "" "Comparez les options du compteur." #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" msgstr "Compteur par niveau" @@ -10508,14 +10515,12 @@ msgid "Keep" msgstr "Conserver" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" -msgstr "CamelCase vers sous_ligné" +msgstr "PascalCase vers snake_case" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" -msgstr "sous_ligné vers CamelCase" +msgstr "snake_case vers PascalCase" #: editor/rename_dialog.cpp msgid "Case" @@ -10534,14 +10539,12 @@ msgid "Reset" msgstr "Réinitialiser" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Expressions régulières" +msgstr "Erreur d'expression régulière" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "Caractères valides :" +msgstr "À caractère %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -11007,9 +11010,8 @@ msgid "Invalid inherited parent name or path." msgstr "Nom ou chemin parent hérité invalide." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "Script valide." +msgstr "Le chemin/nom du script est valide." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -11100,9 +11102,8 @@ msgid "Copy Error" msgstr "Copier l'erreur" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" -msgstr "Mémoire vidéo" +msgstr "Vidéo RAM" #: editor/script_editor_debugger.cpp msgid "Skip Breakpoints" diff --git a/editor/translations/ga.po b/editor/translations/ga.po index 7920e0513b..018d095c92 100644 --- a/editor/translations/ga.po +++ b/editor/translations/ga.po @@ -3807,15 +3807,16 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" -msgstr "" +#, fuzzy +msgid "%d Files" +msgstr "Amharc ar Chomhaid" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/he.po b/editor/translations/he.po index 0509e77e01..1aa8c9d306 100644 --- a/editor/translations/he.po +++ b/editor/translations/he.po @@ -4034,6 +4034,11 @@ msgid "Saving..." msgstr "שמירה…" #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " קבצי×" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "הגדרה כבררת מחדל עבור ‚%s’" @@ -4042,10 +4047,6 @@ msgid "Clear Default for '%s'" msgstr "מחיקת בררת מחדל עבור ‚%s’" #: editor/import_dock.cpp -msgid " Files" -msgstr " קבצי×" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "×™×™×‘×•× ×‘×ª×•×¨:" diff --git a/editor/translations/hi.po b/editor/translations/hi.po index f26820b011..9278e63fc9 100644 --- a/editor/translations/hi.po +++ b/editor/translations/hi.po @@ -3862,15 +3862,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/hr.po b/editor/translations/hr.po index 280116550f..5922d2effb 100644 --- a/editor/translations/hr.po +++ b/editor/translations/hr.po @@ -3826,15 +3826,16 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" -msgstr "" +#, fuzzy +msgid "%d Files" +msgstr "Datoteka:" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/hu.po b/editor/translations/hu.po index 754f297fec..4a2e0eb506 100644 --- a/editor/translations/hu.po +++ b/editor/translations/hu.po @@ -4137,6 +4137,11 @@ msgid "Saving..." msgstr "Mentés..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Fájlok" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "BeállÃtás Alapértelmezettként '%s'-hez" @@ -4145,10 +4150,6 @@ msgid "Clear Default for '%s'" msgstr "Alapértelmezett Törlése '%s'-nél" #: editor/import_dock.cpp -msgid " Files" -msgstr " Fájlok" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importálás Mint:" diff --git a/editor/translations/id.po b/editor/translations/id.po index 3cd3ae4624..6a76af5db6 100644 --- a/editor/translations/id.po +++ b/editor/translations/id.po @@ -29,8 +29,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-14 03:19+0000\n" -"Last-Translator: zephyroths <ridho.hikaru@gmail.com>\n" +"PO-Revision-Date: 2020-02-16 15:21+0000\n" +"Last-Translator: Sofyan Sugianto <sofyanartem@gmail.com>\n" "Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/" "godot/id/>\n" "Language: id\n" @@ -3973,6 +3973,11 @@ msgid "Saving..." msgstr "Menyimpan..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Berkas" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Jadikan Baku untuk '%s'" @@ -3981,10 +3986,6 @@ msgid "Clear Default for '%s'" msgstr "Bersihkan Baku untuk '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Berkas" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Impor sebagai:" @@ -5869,11 +5870,11 @@ msgstr "Buat Bentuk Trimesh Statis" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." -msgstr "" +msgstr "Tidak dapat membuat convex collision shape tunggal untuk skena root." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Tidak dapat membuat convex collision shape tunggal." #: editor/plugins/mesh_instance_editor_plugin.cpp #, fuzzy @@ -5882,7 +5883,7 @@ msgstr "Buat Bentuk Cembung" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." -msgstr "" +msgstr "Tidak dapat membuat beberapa convex collision shape untuk skena root." #: editor/plugins/mesh_instance_editor_plugin.cpp #, fuzzy @@ -5948,6 +5949,10 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Buat StaticBody dan tetapkan collision shape berbasis poligon untuknya " +"secara otomatis.\n" +"Opsi ini merupakan yang paling akurat (tapi paling lambat) untuk deteksi " +"collision." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -5958,6 +5963,9 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Buat collision shape berbasis poligon.\n" +"Opsi ini merupakan yang paling akurat (tapi paling lambat) untuk deteksi " +"collision." #: editor/plugins/mesh_instance_editor_plugin.cpp #, fuzzy @@ -5969,6 +5977,9 @@ msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"Buat convex collision shape tunggal.\n" +"Opsi ini merupakan yang paling cepat (tapi paling tidak akurat) untuk " +"deteksi collision." #: editor/plugins/mesh_instance_editor_plugin.cpp #, fuzzy @@ -5980,6 +5991,8 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"Buat collision shape berbasis poligon.\n" +"Opsi ini kinerjanya berada di antara dua opsi di atas." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -10598,7 +10611,7 @@ msgstr "Node Lainnya" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" -msgstr "" +msgstr "Tidak dapat bekerja pada node dari skena luar!" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes the current scene inherits from!" diff --git a/editor/translations/is.po b/editor/translations/is.po index d55e21cafa..7f0ab2f719 100644 --- a/editor/translations/is.po +++ b/editor/translations/is.po @@ -3850,15 +3850,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/it.po b/editor/translations/it.po index 8c912c4b59..77956e9233 100644 --- a/editor/translations/it.po +++ b/editor/translations/it.po @@ -43,12 +43,13 @@ # Katia Piazza <gydey@ridiculousglitch.com>, 2019. # nickfla1 <lanterniniflavio@gmail.com>, 2019. # Fabio Iotti <fabiogiopla@gmail.com>, 2020. +# Douglas Fiedler <dognew@gmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-01-27 07:09+0000\n" -"Last-Translator: Micila Micillotto <micillotto@gmail.com>\n" +"PO-Revision-Date: 2020-02-18 15:09+0000\n" +"Last-Translator: Douglas Fiedler <dognew@gmail.com>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot/it/>\n" "Language: it\n" @@ -56,7 +57,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.11-dev\n" +"X-Generator: Weblate 3.11\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -726,9 +727,8 @@ msgid "Line Number:" msgstr "Numero linea:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "Rimpiazza..." +msgstr "%d rimpiazzato." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -4015,6 +4015,10 @@ msgid "Saving..." msgstr "Salvataggio..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d File" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Imposta come Default per '%s'" @@ -4023,10 +4027,6 @@ msgid "Clear Default for '%s'" msgstr "Elimina Default per '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Files" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importa Come:" @@ -5906,9 +5906,8 @@ msgid "Mesh is empty!" msgstr "La mesh è vuota!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Crea Fratello di Collisione Trimesh" +msgstr "Non poteva creare una forma di collisione Trimesh." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -7238,7 +7237,7 @@ msgstr "Scalatura: " #: editor/plugins/spatial_editor_plugin.cpp msgid "Translating: " -msgstr "Traducendo: " +msgstr "Spostamento: " #: editor/plugins/spatial_editor_plugin.cpp msgid "Rotating %s degrees." diff --git a/editor/translations/ja.po b/editor/translations/ja.po index 43bca13c13..c0298bb075 100644 --- a/editor/translations/ja.po +++ b/editor/translations/ja.po @@ -35,7 +35,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-14 16:48+0000\n" +"PO-Revision-Date: 2020-02-16 15:20+0000\n" "Last-Translator: Akihiro Ogoshi <technical@palsystem-game.com>\n" "Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/" "godot/ja/>\n" @@ -716,9 +716,8 @@ msgid "Line Number:" msgstr "行番å·:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "ç½®æ›..." +msgstr "%d ã‚’ç½®æ›ã—ã¾ã—ãŸã€‚" #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -1671,11 +1670,11 @@ msgstr "(エディタ無効ã€ãƒ—ãƒãƒ‘ティ無効)" #: editor/editor_feature_profile.cpp msgid "(Properties Disabled)" -msgstr "(プãƒãƒ‘ティ無効)" +msgstr "(プãƒãƒ‘ティ無効)" #: editor/editor_feature_profile.cpp msgid "(Editor Disabled)" -msgstr "(エディタ無効)" +msgstr "(エディタ無効)" #: editor/editor_feature_profile.cpp msgid "Class Options:" @@ -2204,7 +2203,7 @@ msgstr "書込むファイルを開ã‘ã¾ã›ã‚“:" #: editor/editor_node.cpp msgid "Requested file format unknown:" -msgstr "ファイル形å¼ãŒä¸æ˜Ž:" +msgstr "è¦æ±‚ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«å½¢å¼ã¯ä¸æ˜Žã§ã™:" #: editor/editor_node.cpp msgid "Error while saving." @@ -3976,6 +3975,11 @@ msgid "Saving..." msgstr "ä¿å˜ä¸..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " ファイル" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "'%s' ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã¨ã—ã¦è¨å®š" @@ -3984,10 +3988,6 @@ msgid "Clear Default for '%s'" msgstr "'%s' ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã‚’クリア" #: editor/import_dock.cpp -msgid " Files" -msgstr " ファイル" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "åå‰ã‚’付ã‘ã¦ã‚¤ãƒ³ãƒãƒ¼ãƒˆ:" @@ -4292,7 +4292,7 @@ msgstr "BlendSpace2Dã®ãƒã‚¤ãƒ³ãƒˆã‚’削除ã™ã‚‹" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Remove BlendSpace2D Triangle" -msgstr "BlendSpace2D三角形を削除ã™ã‚‹" +msgstr "BlendSpace2Dã®ä¸‰è§’形を削除ã™ã‚‹" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -5066,7 +5066,7 @@ msgstr "å…¬å¼" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Testing" -msgstr "テストä¸" +msgstr "テストã™ã‚‹" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Loading..." @@ -5827,7 +5827,7 @@ msgstr "å³ã‚¯ãƒªãƒƒã‚¯ã§ç‚¹ã‚’è¿½åŠ " #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" -msgstr "ã‚°ãƒãƒ¼ãƒãƒ«ã‚¤ãƒ«ãƒŸãƒãƒ¼ã‚·ãƒ§ãƒ³ã®äº‹å‰è¨ˆç®—" +msgstr "GIプãƒãƒ¼ãƒ–ã®ç„¼ãè¾¼ã¿" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" @@ -5854,9 +5854,8 @@ msgid "Mesh is empty!" msgstr "メッシュãŒã‚ã‚Šã¾ã›ã‚“!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "三角形メッシュ兄弟コリジョンを生æˆ" +msgstr "トライメッシュコリジョンシェイプを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5864,7 +5863,7 @@ msgstr "三角形メッシュé™çš„ボディを作æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "This doesn't work on scene root!" -msgstr "シーンã®ãƒ«ãƒ¼ãƒˆã§ã¯ç„¡åŠ¹ã§ã™!" +msgstr "ã“ã‚Œã¯ã‚·ãƒ¼ãƒ³ã®ãƒ«ãƒ¼ãƒˆã§ã¯æ©Ÿèƒ½ã—ã¾ã›ã‚“!" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Static Shape" @@ -5873,29 +5872,28 @@ msgstr "三角形メッシュé™çš„シェイプを生æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." msgstr "" +"シーンã®ãƒ«ãƒ¼ãƒˆã«å˜ä¸€ã®å‡¸åž‹ã®ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—を作æˆã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "å˜ä¸€ã®å‡¸åž‹ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—を作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "凸状シェイプを作æˆ" +msgstr "å˜ä¸€ã®å‡¸åž‹ã‚·ã‚§ã‚¤ãƒ—を作æˆã™ã‚‹" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." msgstr "" +"シーンã®ãƒ«ãƒ¼ãƒˆã«è¤‡æ•°ã®å‡¸åž‹ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—を作æˆã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "フォルダを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚" +msgstr "コリジョンシェイプを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "凸状シェイプを作æˆ" +msgstr "複数ã®å‡¸åž‹ã‚·ã‚§ã‚¤ãƒ—を作æˆã™ã‚‹" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5919,7 +5917,7 @@ msgstr "モデルã«ã¯ã“ã®ãƒ¬ã‚¤ãƒ¤ãƒ¼ã«UVãŒã‚ã‚Šã¾ã›ã‚“" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "MeshInstance lacks a Mesh!" -msgstr "メッシュインスタンスã«ãƒ¡ãƒƒã‚·ãƒ¥ãŒä¸è¶³ã—ã¦ã„ã¾ã™!" +msgstr "MeshInstanceã«ãƒ¡ãƒƒã‚·ãƒ¥ãŒã‚ã‚Šã¾ã›ã‚“ï¼" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh has not surface to create outlines from!" @@ -5951,6 +5949,9 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"StaticBodyを作æˆã—ã€ãƒãƒªã‚´ãƒ³ãƒ™ãƒ¼ã‚¹ã®ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—を自動的ã«å‰²ã‚Šå½“ã¦ã¾" +"ã™ã€‚\n" +"ã“ã‚Œã¯ã€è¡çªæ¤œå‡ºã®æœ€ã‚‚æ£ç¢ºãª(ãŸã ã—最もé…ã„)オプションã§ã™ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -5961,28 +5962,32 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"ãƒãƒªã‚´ãƒ³ãƒ™ãƒ¼ã‚¹ã®ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—を作æˆã—ã¾ã™ã€‚\n" +"ã“ã‚Œã¯ã€è¡çªæ¤œå‡ºã®æœ€ã‚‚æ£ç¢ºãª(ãŸã ã—最もé…ã„)オプションã§ã™ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "凸型兄弟関係コリジョンを生æˆ" +msgstr "å˜ä¸€ã®å‡¸åž‹ã‚³ãƒªã‚¸ãƒ§ãƒ³ã®å…„弟を作æˆ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"å˜ä¸€ã®å‡¸åž‹ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—を作æˆã—ã¾ã™ã€‚\n" +"ã“ã‚Œã¯ã€è¡çªæ¤œå‡ºã®æœ€é€Ÿã®(ãŸã ã—精度ãŒæœ€ã‚‚低ã„)オプションã§ã™ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "凸型兄弟関係コリジョンを生æˆ" +msgstr "複数ã®å‡¸åž‹ã‚³ãƒªã‚¸ãƒ§ãƒ³ã®å…„弟を作æˆã™ã‚‹" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"ãƒãƒªã‚´ãƒ³ãƒ™ãƒ¼ã‚¹ã®ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—を作æˆã—ã¾ã™ã€‚\n" +"ã“ã‚Œã¯ã€ä¸Šè¨˜ã®2ã¤ã®ã‚ªãƒ—ションã®ä¸é–“çš„ãªãƒ‘フォーマンスã§ã™ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -5995,6 +6000,10 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"é™çš„ãªã‚¢ã‚¦ãƒˆãƒ©ã‚¤ãƒ³ãƒ¡ãƒƒã‚·ãƒ¥ã‚’作æˆã—ã¾ã™ã€‚アウトラインメッシュã®æ³•ç·šã¯è‡ªå‹•çš„ã«" +"å転ã—ã¾ã™ã€‚\n" +"ã“ã®ãƒ—ãƒãƒ‘ティを使用ã§ããªã„å ´åˆã¯ã€SpatialMaterialã®Growプãƒãƒ‘ティを代ã‚ã‚Šã«" +"使用ã§ãã¾ã™ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -6230,11 +6239,11 @@ msgstr "AABBを生æˆä¸" #: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" -msgstr "軸平行境界ボックスã®å¯è¦–性を生æˆã™ã‚‹" +msgstr "å¯è¦–性ã®AABBを生æˆ" #: editor/plugins/particles_editor_plugin.cpp msgid "Generate AABB" -msgstr "軸平行境界ボックス(AABB)を生æˆ" +msgstr "AABBを生æˆ" #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" @@ -6337,14 +6346,12 @@ msgid "Set Curve Point Position" msgstr "カーブãƒã‚¤ãƒ³ãƒˆã®ä½ç½®ã‚’è¨å®š" #: editor/plugins/path_editor_plugin.cpp -#, fuzzy msgid "Set Curve In Position" -msgstr "曲線ã®ä½ç½®ã‚’è¨å®š" +msgstr "曲線ã®In-Controlã®ä½ç½®ã‚’指定" #: editor/plugins/path_editor_plugin.cpp -#, fuzzy msgid "Set Curve Out Position" -msgstr "曲線ã®Out-ãƒãƒ³ãƒ‰ãƒ«ã®ä½ç½®ã‚’指定" +msgstr "曲線ã®Out-Controlã®ä½ç½®ã‚’指定" #: editor/plugins/path_editor_plugin.cpp msgid "Split Path" @@ -6613,7 +6620,7 @@ msgstr "リソースをèªã¿è¾¼ã‚€" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "ResourcePreloader" -msgstr "リソースプリãƒãƒ¼ãƒ€ãƒ¼" +msgstr "ResourcePreloader" #: editor/plugins/root_motion_editor_plugin.cpp msgid "AnimationTree has no path set to an AnimationPlayer" @@ -7018,11 +7025,11 @@ msgstr "行を折りãŸãŸã‚€/展開ã™ã‚‹" #: editor/plugins/script_text_editor.cpp msgid "Fold All Lines" -msgstr "ã™ã¹ã¦ã®è¡Œã‚’折りãŸãŸã‚€" +msgstr "å…¨ã¦ã®è¡Œã‚’折りãŸãŸã‚€" #: editor/plugins/script_text_editor.cpp msgid "Unfold All Lines" -msgstr "ã™ã¹ã¦ã®è¡Œã‚’展開ã™ã‚‹" +msgstr "å…¨ã¦ã®è¡Œã‚’展開ã™ã‚‹" #: editor/plugins/script_text_editor.cpp msgid "Clone Down" @@ -7127,7 +7134,7 @@ msgstr "ボーンã¸ãƒ¬ã‚¹ãƒˆãƒ»ãƒãƒ¼ã‚ºã‚’è¨å®šã™ã‚‹" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" -msgstr "スケルトン2D" +msgstr "Skeleton2D" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Make Rest Pose (From Bones)" @@ -7163,7 +7170,7 @@ msgstr "é€è¦–投影" #: editor/plugins/spatial_editor_plugin.cpp msgid "Transform Aborted." -msgstr "変æ›ã¯ä¸æ¢ã•ã‚Œã¾ã—ãŸ." +msgstr "トランスフォームã¯ä¸æ¢ã•ã‚Œã¾ã—ãŸã€‚" #: editor/plugins/spatial_editor_plugin.cpp msgid "X-Axis Transform." @@ -7287,7 +7294,7 @@ msgstr "回転をビューã«åˆã‚ã›ã‚‹" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." -msgstr "åインスタンスを生æˆã™ã‚‹ãŸã‚ã®è¦ªãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。" +msgstr "åをインスタンス化ã™ã‚‹ãŸã‚ã®è¦ªãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "This operation requires a single selected node." @@ -7378,9 +7385,8 @@ msgid "Freelook Speed Modifier" msgstr "フリールックã®é€Ÿåº¦ã‚’調整" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Freelook Slow Modifier" -msgstr "フリールックã®é€Ÿåº¦ã‚’調整" +msgstr "フリールックã®æ¸›é€Ÿã‚’調整" #: editor/plugins/spatial_editor_plugin.cpp msgid "" @@ -7400,7 +7406,7 @@ msgstr "Xformダイアãƒã‚°" #: editor/plugins/spatial_editor_plugin.cpp msgid "Snap Nodes To Floor" -msgstr "ノードを底é¢ã«ã‚¹ãƒŠãƒƒãƒ—ã•ã›ã‚‹" +msgstr "ノードをフãƒã‚¢ã«ã‚¹ãƒŠãƒƒãƒ—" #: editor/plugins/spatial_editor_plugin.cpp msgid "Couldn't find a solid floor to snap the selection to." @@ -7475,7 +7481,7 @@ msgstr "トランスフォーム" #: editor/plugins/spatial_editor_plugin.cpp msgid "Snap Object to Floor" -msgstr "オブジェクトを底é¢ã«ã‚¹ãƒŠãƒƒãƒ—" +msgstr "オブジェクトをフãƒã‚¢ã«ã‚¹ãƒŠãƒƒãƒ—" #: editor/plugins/spatial_editor_plugin.cpp msgid "Transform Dialog..." @@ -8213,7 +8219,7 @@ msgstr "æ–°è¦ãƒãƒªã‚´ãƒ³ã‚’生æˆã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Keep polygon inside region Rect." -msgstr "é ˜åŸŸRect内ã«ãƒãƒªã‚´ãƒ³ã‚’ä¿æŒã—ã¾ã™ã€‚" +msgstr "é ˜åŸŸRect内ã®ãƒãƒªã‚´ãƒ³ã‚’ä¿æŒã—ã¾ã™ã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Enable snap and show grid (configurable via the Inspector)." @@ -8262,8 +8268,8 @@ msgid "" "Drag handles to edit Rect.\n" "Click on another Tile to edit it." msgstr "" -"四角形を編集ã™ã‚‹ãŸã‚ãƒãƒ³ãƒ‰ãƒ«ã‚’ドラッグã—ã¾ã™ã€‚編集ã®ãŸã‚別ã®ã‚¿ã‚¤ãƒ«ã‚’クリック" -"ã—ã¾ã™ã€‚" +"ãƒãƒ³ãƒ‰ãƒ«ã‚’ドラッグã—ã¦çŸ©å½¢ã‚’編集ã—ã¾ã™ã€‚\n" +"別ã®ã‚¿ã‚¤ãƒ«ã‚’クリックã—ã¦ãれを編集ã—ã¾ã™ã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Delete selected Rect." @@ -8275,7 +8281,7 @@ msgid "" "Click on another Tile to edit it." msgstr "" "ç¾åœ¨ç·¨é›†ä¸ã®ã‚µãƒ–タイルをé¸æŠžã—ã¾ã™ã€‚\n" -"別ã®ã‚¿ã‚¤ãƒ«ã‚’クリックã—ã¦ç·¨é›†ã—ã¾ã™ã€‚" +"別ã®ã‚¿ã‚¤ãƒ«ã‚’クリックã—ã¦ãれを編集ã—ã¾ã™ã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Delete polygon." @@ -8288,10 +8294,10 @@ msgid "" "Shift+LMB: Set wildcard bit.\n" "Click on another Tile to edit it." msgstr "" -"左クリック:ビットをオンã«è¨å®šã—ã¾ã™ã€‚\n" +"左クリック:ビットをオンã«ã—ã¾ã™ã€‚\n" "å³ã‚¯ãƒªãƒƒã‚¯:ビットをオフã«ã—ã¾ã™ã€‚\n" "Shift+左クリック:ワイルドカード・ビットをè¨å®šã—ã¾ã™ã€‚\n" -"別ã®ã‚¿ã‚¤ãƒ«ã‚’クリックã—ã¦ç·¨é›†ã—ã¾ã™ã€‚" +"別ã®ã‚¿ã‚¤ãƒ«ã‚’クリックã—ã¦ãれを編集ã—ã¾ã™ã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "" @@ -8316,8 +8322,8 @@ msgid "" "Select sub-tile to change its z index.\n" "Click on another Tile to edit it." msgstr "" -"Zインデックスを変更ã™ã‚‹ã«ã¯ã€ã‚µãƒ–タイルをé¸æŠžã—ã¾ã™ã€‚\n" -"別ã®ã‚¿ã‚¤ãƒ«ã‚’クリックã—ã¦ç·¨é›†ã—ã¾ã™ã€‚" +"サブタイルをé¸æŠžã—ã¦ã€zインデックスを変更ã—ã¾ã™ã€‚\n" +"別ã®ã‚¿ã‚¤ãƒ«ã‚’クリックã—ã¦ãれを編集ã—ã¾ã™ã€‚" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Set Tile Region" @@ -8514,19 +8520,19 @@ msgstr "å‡ºåŠ›ã‚’è¿½åŠ " #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar" -msgstr "スカラー" +msgstr "スカラー(Scaler)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vector" -msgstr "ベクター(Vector)" +msgstr "ベクトル(Vector)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" -msgstr "ブール" +msgstr "ブール(Boolean)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Sampler" -msgstr "サンプラー" +msgstr "サンプラー(Sampler)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add input port" @@ -8566,7 +8572,7 @@ msgstr "å¼ã®è¨å®š" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Resize VisualShader node" -msgstr "ビジュアルシェーダーノードã®ã‚µã‚¤ã‚ºã‚’変更ã™ã‚‹" +msgstr "VisualShaderノードã®ã‚µã‚¤ã‚ºã‚’変更" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" @@ -8619,7 +8625,7 @@ msgstr "シェーダーノードã®ä½œæˆ" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color function." -msgstr "カラー関数。" +msgstr "Color関数。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color operator." @@ -8679,11 +8685,11 @@ msgstr "SoftLight演算å。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color constant." -msgstr "カラー定数。" +msgstr "Color定数。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color uniform." -msgstr "色ã®uniform。" +msgstr "Colorã®uniform。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the %s comparison between two parameters." @@ -8811,7 +8817,7 @@ msgstr "ãƒã‚¤ãƒ”ア数(2.718282)。自然対数ã®ãƒ™ãƒ¼ã‚¹ã‚’表ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Epsilon constant (0.00001). Smallest possible scalar number." -msgstr "Î¥(イプシãƒãƒ³)定数(0.00001)。å¯èƒ½ãªæœ€å°ã®ã‚¹ã‚«ãƒ©ãƒ¼æ•°ã€‚" +msgstr "Î¥(イプシãƒãƒ³)定数(0.00001)。使用å¯èƒ½ãªæœ€å°ã®ã‚¹ã‚«ãƒ©ãƒ¼æ•°ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Phi constant (1.618034). Golden ratio." @@ -9041,7 +9047,7 @@ msgstr "スカラー定数。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Scalar uniform." -msgstr "スカラã®uniform。" +msgstr "Scalarã®uniform。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the cubic texture lookup." @@ -9113,14 +9119,12 @@ msgid "Multiplies vector by transform." msgstr "トランスフォームã§ãƒ™ã‚¯ãƒˆãƒ«ã‚’ä¹—ç®—ã—ã¾ã™ã€‚" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform constant." -msgstr "トランスフォームã¯ä¸æ¢ã•ã‚Œã¾ã—ãŸ." +msgstr "トランスフォーム定数。" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Transform uniform." -msgstr "トランスフォームã¯ä¸æ¢ã•ã‚Œã¾ã—ãŸ." +msgstr "トランスフォーム用uniform。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vector function." @@ -9270,9 +9274,8 @@ msgid "Vector constant." msgstr "ベクトル定数。" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector uniform." -msgstr "uniform ã¸ã®å‰²ã‚Šå½“ã¦ã€‚" +msgstr "ベクトルuniform。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9359,7 +9362,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" -msgstr "ビジュアルシェーダー" +msgstr "VisualShader" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Edit Visual Property" @@ -9524,7 +9527,7 @@ msgstr "テã‚スト" #: editor/project_export.cpp msgid "Compiled" -msgstr "コンパイル" +msgstr "コンパイル済ã¿" #: editor/project_export.cpp msgid "Encrypted (Provide Key Below)" @@ -9575,21 +9578,19 @@ msgid "Export With Debug" msgstr "デãƒãƒƒã‚°ä»˜ãエクスãƒãƒ¼ãƒˆ" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "å˜åœ¨ã—ãªã„パスã§ã™ã€‚" +msgstr "指定ã•ã‚ŒãŸãƒ‘スã¯å˜åœ¨ã—ã¾ã›ã‚“。" #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "パッケージファイルを開ã‘ã¾ã›ã‚“ã§ã—ãŸã€zip å½¢å¼ã§ã¯ã‚ã‚Šã¾ã›ã‚“。" +msgstr "" +"パッケージ ファイルを開ãã¨ãã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—㟠(ZIPå½¢å¼ã§ã¯ã‚ã‚Šã¾ã›ã‚“)。" #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." msgstr "" -"無効㪠'.zip' プãƒã‚¸ã‚§ã‚¯ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã§ã™ã€‚'project.godot' ファイルãŒå«ã¾ã‚Œã¦ã„" +"無効ãª\".zip\"プãƒã‚¸ã‚§ã‚¯ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã§ã™ã€‚\"project.godot\"ファイルãŒå«ã¾ã‚Œã¦ã„" "ã¾ã›ã‚“。" #: editor/project_manager.cpp @@ -9597,14 +9598,12 @@ msgid "Please choose an empty folder." msgstr "空ã®ãƒ•ã‚©ãƒ«ãƒ€ãƒ¼ã‚’é¸æŠžã—ã¦ãã ã•ã„。" #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "'project.godot' ã‚‚ã—ã㯠'.zip' ファイルをé¸æŠžã—ã¦ãã ã•ã„." +msgstr "\"project.godot\"ã¾ãŸã¯\".zip\"ファイルをé¸æŠžã—ã¦ãã ã•ã„。" #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "ディレクトリã«ã¯Godotプãƒã‚¸ã‚§ã‚¯ãƒˆãŒã™ã§ã«å«ã¾ã‚Œã¦ã„ã¾ã™ã€‚" +msgstr "ã“ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã¯ã™ã§ã«Godotプãƒã‚¸ã‚§ã‚¯ãƒˆãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚" #: editor/project_manager.cpp msgid "New Game Project" @@ -10090,9 +10089,8 @@ msgid "Settings saved OK." msgstr "è¨å®šã®ä¿å˜ã«æˆåŠŸã—ã¾ã—ãŸ." #: editor/project_settings_editor.cpp -#, fuzzy msgid "Moved Input Action Event" -msgstr "å…¥åŠ›ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã‚¤ãƒ™ãƒ³ãƒˆã‚’è¿½åŠ " +msgstr "入力アクションイベントを移動" #: editor/project_settings_editor.cpp msgid "Override for Feature" @@ -10299,9 +10297,8 @@ msgid "Suffix" msgstr "サフィックス" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "æ£è¦è¡¨ç¾" +msgstr "æ£è¦è¡¨ç¾ã‚’使用ã™ã‚‹" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10340,9 +10337,8 @@ msgstr "" "カウンタオプションを比較ã—ã¾ã™ã€‚" #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" -msgstr "レベルã”ã¨ã®ã‚«ã‚¦ãƒ³ã‚¿" +msgstr "レベルã”ã¨ã®ã‚«ã‚¦ãƒ³ã‚¿ãƒ¼" #: editor/rename_dialog.cpp msgid "If set the counter restarts for each group of child nodes" @@ -10381,14 +10377,12 @@ msgid "Keep" msgstr "ä¿æŒ" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" -msgstr "ã‚ャメルケースをアンダースコアã«" +msgstr "PascalCaseã‹ã‚‰snake_caseã¸" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" -msgstr "アンダースコアをã‚ャメルケースã«" +msgstr "snake_caseã‚’PascalCaseã¸" #: editor/rename_dialog.cpp msgid "Case" @@ -10407,14 +10401,12 @@ msgid "Reset" msgstr "リセット" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "æ£è¦è¡¨ç¾" +msgstr "æ£è¦è¡¨ç¾ã‚¨ãƒ©ãƒ¼" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "有効ãªæ–‡å—:" +msgstr "æ–‡å— %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10774,7 +10766,7 @@ msgid "" "Children are not selectable.\n" "Click to make selectable." msgstr "" -"åã‚’é¸æŠžã§ãã¾ã›ã‚“.\n" +"åã‚’é¸æŠžã§ãã¾ã›ã‚“。\n" "クリックã—ã¦é¸æŠžå¯èƒ½ã«ã—ã¦ãã ã•ã„。" #: editor/scene_tree_editor.cpp @@ -10867,20 +10859,19 @@ msgstr "スクリプトを開ã" #: editor/script_create_dialog.cpp msgid "File exists, it will be reused." -msgstr "ファイルã¯å˜åœ¨ã—ã¾ã™ã€‚å†åˆ©ç”¨ã•ã‚Œã¾ã™ã€‚" +msgstr "ファイルãŒæ—¢ã«å˜åœ¨ã—ã¾ã™ã€‚ãã¡ã‚‰ã‚’å†åˆ©ç”¨ã—ã¾ã™ã€‚" #: editor/script_create_dialog.cpp msgid "Invalid class name." -msgstr "クラスåãŒç„¡åŠ¹ã§ã™ã€‚" +msgstr "無効ãªã‚¯ãƒ©ã‚¹å。" #: editor/script_create_dialog.cpp msgid "Invalid inherited parent name or path." msgstr "継承ã•ã‚ŒãŸè¦ªã®åå‰ã¾ãŸã¯ãƒ‘スãŒç„¡åŠ¹ã§ã™ã€‚" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "スクリプトã¯æœ‰åŠ¹ã§ã™ã€‚" +msgstr "スクリプトã®ãƒ‘ス/åå‰ã¯æœ‰åŠ¹ã§ã™ã€‚" #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -10971,9 +10962,8 @@ msgid "Copy Error" msgstr "エラーをコピー" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" -msgstr "ビデオメモリー" +msgstr "ビデオRAM" #: editor/script_editor_debugger.cpp msgid "Skip Breakpoints" @@ -11101,12 +11091,11 @@ msgstr "カメラã®FOVを変更" #: editor/spatial_editor_gizmos.cpp msgid "Change Camera Size" -msgstr "カメラã®ã‚µã‚¤ã‚ºã‚’変更" +msgstr "カメラサイズを変更" #: editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Notifier AABB" -msgstr "パーティクルã®è»¸å¹³è¡Œå¢ƒç•Œãƒœãƒƒã‚¯ã‚¹ã‚’変更" +msgstr "Notifierã®AABBを変更" #: editor/spatial_editor_gizmos.cpp msgid "Change Particles AABB" @@ -11122,7 +11111,7 @@ msgstr "çƒå½¢ã®åŠå¾„を変更" #: editor/spatial_editor_gizmos.cpp modules/csg/csg_gizmos.cpp msgid "Change Box Shape Extents" -msgstr "ボックスシェイプ範囲ã®å¤‰æ›´" +msgstr "ボックスシェイプã®ç¯„囲を変更" #: editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Radius" @@ -11130,7 +11119,7 @@ msgstr "カプセルシェイプã®åŠå¾„を変更" #: editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Height" -msgstr "カプセル形状ã®é«˜ã•ã‚’変更ã™ã‚‹" +msgstr "カプセルシェイプã®é«˜ã•ã‚’変更" #: editor/spatial_editor_gizmos.cpp msgid "Change Cylinder Shape Radius" @@ -11297,14 +11286,12 @@ msgid "Grid Map" msgstr "グリッドマップ" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Snap View" -msgstr "上é¢å›³" +msgstr "スナップビュー" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Clip Disabled" -msgstr "無効" +msgstr "クリップ無効" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Clip Above" @@ -11363,9 +11350,8 @@ msgid "Clear Selection" msgstr "é¸æŠžã‚’クリア" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Fill Selection" -msgstr "ã™ã¹ã¦é¸æŠž" +msgstr "é¸æŠžéƒ¨ã®å¡—ã‚Šæ½°ã—" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "GridMap Settings" @@ -11376,9 +11362,8 @@ msgid "Pick Distance:" msgstr "è·é›¢ã‚’å–å¾—:" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Filter meshes" -msgstr "フィルタメッシュ" +msgstr "メッシュを絞り込む" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Give a MeshLibrary resource to this GridMap to use its meshes." @@ -11428,7 +11413,7 @@ msgstr "移動å¯èƒ½ãªé ˜åŸŸã‚’作æˆä¸..." #: modules/recast/navigation_mesh_generator.cpp msgid "Partitioning..." -msgstr "パーティションを作æˆã—ã¦ã„ã¾ã™..." +msgstr "分割ä¸..." #: modules/recast/navigation_mesh_generator.cpp msgid "Creating contours..." @@ -11505,7 +11490,7 @@ msgstr "引数åã®å¤‰æ›´" #: modules/visual_script/visual_script_editor.cpp msgid "Set Variable Default Value" -msgstr "変数ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤ã‚’è¨å®šã™ã‚‹" +msgstr "変数ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤ã‚’è¨å®š" #: modules/visual_script/visual_script_editor.cpp msgid "Set Variable Type" @@ -11640,15 +11625,13 @@ msgid "Add Node(s) From Tree" msgstr "ツリーã‹ã‚‰ãƒŽãƒ¼ãƒ‰ã‚’è¿½åŠ " #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "" "Can't drop properties because script '%s' is not used in this scene.\n" "Drop holding 'Shift' to just copy the signature." msgstr "" -"スクリプト '%s' ã¯ã“ã®ã‚·ãƒ¼ãƒ³ã§ä½¿ã‚ã‚Œã¦ã„ãªã„ãŸã‚ã€ãƒŽãƒ¼ãƒ‰ã‚’è½ã¨ã™ã“ã¨ãŒã§ãã¾" +"ã“ã®ã‚·ãƒ¼ãƒ³ã§ã¯ã‚¹ã‚¯ãƒªãƒ—ト 'ï¼…s'ãŒä½¿ç”¨ã•ã‚Œã¦ã„ãªã„ãŸã‚ã€ãƒ—ãƒãƒ‘ティを削除ã§ãã¾" "ã›ã‚“。\n" -"'shift' ã‚ーを押ã—ãªãŒã‚‰ãƒ‰ãƒãƒƒãƒ—ã™ã‚‹ã“ã¨ã§ã‚·ã‚°ãƒãƒãƒ£ã‚’コピーã™ã‚‹ã“ã¨ãŒã§ãã¾" -"ã™ã€‚" +"「Shiftã€ã‚’押ã—ãªãŒã‚‰ãƒ‰ãƒãƒƒãƒ—ã™ã‚‹ã¨ã€ç½²åãŒã‚³ãƒ”ーã•ã‚Œã¾ã™ã€‚" #: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" @@ -11832,7 +11815,7 @@ msgstr "パスãŒãƒŽãƒ¼ãƒ‰ã«é”ã—ã¾ã›ã‚“ï¼" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name '%s' in node %s." -msgstr "ノード%sã®ä¸æ£ãªã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã®ãƒ—ãƒãƒ‘ティå'%s' ." +msgstr "ノード%sã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã®ãƒ—ãƒãƒ‘ティå'%s'ã¯ç„¡åŠ¹ã§ã™ã€‚" #: modules/visual_script/visual_script_nodes.cpp msgid ": Invalid argument of type: " @@ -12022,7 +12005,7 @@ msgstr "無効ãªã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆ テンプレート:" #: platform/javascript/export/export.cpp msgid "Could not read custom HTML shell:" -msgstr "カスタムHTMLシェルをèªã¿å–ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸ:" +msgstr "カスタムHTMLシェルをèªã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸ:" #: platform/javascript/export/export.cpp msgid "Could not read boot splash image file:" @@ -12062,37 +12045,39 @@ msgstr "Storeãƒã‚´ã®ç”»åƒã‚µã‚¤ã‚ºãŒç„¡åŠ¹ã§ã™(縦横50x50ã§ãªã„ã¨ã„ã #: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "無効ãª44X44四角ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª44x44ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" +msgstr "44X44ã®æ£æ–¹å½¢ãƒã‚´ã®ç”»åƒã‚µã‚¤ã‚ºãŒç„¡åŠ¹ã§ã™(縦横44x44ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "無効ãª71x71四角ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª71x71ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" +msgstr "71x71ã®æ£æ–¹å½¢ãƒã‚´ã®ç”»åƒã‚µã‚¤ã‚ºãŒç„¡åŠ¹ã§ã™(縦横71x71ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "無効ãª150X150四角ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª150x150ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" +msgstr "" +"150X150ã®æ£æ–¹å½¢ãƒã‚´ã®ç”»åƒã‚µã‚¤ã‚ºãŒç„¡åŠ¹ã§ã™(縦横150x150ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "無効ãª310X310四角ãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª310x310ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" +msgstr "" +"310X310ã®æ£æ–¹å½¢ãƒã‚´ã®ç”»åƒã‚µã‚¤ã‚ºãŒç„¡åŠ¹ã§ã™(縦横310x310ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "無効ãª310X150ワイドãƒã‚´ã‚¤ãƒ¡ãƒ¼ã‚¸ï¼ˆç¸¦æ¨ª310x150ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" +msgstr "" +"310X150ã®ãƒ¯ã‚¤ãƒ‰ãƒã‚´ã®ç”»åƒã‚µã‚¤ã‚ºãŒç„¡åŠ¹ã§ã™(縦横310x150ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" -"無効ãªã‚¹ãƒ—ラッシュスクリーンイメージ(縦横620x300ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" +"スプラッシュスクリーンã®ç”»åƒã‚µã‚¤ã‚ºãŒç„¡åŠ¹ã§ã™(縦横620x300ã§ãªã„ã¨ã„ã‘ã¾ã›ã‚“)。" #: scene/2d/animated_sprite.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite to display frames." msgstr "" -"SpriteFrames リソースを作æˆã¾ãŸã¯ AnimatedSprite フレームを表示ã™ã‚‹ãŸã‚ã«ã¯ " -"'Frames' プãƒãƒ‘ティã«è¨å®šã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" +"AnimatedSpriteã§ãƒ•ãƒ¬ãƒ¼ãƒ を表示ã™ã‚‹ã«ã¯ã€\"Frames\"プãƒãƒ‘ティã§SpriteFramesリ" +"ソースを作æˆã¾ãŸã¯è¨å®šã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" #: scene/2d/canvas_modulate.cpp msgid "" @@ -12120,10 +12105,9 @@ msgid "" "CollisionObject2D derived node. Please only use it as a child of Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionPolygon2D ã¯ã€CollisionObject2D 派生ノードã«è¡çªã‚·ã‚§ã‚¤ãƒ—ã‚’æä¾›ã™ã‚‹ãŸ" -"ã‚ã«ã®ã¿æ©Ÿèƒ½ã—ã¾ã™ã€‚2Dã®å½¢çŠ¶ï¼ˆã‚·ã‚§ã‚¤ãƒ—)を付与ã™ã‚‹ãŸã‚ã«ã¯ Area2Dã€" -"StaticBody2Dã€RigidBody2Dã€KinematicBody2D ãªã©ã®åオブジェクトã¨ã—ã¦åˆ©ç”¨ã—ã¦" -"ãã ã•ã„。" +"CollisionPolygon2Dã¯ã€CollisionObject2D派生ノードã«ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—ã‚’æä¾›ã™" +"ã‚‹ãŸã‚ã«ã®ã¿æ©Ÿèƒ½ã—ã¾ã™ã€‚ã‚·ã‚§ã‚¤ãƒ—ã‚’è¿½åŠ ã™ã‚‹å ´åˆã¯ã€Area2Dã€StaticBody2Dã€" +"RigidBody2Dã€KinematicBody2Dãªã©ã®åã¨ã—ã¦ä½¿ç”¨ã—ã¦ãã ã•ã„。" #: scene/2d/collision_polygon_2d.cpp msgid "An empty CollisionPolygon2D has no effect on collision." @@ -12135,9 +12119,9 @@ msgid "" "CollisionObject2D derived node. Please only use it as a child of Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionShape2D ã¯ã€CollisionObject2D派生ノードã«è¡çªã‚·ã‚§ã‚¤ãƒ—ã‚’æä¾›ã™ã‚‹å ´åˆ" -"ã«ã®ã¿æ©Ÿèƒ½ã—ã¾ã™ã€‚Area2Dã€staticBody2Dã€RigidBody2Dã€KinematicBody2Dãªã©ã®å" -"ã¨ã—ã¦ä½¿ç”¨ã—ã¦ãã ã•ã„。" +"CollisionShape2Dã¯ã€CollisionObject2D派生ノードã«ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—ã‚’æä¾›ã™ã‚‹" +"å ´åˆã«ã®ã¿æ©Ÿèƒ½ã—ã¾ã™ã€‚ã‚·ã‚§ã‚¤ãƒ—ã‚’è¿½åŠ ã™ã‚‹å ´åˆã¯ã€Area2Dã€staticBody2Dã€" +"RigidBody2Dã€KinematicBody2Dãªã©ã®åã¨ã—ã¦ä½¿ç”¨ã—ã¦ãã ã•ã„。" #: scene/2d/collision_shape_2d.cpp msgid "" @@ -12295,7 +12279,7 @@ msgstr "" #: scene/3d/arvr_nodes.cpp msgid "ARVRAnchor must have an ARVROrigin node as its parent." -msgstr "ARVRAnchorã¯ARVROriginを親ã«æŒã¤å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" +msgstr "ARVRAnchorã¯ARVROriginノードを親ã«æŒã¤å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" #: scene/3d/arvr_nodes.cpp msgid "" @@ -12307,7 +12291,7 @@ msgstr "" #: scene/3d/arvr_nodes.cpp msgid "ARVROrigin requires an ARVRCamera child node." -msgstr "ARVROriginã¯ARVRCameraåノードãŒå¿…è¦ã§ã™ã€‚" +msgstr "ARVROriginã¯åノードã«ARVRCameraãŒå¿…è¦ã§ã™ã€‚" #: scene/3d/baked_lightmap.cpp msgid "%d%%" @@ -12350,9 +12334,9 @@ msgid "" "CollisionObject derived node. Please only use it as a child of Area, " "StaticBody, RigidBody, KinematicBody, etc. to give them a shape." msgstr "" -"CollisionPolygonã¯ã€CollisionObject派生ノードã«è¡çªã‚·ã‚§ã‚¤ãƒ—ã‚’æä¾›ã™ã‚‹å ´åˆã«ã®" -"ã¿æ©Ÿèƒ½ã—ã¾ã™ã€‚Areaã€StaticBodyã€RigidBodyã€KinematicBodyãªã©ã®åã¨ã—ã¦ä½¿ç”¨ã—" -"ã¦ãã ã•ã„。" +"CollisionPolygonã¯ã€CollisionObject派生ノードã«ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—ã‚’æä¾›ã™ã‚‹å ´" +"åˆã«ã®ã¿æ©Ÿèƒ½ã—ã¾ã™ã€‚ã‚·ã‚§ã‚¤ãƒ—ã‚’è¿½åŠ ã™ã‚‹å ´åˆã¯ã€Areaã€StaticBodyã€RigidBodyã€" +"KinematicBodyãªã©ã®åã¨ã—ã¦ä½¿ç”¨ã—ã¦ãã ã•ã„。" #: scene/3d/collision_polygon.cpp msgid "An empty CollisionPolygon has no effect on collision." @@ -12364,9 +12348,9 @@ msgid "" "derived node. Please only use it as a child of Area, StaticBody, RigidBody, " "KinematicBody, etc. to give them a shape." msgstr "" -"CollisionShapeã¯ã€CollisionObject派生ノードã«è¡çªã‚·ã‚§ã‚¤ãƒ—ã‚’æä¾›ã™ã‚‹å ´åˆã«ã®ã¿" -"機能ã—ã¾ã™ã€‚Areaã€StaticBodyã€RigidBodyã€KinematicBodyãªã©ã®åã¨ã—ã¦ä½¿ç”¨ã—ã¦" -"ãã ã•ã„。" +"CollisionShapeã¯ã€CollisionObject派生ノードã«ã‚³ãƒªã‚¸ãƒ§ãƒ³ã‚·ã‚§ã‚¤ãƒ—ã‚’æä¾›ã™ã‚‹å ´åˆ" +"ã«ã®ã¿æ©Ÿèƒ½ã—ã¾ã™ã€‚ã‚·ã‚§ã‚¤ãƒ—ã‚’è¿½åŠ ã™ã‚‹å ´åˆã¯ã€Areaã€StaticBodyã€RigidBodyã€" +"KinematicBodyãªã©ã®åã¨ã—ã¦ä½¿ç”¨ã—ã¦ãã ã•ã„。" #: scene/3d/collision_shape.cpp msgid "" @@ -12454,13 +12438,12 @@ msgid "PathFollow only works when set as a child of a Path node." msgstr "PathFollow ã¯ã€Path ノードã®åã¨ã—ã¦è¨å®šã•ã‚Œã¦ã„ã‚‹å ´åˆã®ã¿å‹•ä½œã—ã¾ã™ã€‚" #: scene/3d/path.cpp -#, fuzzy msgid "" "PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its " "parent Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTEDã§ã¯ã€è¦ªãƒ‘スã®Curveリソース㧠\"Up Vector\"を有効" -"ã«ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" +"PathFollowã®ROTATION_ORIENTEDã§ã¯ã€è¦ªã®Pathã®Curveリソースã§\"Up Vector\"を有" +"効ã«ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" #: scene/3d/physics_body.cpp msgid "" @@ -12666,21 +12649,20 @@ msgid "" "Default Environment as specified in Project Settings (Rendering -> " "Environment -> Default Environment) could not be loaded." msgstr "" -"プãƒã‚¸ã‚§ã‚¯ãƒˆè¨å®šã§æŒ‡å®šã•ã‚Œã¦ã„る既定ã®ç’°å¢ƒ (レンダリング -> 環境 -> 既定ã®ç’°" -"境) ã‚’èªã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸã€‚" +"プãƒã‚¸ã‚§ã‚¯ãƒˆè¨å®šã§æŒ‡å®šã•ã‚Œã¦ã„る既定ã®ç’°å¢ƒ (Rendering -> Environment -> " +"Default Environment) ã‚’èªã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸã€‚" #: scene/main/viewport.cpp -#, fuzzy msgid "" "This viewport is not set as render target. If you intend for it to display " "its contents directly to the screen, make it a child of a Control so it can " "obtain a size. Otherwise, make it a RenderTarget and assign its internal " "texture to some node for display." msgstr "" -"ã“ã®ãƒ“ューãƒãƒ¼ãƒˆã¯ã€ãƒ¬ãƒ³ãƒ€ãƒ¼ ターゲットã¨ã—ã¦è¨å®šã•ã‚Œã¦ã„ã¾ã›ã‚“。ãã®å†…容を画" -"é¢ã«ç›´æŽ¥è¡¨ç¤ºã™ã‚‹å ´åˆã¯ã€ã‚µã‚¤ã‚ºã‚’å¾—ã‚‹ã“ã¨ãŒã§ãるよã†ã«ã€ã‚³ãƒ³ãƒˆãƒãƒ¼ãƒ«ã®åã‚’ã¤" -"ãã‚Šã¾ã™ã€‚ãれ以外ã®å ´åˆã€ãƒ¬ãƒ³ãƒ€ãƒ¼ ターゲットã—ã€ãã®å†…部ã®ãƒ†ã‚¯ã‚¹ãƒãƒ£è¡¨ç¤ºã®ã„" -"ãã¤ã‹ã®ãƒŽãƒ¼ãƒ‰ã«å‰²ã‚Šå½“ã¦ã¾ã™ã€‚" +"ã“ã®ãƒ“ューãƒãƒ¼ãƒˆã¯ãƒ¬ãƒ³ãƒ€ãƒ¼ ターゲットã¨ã—ã¦è¨å®šã•ã‚Œã¦ã„ã¾ã›ã‚“。コンテンツを画" +"é¢ã«ç›´æŽ¥è¡¨ç¤ºã™ã‚‹å ´åˆã¯ã€ã‚µã‚¤ã‚ºã‚’å–å¾—ã§ãるよã†ã«ã‚³ãƒ³ãƒˆãƒãƒ¼ãƒ«ã®åã«ã—ã¾ã™ã€‚ã" +"れ以外ã®å ´åˆã¯ã€RenderTarget ã«ã—ã¦ã€ãã®å†…部テクスãƒãƒ£ã‚’表示ã™ã‚‹ãƒŽãƒ¼ãƒ‰ã«å‰²ã‚Š" +"当ã¦ã¾ã™ã€‚" #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." diff --git a/editor/translations/ka.po b/editor/translations/ka.po index 16a2628500..3c9ab6c79e 100644 --- a/editor/translations/ka.po +++ b/editor/translations/ka.po @@ -3950,15 +3950,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/ko.po b/editor/translations/ko.po index 55bee75d3b..fc23015cf8 100644 --- a/editor/translations/ko.po +++ b/editor/translations/ko.po @@ -3943,6 +3943,11 @@ msgid "Saving..." msgstr "ì €ìž¥ 중..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " 파ì¼" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "'%s'ì„(를) 기본으로 ì„¤ì •" @@ -3951,10 +3956,6 @@ msgid "Clear Default for '%s'" msgstr "'%s'ì„(를) 기본ì—ì„œ 지우기" #: editor/import_dock.cpp -msgid " Files" -msgstr " 파ì¼" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "ë‹¤ìŒ í˜•ì‹ìœ¼ë¡œ ê°€ì ¸ì˜¤ê¸°:" diff --git a/editor/translations/lt.po b/editor/translations/lt.po index 5f8d87a7a5..60d2adc418 100644 --- a/editor/translations/lt.po +++ b/editor/translations/lt.po @@ -3923,15 +3923,16 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" -msgstr "" +#, fuzzy +msgid "%d Files" +msgstr "Redaguoti Filtrus" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/lv.po b/editor/translations/lv.po index 84c4a0e584..9a6454d81b 100644 --- a/editor/translations/lv.po +++ b/editor/translations/lv.po @@ -3916,15 +3916,16 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" -msgstr "" +#, fuzzy +msgid "%d Files" +msgstr "NederÄ«gs nosaukums." #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/mi.po b/editor/translations/mi.po index de68081972..2e6c563aec 100644 --- a/editor/translations/mi.po +++ b/editor/translations/mi.po @@ -3795,15 +3795,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/ml.po b/editor/translations/ml.po index b3deb29090..500a1d9156 100644 --- a/editor/translations/ml.po +++ b/editor/translations/ml.po @@ -3807,15 +3807,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/mr.po b/editor/translations/mr.po index 3803ad7731..ca97848940 100644 --- a/editor/translations/mr.po +++ b/editor/translations/mr.po @@ -3802,15 +3802,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/ms.po b/editor/translations/ms.po index ed332284c9..d7e9bd443a 100644 --- a/editor/translations/ms.po +++ b/editor/translations/ms.po @@ -3830,15 +3830,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/nb.po b/editor/translations/nb.po index 09bec2c4aa..9060ee7249 100644 --- a/editor/translations/nb.po +++ b/editor/translations/nb.po @@ -4196,6 +4196,10 @@ msgid "Saving..." msgstr "Lagrer..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Filer" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Sett som Standard for '%s'" @@ -4204,10 +4208,6 @@ msgid "Clear Default for '%s'" msgstr "Fjern Standard for '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Filer" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importer Som:" diff --git a/editor/translations/nl.po b/editor/translations/nl.po index 2f79bf52d9..cc5c2c978f 100644 --- a/editor/translations/nl.po +++ b/editor/translations/nl.po @@ -3997,6 +3997,10 @@ msgid "Saving..." msgstr "Opslaan..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Bestanden" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Stel in als Standaard voor '%s'" @@ -4005,10 +4009,6 @@ msgid "Clear Default for '%s'" msgstr "Wis Standaard voor '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Bestanden" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importeer als:" diff --git a/editor/translations/or.po b/editor/translations/or.po index 8645103d62..1e2acc1c86 100644 --- a/editor/translations/or.po +++ b/editor/translations/or.po @@ -3801,15 +3801,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/pl.po b/editor/translations/pl.po index 19ed399df1..48c51e8ea1 100644 --- a/editor/translations/pl.po +++ b/editor/translations/pl.po @@ -42,7 +42,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-01-27 07:10+0000\n" +"PO-Revision-Date: 2020-02-18 15:09+0000\n" "Last-Translator: Tomek <kobewi4e@gmail.com>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/" "godot/pl/>\n" @@ -52,7 +52,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 3.11-dev\n" +"X-Generator: Weblate 3.11\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -721,9 +721,8 @@ msgid "Line Number:" msgstr "Numer linii:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "ZamieÅ„..." +msgstr "%d zamieniono." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -3981,6 +3980,11 @@ msgid "Saving..." msgstr "Zapisywanie..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Pliki" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Ustaw jako domyÅ›lne dla \"%s\"" @@ -3989,10 +3993,6 @@ msgid "Clear Default for '%s'" msgstr "UsuÅ„ domyÅ›lne dla \"%s\"" #: editor/import_dock.cpp -msgid " Files" -msgstr " Pliki" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importuj jako:" @@ -5869,9 +5869,8 @@ msgid "Mesh is empty!" msgstr "Siatka jest pusta!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Utwórz sÄ…siadujÄ…cÄ… trójsiatkÄ™ kolizji" +msgstr "Nie udaÅ‚o siÄ™ utworzyć ksztaÅ‚tu trójsiatki." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5888,29 +5887,29 @@ msgstr "Utwórz statyczny ksztaÅ‚t trójsiatki" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." msgstr "" +"Nie można utworzyć pojedynczego wypukÅ‚ego ksztaÅ‚tu kolizji dla korzenia " +"sceny." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Nie udaÅ‚o siÄ™ utworzyć pojedynczego wypukÅ‚ego ksztaÅ‚tu kolizji." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Utwórz ksztaÅ‚t wypukÅ‚y" +msgstr "Utwórz pojedynczy wypukÅ‚y ksztaÅ‚t" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." msgstr "" +"Nie można utworzyć wielu wypukÅ‚ych ksztaÅ‚tów kolizji dla korzenia sceny." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "Nie można utworzyć katalogu." +msgstr "Nie udaÅ‚o siÄ™ utworzyć żadnego ksztaÅ‚tu kolizji." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Utwórz ksztaÅ‚t wypukÅ‚y" +msgstr "Utwórz wiele wypukÅ‚ych ksztaÅ‚tów" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -10394,14 +10393,12 @@ msgid "Keep" msgstr "Bez zmian" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" -msgstr "CamelCase na under_scored" +msgstr "PascalCase na snake_case" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" -msgstr "under_scored na CamelCase" +msgstr "snake_case na PascalCase" #: editor/rename_dialog.cpp msgid "Case" @@ -10420,14 +10417,12 @@ msgid "Reset" msgstr "Resetuj" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Wyrażenia regularne" +msgstr "BÅ‚Ä…d wyrażenia regularnego" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "Dopuszczalne znaki:" +msgstr "Przy znaku %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10892,9 +10887,8 @@ msgid "Invalid inherited parent name or path." msgstr "NieprawidÅ‚owa nazwa lub Å›cieżka klasy bazowej." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "Skrypt jest prawidÅ‚owy." +msgstr "Åšcieżka/nazwa skryptu jest prawidÅ‚owa." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -10985,9 +10979,8 @@ msgid "Copy Error" msgstr "Kopiuj bÅ‚Ä…d" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" -msgstr "Pamięć wideo" +msgstr "Wideo RAM" #: editor/script_editor_debugger.cpp msgid "Skip Breakpoints" diff --git a/editor/translations/pr.po b/editor/translations/pr.po index 8baec6f376..2be9100ab8 100644 --- a/editor/translations/pr.po +++ b/editor/translations/pr.po @@ -3927,15 +3927,16 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" -msgstr "" +#, fuzzy +msgid "%d Files" +msgstr "Edit yer Variable:" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po index e8e94eced4..8fc0ef4f39 100644 --- a/editor/translations/pt_BR.po +++ b/editor/translations/pt_BR.po @@ -48,7 +48,7 @@ # joel silva <joelgbsilva@gmail.com>, 2019. # Heitor Novais Pereira <heitornovais394@outlook.com>, 2019. # Joel Landgraf Filho <joel.landgraf@gmail.com>, 2019. -# Alan Valmorbida <alanvalmorbida@gmail.com>, 2019. +# Alan Valmorbida <alanvalmorbida@gmail.com>, 2019, 2020. # João Vitor Ferreira Cavalcante <jvfecav@gmail.com>, 2019. # Thiago Amendola <amendolathiago@gmail.com>, 2019. # Raphael Nogueira Campos <raphaelncampos@gmail.com>, 2019. @@ -61,7 +61,7 @@ # Ivo Nascimento <iannsp@gmail.com>, 2019. # Klaus Dellano <klausdell@hotmail.com>, 2019. # Esdras Tarsis <esdrastarsis@gmail.com>, 2019. -# Douglas Fiedler <dognew@gmail.com>, 2019. +# Douglas Fiedler <dognew@gmail.com>, 2019, 2020. # Rarysson Guilherme <r_guilherme12@hotmail.com>, 2019. # Gustavo da Silva Santos <gustavo94.rb@gmail.com>, 2019. # Rafael Roque <rafael.roquec@gmail.com>, 2019. @@ -86,8 +86,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: 2016-05-30\n" -"PO-Revision-Date: 2020-02-06 09:45+0000\n" -"Last-Translator: Leonardo Dimano <leodimano@live.com>\n" +"PO-Revision-Date: 2020-02-18 15:09+0000\n" +"Last-Translator: Douglas Fiedler <dognew@gmail.com>\n" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_BR/>\n" "Language: pt_BR\n" @@ -95,7 +95,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 3.11-dev\n" +"X-Generator: Weblate 3.11\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -763,9 +763,8 @@ msgid "Line Number:" msgstr "Número da Linha:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "Substituir..." +msgstr "%d substituÃdo." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -4036,6 +4035,10 @@ msgid "Saving..." msgstr "Salvando..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Arquivos" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Definir como Padrão para '%s'" @@ -4044,10 +4047,6 @@ msgid "Clear Default for '%s'" msgstr "Limpar Padrão para '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Arquivos" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importar como:" @@ -5927,9 +5926,8 @@ msgid "Mesh is empty!" msgstr "Mesh está vazia!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Criar Colisão Trimesh Irmã" +msgstr "Não foi possÃvel criar uma forma de colisão Trimesh." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5945,30 +5943,27 @@ msgstr "Criar Forma Estática Trimesh" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." -msgstr "" +msgstr "Não foi possÃvel criar forma de colisão convexa para a cena raiz." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Não foi possÃvel criar uma forma de colisão convexa simples." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Criar Forma(s) Convexa(s)" +msgstr "Criar Forma(s) Convexa(s) Simples" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." -msgstr "" +msgstr "Não foi possÃvel criar uma forma de colisão convexa para a cena raiz." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "ImpossÃvel criar a pasta." +msgstr "Não foi possÃvel criar nenhuma forma de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Criar Forma(s) Convexa(s)" +msgstr "Criar Múltiplas Forma(s) Convexa(s)" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -6024,6 +6019,9 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Criar um Staticbody e atribuir uma forma de colisão baseado em polÃgono para " +"isto automaticamente.\n" +"Esta é a opção mais precisa (mas lenta) para detecção de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -6034,28 +6032,32 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Criar uma forma de colisão baseada em polÃgono.\n" +"Este é a opção mais precisa (mas lenta) para detecção de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "Criar Colisão Convexa Irmã(s)" +msgstr "Criar Simples Colisão Convexa Irmã(s)" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"Criar uma simples forma convexa de colisão.\n" +"Esta é a opção mais rápida (mas menos precisa) para detecção de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "Criar Colisão Convexa Irmã(s)" +msgstr "Criar Múltipla Colisão Convexa Irmã(s)" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"Cria um polÃgono base de colisão forma.\n" +"Este é um meio-termo entre as duas opções acima." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -6068,6 +6070,10 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"Cria uma malha de contorno estática. A malha de contorno pode ter suas " +"normals viradas automaticamente.\n" +"Isso pode ser usado em vez da propriedade SpatialMaterial Grow quando o uso " +"dessa propriedade não for possÃvel." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -9645,33 +9651,27 @@ msgid "Export With Debug" msgstr "Exportar Com Depuração" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "O caminho não existe." +msgstr "O caminho especificado não existe." #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "Erro ao abrir arquivo compactado, não está no formato ZIP." +msgstr "Erro ao abrir arquivo compactado (não está em formato ZIP)." #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." -msgstr "" -"Projeto '.zip' inválido, o projeto não contém um arquivo 'project.godot'." +msgstr "Projeto '.zip' inválido; não contém um arquivo 'project.godot'." #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "Por favor, escolha uma pasta vazia." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "Por favor, escolha um arquivo 'project.godot' ou '.zip'." +msgstr "Por favor, escolha um arquivo 'project.godot' ou arquivo '.zip'." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." msgstr "O diretório já contém um projeto Godot." @@ -10371,9 +10371,8 @@ msgid "Suffix" msgstr "Sufixo" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "Expressões regulares" +msgstr "Utilize Expressões Regulares" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10412,7 +10411,6 @@ msgstr "" "Compare as opções do contador." #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" msgstr "Contador de nÃvel" @@ -10453,14 +10451,12 @@ msgid "Keep" msgstr "Manter" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" -msgstr "CamelCase para under_scored" +msgstr "PascalCase para snake_case" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" -msgstr "under_scored para CamelCase" +msgstr "snake_case para PascalCase" #: editor/rename_dialog.cpp msgid "Case" @@ -10479,14 +10475,12 @@ msgid "Reset" msgstr "Recompor" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Expressões regulares" +msgstr "Erro de Expressão Regular" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "Caracteres válidos:" +msgstr "Para caractere %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10951,9 +10945,8 @@ msgid "Invalid inherited parent name or path." msgstr "Nome ou caminho do pai herdado inválido." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "Script válido." +msgstr "O caminho/nome do script é válido." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -11044,9 +11037,8 @@ msgid "Copy Error" msgstr "Copiar Erro" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" -msgstr "Mem. de VÃdeo" +msgstr "Memória de VÃdeo" #: editor/script_editor_debugger.cpp msgid "Skip Breakpoints" diff --git a/editor/translations/pt_PT.po b/editor/translations/pt_PT.po index 8f8c1476fb..6bd8da8610 100644 --- a/editor/translations/pt_PT.po +++ b/editor/translations/pt_PT.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-01-27 07:10+0000\n" +"PO-Revision-Date: 2020-02-18 15:09+0000\n" "Last-Translator: João Lopes <linux-man@hotmail.com>\n" "Language-Team: Portuguese (Portugal) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_PT/>\n" @@ -28,7 +28,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.11-dev\n" +"X-Generator: Weblate 3.11\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -37,7 +37,7 @@ msgstr "Tipo de argumento inválido para convert(), use constantes TYPE_*." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "Esperado um string de comprimento 1 (um caráter)." +msgstr "Esperado um string de comprimento 1 (um carácter)." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -428,7 +428,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Not possible to add a new track without a root" -msgstr "Não é possÃvel adicionar nova pista sem uma raÃz" +msgstr "Não é possÃvel adicionar nova pista sem uma raiz" #: editor/animation_track_editor.cpp msgid "Invalid track for Bezier (no suitable sub-properties)" @@ -444,7 +444,7 @@ msgstr "Caminho da pista é inválido, não se consegue adicionar uma chave." #: editor/animation_track_editor.cpp msgid "Track is not of type Spatial, can't insert key" -msgstr "Pista não do tipo Spatial, impossÃvel inserir chave" +msgstr "Pista não é do tipo Spatial, não consigo inserir chave" #: editor/animation_track_editor.cpp msgid "Add Transform Track Key" @@ -456,7 +456,7 @@ msgstr "Adicionar Chave da Pista" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." -msgstr "Caminho da pista é inválido, impossÃvel adicionar uma chave método." +msgstr "Caminho da pista é inválido, não consigo adicionar uma chave método." #: editor/animation_track_editor.cpp msgid "Add Method Track Key" @@ -698,9 +698,8 @@ msgid "Line Number:" msgstr "Numero da linha:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "Substituir..." +msgstr "%d substituÃdo." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -765,7 +764,7 @@ msgstr "Números de Linha e Coluna." #: editor/connections_dialog.cpp msgid "Method in target node must be specified." -msgstr "Método no Nó alvo deve ser especificado." +msgstr "Método no nó alvo deve ser especificado." #: editor/connections_dialog.cpp msgid "" @@ -773,7 +772,7 @@ msgid "" "target node." msgstr "" "Método alvo não encontrado. Especifique um método válido ou anexe um script " -"ao Nó de destino." +"ao nó de destino." #: editor/connections_dialog.cpp msgid "Connect to Node:" @@ -789,7 +788,7 @@ msgstr "Do Sinal:" #: editor/connections_dialog.cpp msgid "Scene does not contain any script." -msgstr "A Cena não contém qualquer script." +msgstr "A cena não contém qualquer script." #: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp @@ -845,7 +844,7 @@ msgstr "Desconecta o sinal após a primeira emissão." #: editor/connections_dialog.cpp msgid "Cannot connect signal" -msgstr "ImpossÃvel conectar sinal" +msgstr "Não consigo conectar sinal" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/export_template_manager.cpp editor/groups_editor.cpp @@ -977,7 +976,7 @@ msgid "" "Scene '%s' is currently being edited.\n" "Changes will only take effect when reloaded." msgstr "" -"A Cena '%s' está a ser editada.\n" +"A cena '%s' está a ser editada.\n" "As alterações só terão efeito quando recarregar." #: editor/dependency_editor.cpp @@ -1048,7 +1047,7 @@ msgstr "" #: editor/dependency_editor.cpp msgid "Cannot remove:" -msgstr "ImpossÃvel remover:" +msgstr "Não consigo remover:" #: editor/dependency_editor.cpp msgid "Error loading:" @@ -1208,7 +1207,7 @@ msgstr "%s (Já Existe)" #: editor/editor_asset_installer.cpp msgid "Uncompressing Assets" -msgstr "A descompactar Ativos" +msgstr "A Descomprimir Ativos" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -1416,7 +1415,7 @@ msgstr "Nome inválido." #: editor/editor_autoload_settings.cpp msgid "Valid characters:" -msgstr "Carateres válidos:" +msgstr "Caracteres válidos:" #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing engine class name." @@ -1502,7 +1501,7 @@ msgstr "Instância única" #: editor/editor_data.cpp msgid "Updating Scene" -msgstr "Atualizando a Cena" +msgstr "A atualizar Cena" #: editor/editor_data.cpp msgid "Storing local changes..." @@ -1510,7 +1509,7 @@ msgstr "Armazenando alterações locais..." #: editor/editor_data.cpp msgid "Updating scene..." -msgstr "Atualizando a Cena..." +msgstr "A atualizar cena..." #: editor/editor_data.cpp editor/editor_properties.cpp msgid "[empty]" @@ -1544,7 +1543,7 @@ msgstr "Nome:" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp msgid "Could not create folder." -msgstr "Não foi possÃvel criar pasta." +msgstr "Não consegui criar pasta." #: editor/editor_dir_dialog.cpp msgid "Choose" @@ -1633,7 +1632,7 @@ msgstr "Importar Doca" #: editor/editor_feature_profile.cpp msgid "Node Dock" -msgstr "Nó Doca" +msgstr "Doca de Nó" #: editor/editor_feature_profile.cpp msgid "FileSystem and Import Docks" @@ -2185,7 +2184,7 @@ msgstr "Guardar Recurso Como..." #: editor/editor_node.cpp msgid "Can't open file for writing:" -msgstr "ImpossÃvel abrir o Ficheiro para escrita:" +msgstr "Não consigo abrir o ficheiro para escrita:" #: editor/editor_node.cpp msgid "Requested file format unknown:" @@ -2197,7 +2196,7 @@ msgstr "Erro ao guardar." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Can't open '%s'. The file could have been moved or deleted." -msgstr "ImpossÃvel abrir '%s'. O ficheiro pode ter sido movido ou apagado." +msgstr "Não consigo abrir '%s'. O ficheiro pode ter sido movido ou apagado." #: editor/editor_node.cpp msgid "Error while parsing '%s'." @@ -2217,7 +2216,7 @@ msgstr "Erro ao carregar '%s'." #: editor/editor_node.cpp msgid "Saving Scene" -msgstr "A guardar a Cena" +msgstr "A guardar Cena" #: editor/editor_node.cpp msgid "Analyzing" @@ -2245,7 +2244,7 @@ msgid "" "Couldn't save scene. Likely dependencies (instances or inheritance) couldn't " "be satisfied." msgstr "" -"ImpossÃvel guardar Cena. Provavelmente, as dependências (instâncias ou " +"Não consigo guardar cena. Provavelmente, as dependências (instâncias ou " "heranças) não puderam ser satisfeitas." #: editor/editor_node.cpp editor/scene_tree_dock.cpp @@ -2254,7 +2253,7 @@ msgstr "Não se consegue sobrescrever cena ainda aberta!" #: editor/editor_node.cpp msgid "Can't load MeshLibrary for merging!" -msgstr "ImpossÃvel carregar MeshLibrary para fundir!" +msgstr "Não consigo carregar MeshLibrary para combinar!" #: editor/editor_node.cpp msgid "Error saving MeshLibrary!" @@ -2262,7 +2261,7 @@ msgstr "Erro ao guardar MeshLibrary!" #: editor/editor_node.cpp msgid "Can't load TileSet for merging!" -msgstr "ImpossÃvel carregar TileSet para fundir!" +msgstr "Não consigo carregar TileSet para combinar!" #: editor/editor_node.cpp msgid "Error saving TileSet!" @@ -2290,9 +2289,8 @@ msgid "" "Please read the documentation relevant to importing scenes to better " "understand this workflow." msgstr "" -"Este recurso pertence a uma Cena que foi importado, portanto, não é " -"editável.\n" -"Por favor, leia a documentação relevante sobre importação de Cenas, para um " +"Este recurso pertence a uma cena que foi importado, não sendo editável.\n" +"Por favor, leia a documentação relevante sobre importação de cenas, para um " "melhor entendimento deste fluxo de trabalho." #: editor/editor_node.cpp @@ -2337,15 +2335,15 @@ msgstr "" #: editor/editor_node.cpp msgid "There is no defined scene to run." -msgstr "Não existe nenhuma Cena definida para executar." +msgstr "Não existe cena definida para execução." #: editor/editor_node.cpp msgid "Current scene was never saved, please save it prior to running." -msgstr "A Cena atual nunca foi guardada, por favor guarde-a antes de executar." +msgstr "A cena atual nunca foi guardada, por favor guarde-a antes de executar." #: editor/editor_node.cpp msgid "Could not start subprocess!" -msgstr "Não foi possÃvel iniciar o subprocesso!" +msgstr "Não consegui iniciar o subprocesso!" #: editor/editor_node.cpp editor/filesystem_dock.cpp msgid "Open Scene" @@ -2361,7 +2359,7 @@ msgstr "Abertura rápida..." #: editor/editor_node.cpp msgid "Quick Open Scene..." -msgstr "Abrir Cena de forma rápida..." +msgstr "Abrir Cena Rapidamente..." #: editor/editor_node.cpp msgid "Quick Open Script..." @@ -2381,11 +2379,11 @@ msgstr "Guardado(s) %s recurso(s) modificado(s)." #: editor/editor_node.cpp msgid "A root node is required to save the scene." -msgstr "É necessário um Nó Raiz para guardar a cena." +msgstr "É necessário um nó raiz para guardar a cena." #: editor/editor_node.cpp msgid "Save Scene As..." -msgstr "Guardar Cena como..." +msgstr "Guardar Cena Como..." #: editor/editor_node.cpp msgid "No" @@ -2397,11 +2395,11 @@ msgstr "Sim" #: editor/editor_node.cpp msgid "This scene has never been saved. Save before running?" -msgstr "Esta Cena nunca foi guardada. Guardar antes de executar?" +msgstr "Esta cena nunca foi guardada. Guardar antes de executar?" #: editor/editor_node.cpp editor/scene_tree_dock.cpp msgid "This operation can't be done without a scene." -msgstr "Esta operação não pode ser efetuada sem uma Cena." +msgstr "Esta operação não pode ser efetuada sem uma cena." #: editor/editor_node.cpp msgid "Export Mesh Library" @@ -2409,7 +2407,7 @@ msgstr "Exportar Biblioteca de Malhas" #: editor/editor_node.cpp msgid "This operation can't be done without a root node." -msgstr "Esta operação não pode ser efetuada sem um Nó raiz." +msgstr "Esta operação não pode ser efetuada sem um nó raiz." #: editor/editor_node.cpp msgid "Export Tile Set" @@ -2417,15 +2415,15 @@ msgstr "Exportar conjunto de Tiles" #: editor/editor_node.cpp msgid "This operation can't be done without a selected node." -msgstr "Esta operação não pode ser efetuada sem um Nó selecionado." +msgstr "Esta operação não pode ser efetuada sem um nó selecionado." #: editor/editor_node.cpp msgid "Current scene not saved. Open anyway?" -msgstr "A Cena atual não foi guardada. Abrir na mesma?" +msgstr "A cena atual não foi guardada. Abrir na mesma?" #: editor/editor_node.cpp msgid "Can't reload a scene that was never saved." -msgstr "ImpossÃvel recarregar uma Cena que nunca foi guardada." +msgstr "Não consigo recarregar uma cena que nunca foi guardada." #: editor/editor_node.cpp msgid "Revert" @@ -2437,7 +2435,7 @@ msgstr "Esta acção não pode ser desfeita. Reverter na mesma?" #: editor/editor_node.cpp msgid "Quick Run Scene..." -msgstr "Executar Cena de forma rápida..." +msgstr "Executar Cena Rapidamente..." #: editor/editor_node.cpp msgid "Quit" @@ -2457,12 +2455,12 @@ msgstr "Guardar & Sair" #: editor/editor_node.cpp msgid "Save changes to the following scene(s) before quitting?" -msgstr "Guardar alterações da(s) seguinte(s) Cena(s) antes de sair?" +msgstr "Guardar alterações da(s) seguinte(s) cena(s) antes de sair?" #: editor/editor_node.cpp msgid "Save changes the following scene(s) before opening Project Manager?" msgstr "" -"Guardar alterações da(s) seguinte(s) Cena(s) antes de abrir o Gestor de " +"Guardar alterações da(s) seguinte(s) cena(s) antes de abrir o Gestor de " "Projeto?" #: editor/editor_node.cpp @@ -2524,19 +2522,19 @@ msgid "" "To make changes to it, a new inherited scene can be created." msgstr "" "Cena '%s' foi importada automaticamente, não podendo ser alterada.\n" -"Para fazer alterações, pode ser criada uma nova Cena herdada." +"Para fazer alterações, pode ser criada uma nova cena herdada." #: editor/editor_node.cpp msgid "" "Error loading scene, it must be inside the project path. Use 'Import' to " "open the scene, then save it inside the project path." msgstr "" -"Erro ao carregar a Cena, tem de estar no Caminho do Projeto. Use 'Importar' " -"para abrir a Cena, e guarde-a dentro do Caminho do Projeto." +"Erro ao carregar cena, tem de estar no caminho do projeto. Use 'Importar' " +"para abrir a cena, e guarde-a dentro do caminho do projeto." #: editor/editor_node.cpp msgid "Scene '%s' has broken dependencies:" -msgstr "A Cena '%s' tem dependências não satisfeitas:" +msgstr "Cena '%s' tem dependências não satisfeitas:" #: editor/editor_node.cpp msgid "Clear Recent Scenes" @@ -2548,7 +2546,7 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" -"Não foi definida nenhuma Cena principal. Selecionar uma?\n" +"Não foi definida nenhuma cena principal. Selecionar uma?\n" "Poderá alterá-la depois nas \"Definições do Projeto\", na categoria " "'aplicação'." @@ -2558,8 +2556,8 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" -"A Cena selecionada '%s' não existe, selecionar uma válida?\n" -"Poderá alterá-la depois em \"Configurações de Projeto\", na categoria de " +"A cena selecionada '%s' não existe, selecionar uma válida?\n" +"Poderá alterá-la depois em \"Configurações de Projeto\", na categoria " "'aplicação'." #: editor/editor_node.cpp @@ -2568,7 +2566,7 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" -"A Cena selecionada '%s' não é um Ficheiro de Cena, selecione um Ficheiro " +"A cena selecionada '%s' não é um ficheiro de cena, selecione um ficheiro " "válido?\n" "Poderá alterá-la depois em \"Configurações de Projeto\", na categoria " "'aplicação'." @@ -2593,7 +2591,7 @@ msgstr "Mostrar no Sistema de Ficheiros" #: editor/editor_node.cpp msgid "Play This Scene" -msgstr "Executar esta Cena" +msgstr "Executar Esta Cena" #: editor/editor_node.cpp msgid "Close Tab" @@ -2617,7 +2615,7 @@ msgstr "Fechar Todos os Separadores" #: editor/editor_node.cpp msgid "Switch Scene Tab" -msgstr "Trocar Tab de Cena" +msgstr "Trocar Aba de Cena" #: editor/editor_node.cpp msgid "%d more files or folders" @@ -2645,7 +2643,7 @@ msgstr "Alternar modo livre de distrações." #: editor/editor_node.cpp msgid "Add a new scene." -msgstr "Adicionar nova Cena." +msgstr "Adicionar nova cena." #: editor/editor_node.cpp msgid "Scene" @@ -2653,7 +2651,7 @@ msgstr "Cena" #: editor/editor_node.cpp msgid "Go to previously opened scene." -msgstr "Ir para Cena aberta anteriormente." +msgstr "Ir para cena aberta anteriormente." #: editor/editor_node.cpp msgid "Copy Text" @@ -2673,7 +2671,7 @@ msgstr "Filtrar Ficheiro..." #: editor/editor_node.cpp msgid "Operations with scene files." -msgstr "Operações com Ficheiros de Cena." +msgstr "Operações com ficheiros de cena." #: editor/editor_node.cpp msgid "New Scene" @@ -2727,7 +2725,7 @@ msgstr "Reverter Cena" #: editor/editor_node.cpp msgid "Miscellaneous project or scene-wide tools." -msgstr "Ferramentas diversas de Projeto ou Cena." +msgstr "Ferramentas diversas de projeto ou cena." #: editor/editor_node.cpp editor/project_manager.cpp #: editor/script_create_dialog.cpp @@ -2819,7 +2817,7 @@ msgid "" "Collision shapes and raycast nodes (for 2D and 3D) will be visible on the " "running game if this option is turned on." msgstr "" -"Com esta opção ativa, formas de colisão e Nós raycast (para 2D e 3D) serão " +"Com esta opção ativa, formas de colisão e nós raycast (para 2D e 3D) serão " "visÃveis no jogo em execução." #: editor/editor_node.cpp @@ -2844,10 +2842,10 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" -"Com esta opção ativa, alterações da Cena no Editor serão replicadas no jogo " +"Com esta opção ativa, alterações da cena no editor serão replicadas no jogo " "em execução.\n" -"Quando usada num dispositivo remoto, é mais eficiente com um Sistema de " -"Ficheiros em rede." +"Quando usada num dispositivo remoto, é mais eficiente com um sistema de " +"ficheiros em rede." #: editor/editor_node.cpp msgid "Sync Script Changes" @@ -2962,11 +2960,11 @@ msgstr "Pausar a execução da cena para depuração." #: editor/editor_node.cpp msgid "Pause Scene" -msgstr "Pausar a Cena" +msgstr "Pausar Cena" #: editor/editor_node.cpp msgid "Stop the scene." -msgstr "Para a Cena." +msgstr "Para a cena." #: editor/editor_node.cpp msgid "Play the edited scene." @@ -2974,11 +2972,11 @@ msgstr "Executa a cena editada." #: editor/editor_node.cpp msgid "Play Scene" -msgstr "Executar a Cena" +msgstr "Executar Cena" #: editor/editor_node.cpp msgid "Play custom scene" -msgstr "Executa a cena personalizada" +msgstr "Executa cena personalizada" #: editor/editor_node.cpp msgid "Play Custom Scene" @@ -3081,7 +3079,7 @@ msgstr "Exportar Biblioteca" #: editor/editor_node.cpp msgid "Merge With Existing" -msgstr "Fundir com o Existente" +msgstr "Combinar com o Existente" #: editor/editor_node.cpp msgid "Open & Run a Script" @@ -3266,7 +3264,7 @@ msgstr "" "Não se consegue criar Textura Viewport neste recurso porque não está " "definido na cena como local.\n" "Ative a sua propriedade 'local to scene' (e em todos os recursos que o " -"contêm até a um Nó)." +"contêm até a um nó)." #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Pick a Viewport" @@ -3349,11 +3347,11 @@ msgstr "Escreva a sua lógica no Método _run()." #: editor/editor_run_script.cpp msgid "There is an edited scene already." -msgstr "Já existe uma Cena editada." +msgstr "Já existe uma cena editada." #: editor/editor_run_script.cpp msgid "Couldn't instance script:" -msgstr "Não foi possÃvel instanciar o Script:" +msgstr "Não consegui instanciar o script:" #: editor/editor_run_script.cpp msgid "Did you forget the 'tool' keyword?" @@ -3361,7 +3359,7 @@ msgstr "Esqueceu-se da palavra chave 'tool'?" #: editor/editor_run_script.cpp msgid "Couldn't run script:" -msgstr "Não foi possÃvel executar o Script:" +msgstr "Não consegui executar o script:" #: editor/editor_run_script.cpp msgid "Did you forget the '_run' method?" @@ -3369,7 +3367,7 @@ msgstr "Esqueceu-se do médodo '_run'?" #: editor/editor_sub_scene.cpp msgid "Select Node(s) to Import" -msgstr "Selecionar Nó(s) para importar" +msgstr "Selecionar Nó(s) para Importar" #: editor/editor_sub_scene.cpp editor/project_manager.cpp msgid "Browse" @@ -3424,7 +3422,7 @@ msgstr "Remover versão '%s' do Modelo?" #: editor/export_template_manager.cpp msgid "Can't open export templates zip." -msgstr "ImpossÃvel abrir o zip de Modelos." +msgstr "Não consigo abrir zip de modelos de exportação." #: editor/export_template_manager.cpp msgid "Invalid version.txt format inside templates: %s." @@ -3466,12 +3464,12 @@ msgstr "" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't resolve." -msgstr "ImpossÃvel resolver." +msgstr "Não consigo resolver." #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't connect." -msgstr "ImpossÃvel conectar." +msgstr "Não consigo conectar." #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp @@ -3497,7 +3495,7 @@ msgstr "Download Completo." #: editor/export_template_manager.cpp msgid "Cannot remove temporary file:" -msgstr "ImpossÃvel remover ficheiro temporário:" +msgstr "Não consigo remover ficheiro temporário:" #: editor/export_template_manager.cpp msgid "" @@ -3525,7 +3523,7 @@ msgstr "A resolver" #: editor/export_template_manager.cpp msgid "Can't Resolve" -msgstr "ImpossÃvel resolver" +msgstr "Não consigo Resolver" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp @@ -3534,7 +3532,7 @@ msgstr "A ligar..." #: editor/export_template_manager.cpp msgid "Can't Connect" -msgstr "ImpossÃvel conetar" +msgstr "Não consigo Conectar" #: editor/export_template_manager.cpp msgid "Connected" @@ -3609,7 +3607,7 @@ msgstr "" #: editor/filesystem_dock.cpp msgid "Cannot move/rename resources root." -msgstr "Não foi possÃvel mover/renomear raÃz dos recursos." +msgstr "Não consegui mover/renomear raiz dos recursos." #: editor/filesystem_dock.cpp msgid "Cannot move a folder into itself." @@ -3633,7 +3631,7 @@ msgstr "Nome não fornecido." #: editor/filesystem_dock.cpp msgid "Provided name contains invalid characters." -msgstr "O nome fornecido contém carateres inválidos." +msgstr "O nome fornecido contém caracteres inválidos." #: editor/filesystem_dock.cpp msgid "A file or folder with this name already exists." @@ -3641,7 +3639,7 @@ msgstr "Um Ficheiro ou diretoria já existe com este nome." #: editor/filesystem_dock.cpp msgid "Name contains invalid characters." -msgstr "O nome contém carateres inválidos." +msgstr "O nome contém caracteres inválidos." #: editor/filesystem_dock.cpp msgid "Renaming file:" @@ -3872,7 +3870,7 @@ msgstr "Nós fora do Grupo" #: editor/groups_editor.cpp editor/scene_tree_dock.cpp #: editor/scene_tree_editor.cpp msgid "Filter nodes" -msgstr "Filtrar Nós" +msgstr "Filtrar nós" #: editor/groups_editor.cpp msgid "Nodes in Group" @@ -3892,7 +3890,7 @@ msgstr "Gerir Grupos" #: editor/import/resource_importer_scene.cpp msgid "Import as Single Scene" -msgstr "Importar como Cena única" +msgstr "Importar como Cena Única" #: editor/import/resource_importer_scene.cpp msgid "Import with Separate Animations" @@ -3928,7 +3926,7 @@ msgstr "Importar como Cenas Múltiplas" #: editor/import/resource_importer_scene.cpp msgid "Import as Multiple Scenes+Materials" -msgstr "Importar como Cenas e Materiais Múltiplos" +msgstr "Importar como Cenas Múltiplas + Materiais" #: editor/import/resource_importer_scene.cpp #: editor/plugins/mesh_library_editor_plugin.cpp @@ -3968,6 +3966,10 @@ msgid "Saving..." msgstr "A guardar..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Ficheiros" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Definir como Padrão para '%s'" @@ -3976,10 +3978,6 @@ msgid "Clear Default for '%s'" msgstr "Limpar Padrão para '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Ficheiros" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importar Como:" @@ -4089,7 +4087,7 @@ msgstr "As alterações podem ser perdidas!" #: editor/multi_node_edit.cpp msgid "MultiNode Set" -msgstr "Conjunto MultiNode" +msgstr "Conjunto MultiNó" #: editor/node_dock.cpp msgid "Select a single node to edit its signals and groups." @@ -4527,7 +4525,7 @@ msgstr "Posição da Animação (em segundos)." #: editor/plugins/animation_player_editor_plugin.cpp msgid "Scale animation playback globally for the node." -msgstr "Escalar globalmente a reprodução da Animação para o Nó." +msgstr "Escalar globalmente a reprodução da animação para o nó." #: editor/plugins/animation_player_editor_plugin.cpp msgid "Animation Tools" @@ -4671,7 +4669,7 @@ msgstr "Viagem" #: editor/plugins/animation_state_machine_editor.cpp msgid "Start and end nodes are needed for a sub-transition." -msgstr "Nodos de inÃcio e fim são necessários para uma sub-transição." +msgstr "Nós de inÃcio e fim são necessários para uma sub-transição." #: editor/plugins/animation_state_machine_editor.cpp msgid "No playback resource set at path: %s." @@ -4863,7 +4861,7 @@ msgstr "Importar Animações..." #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Edit Node Filters" -msgstr "Editar filtros de Nó" +msgstr "Editar Filtros de Nó" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Filters..." @@ -4883,7 +4881,7 @@ msgstr "Erro de ligação, tente novamente." #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't connect to host:" -msgstr "ImpossÃvel ligar ao host:" +msgstr "Não consigo ligar ao host:" #: editor/plugins/asset_library_editor_plugin.cpp msgid "No response from host:" @@ -4891,7 +4889,7 @@ msgstr "Sem resposta do host:" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't resolve hostname:" -msgstr "ImpossÃvel resolver hostname:" +msgstr "Não consigo resolver hostname:" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Request failed, return code:" @@ -4903,7 +4901,7 @@ msgstr "Pedido falhado." #: editor/plugins/asset_library_editor_plugin.cpp msgid "Cannot save response to:" -msgstr "ImpossÃvel guardar resposta para:" +msgstr "Não consigo guardar resposta para:" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Write error." @@ -5076,8 +5074,8 @@ msgid "" "Save your scene (for images to be saved in the same dir), or pick a save " "path from the BakedLightmap properties." msgstr "" -"ImpossÃvel determinar um caminho para guardar imagens lightmap.\n" -"Guarde a sua Cena (para as imagens serem guardadas na mesma diretoria), ou " +"Não consigo determinar um caminho para guardar imagens lightmap.\n" +"Guarde a sua cena (para as imagens serem guardadas na mesma diretoria), ou " "escolha um caminho nas propriedades BakedLightmap." #: editor/plugins/baked_lightmap_editor_plugin.cpp @@ -5195,7 +5193,7 @@ msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Presets for the anchors and margins values of a Control node." -msgstr "Pré-definições para âncoras e margens de um Nó Control." +msgstr "Pré-definições para âncoras e margens de um nó Control." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "" @@ -5491,7 +5489,7 @@ msgstr "Ajustar à s Guias" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Lock the selected object in place (can't be moved)." -msgstr "Bloquear a posição do Objeto selecionado (não pode ser movido)." +msgstr "Bloquear a posição do objeto selecionado (não pode ser movido)." #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5640,7 +5638,7 @@ msgstr "A adicionar %s..." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Cannot instantiate multiple nodes without root." -msgstr "ImpossÃvel instanciar nós múltiplos sem raiz." +msgstr "Não consigo instanciar nós múltiplos sem raiz." #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -5650,7 +5648,7 @@ msgstr "Criar Nó" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "Error instancing scene from %s" -msgstr "Erro a instanciar Cena de %s" +msgstr "Erro a instanciar cena de %s" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Change Default Type" @@ -5661,8 +5659,8 @@ msgid "" "Drag & drop + Shift : Add node as sibling\n" "Drag & drop + Alt : Change node type" msgstr "" -"Arrastar & largar + Shift : Adiciona Nó como irmão\n" -"Arrastar & largar + Alt : Altera o tipo de Nó" +"Arrastar & largar + Shift : Adiciona nó como irmão\n" +"Arrastar & largar + Alt : Altera o tipo de nó" #: editor/plugins/collision_polygon_editor_plugin.cpp msgid "Create Polygon3D" @@ -5849,9 +5847,8 @@ msgid "Mesh is empty!" msgstr "A Malha está vazia!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Criar irmão de colisão Trimesh" +msgstr "Não consegui criar uma forma de colisão Trimesh." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5859,7 +5856,7 @@ msgstr "Criar corpo estático Trimesh" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "This doesn't work on scene root!" -msgstr "Não funciona na raiz da Cena!" +msgstr "Isto não funciona na raiz da cena!" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Static Shape" @@ -5867,30 +5864,28 @@ msgstr "Criar Forma Estática Trimesh" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." -msgstr "" +msgstr "Não consigo criar uma única forma convexa para a raiz da cena." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Não consegui criar uma forma única de colisão convexa." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Criar Forma(s) Convexa(s)" +msgstr "Criar Forma Convexa Simples" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." msgstr "" +"Não consigo criar múltiplas formas de colisão convexas para a raiz da cena." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "ImpossÃvel criar pasta." +msgstr "Não consegui criar qualquer forma de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Criar Forma(s) Convexa(s)" +msgstr "Criar Múltiplas Formas Convexas" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5946,38 +5941,45 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Cria um StaticBody e atribui-lhe automaticamente uma forma de colisão " +"baseada em polÃgonos.\n" +"Esta é a mais precisa (mas mais lenta) opção para deteção de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" -msgstr "Criar irmão de colisão Trimesh" +msgstr "Criar Irmão de Colisão Trimesh" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Cria uma forma de colisão baseada em polÃgonos.\n" +"Esta é a mais precisa (mas mais lenta) opção para deteção de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "Criar Irmão(s) de Colisão Convexa" +msgstr "Criar Irmãos Únicos de Colisão Convexa" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"Cria uma única forma de colisão convexa.\n" +"Esta é a mais rápida (mas menos precisa) opção para deteção de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "Criar Irmão(s) de Colisão Convexa" +msgstr "Criar Vários Irmãos de Colisão Convexa" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"Cria uma forma de colisão baseada em polÃgonos.\n" +"Esta uma opção de desempenho intermédio entre as duas opções acima." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -5990,6 +5992,10 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"Cria uma malha de contorno estática. A malha de contorno terá as suas " +"normais automaticamente invertidas.\n" +"Pode ser usada no lugar da propriedade Aumentar de SpatialMaterial quando " +"não é possÃvel usar essa propriedade." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -6046,11 +6052,11 @@ msgstr "Importar da Cena" #: editor/plugins/mesh_library_editor_plugin.cpp msgid "Update from Scene" -msgstr "Atualizar da Cena" +msgstr "Atualizar a partir da Cena" #: editor/plugins/multimesh_editor_plugin.cpp msgid "No mesh source specified (and no MultiMesh set in node)." -msgstr "Fonte da Malha não especificada (nem MultiMesh no Nó)." +msgstr "Fonte da Malha não especificada (nem MultiMesh no nó)." #: editor/plugins/multimesh_editor_plugin.cpp msgid "No mesh source specified (and MultiMesh contains no Mesh)." @@ -6558,7 +6564,7 @@ msgstr "Sincronizar Ossos com PolÃgono" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "ERROR: Couldn't load resource!" -msgstr "ERRO: Não foi possÃvel carregar recurso!" +msgstr "ERRO: Não consegui carregar recurso!" #: editor/plugins/resource_preloader_editor_plugin.cpp msgid "Add Resource" @@ -6628,7 +6634,7 @@ msgstr "Erro ao escrever TextFile:" #: editor/plugins/script_editor_plugin.cpp msgid "Could not load file at:" -msgstr "ImpossÃvel carregar ficheiro em:" +msgstr "Não consigo carregar ficheiro em:" #: editor/plugins/script_editor_plugin.cpp msgid "Error saving file!" @@ -6664,7 +6670,7 @@ msgstr "Guardar Ficheiro Como..." #: editor/plugins/script_editor_plugin.cpp msgid "Can't obtain the script for running." -msgstr "Não é possÃvel obter o script para executar." +msgstr "Não consigo obter o script para executar." #: editor/plugins/script_editor_plugin.cpp msgid "Script failed reloading, check console for errors." @@ -6927,7 +6933,7 @@ msgstr "Só podem ser largados recursos do Sistema de Ficheiros ." #: editor/plugins/script_text_editor.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Can't drop nodes because script '%s' is not used in this scene." -msgstr "ImpossÃvel largar nós porque o script '%s' não é usado neste cena." +msgstr "Não consigo largar nós porque o script '%s' não é usado neste cena." #: editor/plugins/script_text_editor.cpp msgid "Lookup Symbol" @@ -7100,7 +7106,7 @@ msgstr "Shader" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "This skeleton has no bones, create some children Bone2D nodes." -msgstr "Este esqueleto não tem ossos, crie alguns nós Bone2D filhos." +msgstr "Este esqueleto não tem ossos, crie alguns nós filhos Bone2D." #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Create Rest Pose from Bones" @@ -7276,7 +7282,7 @@ msgstr "Sem parente para criar instância de filho." #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "This operation requires a single selected node." -msgstr "Esta operação requer um único Nó selecionado." +msgstr "Esta operação requer um único nó selecionado." #: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" @@ -7608,7 +7614,7 @@ msgstr "Sprite está vazia!" #: editor/plugins/sprite_editor_plugin.cpp msgid "Can't convert a sprite using animation frames to mesh." -msgstr "ImpossÃvel converter sprite com frames de animação para malha." +msgstr "Não consigo converter sprite com frames de animação para malha." #: editor/plugins/sprite_editor_plugin.cpp msgid "Invalid geometry, can't replace by mesh." @@ -7620,7 +7626,7 @@ msgstr "Converter para Mesh2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Invalid geometry, can't create polygon." -msgstr "Geometria inválida, impossÃvel criar polÃgono." +msgstr "Geometria inválida, não consigo criar polÃgono." #: editor/plugins/sprite_editor_plugin.cpp msgid "Convert to Polygon2D" @@ -7628,19 +7634,19 @@ msgstr "Converter para Polygon2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Invalid geometry, can't create collision polygon." -msgstr "Geometria inválida, impossÃvel criar polÃgono de colisão." +msgstr "Geometria inválida, não consigo criar polÃgono de colisão." #: editor/plugins/sprite_editor_plugin.cpp msgid "Create CollisionPolygon2D Sibling" -msgstr "Criar irmão de CollisionPolygon2D" +msgstr "Criar Irmão de CollisionPolygon2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Invalid geometry, can't create light occluder." -msgstr "Geometria inválida, impossÃvel criar oclusor de luz." +msgstr "Geometria inválida, não consigo criar oclusor de luz." #: editor/plugins/sprite_editor_plugin.cpp msgid "Create LightOccluder2D Sibling" -msgstr "Criar irmão de LightOccluder2D" +msgstr "Criar Irmão de LightOccluder2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Sprite" @@ -8083,7 +8089,7 @@ msgstr "Criar a partir da Cena" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Merge from Scene" -msgstr "Fundir a partir da Cena" +msgstr "Combinar a partir da Cena" #: editor/plugins/tile_set_editor_plugin.cpp msgid "New Single Tile" @@ -8223,11 +8229,11 @@ msgstr "Não selecionou uma textura para remover." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create from scene? This will overwrite all current tiles." -msgstr "Criar a partir de cena? Irá substituir todos os Tiles atuais." +msgstr "Criar a partir de cena? Irá substituir todos os tiles atuais." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Merge from scene?" -msgstr "Fundir a partir da Cena?" +msgstr "Combinar a partir da cena?" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Texture" @@ -9437,7 +9443,7 @@ msgstr "Exportar todos os recursos do Projeto" #: editor/project_export.cpp msgid "Export selected scenes (and dependencies)" -msgstr "Exportar Cenas (e dependências) selecionadas" +msgstr "Exportar cenas (e dependências) selecionadas" #: editor/project_export.cpp msgid "Export selected resources (and dependencies)" @@ -9489,7 +9495,7 @@ msgstr "Personalizado (separados por vÃrgula):" #: editor/project_export.cpp msgid "Feature List:" -msgstr "Lista de caracterÃsticas:" +msgstr "Lista de CaracterÃsticas:" #: editor/project_export.cpp msgid "Script" @@ -9556,35 +9562,31 @@ msgid "Export With Debug" msgstr "Exportar com Depuração" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "O Caminho não existe." +msgstr "O caminho especificado não existe." #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "Erro ao abrir ficheiro comprimido, não está no formato ZIP." +msgstr "Erro ao abrir ficheiro comprimido (não está no formato ZIP)." #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." msgstr "" -"Ficheiro de projeto '.zip' inválido, não contém um ficheiro 'project.godot'." +"Ficheiro de projeto \".zip\" inválido, não contém um ficheiro \"project.godot" +"\"." #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "Por favor escolha uma pasta vazia." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "Escolha um ficheiro 'project.godot' ou '.zip'." +msgstr "Escolha um ficheiro \"project.godot\" ou \".zip\"." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "A pasta já contém um projeto Godot." +msgstr "Esta diretoria já contém um projeto Godot." #: editor/project_manager.cpp msgid "New Game Project" @@ -9600,7 +9602,7 @@ msgstr "Nome do Projeto Inválido." #: editor/project_manager.cpp msgid "Couldn't create folder." -msgstr "ImpossÃvel criar pasta." +msgstr "Não consigo criar pasta." #: editor/project_manager.cpp msgid "There is already a folder in this path with the specified name." @@ -9619,16 +9621,16 @@ msgid "" "Couldn't load project.godot in project path (error %d). It may be missing or " "corrupted." msgstr "" -"Não foi possÃvel carregar o project.godot no caminho do projeto (erro %d). " +"Não consegui carregar o project.godot no caminho do projeto (erro %d). " "Poderá estar em falta ou corrompido." #: editor/project_manager.cpp msgid "Couldn't edit project.godot in project path." -msgstr "ImpossÃvel editar project.godot no Caminho do Projeto." +msgstr "Não consigo editar project.godot no caminho do projeto." #: editor/project_manager.cpp msgid "Couldn't create project.godot in project path." -msgstr "ImpossÃvel criar project.godot no Caminho do Projeto." +msgstr "Não consigo criar project.godot no caminho do projeto." #: editor/project_manager.cpp msgid "Rename Project" @@ -9709,7 +9711,7 @@ msgstr "" #: editor/project_manager.cpp msgid "Renderer can be changed later, but scenes may need to be adjusted." msgstr "" -"O Renderizador pode ser alterado mais tarde, mas as cenas poderão ter de ser " +"O renderizador pode ser alterado mais tarde, mas as cenas poderão ter de ser " "ajustadas." #: editor/project_manager.cpp @@ -9726,7 +9728,7 @@ msgstr "Erro: Projeto inexistente no sistema de ficheiros." #: editor/project_manager.cpp msgid "Can't open project at '%s'." -msgstr "ImpossÃvel abrir Projeto em '%s'." +msgstr "Não consigo abrir projeto em '%s'." #: editor/project_manager.cpp msgid "Are you sure to open more than one project?" @@ -9788,8 +9790,8 @@ msgid "" "Please edit the project and set the main scene in the Project Settings under " "the \"Application\" category." msgstr "" -"ImpossÃvel executar o Projeto: Cena principal não definida.\n" -"Edite o Projeto e defina a Cena principal em Definições do Projeto dentro da " +"Não consigo executar o projeto: cena principal não definida.\n" +"Edite o projeto e defina a cena principal em Definições do Projeto dentro da " "categoria \"Aplicação\"." #: editor/project_manager.cpp @@ -9797,8 +9799,8 @@ msgid "" "Can't run project: Assets need to be imported.\n" "Please edit the project to trigger the initial import." msgstr "" -"ImpossÃvel executar o Projeto: Ativos têm de ser importados.\n" -"Edite o Projeto para desencadear a importação inicial." +"Não consigo executar o projeto: Ativos têm de ser importados.\n" +"Edite o projeto para desencadear a importação inicial." #: editor/project_manager.cpp msgid "Are you sure to run %d projects at once?" @@ -9883,7 +9885,7 @@ msgstr "Reiniciar agora" #: editor/project_manager.cpp msgid "Can't run project" -msgstr "ImpossÃvel executar o Projeto" +msgstr "Não consigo executar o Projeto" #: editor/project_manager.cpp msgid "" @@ -10282,9 +10284,8 @@ msgid "Suffix" msgstr "Sufixo" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "Expressões Regulares" +msgstr "Usar Expressões Regulares" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10296,15 +10297,15 @@ msgstr "Substituto" #: editor/rename_dialog.cpp msgid "Node name" -msgstr "Nome do Nó" +msgstr "Nome do nó" #: editor/rename_dialog.cpp msgid "Node's parent name, if available" -msgstr "Nome do parente do Nó, se disponÃvel" +msgstr "Nome do parente do nó, se disponÃvel" #: editor/rename_dialog.cpp msgid "Node type" -msgstr "Tipo de Nó" +msgstr "Tipo de nó" #: editor/rename_dialog.cpp msgid "Current scene name" @@ -10312,7 +10313,7 @@ msgstr "Nome da cena atual" #: editor/rename_dialog.cpp msgid "Root node name" -msgstr "Nome do Nó raiz" +msgstr "Nome do nó raiz" #: editor/rename_dialog.cpp msgid "" @@ -10323,7 +10324,6 @@ msgstr "" "Comparar opções do contador." #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" msgstr "Contador por nÃvel" @@ -10364,14 +10364,12 @@ msgid "Keep" msgstr "Manter" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" -msgstr "CamelCase para under_scored" +msgstr "PascalCase para snake_case" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" -msgstr "under_scored para CamelCase" +msgstr "snake_case para PascalCase" #: editor/rename_dialog.cpp msgid "Case" @@ -10390,14 +10388,12 @@ msgid "Reset" msgstr "Repor" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Expressões Regulares" +msgstr "Erro em Expressão Regular" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "Carateres válidos:" +msgstr "No carácter %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10421,35 +10417,35 @@ msgstr "Modo Execução:" #: editor/run_settings_dialog.cpp msgid "Current Scene" -msgstr "Cena atual" +msgstr "Cena Atual" #: editor/run_settings_dialog.cpp msgid "Main Scene" -msgstr "Cena principal" +msgstr "Cena Principal" #: editor/run_settings_dialog.cpp msgid "Main Scene Arguments:" -msgstr "Argumentos da Cena principal:" +msgstr "Argumentos da Cena Principal:" #: editor/run_settings_dialog.cpp msgid "Scene Run Settings" -msgstr "Configurações de execução da Cena" +msgstr "Configurações de Execução da Cena" #: editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." -msgstr "Nenhum parente para instanciar a Cena." +msgstr "Nenhum parente para instância das cenas." #: editor/scene_tree_dock.cpp msgid "Error loading scene from %s" -msgstr "Erro ao carregar a Cena de %s" +msgstr "Erro ao carregar a cena de %s" #: editor/scene_tree_dock.cpp msgid "" "Cannot instance the scene '%s' because the current scene exists within one " "of its nodes." msgstr "" -"ImpossÃvel instanciar a Cena '%s' porque a Cena atual existe dentro de um " -"dos seus Nós." +"Não consigo instanciar a cena '%s' porque a cena atual existe dentro de um " +"dos seus nós." #: editor/scene_tree_dock.cpp msgid "Instance Scene(s)" @@ -10461,7 +10457,7 @@ msgstr "Substituir com Cena-Ramo" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" -msgstr "Instanciar Cena filha" +msgstr "Instanciar Cena Filha" #: editor/scene_tree_dock.cpp msgid "Clear Script" @@ -10485,15 +10481,16 @@ msgstr "Duplicar Nó(s)" #: editor/scene_tree_dock.cpp msgid "Can't reparent nodes in inherited scenes, order of nodes can't change." -msgstr "ImpossÃvel mudar nó em cenas herdadas, a ordem dos nós não pode mudar." +msgstr "" +"Não consigo mudar nó em cenas herdadas, a ordem dos nós não pode mudar." #: editor/scene_tree_dock.cpp msgid "Node must belong to the edited scene to become root." -msgstr "O nó deve pertencer à cena editada para se tornar root." +msgstr "O nó deve pertencer à cena editada para se tornar raiz." #: editor/scene_tree_dock.cpp msgid "Instantiated scenes can't become root" -msgstr "Cenas instantâneas não se podem tornar root" +msgstr "Cenas instanciadas não se podem tornar raÃzes" #: editor/scene_tree_dock.cpp msgid "Make node as Root" @@ -10501,38 +10498,38 @@ msgstr "Tornar Nó Raiz" #: editor/scene_tree_dock.cpp msgid "Delete %d nodes?" -msgstr "Apagar %d Nós?" +msgstr "Apagar %d nós?" #: editor/scene_tree_dock.cpp msgid "Delete the root node \"%s\"?" -msgstr "Apagar Nó raiz \"%s\"?" +msgstr "Apagar nó raiz \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "Apagar Nó \"%s\" e filhos?" +msgstr "Apagar nó \"%s\" e filhos?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\"?" -msgstr "Apagar Nó \"%s\"?" +msgstr "Apagar nó \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." -msgstr "ImpossÃvel executar com o Nó raiz." +msgstr "Não consigo executar com o nó raiz." #: editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." -msgstr "Esta operação não pode ser feita numa Cena instanciada." +msgstr "Esta operação não pode ser feita numa cena instanciada." #: editor/scene_tree_dock.cpp msgid "Save New Scene As..." -msgstr "Guardar nova Cena como..." +msgstr "Guardar Nova Cena Como..." #: editor/scene_tree_dock.cpp msgid "" "Disabling \"editable_instance\" will cause all properties of the node to be " "reverted to their default." msgstr "" -"Desativar \"editable_instance\" irá reverter todas as propriedades do Nó " +"Desativar \"editable_instance\" irá reverter todas as propriedades do nó " "para os seus valores padrão." #: editor/scene_tree_dock.cpp @@ -10549,7 +10546,7 @@ msgstr "Tornar Local" #: editor/scene_tree_dock.cpp msgid "New Scene Root" -msgstr "Nova Raiz de Cena" +msgstr "Nova Raiz da Cena" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -10573,11 +10570,11 @@ msgstr "Outro Nó" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" -msgstr "ImpossÃvel operar em Nós de uma Cena externa!" +msgstr "Não consigo operar em nós de uma cena externa!" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes the current scene inherits from!" -msgstr "ImpossÃvel operar em Nós herdados pela Cena atual!" +msgstr "Não consigo operar em nós herdados pela cena atual!" #: editor/scene_tree_dock.cpp msgid "Attach Script" @@ -10596,16 +10593,16 @@ msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." msgstr "" -"ImpossÃvel guardar nova Cena. Provavelmente dependências (instâncias) não " +"Não consigo guardar nova cena. Provavelmente dependências (instâncias) não " "foram satisfeitas." #: editor/scene_tree_dock.cpp msgid "Error saving scene." -msgstr "Erro ao guardar Cena." +msgstr "Erro ao guardar cena." #: editor/scene_tree_dock.cpp msgid "Error duplicating scene to save it." -msgstr "Erro ao duplicar Cena para guardar." +msgstr "Erro ao duplicar cena para guardar." #: editor/scene_tree_dock.cpp msgid "Sub-Resources" @@ -10629,7 +10626,7 @@ msgstr "Abrir documentação" #: editor/scene_tree_dock.cpp msgid "Add Child Node" -msgstr "Adicionar Nó filho" +msgstr "Adicionar Nó Filho" #: editor/scene_tree_dock.cpp msgid "Expand/Collapse All" @@ -10645,15 +10642,15 @@ msgstr "Recolocar o Novo Nó" #: editor/scene_tree_dock.cpp msgid "Make Scene Root" -msgstr "Tornar Nó Raiz" +msgstr "Tornar Raiz da Cena" #: editor/scene_tree_dock.cpp msgid "Merge From Scene" -msgstr "Fundir a partir da Cena" +msgstr "Combinar a partir da Cena" #: editor/scene_tree_dock.cpp editor/script_editor_debugger.cpp msgid "Save Branch as Scene" -msgstr "Guardar ramo como Cena" +msgstr "Guardar Ramo como Cena" #: editor/scene_tree_dock.cpp editor/script_editor_debugger.cpp msgid "Copy Node Path" @@ -10672,16 +10669,16 @@ msgid "" "Instance a scene file as a Node. Creates an inherited scene if no root node " "exists." msgstr "" -"Instanciar Ficheiro de Cena como Nó. Cria uma Cena herdada se não existir Nó " -"raiz." +"Instanciar um ficheiro de cena como um Nó. Cria uma cena herdada se não " +"existir nó raiz." #: editor/scene_tree_dock.cpp msgid "Attach a new or existing script for the selected node." -msgstr "Anexar Script novo ou existente ao Nó selecionado." +msgstr "Anexar script novo ou existente ao nó selecionado." #: editor/scene_tree_dock.cpp msgid "Clear a script for the selected node." -msgstr "Limpar Script do Nó selecionado." +msgstr "Limpar script do nó selecionado." #: editor/scene_tree_dock.cpp msgid "Remote" @@ -10713,7 +10710,7 @@ msgstr "(A Ligar de)" #: editor/scene_tree_editor.cpp msgid "Node configuration warning:" -msgstr "Aviso de configuração do Nó:" +msgstr "Aviso de configuração do nó:" #: editor/scene_tree_editor.cpp msgid "" @@ -10773,7 +10770,7 @@ msgstr "" #: editor/scene_tree_editor.cpp msgid "Invalid node name, the following characters are not allowed:" -msgstr "Nome de Nó inválido, os carateres seguintes não são permitidos:" +msgstr "Nome de nó inválido, os caracteres seguintes não são permitidos:" #: editor/scene_tree_editor.cpp msgid "Rename Node" @@ -10785,7 +10782,7 @@ msgstr "Ãrvore de Cena (Nós):" #: editor/scene_tree_editor.cpp msgid "Node Configuration Warning!" -msgstr "Aviso de configuração de Nó!" +msgstr "Aviso de Configuração de Nó!" #: editor/scene_tree_editor.cpp msgid "Select a Node" @@ -10825,7 +10822,7 @@ msgstr "Erro ao carregar Modelo '%s'" #: editor/script_create_dialog.cpp msgid "Error - Could not create script in filesystem." -msgstr "Erro - ImpossÃvel criar Script no Sistema de Ficheiros." +msgstr "Erro - Não consigo criar script no sistema de ficheiros." #: editor/script_create_dialog.cpp msgid "Error loading script from %s" @@ -10860,9 +10857,8 @@ msgid "Invalid inherited parent name or path." msgstr "Nome ou Caminho de parente herdado inválido." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "Script é válido." +msgstr "Caminho/nome de Script é válido." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -10953,7 +10949,6 @@ msgid "Copy Error" msgstr "Copiar Erro" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" msgstr "Memória VÃdeo" @@ -11035,7 +11030,7 @@ msgstr "Tipo de controlo clicado:" #: editor/script_editor_debugger.cpp msgid "Live Edit Root:" -msgstr "Raiz de edição ao vivo:" +msgstr "Raiz de Edição ao Vivo:" #: editor/script_editor_debugger.cpp msgid "Set From Tree" @@ -11220,8 +11215,8 @@ msgstr "Formato de dicionário de instância inválido (falta @path)" #: modules/gdscript/gdscript_functions.cpp msgid "Invalid instance dictionary format (can't load script at @path)" msgstr "" -"Formato de dicionário de instância inválido (não foi possÃvel carregar o " -"Script em @path)" +"Formato de dicionário de instância inválido (não consigo carregar o script " +"em @path)" #: modules/gdscript/gdscript_functions.cpp msgid "Invalid instance dictionary format (invalid script at @path)" @@ -11436,7 +11431,7 @@ msgid "" "A node yielded without working memory, please read the docs on how to yield " "properly!" msgstr "" -"Um Nó fez yield sem memória para usar, por favor leia os documentos para " +"Um nó fez yield sem memória para usar, por favor leia os documentos para " "saber como fazer yield corretamente!" #: modules/visual_script/visual_script.cpp @@ -11444,7 +11439,7 @@ msgid "" "Node yielded, but did not return a function state in the first working " "memory." msgstr "" -"O Nó fez yield, mas não retornou um estado de Função na primeira memória de " +"O nó fez yield, mas não retornou um estado de função na primeira memória de " "trabalho." #: modules/visual_script/visual_script.cpp @@ -11453,15 +11448,15 @@ msgid "" "your node please." msgstr "" "O valor de retorno deve ser atribuÃdo ao primeiro elemento da memória de " -"trabalho de Nós! Corrija o seu Nó por favor." +"trabalho de nós! Corrija o seu nó por favor." #: modules/visual_script/visual_script.cpp msgid "Node returned an invalid sequence output: " -msgstr "O Nó retornou uma sequência de saÃda (output) incorreta: " +msgstr "O nó retornou uma sequência de saÃda (output) incorreta: " #: modules/visual_script/visual_script.cpp msgid "Found sequence bit but not the node in the stack, report bug!" -msgstr "Foi encontrada o bit da sequência mas não o Nó na pilha, relate o bug!" +msgstr "Foi encontrada o bit da sequência mas não o nó na pilha, relate o bug!" #: modules/visual_script/visual_script.cpp msgid "Stack overflow with stack depth: " @@ -11589,11 +11584,11 @@ msgstr "" #: modules/visual_script/visual_script_editor.cpp msgid "Hold %s to drop a simple reference to the node." -msgstr "Pressione %s para largar uma referência simples no Nó." +msgstr "Pressione %s para largar uma referência simples no nó." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a simple reference to the node." -msgstr "Pressione Ctrl para largar uma referência simples no Nó." +msgstr "Pressione Ctrl para largar uma referência simples no nó." #: modules/visual_script/visual_script_editor.cpp msgid "Hold %s to drop a Variable Setter." @@ -11601,7 +11596,7 @@ msgstr "Pressione %s para largar um Setter variável." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Variable Setter." -msgstr "Pressione Ctrl para largar um Setter variável." +msgstr "Pressione Ctrl para largar um Setter Variável." #: modules/visual_script/visual_script_editor.cpp msgid "Add Preload Node" @@ -11609,14 +11604,15 @@ msgstr "Adicionar Nó de Pré-carregamento" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" -msgstr "Adicionar Nó da Ãrvore" +msgstr "Adicionar Nó(s) da Ãrvore" #: modules/visual_script/visual_script_editor.cpp msgid "" "Can't drop properties because script '%s' is not used in this scene.\n" "Drop holding 'Shift' to just copy the signature." msgstr "" -"ImpossÃvel largar propriedades porque o script '%s' não é usado neste cena.\n" +"Não consigo largar propriedades porque o script '%s' não é usado neste " +"cena.\n" "Largue com 'Shift' para copiar apenas a assinatura." #: modules/visual_script/visual_script_editor.cpp @@ -11649,11 +11645,11 @@ msgstr "Desconectar Nós" #: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Data" -msgstr "Conectar Dados de Nó" +msgstr "Conectar Dados do Nó" #: modules/visual_script/visual_script_editor.cpp msgid "Connect Node Sequence" -msgstr "Conectar Sequência de Nós" +msgstr "Conectar Sequência do Nó" #: modules/visual_script/visual_script_editor.cpp msgid "Script already has function '%s'" @@ -11669,7 +11665,7 @@ msgstr "Redimensionar Comentário" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." -msgstr "ImpossÃvel copiar o Nó Função." +msgstr "Não consigo copiar o nó função." #: modules/visual_script/visual_script_editor.cpp msgid "Clipboard is empty!" @@ -11681,11 +11677,11 @@ msgstr "Colar Nós VisualScript" #: modules/visual_script/visual_script_editor.cpp msgid "Can't create function with a function node." -msgstr "ImpossÃvel criar função com um nó função." +msgstr "Não consigo criar função com um nó função." #: modules/visual_script/visual_script_editor.cpp msgid "Can't create function of nodes from nodes of multiple functions." -msgstr "ImpossÃvel criar função de nós com nós de várias funções." +msgstr "Não consigo criar função de nós a partir de nós de várias funções." #: modules/visual_script/visual_script_editor.cpp msgid "Select at least one node with sequence port." @@ -11801,7 +11797,7 @@ msgstr "Caminho não conduz Nó!" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name '%s' in node %s." -msgstr "Nome de Propriedade Ãndice '%s' inválido em Nó %s." +msgstr "Nome de propriedade Ãndice '%s' inválido no nó %s." #: modules/visual_script/visual_script_nodes.cpp msgid ": Invalid argument of type: " @@ -11821,15 +11817,16 @@ msgstr "VariableSet não encontrado no script: " #: modules/visual_script/visual_script_nodes.cpp msgid "Custom node has no _step() method, can't process graph." -msgstr "ImpossÃvel processar gráfico, Nó personalizado sem método _step()." +msgstr "" +"Nó personalizado não tem método _step(), não podendo processar um gráfico." #: modules/visual_script/visual_script_nodes.cpp msgid "" "Invalid return value from _step(), must be integer (seq out), or string " "(error)." msgstr "" -"Valor de retorno de _step() inválido, tem de ser inteiro (seq out), ou " -"string (error)." +"Retorno de valor inválido a partir do _step(), tem de ser inteiro (seq out), " +"ou string (error)." #: modules/visual_script/visual_script_property_selector.cpp msgid "Search VisualScript" @@ -11854,15 +11851,16 @@ msgstr "Os segmentos de pacote devem ser de comprimento diferente de zero." #: platform/android/export/export.cpp msgid "The character '%s' is not allowed in Android application package names." msgstr "" -"O caráter '%s' não é permitido em nomes de pacotes de aplicações Android." +"O carácter '%s' não é permitido em nomes de pacotes de aplicações Android." #: platform/android/export/export.cpp msgid "A digit cannot be the first character in a package segment." -msgstr "Um dÃgito não pode ser o primeiro caráter num segmento de pacote." +msgstr "Um dÃgito não pode ser o primeiro carácter num segmento de pacote." #: platform/android/export/export.cpp msgid "The character '%s' cannot be the first character in a package segment." -msgstr "O caráter '%s' não pode ser o primeiro caráter num segmento de pacote." +msgstr "" +"O carácter '%s' não pode ser o primeiro carácter num segmento de pacote." #: platform/android/export/export.cpp msgid "The package must have at least one '.' separator." @@ -11957,13 +11955,13 @@ msgstr "Falta o identificador." #: platform/iphone/export/export.cpp msgid "The character '%s' is not allowed in Identifier." -msgstr "O caráter \"%s\" não é permitido no Identificador." +msgstr "O carácter \"%s\" não é permitido no Identificador." #: platform/iphone/export/export.cpp msgid "App Store Team ID not specified - cannot configure the project." msgstr "" -"ID da equipa da App Store não especificado - não é possÃvel configurar o " -"projecto." +"ID da equipa da App Store não especificado - não consigo configurar o " +"projeto." #: platform/iphone/export/export.cpp msgid "Invalid Identifier:" @@ -11987,11 +11985,11 @@ msgstr "Executar HTML exportado no Navegador padrão do sistema." #: platform/javascript/export/export.cpp msgid "Could not write file:" -msgstr "ImpossÃvel escrever Ficheiro:" +msgstr "Não consigo escrever ficheiro:" #: platform/javascript/export/export.cpp msgid "Could not open template for export:" -msgstr "ImpossÃvel abrir Modelo para exportar:" +msgstr "Não consigo abrir modelo para exportação:" #: platform/javascript/export/export.cpp msgid "Invalid export template:" @@ -11999,11 +11997,11 @@ msgstr "Modelo de exportação inválido:" #: platform/javascript/export/export.cpp msgid "Could not read custom HTML shell:" -msgstr "ImpossÃvel ler Shell HTML personalizado:" +msgstr "Não consigo ler shell HTML personalizado:" #: platform/javascript/export/export.cpp msgid "Could not read boot splash image file:" -msgstr "ImpossÃvel ler Ficheiro de imagem do ecrã de inicialização:" +msgstr "Não consigo ler ficheiro de imagem do ecrã de inicialização:" #: platform/javascript/export/export.cpp msgid "Using default boot splash image." @@ -12090,8 +12088,7 @@ msgid "" "Consider adding a CollisionShape2D or CollisionPolygon2D as a child to " "define its shape." msgstr "" -"Este nó não tem forma, não conseguindo assim colidir ou interagir com outros " -"objetos.\n" +"Este nó não tem forma, não podendo colidir ou interagir com outros objetos.\n" "Considere adicionar nós CollisionShape2D ou CollisionPolygon2D como filhos " "para definir a sua forma." @@ -12101,7 +12098,7 @@ msgid "" "CollisionObject2D derived node. Please only use it as a child of Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionPolygon2D serve apenas para fornecer uma forma de colisão a um Nó " +"CollisionPolygon2D serve apenas para fornecer uma forma de colisão a um nó " "derivado de CollisionObject2D. Use-o apenas como um filho de Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. para lhes dar uma forma." @@ -12115,7 +12112,7 @@ msgid "" "CollisionObject2D derived node. Please only use it as a child of Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionShape2D serve apenas para fornecer uma forma de colisão a um Nó " +"CollisionShape2D serve apenas para fornecer uma forma de colisão a um nó " "derivado de CollisionObject2D. Use-o apenas como um filho de Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. para lhes dar uma forma." @@ -12159,22 +12156,22 @@ msgid "" "A NavigationPolygon resource must be set or created for this node to work. " "Please set a property or draw a polygon." msgstr "" -"Um recurso NavigationPolygon tem de ser definido ou criado para este Nó " -"funcionar. Defina a Propriedade ou desenhe o PolÃgono." +"Um recurso NavigationPolygon tem de ser definido ou criado para este nó " +"funcionar. Defina a propriedade ou desenhe o polÃgono." #: scene/2d/navigation_polygon.cpp msgid "" "NavigationPolygonInstance must be a child or grandchild to a Navigation2D " "node. It only provides navigation data." msgstr "" -"NavigationPolygonInstance tem de ser filho ou neto de um Nó Navigation2D. " +"NavigationPolygonInstance tem de ser filho ou neto de um nó Navigation2D. " "Apenas fornece dados de navegação." #: scene/2d/parallax_layer.cpp msgid "" "ParallaxLayer node only works when set as child of a ParallaxBackground node." msgstr "" -"O Nó ParallaxLayer só funciona quando definido como filho de um Nó " +"O nó ParallaxLayer só funciona quando definido como filho de um nó " "ParallaxBackground." #: scene/2d/particles_2d.cpp @@ -12184,7 +12181,7 @@ msgid "" "CPUParticles\" option for this purpose." msgstr "" "PartÃculas baseadas em GPU não são suportadas pelo driver de vÃdeo GLES2.\n" -"Use o Nó CPUParticles2D. Pode usar a opção \"Converter em CPUParticles\" " +"Use o nó CPUParticles2D. Pode usar a opção \"Converter em CPUParticles\" " "para este efeito." #: scene/2d/particles_2d.cpp scene/3d/particles.cpp @@ -12206,7 +12203,7 @@ msgstr "" #: scene/2d/path_2d.cpp msgid "PathFollow2D only works when set as a child of a Path2D node." msgstr "" -"PathFollow2D apenas funciona quando definido como filho de um Nó Path2D." +"PathFollow2D apenas funciona quando definido como filho de um nó Path2D." #: scene/2d/physics_body_2d.cpp msgid "" @@ -12214,14 +12211,14 @@ msgid "" "by the physics engine when running.\n" "Change the size in children collision shapes instead." msgstr "" -"Mudanças no tamanho do RigidBody2D (em modos caráter ou rÃgido) serão " +"Mudanças no tamanho do RigidBody2D (em modos carácter ou rÃgido) serão " "reescritas pelo motor de fÃsica na execução.\n" "Mude antes o tamanho das formas de colisão filhas." #: scene/2d/remote_transform_2d.cpp msgid "Path property must point to a valid Node2D node to work." msgstr "" -"Para funcionar, a Propriedade Caminho tem de apontar para um Nó Node2D " +"Para funcionar, a Propriedade Caminho tem de apontar para um nó Node2D " "válido." #: scene/2d/skeleton_2d.cpp @@ -12253,15 +12250,15 @@ msgid "" "as parent." msgstr "" "VisibilityEnabler2D funciona melhor quando usado diretamente como parente na " -"Cena raiz editada." +"cena raiz editada." #: scene/3d/arvr_nodes.cpp msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "ARVRCamera precisa de um Nó ARVROrigin como parente." +msgstr "ARVRCamera precisa de um nó ARVROrigin como parente." #: scene/3d/arvr_nodes.cpp msgid "ARVRController must have an ARVROrigin node as its parent." -msgstr "ARVRController precisa de um Nó ARVROrigin como parente." +msgstr "ARVRController precisa de um nó ARVROrigin como parente." #: scene/3d/arvr_nodes.cpp msgid "" @@ -12273,7 +12270,7 @@ msgstr "" #: scene/3d/arvr_nodes.cpp msgid "ARVRAnchor must have an ARVROrigin node as its parent." -msgstr "ARVRAnchor precisa de um Nó ARVROrigin como parente." +msgstr "ARVRAnchor precisa de um nó ARVROrigin como parente." #: scene/3d/arvr_nodes.cpp msgid "" @@ -12285,7 +12282,7 @@ msgstr "" #: scene/3d/arvr_nodes.cpp msgid "ARVROrigin requires an ARVRCamera child node." -msgstr "ARVROrigin exige um Nó filho ARVRCamera." +msgstr "ARVROrigin exige um nó filho ARVRCamera." #: scene/3d/baked_lightmap.cpp msgid "%d%%" @@ -12317,8 +12314,7 @@ msgid "" "Consider adding a CollisionShape or CollisionPolygon as a child to define " "its shape." msgstr "" -"Este nó não tem forma, não conseguindo assim colidir ou interagir com outros " -"objetos.\n" +"Este nó não tem forma, não podendo colidir ou interagir com outros objetos.\n" "Considere adicionar nós CollisionShape ou CollisionPolygon como filhos para " "definir a sua forma." @@ -12328,7 +12324,7 @@ msgid "" "CollisionObject derived node. Please only use it as a child of Area, " "StaticBody, RigidBody, KinematicBody, etc. to give them a shape." msgstr "" -"CollisionPolygon serve apenas para fornecer uma forma de colisão a um Nó " +"CollisionPolygon serve apenas para fornecer uma forma de colisão a um nó " "derivado de CollisionObject. Use-o apenas como um filho de Area, StaticBody, " "RigidBody, KinematicBody, etc. para lhes dar uma forma." @@ -12342,7 +12338,7 @@ msgid "" "derived node. Please only use it as a child of Area, StaticBody, RigidBody, " "KinematicBody, etc. to give them a shape." msgstr "" -"CollisionShape serve apenas para fornecer uma forma de colisão a um Nó " +"CollisionShape serve apenas para fornecer uma forma de colisão a um nó " "derivado de CollisionObject. Use-o apenas como um filho de Area, StaticBody, " "RigidBody, KinematicBody, etc. para lhes dar uma forma." @@ -12393,7 +12389,7 @@ msgstr "Uma SpotLight com ângulo superior a 90 graus não cria sombras." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" -"Um recurso NavigationMesh tem de ser definido ou criado para este Nó " +"Um recurso NavigationMesh tem de ser definido ou criado para este nó " "funcionar." #: scene/3d/navigation_mesh.cpp @@ -12401,7 +12397,7 @@ msgid "" "NavigationMeshInstance must be a child or grandchild to a Navigation node. " "It only provides navigation data." msgstr "" -"NavigationMeshInstance tem de ser filho ou neto de um Nó Navigation. Apenas " +"NavigationMeshInstance tem de ser filho ou neto de um nó Navigation. Apenas " "fornece dados de navegação." #: scene/3d/particles.cpp @@ -12411,7 +12407,7 @@ msgid "" "\" option for this purpose." msgstr "" "PartÃculas baseadas em GPU não são suportadas pelo driver de vÃdeo GLES2.\n" -"Use o Nó CPUParticles. Pode usar a opção \"Converter em CPUParticles\" para " +"Use o nó CPUParticles. Pode usar a opção \"Converter em CPUParticles\" para " "este efeito." #: scene/3d/particles.cpp @@ -12430,7 +12426,7 @@ msgstr "" #: scene/3d/path.cpp msgid "PathFollow only works when set as a child of a Path node." -msgstr "PathFollow apenas funciona quando definido como filho de um Nó Path." +msgstr "PathFollow apenas funciona quando definido como filho de um nó Path." #: scene/3d/path.cpp msgid "" @@ -12446,7 +12442,7 @@ msgid "" "by the physics engine when running.\n" "Change the size in children collision shapes instead." msgstr "" -"Mudanças no tamanho do RigidBody (em modos caráter ou rÃgido) serão " +"Mudanças no tamanho do RigidBody (em modos carácter ou rÃgido) serão " "reescritas pelo motor de fÃsica na execução.\n" "Mude antes o tamanho das formas de colisão filhas." @@ -12455,7 +12451,7 @@ msgid "" "The \"Remote Path\" property must point to a valid Spatial or Spatial-" "derived node to work." msgstr "" -"Para funcionar, a Propriedade \"Caminho Remoto\" tem de apontar para um Nó " +"Para funcionar, a Propriedade \"Caminho Remoto\" tem de apontar para um nó " "Spatial válido ou seu derivado." #: scene/3d/soft_body.cpp @@ -12500,7 +12496,7 @@ msgstr "" msgid "" "Only one WorldEnvironment is allowed per scene (or set of instanced scenes)." msgstr "" -"Apenas um WorldEnvironment é permitido por Cena (ou grupo de cenas " +"Apenas um WorldEnvironment é permitido por cena (ou grupo de cenas " "instanciadas)." #: scene/3d/world_environment.cpp @@ -12533,7 +12529,7 @@ msgstr "Nada conectado à entrada '%s' do nó '%s'." #: scene/animation/animation_tree.cpp msgid "No root AnimationNode for the graph is set." -msgstr "Não foi definida uma raÃz AnimationNode para o gráfico." +msgstr "Não foi definida uma raiz AnimationNode para o gráfico." #: scene/animation/animation_tree.cpp msgid "Path to an AnimationPlayer node containing animations is not set." @@ -12547,11 +12543,11 @@ msgstr "" #: scene/animation/animation_tree.cpp msgid "The AnimationPlayer root node is not a valid node." -msgstr "O Nó raiz de AnimationPlayer não é um Nó válido." +msgstr "O nó raiz de AnimationPlayer não é um nó válido." #: scene/animation/animation_tree_player.cpp msgid "This node has been deprecated. Use AnimationTree instead." -msgstr "Este nó foi depreciado. Use AnimationTree em vez disso." +msgstr "Este nó foi descontinuado. Use antes AnimationTree." #: scene/gui/color_picker.cpp msgid "" @@ -12591,7 +12587,7 @@ msgid "" msgstr "" "Por si só um Contentor não tem utilidade, a não ser que um script configure " "a disposição dos seu filhos.\n" -"Se não pretende adicionar um script, use antes um simples Nó Control." +"Se não pretende adicionar um script, use antes um simples nó Control." #: scene/gui/control.cpp msgid "" @@ -12656,7 +12652,7 @@ msgstr "" "Esta vista não está definida como alvo de Renderização. Se pretende " "apresentar o seu conteúdo diretamente no ecrã, torne-a um filho de um " "Control de modo a que obtenha um tamanho. Caso contrário, torne-a um " -"RenderTarget e atribua a sua textura interna a outro Nó para visualizar." +"RenderTarget e atribua a sua textura interna a outro nó para visualizar." #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." diff --git a/editor/translations/ro.po b/editor/translations/ro.po index 464f5ba57a..7bd5c90156 100644 --- a/editor/translations/ro.po +++ b/editor/translations/ro.po @@ -3996,6 +3996,11 @@ msgid "Saving..." msgstr "Se Salvează..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " FiÈ™iere" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Setează ca Implicit pentru '%s'" @@ -4004,10 +4009,6 @@ msgid "Clear Default for '%s'" msgstr "Curăță setarea Implicită pentru '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " FiÈ™iere" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importă Ca:" diff --git a/editor/translations/ru.po b/editor/translations/ru.po index f21dc93c64..d4efabc2cd 100644 --- a/editor/translations/ru.po +++ b/editor/translations/ru.po @@ -4013,6 +4013,11 @@ msgid "Saving..." msgstr "Сохранение..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Файлы" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "УÑтановить по умолчанию Ð´Ð»Ñ '%s'" @@ -4021,10 +4026,6 @@ msgid "Clear Default for '%s'" msgstr "ОчиÑтить по умолчанию Ð´Ð»Ñ '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Файлы" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Импортировать как:" diff --git a/editor/translations/si.po b/editor/translations/si.po index 98432aea62..15bc5975ef 100644 --- a/editor/translations/si.po +++ b/editor/translations/si.po @@ -3828,15 +3828,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/sk.po b/editor/translations/sk.po index 995ab69e47..709d2964ca 100644 --- a/editor/translations/sk.po +++ b/editor/translations/sk.po @@ -3942,6 +3942,11 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr "Súbor:" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "" @@ -3950,11 +3955,6 @@ msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp -#, fuzzy -msgid " Files" -msgstr "Súbor:" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "" diff --git a/editor/translations/sl.po b/editor/translations/sl.po index b2f7a70afa..3a30fcac1a 100644 --- a/editor/translations/sl.po +++ b/editor/translations/sl.po @@ -4125,6 +4125,11 @@ msgid "Saving..." msgstr "Shranjevanje..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Datoteke" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Nastavi kot Privzeto za '%s'" @@ -4133,10 +4138,6 @@ msgid "Clear Default for '%s'" msgstr "PoÄisti privzeto za '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Datoteke" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Uvozi Kot:" diff --git a/editor/translations/sq.po b/editor/translations/sq.po index 07f9b1dc46..65ea4fdb56 100644 --- a/editor/translations/sq.po +++ b/editor/translations/sq.po @@ -4036,6 +4036,11 @@ msgid "Saving..." msgstr "Duke Ruajtur..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Skedarët" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Vendos si të Parazgjedhur për '%s'" @@ -4044,10 +4049,6 @@ msgid "Clear Default for '%s'" msgstr "Pastro të Parazgjedhurat për '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Skedarët" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importo Si:" diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po index ecc96cf02e..7b6f9a73b1 100644 --- a/editor/translations/sr_Cyrl.po +++ b/editor/translations/sr_Cyrl.po @@ -4151,6 +4151,11 @@ msgid "Saving..." msgstr "Чување..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Датотеке" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "ПоÑтави као уобичајено за „%s“" @@ -4159,10 +4164,6 @@ msgid "Clear Default for '%s'" msgstr "Обриши уобичајено за „%s“" #: editor/import_dock.cpp -msgid " Files" -msgstr " Датотеке" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Увези као:" diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po index ecccf23b27..3bbd854cb0 100644 --- a/editor/translations/sr_Latn.po +++ b/editor/translations/sr_Latn.po @@ -3845,15 +3845,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/sv.po b/editor/translations/sv.po index 6166371e03..0c35991d32 100644 --- a/editor/translations/sv.po +++ b/editor/translations/sv.po @@ -4110,6 +4110,10 @@ msgid "Saving..." msgstr "Sparar..." #: editor/import_dock.cpp +msgid "%d Files" +msgstr "%d Filer" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Ange som Standard för '%s'" @@ -4118,10 +4122,6 @@ msgid "Clear Default for '%s'" msgstr "Rensa Standarden för '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr "" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Importera Som:" diff --git a/editor/translations/ta.po b/editor/translations/ta.po index f4c9950079..ae6b41bf5c 100644 --- a/editor/translations/ta.po +++ b/editor/translations/ta.po @@ -3832,15 +3832,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/te.po b/editor/translations/te.po index 5306a32fb5..836675db64 100644 --- a/editor/translations/te.po +++ b/editor/translations/te.po @@ -3803,15 +3803,15 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" +msgid "%d Files" msgstr "" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/th.po b/editor/translations/th.po index e1553b1bb0..30dba54a16 100644 --- a/editor/translations/th.po +++ b/editor/translations/th.po @@ -4080,6 +4080,11 @@ msgid "Saving..." msgstr "à¸à¸³à¸¥à¸±à¸‡à¸šà¸±à¸™à¸—ึà¸..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " ไฟล์" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "à¸à¸³à¸«à¸™à¸”เป็นค่าเริ่มต้นขà¸à¸‡ '%s'" @@ -4088,10 +4093,6 @@ msgid "Clear Default for '%s'" msgstr "ลบค่าเริ่มต้นขà¸à¸‡ '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " ไฟล์" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "นำเข้าเป็น:" diff --git a/editor/translations/tr.po b/editor/translations/tr.po index 2573383f5e..207c91e7c3 100644 --- a/editor/translations/tr.po +++ b/editor/translations/tr.po @@ -3985,6 +3985,11 @@ msgid "Saving..." msgstr "Kaydediliyor..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Dosyalar" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "'%s' için Varsayılanı Ayarla" @@ -3993,10 +3998,6 @@ msgid "Clear Default for '%s'" msgstr "'%s' İçin Varsayılanı Temizle" #: editor/import_dock.cpp -msgid " Files" -msgstr " Dosyalar" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Åžu Åžekilde İçe Aktar:" diff --git a/editor/translations/uk.po b/editor/translations/uk.po index 944a73ea67..32cb1e33cd 100644 --- a/editor/translations/uk.po +++ b/editor/translations/uk.po @@ -17,7 +17,7 @@ msgid "" msgstr "" "Project-Id-Version: Ukrainian (Godot Engine)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-01-27 07:10+0000\n" +"PO-Revision-Date: 2020-02-16 15:20+0000\n" "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/" "godot/uk/>\n" @@ -702,9 +702,8 @@ msgid "Line Number:" msgstr "Ðомер Ñ€Ñдка:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "Замінити..." +msgstr "%d замінено." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -3974,6 +3973,11 @@ msgid "Saving..." msgstr "ЗбереженнÑ..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Файли" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Ð’Ñтановити Ñк типове Ð´Ð»Ñ '%s'" @@ -3982,10 +3986,6 @@ msgid "Clear Default for '%s'" msgstr "ОчиÑтити типове Ð´Ð»Ñ '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Файли" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Імпортувати Ñк:" @@ -5865,9 +5865,8 @@ msgid "Mesh is empty!" msgstr "Сітка порожнÑ!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "Створити увігнуту облаÑÑ‚ÑŒ зіткненнÑ" +msgstr "Ðе вдалоÑÑ Ñтворити форму Ð·Ñ–Ñ‚ÐºÐ½ÐµÐ½Ð½Ñ Trimesh." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5883,30 +5882,27 @@ msgstr "Створити триÑіткову Ñтатичну форму" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." -msgstr "" +msgstr "Ðе вдалоÑÑ Ñтворити єдину опуклу форму Ð·Ñ–Ñ‚ÐºÐ½ÐµÐ½Ð½Ñ Ð´Ð»Ñ ÐºÐ¾Ñ€ÐµÐ½Ñ Ñцени." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Ðе вдалоÑÑ Ñтворити єдину опуклу форму зіткненнÑ." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Створити вигнуті форми" +msgstr "Створити єдину опуклу форму" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." -msgstr "" +msgstr "Ðе вдалоÑÑ Ñтворити декілька опуклих форм Ð·Ñ–Ñ‚ÐºÐ½ÐµÐ½Ð½Ñ Ð´Ð»Ñ ÐºÐ¾Ñ€ÐµÐ½Ñ Ñцени." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "Ðеможливо Ñтворити теку." +msgstr "Ðе вдалоÑÑ Ñтворити жодних форм зіткненнÑ." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Створити вигнуті форми" +msgstr "Створити декілька опуклих форм" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5962,6 +5958,9 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Створює StaticBody Ñ– автоматично пов'Ñзує з ним заÑновану на багатокутниках " +"форму зіткненнÑ.\n" +"Це найточніший (але найповільніший) варіант Ð´Ð»Ñ Ð²Ð¸ÑÐ²Ð»ÐµÐ½Ð½Ñ Ð·Ñ–Ñ‚ÐºÐ½ÐµÐ½Ð½Ñ." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -5972,28 +5971,32 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"Створює заÑновану на багатокутниках форму зіткненнÑ.\n" +"Цей найточніший (але найповільніший) варіант Ð´Ð»Ñ Ð²Ð¸ÑÐ²Ð»ÐµÐ½Ð½Ñ Ð·Ñ–Ñ‚ÐºÐ½ÐµÐ½ÑŒ." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "Створити опуклу облаÑÑ‚Ñ– зіткненнÑ" +msgstr "Створити єдині опуклі облаÑÑ‚Ñ– зіткненнÑ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"Створює єдину опуклу форму зіткненнÑ.\n" +"Цей найшвидший (але найменш точний) варіант Ð´Ð»Ñ Ð²Ð¸ÑÐ²Ð»ÐµÐ½Ð½Ñ Ð·Ñ–Ñ‚ÐºÐ½ÐµÐ½ÑŒ." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "Створити опуклу облаÑÑ‚Ñ– зіткненнÑ" +msgstr "Створити декілька опуклих облаÑтей зіткненнÑ" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"Створює заÑновану на багатокутниках форму зіткненнÑ.\n" +"Цей проміжний за швидкіÑÑ‚ÑŽ варіант між наведеними вище двома варіантами." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -6006,6 +6009,10 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"Створює Ñтатичну контурну Ñітку. Ðормалі контурної Ñітки " +"віддзеркалюватимутьÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡Ð½Ð¾.\n" +"Цим можна ÑкориÑтатиÑÑ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ влаÑтивоÑÑ‚Ñ– Grow SpatialMaterial, Ñкщо " +"викориÑÑ‚Ð°Ð½Ð½Ñ Ñ†Ñ–Ñ”Ñ— влаÑтивоÑÑ‚Ñ– Ñ” неможливим." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -9594,17 +9601,14 @@ msgid "Export With Debug" msgstr "ЕкÑпортувати із діагноÑтикою" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "ШлÑху не Ñ–Ñнує." +msgstr "Вказаного шлÑху не Ñ–Ñнує." #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби відкрити файл пакунка — дані не у форматі zip." +msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби відкрити файл пакунка (дані не у форматі ZIP)." #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." msgstr "Ðекоректний файл проєкту «.zip»: у ньому немає файла «project.godot»." @@ -9614,14 +9618,12 @@ msgid "Please choose an empty folder." msgstr "Будь лаÑка, виберіть порожню теку." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." msgstr "Будь лаÑка, виберіть файл «project.godot» або «.zip»." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "У каталозі вже міÑтитьÑÑ Ð¿Ñ€Ð¾Ñ”ÐºÑ‚ Godot." +msgstr "У цьому каталозі вже міÑтитьÑÑ Ð¿Ñ€Ð¾Ñ”ÐºÑ‚ Godot." #: editor/project_manager.cpp msgid "New Game Project" @@ -10319,9 +10321,8 @@ msgid "Suffix" msgstr "СуфікÑ" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "Формальні вирази" +msgstr "ВикориÑтовувати формальні вирази" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10360,7 +10361,6 @@ msgstr "" "ПорівнÑйте параметри лічильника." #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" msgstr "Лічильник на рівень" @@ -10403,12 +10403,10 @@ msgid "Keep" msgstr "Ðе змінювати" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" msgstr "ГорбатийРегіÑÑ‚Ñ€ у під_креÑлюваннÑ" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" msgstr "під_креÑÐ»ÑŽÐ²Ð°Ð½Ð½Ñ Ñƒ ГорбатийРегіÑÑ‚Ñ€" @@ -10429,14 +10427,12 @@ msgid "Reset" msgstr "Скинути" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Формальні вирази" +msgstr "Помилка у формальному виразі" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "ПрипуÑтимі Ñимволи:" +msgstr "Ðа Ñимволі %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10901,9 +10897,8 @@ msgid "Invalid inherited parent name or path." msgstr "Ðекоректна назва або шлÑÑ… до уÑпадкованого батьківÑького елемента." #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "Скрипт Ñ” коректним." +msgstr "ШлÑÑ… до Ñкрипту Ñ– назва Ñкрипту Ñ” коректними." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -10994,7 +10989,6 @@ msgid "Copy Error" msgstr "Помилка копіюваннÑ" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" msgstr "Відеопам'ÑÑ‚ÑŒ" diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po index 13e42dc0d1..00c647fba1 100644 --- a/editor/translations/ur_PK.po +++ b/editor/translations/ur_PK.po @@ -3878,15 +3878,16 @@ msgid "Saving..." msgstr "" #: editor/import_dock.cpp -msgid "Set as Default for '%s'" -msgstr "" +#, fuzzy +msgid "%d Files" +msgstr "Ø§Ø«Ø§Ø«Û Ú©ÛŒ زپ Ùائل" #: editor/import_dock.cpp -msgid "Clear Default for '%s'" +msgid "Set as Default for '%s'" msgstr "" #: editor/import_dock.cpp -msgid " Files" +msgid "Clear Default for '%s'" msgstr "" #: editor/import_dock.cpp diff --git a/editor/translations/vi.po b/editor/translations/vi.po index 868a2f2ad8..9c81e2b063 100644 --- a/editor/translations/vi.po +++ b/editor/translations/vi.po @@ -3944,6 +3944,11 @@ msgid "Saving..." msgstr "Äang lÆ°u ..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " Tệp tin" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "Gán Mặc định cho '%s'" @@ -3952,10 +3957,6 @@ msgid "Clear Default for '%s'" msgstr "Dá»n Mặc định cho '%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " Tệp tin" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "Nháºp và o vá»›i:" diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po index a2c33ea918..e984a05e3a 100644 --- a/editor/translations/zh_CN.po +++ b/editor/translations/zh_CN.po @@ -64,7 +64,7 @@ msgid "" msgstr "" "Project-Id-Version: Chinese (Simplified) (Godot Engine)\n" "POT-Creation-Date: 2018-01-20 12:15+0200\n" -"PO-Revision-Date: 2020-02-14 03:19+0000\n" +"PO-Revision-Date: 2020-02-16 15:21+0000\n" "Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot/zh_Hans/>\n" @@ -733,9 +733,8 @@ msgid "Line Number:" msgstr "è¡Œå·:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "替æ¢..." +msgstr "已替æ¢%d处。" #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -3930,6 +3929,11 @@ msgid "Saving..." msgstr "ä¿å˜ä¸..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " 文件" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "设置为“%sâ€çš„默认值" @@ -3938,10 +3942,6 @@ msgid "Clear Default for '%s'" msgstr "清除默认'%s'" #: editor/import_dock.cpp -msgid " Files" -msgstr " 文件" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "导入为:" @@ -5789,9 +5789,8 @@ msgid "Mesh is empty!" msgstr "ç½‘æ ¼ä¸ºç©ºï¼" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create a Trimesh collision shape." -msgstr "åˆ›å»ºä¸‰è§’ç½‘æ ¼ç¢°æ’žåŒçº§" +msgstr "æ— æ³•åˆ›å»ºTrimesh碰撞形状。" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" @@ -5807,30 +5806,27 @@ msgstr "åˆ›å»ºä¸‰ç»´ç½‘æ ¼é™æ€å½¢çŠ¶" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." -msgstr "" +msgstr "æ— æ³•ä¸ºåœºæ™¯æ ¹èŠ‚ç‚¹åˆ›å»ºå•ä¸€å‡¸ç¢°æ’žå½¢çŠ¶ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "æ— æ³•åˆ›å»ºå•ä¸€å‡¸ç¢°æ’žå½¢çŠ¶ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "创建凸形" +msgstr "创建å•ä¸€å‡¸å½¢çŠ¶" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." -msgstr "" +msgstr "æ— æ³•ä¸ºåœºæ™¯æ ¹èŠ‚ç‚¹åˆ›å»ºå¤šä¸ªå‡¸ç¢°æ’žå½¢çŠ¶ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "æ— æ³•åˆ›å»ºæ–‡ä»¶å¤¹ã€‚" +msgstr "æ— æ³•åˆ›å»ºç¢°æ’žå½¢çŠ¶ã€‚" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "创建凸形" +msgstr "创建多个凸形状" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5886,6 +5882,8 @@ msgid "" "automatically.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"创建StaticBody并自动为其分é…基于多边形的碰撞形状。\n" +"这是最准确(但是最慢)的碰撞检测手段。" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" @@ -5896,28 +5894,32 @@ msgid "" "Creates a polygon-based collision shape.\n" "This is the most accurate (but slowest) option for collision detection." msgstr "" +"创建基于多边形的碰撞形状。\n" +"这是最准确(但是最慢)的碰撞检测手段。" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Siblings" -msgstr "创建凸型碰撞åŒçº§" +msgstr "创建å•ä¸€å‡¸ç¢°æ’žåŒçº§" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a single convex collision shape.\n" "This is the fastest (but least accurate) option for collision detection." msgstr "" +"创建å•ä¸€å‡¸ç¢°æ’žå½¢çŠ¶ã€‚\n" +"这是最快(但是最ä¸ç²¾ç¡®ï¼‰çš„碰撞检测手段。" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "创建凸型碰撞åŒçº§" +msgstr "创建多个凸碰撞åŒçº§" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" "Creates a polygon-based collision shape.\n" "This is a performance middle-ground between the two above options." msgstr "" +"创建基于多边形的碰撞形状。\n" +"这是性能ä½äºŽä¸Šè¿°ä¸¤ç§ä¹‹é—´çš„碰撞检测手段。" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh..." @@ -5930,6 +5932,8 @@ msgid "" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"创建一个é™æ€è½®å»“ç½‘æ ¼ã€‚è½®å»“ç½‘æ ¼ä¼šè‡ªåŠ¨ç¿»è½¬æ³•çº¿ã€‚\n" +"å¯ä»¥ç”¨æ¥åœ¨å¿…è¦æ—¶ä»£æ›¿SpatialMaterialçš„Grow属性。" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -9446,34 +9450,29 @@ msgid "Export With Debug" msgstr "使用调试导出" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "该路径ä¸å˜åœ¨ã€‚" +msgstr "指定的路径ä¸å˜åœ¨ã€‚" #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "打开压缩文件时出错,éžzipæ ¼å¼ã€‚" +msgstr "打开包文件时出错(éžZIPæ ¼å¼ï¼‰ã€‚" #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." -msgstr "æ— æ•ˆçš„â€œ.zipâ€é¡¹ç›®æ–‡ä»¶ï¼Œæ²¡æœ‰åŒ…å«ä¸€ä¸ªâ€œproject.godotâ€æ–‡ä»¶ã€‚" +msgstr "æ— æ•ˆçš„â€œ.zipâ€é¡¹ç›®æ–‡ä»¶ï¼›æ²¡æœ‰åŒ…å«â€œproject.godotâ€æ–‡ä»¶ã€‚" #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "请选择空文件夹。" #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "请选择一个“project.godotâ€æˆ–者“.zipâ€æ–‡ä»¶ã€‚" +msgstr "请选择“project.godotâ€æˆ–“.zipâ€æ–‡ä»¶ã€‚" #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "文件夹已ç»åŒ…å«äº†ä¸€ä¸ªGodot项目。" +msgstr "该目录已ç»åŒ…å«Godot项目。" #: editor/project_manager.cpp msgid "New Game Project" @@ -10154,9 +10153,8 @@ msgid "Suffix" msgstr "åŽç¼€" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "æ£åˆ™è¡¨è¾¾å¼" +msgstr "使用æ£åˆ™è¡¨è¾¾å¼" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10195,7 +10193,6 @@ msgstr "" "比较计数器的选项。" #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" msgstr "å„级å•ç‹¬è®¡æ•°" @@ -10236,12 +10233,10 @@ msgid "Keep" msgstr "ä¿æŒ" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" msgstr "驼峰å¼è½¬ä¸ºä¸‹åˆ’线å¼" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" msgstr "下划线å¼è½¬ä¸ºé©¼å³°å¼" @@ -10262,14 +10257,12 @@ msgid "Reset" msgstr "é‡ç½®" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "æ£åˆ™è¡¨è¾¾å¼" +msgstr "æ£åˆ™è¡¨è¾¾å¼å‡ºé”™" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "有效å—符:" +msgstr "ä½äºŽå—符%s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10723,9 +10716,8 @@ msgid "Invalid inherited parent name or path." msgstr "所继承父类的åç§°æˆ–è·¯å¾„æ— æ•ˆã€‚" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "脚本有效。" +msgstr "脚本路径/å称有效。" #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -10816,7 +10808,6 @@ msgid "Copy Error" msgstr "å¤åˆ¶é”™è¯¯ä¿¡æ¯" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Video RAM" msgstr "显å˜" diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po index 1264617142..23b5c90459 100644 --- a/editor/translations/zh_HK.po +++ b/editor/translations/zh_HK.po @@ -4149,6 +4149,11 @@ msgid "Saving..." msgstr "儲å˜ä¸..." #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr "檔案" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "" @@ -4158,11 +4163,6 @@ msgstr "" #: editor/import_dock.cpp #, fuzzy -msgid " Files" -msgstr "檔案" - -#: editor/import_dock.cpp -#, fuzzy msgid "Import As:" msgstr "å°Žå…¥" diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po index eaea30d310..9678b2f8cb 100644 --- a/editor/translations/zh_TW.po +++ b/editor/translations/zh_TW.po @@ -4124,6 +4124,11 @@ msgid "Saving..." msgstr "儲å˜ä¸â€¦â€¦" #: editor/import_dock.cpp +#, fuzzy +msgid "%d Files" +msgstr " 資料夾" + +#: editor/import_dock.cpp msgid "Set as Default for '%s'" msgstr "è¨å®šç‚ºâ€œ%sâ€çš„é è¨å€¼" @@ -4132,10 +4137,6 @@ msgid "Clear Default for '%s'" msgstr "清除“%sâ€çš„é è¨å€¼" #: editor/import_dock.cpp -msgid " Files" -msgstr " 資料夾" - -#: editor/import_dock.cpp msgid "Import As:" msgstr "導入為:" diff --git a/main/main.cpp b/main/main.cpp index 9f1d9ce5fe..d8a9cc87a7 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -44,6 +44,7 @@ #include "core/project_settings.h" #include "core/register_core_types.h" #include "core/script_debugger_local.h" +#include "core/script_debugger_remote.h" #include "core/script_language.h" #include "core/translation.h" #include "core/version.h" @@ -58,7 +59,6 @@ #include "main/tests/test_main.h" #include "modules/register_module_types.h" #include "platform/register_platform_apis.h" -#include "scene/debugger/script_debugger_remote.h" #include "scene/main/scene_tree.h" #include "scene/main/viewport.h" #include "scene/register_scene_types.h" @@ -203,6 +203,7 @@ void finalize_physics() { void initialize_navigation_server() { ERR_FAIL_COND(navigation_server != NULL); + navigation_server = NavigationServerManager::new_default_server(); navigation_2d_server = memnew(Navigation2DServer); } @@ -210,6 +211,7 @@ void initialize_navigation_server() { void finalize_navigation_server() { memdelete(navigation_server); navigation_server = NULL; + memdelete(navigation_2d_server); navigation_2d_server = NULL; } @@ -1657,12 +1659,6 @@ bool Main::start() { if (!project_manager && !editor) { // game if (game_path != "" || script != "") { - if (script_debugger && script_debugger->is_remote()) { - ScriptDebuggerRemote *remote_debugger = static_cast<ScriptDebuggerRemote *>(script_debugger); - - remote_debugger->set_scene_tree(sml); - } - //autoload List<PropertyInfo> props; ProjectSettings::get_singleton()->get_property_list(&props); @@ -1823,7 +1819,7 @@ bool Main::start() { GLOBAL_DEF("display/window/stretch/aspect", "ignore"); ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/aspect", PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand")); GLOBAL_DEF("display/window/stretch/shrink", 1.0); - ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::REAL, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1.0,8.0,0.1")); + ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::FLOAT, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1.0,8.0,0.1")); sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true)); sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true)); GLOBAL_DEF("gui/common/snap_controls_to_pixels", true); @@ -2043,9 +2039,9 @@ bool Main::iteration() { break; } - message_queue->flush(); + NavigationServer::get_singleton_mut()->process(frame_slice * time_scale); - NavigationServer::get_singleton_mut()->step(frame_slice * time_scale); + message_queue->flush(); PhysicsServer::get_singleton()->step(frame_slice * time_scale); diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index a2891de8ff..0e7c45f603 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -128,7 +128,7 @@ static String _parser_expr(const GDScriptParser::Node *p_expr) { case GDScriptParser::OperatorNode::OP_PARENT_CALL: txt += "."; - FALLTHROUGH; + [[fallthrough]]; case GDScriptParser::OperatorNode::OP_CALL: { ERR_FAIL_COND_V(c_node->arguments.size() < 1, ""); diff --git a/methods.py b/methods.py index f6c9e939c6..3f03e6bbd2 100644 --- a/methods.py +++ b/methods.py @@ -549,15 +549,27 @@ def detect_darwin_sdk_path(platform, env): print("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name)) raise +def is_vanilla_clang(env): + if not using_clang(env): + return False + version = decode_utf8(subprocess.check_output([env['CXX'], '--version']).strip()) + return not version.startswith("Apple") + + def get_compiler_version(env): - # Not using this method on clang because it returns 4.2.1 # https://reviews.llvm.org/D56803 - if using_gcc(env): - version = decode_utf8(subprocess.check_output([env['CXX'], '-dumpversion']).strip()) - else: + """ + Returns an array of version numbers as ints: [major, minor, patch]. + The return array should have at least two values (major, minor). + """ + if not env.msvc: + # Not using -dumpversion as some GCC distros only return major, and + # Clang used to return hardcoded 4.2.1: # https://reviews.llvm.org/D56803 version = decode_utf8(subprocess.check_output([env['CXX'], '--version']).strip()) - match = re.search('[0-9][0-9.]*', version) + else: # TODO: Implement for MSVC + return None + match = re.search('[0-9]+\.[0-9.]+', version) if match is not None: - return match.group().split('.') + return list(map(int, match.group().split('.'))) else: return None diff --git a/misc/dist/osx_template.app/Contents/Info.plist b/misc/dist/osx_template.app/Contents/Info.plist index 696c825594..3b765e6bb8 100755 --- a/misc/dist/osx_template.app/Contents/Info.plist +++ b/misc/dist/osx_template.app/Contents/Info.plist @@ -31,13 +31,13 @@ <key>NSHumanReadableCopyright</key> <string>$copyright</string> <key>LSMinimumSystemVersion</key> - <string>10.9.0</string> + <string>10.12.0</string> <key>LSMinimumSystemVersionByArchitecture</key> <dict> <key>x86_64</key> - <string>10.9.0</string> + <string>10.12.0</string> </dict> <key>NSHighResolutionCapable</key> $highres </dict> -</plist>
\ No newline at end of file +</plist> diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index 46550ba6c7..c519a232c4 100755 --- a/misc/dist/osx_tools.app/Contents/Info.plist +++ b/misc/dist/osx_tools.app/Contents/Info.plist @@ -33,11 +33,11 @@ <key>NSHumanReadableCopyright</key> <string>© 2007-2020 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> <key>LSMinimumSystemVersion</key> - <string>10.9.0</string> + <string>10.12.0</string> <key>LSMinimumSystemVersionByArchitecture</key> <dict> <key>x86_64</key> - <string>10.9.0</string> + <string>10.12.0</string> </dict> <key>NSHighResolutionCapable</key> <true/> diff --git a/misc/travis/clang-format.sh b/misc/travis/clang-format.sh index 097b2a9378..a6585578e1 100755 --- a/misc/travis/clang-format.sh +++ b/misc/travis/clang-format.sh @@ -3,11 +3,17 @@ CLANG_FORMAT=clang-format-8 if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - # Check the whole commit range against $TRAVIS_BRANCH, the base merge branch - # We could use $TRAVIS_COMMIT_RANGE but it doesn't play well with force pushes - RANGE="$(git rev-parse $TRAVIS_BRANCH) HEAD" + # Travis only clones the PR branch and uses its HEAD commit as detached HEAD, + # so it's problematic when we want an exact commit range for format checks. + # We fetch upstream to ensure that we have the proper references to resolve. + # Ideally we would use $TRAVIS_COMMIT_RANGE but it doesn't play well with PR + # updates, as it only includes changes since the previous state of the PR. + git remote add upstream https://github.com/godotengine/godot \ + --no-tags -f -t $TRAVIS_BRANCH + RANGE="upstream/$TRAVIS_BRANCH HEAD" else - # Test only the last commit + # Test only the last commit, since $TRAVIS_COMMIT_RANGE wouldn't support + # force pushes. RANGE=HEAD fi diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index 01d49e7995..1881d0db33 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -1275,7 +1275,7 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat for (size_t l = 0; l < num_vertices; l++) { AssimpUtils::calc_tangent_from_mesh(ai_mesh, j, l, l, w); } - PackedRealArray new_tangents = array_copy[VisualServer::ARRAY_TANGENT].duplicate(true); + PackedFloat32Array new_tangents = array_copy[VisualServer::ARRAY_TANGENT].duplicate(true); ERR_CONTINUE(new_tangents.size() != tangents.size() * 4); for (int32_t l = 0; l < tangents.size(); l++) { new_tangents.ptrw()[l + 0] = tangents[l].r; diff --git a/modules/bullet/area_bullet.cpp b/modules/bullet/area_bullet.cpp index 7806145390..e8a5c1475a 100644 --- a/modules/bullet/area_bullet.cpp +++ b/modules/bullet/area_bullet.cpp @@ -117,7 +117,7 @@ void AreaBullet::call_event(CollisionObjectBullet *p_otherObject, PhysicsServer: call_event_res[3] = 0; // other_body_shape ID call_event_res[4] = 0; // self_shape ID - Variant::CallError outResp; + Callable::CallError outResp; areaGodoObject->call(event.event_callback_method, (const Variant **)call_event_res_ptr, 5, outResp); } diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index e5804fbde8..d33c3a748c 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -370,7 +370,7 @@ void RigidBodyBullet::dispatch_callbacks() { } else { const Variant *vp[2] = { &variantBodyDirect, &force_integration_callback->udata }; - Variant::CallError responseCallError; + Callable::CallError responseCallError; int argc = (force_integration_callback->udata.get_type() == Variant::NIL) ? 1 : 2; obj->call(force_integration_callback->method, vp, argc, responseCallError); } diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index 1690950049..6780f89d9e 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -122,8 +122,8 @@ btBoxShape *ShapeBullet::create_shape_box(const btVector3 &boxHalfExtents) { return bulletnew(btBoxShape(boxHalfExtents)); } -btCapsuleShapeZ *ShapeBullet::create_shape_capsule(btScalar radius, btScalar height) { - return bulletnew(btCapsuleShapeZ(radius, height)); +btCapsuleShape *ShapeBullet::create_shape_capsule(btScalar radius, btScalar height) { + return bulletnew(btCapsuleShape(radius, height)); } btCylinderShape *ShapeBullet::create_shape_cylinder(btScalar radius, btScalar height) { @@ -474,7 +474,7 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) { Vector<real_t> l_heights; Variant l_heights_v = d["heights"]; - if (l_heights_v.get_type() == Variant::PACKED_REAL_ARRAY) { + if (l_heights_v.get_type() == Variant::PACKED_FLOAT32_ARRAY) { // Ready-to-use heights can be passed l_heights = l_heights_v; @@ -505,7 +505,7 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) { } } else { - ERR_FAIL_MSG("Expected PackedRealArray or float Image."); + ERR_FAIL_MSG("Expected PackedFloat32Array or float Image."); } ERR_FAIL_COND(l_width <= 0); diff --git a/modules/bullet/shape_bullet.h b/modules/bullet/shape_bullet.h index 27bf011ca1..c8b5ca102a 100644 --- a/modules/bullet/shape_bullet.h +++ b/modules/bullet/shape_bullet.h @@ -85,7 +85,7 @@ public: static class btStaticPlaneShape *create_shape_plane(const btVector3 &planeNormal, btScalar planeConstant); static class btSphereShape *create_shape_sphere(btScalar radius); static class btBoxShape *create_shape_box(const btVector3 &boxHalfExtents); - static class btCapsuleShapeZ *create_shape_capsule(btScalar radius, btScalar height); + static class btCapsuleShape *create_shape_capsule(btScalar radius, btScalar height); static class btCylinderShape *create_shape_cylinder(btScalar radius, btScalar height); /// IMPORTANT: Remember to delete the shape interface by calling: delete my_shape->getMeshInterface(); static class btConvexPointCloudShape *create_shape_convex(btAlignedObjectArray<btVector3> &p_vertices, const btVector3 &p_local_scaling = btVector3(1, 1, 1)); diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index 0e4c4b4731..f6df97f11d 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -726,9 +726,6 @@ void SpaceBullet::check_ghost_overlaps() { other_body_shape = static_cast<btCollisionShape *>(otherObject->get_bt_shape(z)); - if (other_body_shape->isConcave()) - continue; - btTransform other_shape_transform(otherObject->get_bt_shape_transform(z)); other_shape_transform.getOrigin() *= other_body_scale; diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index e0c0aa6a51..d017afd792 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -621,7 +621,7 @@ void CSGShape::_bind_methods() { ClassDB::bind_method(D_METHOD("get_meshes"), &CSGShape::get_meshes); ADD_PROPERTY(PropertyInfo(Variant::INT, "operation", PROPERTY_HINT_ENUM, "Union,Intersection,Subtraction"), "set_operation", "get_operation"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "snap", PROPERTY_HINT_RANGE, "0.0001,1,0.001"), "set_snap", "get_snap"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "snap", PROPERTY_HINT_RANGE, "0.0001,1,0.001"), "set_snap", "get_snap"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "calculate_tangents"), "set_calculate_tangents", "is_calculating_tangents"); ADD_GROUP("Collision", "collision_"); @@ -898,12 +898,12 @@ void CSGMesh::set_mesh(const Ref<Mesh> &p_mesh) { if (mesh == p_mesh) return; if (mesh.is_valid()) { - mesh->disconnect("changed", this, "_mesh_changed"); + mesh->disconnect_compat("changed", this, "_mesh_changed"); } mesh = p_mesh; if (mesh.is_valid()) { - mesh->connect("changed", this, "_mesh_changed"); + mesh->connect_compat("changed", this, "_mesh_changed"); } _make_dirty(); @@ -1049,7 +1049,7 @@ void CSGSphere::_bind_methods() { ClassDB::bind_method(D_METHOD("set_material", "material"), &CSGSphere::set_material); ClassDB::bind_method(D_METHOD("get_material"), &CSGSphere::get_material); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001"), "set_radius", "get_radius"); ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1"), "set_radial_segments", "get_radial_segments"); ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1"), "set_rings", "get_rings"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces"); @@ -1236,9 +1236,9 @@ void CSGBox::_bind_methods() { ClassDB::bind_method(D_METHOD("set_material", "material"), &CSGBox::set_material); ClassDB::bind_method(D_METHOD("get_material"), &CSGBox::get_material); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "width", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_width", "get_width"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "width", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_width", "get_width"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "StandardMaterial3D,ShaderMaterial"), "set_material", "get_material"); } @@ -1451,8 +1451,8 @@ void CSGCylinder::_bind_methods() { ClassDB::bind_method(D_METHOD("set_smooth_faces", "smooth_faces"), &CSGCylinder::set_smooth_faces); ClassDB::bind_method(D_METHOD("get_smooth_faces"), &CSGCylinder::get_smooth_faces); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::INT, "sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_sides", "get_sides"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cone"), "set_cone", "is_cone"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces"); @@ -1678,8 +1678,8 @@ void CSGTorus::_bind_methods() { ClassDB::bind_method(D_METHOD("set_smooth_faces", "smooth_faces"), &CSGTorus::set_smooth_faces); ClassDB::bind_method(D_METHOD("get_smooth_faces"), &CSGTorus::get_smooth_faces); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "inner_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_inner_radius", "get_inner_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "outer_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_outer_radius", "get_outer_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inner_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_inner_radius", "get_inner_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "outer_radius", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_outer_radius", "get_outer_radius"); ADD_PROPERTY(PropertyInfo(Variant::INT, "sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_sides", "get_sides"); ADD_PROPERTY(PropertyInfo(Variant::INT, "ring_sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_ring_sides", "get_ring_sides"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces"); @@ -1812,15 +1812,15 @@ CSGBrush *CSGPolygon::_build_brush() { if (path != path_cache) { if (path_cache) { - path_cache->disconnect("tree_exited", this, "_path_exited"); - path_cache->disconnect("curve_changed", this, "_path_changed"); + path_cache->disconnect_compat("tree_exited", this, "_path_exited"); + path_cache->disconnect_compat("curve_changed", this, "_path_changed"); path_cache = NULL; } path_cache = path; - path_cache->connect("tree_exited", this, "_path_exited"); - path_cache->connect("curve_changed", this, "_path_changed"); + path_cache->connect_compat("tree_exited", this, "_path_exited"); + path_cache->connect_compat("curve_changed", this, "_path_changed"); path_cache = NULL; } curve = path->get_curve(); @@ -2236,8 +2236,8 @@ CSGBrush *CSGPolygon::_build_brush() { void CSGPolygon::_notification(int p_what) { if (p_what == NOTIFICATION_EXIT_TREE) { if (path_cache) { - path_cache->disconnect("tree_exited", this, "_path_exited"); - path_cache->disconnect("curve_changed", this, "_path_changed"); + path_cache->disconnect_compat("tree_exited", this, "_path_exited"); + path_cache->disconnect_compat("curve_changed", this, "_path_changed"); path_cache = NULL; } } @@ -2314,11 +2314,11 @@ void CSGPolygon::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon"); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Depth,Spin,Path"), "set_mode", "get_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "spin_degrees", PROPERTY_HINT_RANGE, "1,360,0.1"), "set_spin_degrees", "get_spin_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spin_degrees", PROPERTY_HINT_RANGE, "1,360,0.1"), "set_spin_degrees", "get_spin_degrees"); ADD_PROPERTY(PropertyInfo(Variant::INT, "spin_sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_spin_sides", "get_spin_sides"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "path_node", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Path"), "set_path_node", "get_path_node"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "path_interval", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_path_interval", "get_path_interval"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_interval", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_path_interval", "get_path_interval"); ADD_PROPERTY(PropertyInfo(Variant::INT, "path_rotation", PROPERTY_HINT_ENUM, "Polygon,Path,PathFollow"), "set_path_rotation", "get_path_rotation"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "path_local"), "set_path_local", "is_path_local"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "path_continuous_u"), "set_path_continuous_u", "is_path_continuous_u"); diff --git a/modules/gdnative/doc_classes/GDNative.xml b/modules/gdnative/doc_classes/GDNative.xml index b4b63bf04a..44d9e32ed8 100644 --- a/modules/gdnative/doc_classes/GDNative.xml +++ b/modules/gdnative/doc_classes/GDNative.xml @@ -10,9 +10,9 @@ <method name="call_native"> <return type="Variant"> </return> - <argument index="0" name="calling_type" type="String"> + <argument index="0" name="calling_type" type="StringName"> </argument> - <argument index="1" name="procedure_name" type="String"> + <argument index="1" name="procedure_name" type="StringName"> </argument> <argument index="2" name="arguments" type="Array"> </argument> diff --git a/modules/gdnative/doc_classes/NativeScript.xml b/modules/gdnative/doc_classes/NativeScript.xml index b21d16a6fd..f2e9cac6dc 100644 --- a/modules/gdnative/doc_classes/NativeScript.xml +++ b/modules/gdnative/doc_classes/NativeScript.xml @@ -17,7 +17,7 @@ <method name="get_method_documentation" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="method" type="String"> + <argument index="0" name="method" type="StringName"> </argument> <description> Returns the documentation string that was previously set with [code]godot_nativescript_set_method_documentation[/code]. @@ -26,7 +26,7 @@ <method name="get_property_documentation" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="path" type="String"> + <argument index="0" name="path" type="StringName"> </argument> <description> Returns the documentation string that was previously set with [code]godot_nativescript_set_property_documentation[/code]. @@ -35,7 +35,7 @@ <method name="get_signal_documentation" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="signal_name" type="String"> + <argument index="0" name="signal_name" type="StringName"> </argument> <description> Returns the documentation string that was previously set with [code]godot_nativescript_set_signal_documentation[/code]. diff --git a/modules/gdnative/gdnative/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp index 018a613724..d996b006a5 100644 --- a/modules/gdnative/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -79,7 +79,7 @@ godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, god Variant *ret_val = (Variant *)&ret; - Variant::CallError r_error; + Callable::CallError r_error; *ret_val = mb->call(o, args, p_arg_count, r_error); if (p_call_error) { diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp index 176d5a0461..f0fc44ae8a 100644 --- a/modules/gdnative/gdnative/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -209,13 +209,13 @@ void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godo void GDAPI godot_variant_new_packed_int_array(godot_variant *r_dest, const godot_packed_int_array *p_pia) { Variant *dest = (Variant *)r_dest; - PackedIntArray *pia = (PackedIntArray *)p_pia; + PackedInt32Array *pia = (PackedInt32Array *)p_pia; memnew_placement_custom(dest, Variant, Variant(*pia)); } void GDAPI godot_variant_new_packed_real_array(godot_variant *r_dest, const godot_packed_real_array *p_pra) { Variant *dest = (Variant *)r_dest; - PackedRealArray *pra = (PackedRealArray *)p_pra; + PackedFloat32Array *pra = (PackedFloat32Array *)p_pra; memnew_placement_custom(dest, Variant, Variant(*pra)); } @@ -402,8 +402,8 @@ godot_packed_byte_array GDAPI godot_variant_as_packed_byte_array(const godot_var godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_variant *p_self) { godot_packed_int_array raw_dest; const Variant *self = (const Variant *)p_self; - PackedIntArray *dest = (PackedIntArray *)&raw_dest; - memnew_placement(dest, PackedIntArray(self->operator PackedIntArray())); // operator = is overloaded by PackedIntArray + PackedInt32Array *dest = (PackedInt32Array *)&raw_dest; + memnew_placement(dest, PackedInt32Array(self->operator PackedInt32Array())); // operator = is overloaded by PackedInt32Array *dest = *self; return raw_dest; } @@ -411,8 +411,8 @@ godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_varia godot_packed_real_array GDAPI godot_variant_as_packed_real_array(const godot_variant *p_self) { godot_packed_real_array raw_dest; const Variant *self = (const Variant *)p_self; - PackedRealArray *dest = (PackedRealArray *)&raw_dest; - memnew_placement(dest, PackedRealArray(self->operator PackedRealArray())); // operator = is overloaded by PackedRealArray + PackedFloat32Array *dest = (PackedFloat32Array *)&raw_dest; + memnew_placement(dest, PackedFloat32Array(self->operator PackedFloat32Array())); // operator = is overloaded by PackedFloat32Array *dest = *self; return raw_dest; } @@ -459,7 +459,7 @@ godot_variant GDAPI godot_variant_call(godot_variant *p_self, const godot_string const Variant **args = (const Variant **)p_args; godot_variant raw_dest; Variant *dest = (Variant *)&raw_dest; - Variant::CallError error; + Callable::CallError error; memnew_placement_custom(dest, Variant, Variant(self->call(*method, args, p_argcount, error))); if (r_error) { r_error->error = (godot_variant_call_error_error)error.error; diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index a30b438e6f..b434bc8385 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -359,7 +359,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { filter_list->set_item_checked(idx, true); idx += 1; } - filter_list->connect("index_pressed", this, "_on_filter_selected"); + filter_list->connect_compat("index_pressed", this, "_on_filter_selected"); tree = memnew(Tree); container->add_child(tree); @@ -374,16 +374,16 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { tree->set_column_title(2, TTR("Dependencies")); tree->set_column_expand(3, false); tree->set_column_min_width(3, int(110 * EDSCALE)); - tree->connect("button_pressed", this, "_on_item_button"); - tree->connect("item_collapsed", this, "_on_item_collapsed"); - tree->connect("item_activated", this, "_on_item_activated"); + tree->connect_compat("button_pressed", this, "_on_item_button"); + tree->connect_compat("item_collapsed", this, "_on_item_collapsed"); + tree->connect_compat("item_activated", this, "_on_item_activated"); file_dialog = memnew(EditorFileDialog); file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES); file_dialog->set_resizable(true); add_child(file_dialog); - file_dialog->connect("file_selected", this, "_on_library_selected"); - file_dialog->connect("files_selected", this, "_on_dependencies_selected"); + file_dialog->connect_compat("file_selected", this, "_on_library_selected"); + file_dialog->connect_compat("files_selected", this, "_on_dependencies_selected"); new_architecture_dialog = memnew(ConfirmationDialog); add_child(new_architecture_dialog); @@ -392,7 +392,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { new_architecture_dialog->add_child(new_architecture_input); new_architecture_dialog->set_custom_minimum_size(Vector2(300, 80) * EDSCALE); new_architecture_input->set_anchors_and_margins_preset(PRESET_HCENTER_WIDE, PRESET_MODE_MINSIZE, 5 * EDSCALE); - new_architecture_dialog->get_ok()->connect("pressed", this, "_on_create_new_entry"); + new_architecture_dialog->get_ok()->connect_compat("pressed", this, "_on_create_new_entry"); } void GDNativeLibraryEditorPlugin::edit(Object *p_node) { diff --git a/modules/gdnative/gdnative_library_singleton_editor.cpp b/modules/gdnative/gdnative_library_singleton_editor.cpp index 17a7d5492a..e5eb3c44d0 100644 --- a/modules/gdnative/gdnative_library_singleton_editor.cpp +++ b/modules/gdnative/gdnative_library_singleton_editor.cpp @@ -207,8 +207,8 @@ GDNativeLibrarySingletonEditor::GDNativeLibrarySingletonEditor() { libraries->set_hide_root(true); add_margin_child(TTR("Libraries: "), libraries, true); updating = false; - libraries->connect("item_edited", this, "_item_edited"); - EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_discover_singletons"); + libraries->connect_compat("item_edited", this, "_item_edited"); + EditorFileSystem::get_singleton()->connect_compat("filesystem_changed", this, "_discover_singletons"); } #endif // TOOLS_ENABLED diff --git a/modules/gdnative/include/gdnative/pool_arrays.h b/modules/gdnative/include/gdnative/pool_arrays.h index 315fb7ada2..c610377f54 100644 --- a/modules/gdnative/include/gdnative/pool_arrays.h +++ b/modules/gdnative/include/gdnative/pool_arrays.h @@ -48,7 +48,7 @@ typedef struct { } godot_packed_byte_array; #endif -/////// PackedIntArray +/////// PackedInt32Array #define GODOT_PACKED_INT_ARRAY_SIZE sizeof(void *) @@ -59,7 +59,7 @@ typedef struct { } godot_packed_int_array; #endif -/////// PackedRealArray +/////// PackedFloat32Array #define GODOT_PACKED_REAL_ARRAY_SIZE sizeof(void *) diff --git a/modules/gdnative/include/gdnative/variant.h b/modules/gdnative/include/gdnative/variant.h index 4d70f1143c..934e856fbf 100644 --- a/modules/gdnative/include/gdnative/variant.h +++ b/modules/gdnative/include/gdnative/variant.h @@ -56,31 +56,33 @@ typedef enum godot_variant_type { GODOT_VARIANT_TYPE_STRING, // math types - - GODOT_VARIANT_TYPE_VECTOR2, // 5 + GODOT_VARIANT_TYPE_VECTOR2, + GODOT_VARIANT_TYPE_VECTOR2I, GODOT_VARIANT_TYPE_RECT2, + GODOT_VARIANT_TYPE_RECT2I, GODOT_VARIANT_TYPE_VECTOR3, + GODOT_VARIANT_TYPE_VECTOR3I, GODOT_VARIANT_TYPE_TRANSFORM2D, GODOT_VARIANT_TYPE_PLANE, - GODOT_VARIANT_TYPE_QUAT, // 10 + GODOT_VARIANT_TYPE_QUAT, GODOT_VARIANT_TYPE_AABB, GODOT_VARIANT_TYPE_BASIS, GODOT_VARIANT_TYPE_TRANSFORM, // misc types GODOT_VARIANT_TYPE_COLOR, - GODOT_VARIANT_TYPE_NODE_PATH, // 15 + GODOT_VARIANT_TYPE_NODE_PATH, GODOT_VARIANT_TYPE_RID, GODOT_VARIANT_TYPE_OBJECT, GODOT_VARIANT_TYPE_DICTIONARY, - GODOT_VARIANT_TYPE_ARRAY, // 20 + GODOT_VARIANT_TYPE_ARRAY, // arrays GODOT_VARIANT_TYPE_PACKED_BYTE_ARRAY, GODOT_VARIANT_TYPE_PACKED_INT_ARRAY, GODOT_VARIANT_TYPE_PACKED_REAL_ARRAY, GODOT_VARIANT_TYPE_PACKED_STRING_ARRAY, - GODOT_VARIANT_TYPE_PACKED_VECTOR2_ARRAY, // 25 + GODOT_VARIANT_TYPE_PACKED_VECTOR2_ARRAY, GODOT_VARIANT_TYPE_PACKED_VECTOR3_ARRAY, GODOT_VARIANT_TYPE_PACKED_COLOR_ARRAY, } godot_variant_type; diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index a2be4807d7..8240ae2f83 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -725,21 +725,21 @@ String NativeScript::get_property_documentation(const StringName &p_path) const ERR_FAIL_V_MSG("", "Attempt to get property documentation for non-existent signal."); } -Variant NativeScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant NativeScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (lib_path.empty() || class_name.empty() || library.is_null()) { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); } NativeScriptDesc *script_data = get_script_desc(); if (!script_data) { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; REF ref; Object *owner = NULL; @@ -751,7 +751,7 @@ Variant NativeScript::_new(const Variant **p_args, int p_argcount, Variant::Call } if (!owner) { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); } @@ -964,7 +964,7 @@ bool NativeScriptInstance::has_method(const StringName &p_method) const { return script->has_method(p_method); } -Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { NativeScriptDesc *script_data = GET_SCRIPT_DESC(); @@ -989,14 +989,14 @@ Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p Variant res = *(Variant *)&result; godot_variant_destroy(&result); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; return res; } script_data = script_data->base_data; } - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } @@ -1017,9 +1017,9 @@ void NativeScriptInstance::notification(int p_notification) { String NativeScriptInstance::to_string(bool *r_valid) { if (has_method(CoreStringNames::get_singleton()->_to_string)) { - Variant::CallError ce; + Callable::CallError ce; Variant ret = call(CoreStringNames::get_singleton()->_to_string, NULL, 0, ce); - if (ce.error == Variant::CallError::CALL_OK) { + if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { if (r_valid) *r_valid = false; @@ -1036,21 +1036,21 @@ String NativeScriptInstance::to_string(bool *r_valid) { } void NativeScriptInstance::refcount_incremented() { - Variant::CallError err; + Callable::CallError err; call("_refcount_incremented", NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK && err.error != Variant::CallError::CALL_ERROR_INVALID_METHOD) { + if (err.error != Callable::CallError::CALL_OK && err.error != Callable::CallError::CALL_ERROR_INVALID_METHOD) { ERR_PRINT("Failed to invoke _refcount_incremented - should not happen"); } } bool NativeScriptInstance::refcount_decremented() { - Variant::CallError err; + Callable::CallError err; Variant ret = call("_refcount_decremented", NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK && err.error != Variant::CallError::CALL_ERROR_INVALID_METHOD) { + if (err.error != Callable::CallError::CALL_OK && err.error != Callable::CallError::CALL_ERROR_INVALID_METHOD) { ERR_PRINT("Failed to invoke _refcount_decremented - should not happen"); return true; // assume we can destroy the object } - if (err.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) { + if (err.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) { // the method does not exist, default is true return true; } diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 58e4052368..609ffa2bd4 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -197,7 +197,7 @@ public: String get_signal_documentation(const StringName &p_signal_name) const; String get_property_documentation(const StringName &p_path) const; - Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error); NativeScript(); ~NativeScript(); @@ -224,7 +224,7 @@ public: virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid) const; virtual void get_method_list(List<MethodInfo> *p_list) const; virtual bool has_method(const StringName &p_method) const; - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual void notification(int p_notification); String to_string(bool *r_valid); virtual Ref<Script> get_script() const; diff --git a/modules/gdnative/pluginscript/pluginscript_instance.cpp b/modules/gdnative/pluginscript/pluginscript_instance.cpp index 26a1d5f47a..22e8372130 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.cpp +++ b/modules/gdnative/pluginscript/pluginscript_instance.cpp @@ -79,7 +79,7 @@ bool PluginScriptInstance::has_method(const StringName &p_method) const { return _script->has_method(p_method); } -Variant PluginScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant PluginScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { // TODO: optimize when calling a Godot method from Godot to avoid param conversion ? godot_variant ret = _desc->call_method( _data, (godot_string_name *)&p_method, (const godot_variant **)p_args, diff --git a/modules/gdnative/pluginscript/pluginscript_instance.h b/modules/gdnative/pluginscript/pluginscript_instance.h index 154bebd72a..c91ad643a7 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.h +++ b/modules/gdnative/pluginscript/pluginscript_instance.h @@ -60,7 +60,7 @@ public: virtual void get_method_list(List<MethodInfo> *p_list) const; virtual bool has_method(const StringName &p_method) const; - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); // Rely on default implementations provided by ScriptInstance for the moment. // Note that multilevel call could be removed in 3.0 release, so stay tuned diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index fffb169129..fe1f63f6da 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -55,9 +55,9 @@ void PluginScript::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "new", &PluginScript::_new, MethodInfo("new")); } -PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Variant::CallError &r_error) { +PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Callable::CallError &r_error) { - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; // Create instance PluginScriptInstance *instance = memnew(PluginScriptInstance()); @@ -67,7 +67,7 @@ PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int _instances.insert(instance->get_owner()); _language->unlock(); } else { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; memdelete(instance); ERR_FAIL_V(NULL); } @@ -83,12 +83,12 @@ PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int return instance; } -Variant PluginScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant PluginScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; if (!_valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } @@ -102,7 +102,7 @@ Variant PluginScript::_new(const Variant **p_args, int p_argcount, Variant::Call } if (!owner) { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); } @@ -201,7 +201,7 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) { } } - Variant::CallError unchecked_error; + Callable::CallError unchecked_error; return _create_instance(NULL, 0, p_this, unchecked_error); } diff --git a/modules/gdnative/pluginscript/pluginscript_script.h b/modules/gdnative/pluginscript/pluginscript_script.h index f6bca8a9cb..5c93ae38f5 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.h +++ b/modules/gdnative/pluginscript/pluginscript_script.h @@ -72,8 +72,8 @@ private: protected: static void _bind_methods(); - PluginScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Variant::CallError &r_error); - Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + PluginScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Callable::CallError &r_error); + Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error); #ifdef TOOLS_ENABLED Set<PlaceHolderScriptInstance *> placeholders; diff --git a/modules/gdnavigation/gd_navigation_server.cpp b/modules/gdnavigation/gd_navigation_server.cpp index 1f1783802d..4129d1f65a 100644 --- a/modules/gdnavigation/gd_navigation_server.cpp +++ b/modules/gdnavigation/gd_navigation_server.cpp @@ -121,6 +121,7 @@ GdNavigationServer::GdNavigationServer() : } GdNavigationServer::~GdNavigationServer() { + flush_queries(); memdelete(operations_mutex); memdelete(commands_mutex); } @@ -474,12 +475,9 @@ void GdNavigationServer::set_active(bool p_active) const { mut_this->operations_mutex->unlock(); } -void GdNavigationServer::step(real_t p_delta_time) { - if (!active) { - return; - } - - // With c++ we can't be 100% sure this is called in single thread so use the mutex. +void GdNavigationServer::flush_queries() { + // In c++ we can't be sure that this is performed in the main thread + // even with mutable functions. commands_mutex->lock(); operations_mutex->lock(); for (size_t i(0); i < commands.size(); i++) { @@ -489,13 +487,24 @@ void GdNavigationServer::step(real_t p_delta_time) { commands.clear(); operations_mutex->unlock(); commands_mutex->unlock(); +} + +void GdNavigationServer::process(real_t p_delta_time) { + flush_queries(); - // These are internal operations so don't need to be shielded. + if (!active) { + return; + } + + // In c++ we can't be sure that this is performed in the main thread + // even with mutable functions. + operations_mutex->lock(); for (int i(0); i < active_maps.size(); i++) { active_maps[i]->sync(); active_maps[i]->step(p_delta_time); active_maps[i]->dispatch_callbacks(); } + operations_mutex->unlock(); } #undef COMMAND_1 diff --git a/modules/gdnavigation/gd_navigation_server.h b/modules/gdnavigation/gd_navigation_server.h index 7fa5979c31..0400acf1a3 100644 --- a/modules/gdnavigation/gd_navigation_server.h +++ b/modules/gdnavigation/gd_navigation_server.h @@ -131,7 +131,9 @@ public: COMMAND_1(free, RID, p_object); virtual void set_active(bool p_active) const; - virtual void step(real_t p_delta_time); + + void flush_queries(); + virtual void process(real_t p_delta_time); }; #undef COMMAND_1 diff --git a/modules/gdnavigation/nav_map.cpp b/modules/gdnavigation/nav_map.cpp index d3e2f8f388..c3880f89b6 100644 --- a/modules/gdnavigation/nav_map.cpp +++ b/modules/gdnavigation/nav_map.cpp @@ -545,8 +545,11 @@ void NavMap::add_region(NavRegion *p_region) { } void NavMap::remove_region(NavRegion *p_region) { - regions.push_back(p_region); - regenerate_links = true; + std::vector<NavRegion *>::iterator it = std::find(regions.begin(), regions.end(), p_region); + if (it != regions.end()) { + regions.erase(it); + regenerate_links = true; + } } bool NavMap::has_agent(RvoAgent *agent) const { diff --git a/modules/gdnavigation/navigation_mesh_editor_plugin.cpp b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp index 13c74d5706..28fe0bfd06 100644 --- a/modules/gdnavigation/navigation_mesh_editor_plugin.cpp +++ b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp @@ -107,13 +107,13 @@ NavigationMeshEditor::NavigationMeshEditor() { bake_hbox->add_child(button_bake); button_bake->set_toggle_mode(true); button_bake->set_text(TTR("Bake NavMesh")); - button_bake->connect("pressed", this, "_bake_pressed"); + button_bake->connect_compat("pressed", this, "_bake_pressed"); button_reset = memnew(ToolButton); bake_hbox->add_child(button_reset); // No button text, we only use a revert icon which is set when entering the tree. button_reset->set_tooltip(TTR("Clear the navigation mesh.")); - button_reset->connect("pressed", this, "_clear_pressed"); + button_reset->connect_compat("pressed", this, "_clear_pressed"); bake_info = memnew(Label); bake_hbox->add_child(bake_info); diff --git a/modules/gdnavigation/rvo_agent.cpp b/modules/gdnavigation/rvo_agent.cpp index 4d19bc15af..677e525bbf 100644 --- a/modules/gdnavigation/rvo_agent.cpp +++ b/modules/gdnavigation/rvo_agent.cpp @@ -74,7 +74,7 @@ void RvoAgent::dispatch_callback() { callback.id = ObjectID(); } - Variant::CallError responseCallError; + Callable::CallError responseCallError; callback.new_velocity = Vector3(agent.newVelocity_.x(), agent.newVelocity_.y(), agent.newVelocity_.z()); diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index a73276dda2..a72bb7ba49 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -84,7 +84,7 @@ Object *GDScriptNativeClass::instance() { return ClassDB::instance(name); } -GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error) { +GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error) { /* STEP 1, CREATE */ @@ -116,7 +116,7 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco initializer->call(instance, p_args, p_argcount, r_error); - if (r_error.error != Variant::CallError::CALL_OK) { + if (r_error.error != Callable::CallError::CALL_OK) { instance->script = Ref<GDScript>(); instance->owner->set_script_instance(NULL); #ifndef NO_THREADS @@ -127,23 +127,23 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco GDScriptLanguage::singleton->lock->unlock(); #endif - ERR_FAIL_COND_V(r_error.error != Variant::CallError::CALL_OK, NULL); //error constructing + ERR_FAIL_COND_V(r_error.error != Callable::CallError::CALL_OK, NULL); //error constructing } //@TODO make thread safe return instance; } -Variant GDScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant GDScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { /* STEP 1, CREATE */ if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; REF ref; Object *owner = NULL; @@ -329,7 +329,7 @@ ScriptInstance *GDScript::instance_create(Object *p_this) { } } - Variant::CallError unchecked_error; + Callable::CallError unchecked_error; return _create_instance(NULL, 0, p_this, Object::cast_to<Reference>(p_this) != NULL, unchecked_error); } @@ -739,7 +739,7 @@ MultiplayerAPI::RPCMode GDScript::get_rset_mode(const StringName &p_variable) co return get_rset_mode_by_id(get_rset_property_id(p_variable)); } -Variant GDScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant GDScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { GDScript *top = this; while (top) { @@ -995,7 +995,6 @@ void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const { GDScript::GDScript() : script_list(this) { - _static_ref = this; valid = false; subclass_count = 0; initializer = NULL; @@ -1082,18 +1081,18 @@ bool GDScriptInstance::set(const StringName &p_name, const Variant &p_value) { const GDScript::MemberInfo *member = &E->get(); if (member->setter) { const Variant *val = &p_value; - Variant::CallError err; + Callable::CallError err; call(member->setter, &val, 1, err); - if (err.error == Variant::CallError::CALL_OK) { + if (err.error == Callable::CallError::CALL_OK) { return true; //function exists, call was successful } } else { if (!member->data_type.is_type(p_value)) { // Try conversion - Variant::CallError ce; + Callable::CallError ce; const Variant *value = &p_value; Variant converted = Variant::construct(member->data_type.builtin_type, &value, 1, ce); - if (ce.error == Variant::CallError::CALL_OK) { + if (ce.error == Callable::CallError::CALL_OK) { members.write[member->index] = converted; return true; } else { @@ -1116,9 +1115,9 @@ bool GDScriptInstance::set(const StringName &p_name, const Variant &p_value) { Variant name = p_name; const Variant *args[2] = { &name, &p_value }; - Variant::CallError err; + Callable::CallError err; Variant ret = E->get()->call(this, (const Variant **)args, 2, err); - if (err.error == Variant::CallError::CALL_OK && ret.get_type() == Variant::BOOL && ret.operator bool()) + if (err.error == Callable::CallError::CALL_OK && ret.get_type() == Variant::BOOL && ret.operator bool()) return true; } sptr = sptr->_base; @@ -1136,9 +1135,9 @@ bool GDScriptInstance::get(const StringName &p_name, Variant &r_ret) const { const Map<StringName, GDScript::MemberInfo>::Element *E = script->member_indices.find(p_name); if (E) { if (E->get().getter) { - Variant::CallError err; + Callable::CallError err; r_ret = const_cast<GDScriptInstance *>(this)->call(E->get().getter, NULL, 0, err); - if (err.error == Variant::CallError::CALL_OK) { + if (err.error == Callable::CallError::CALL_OK) { return true; } } @@ -1167,9 +1166,9 @@ bool GDScriptInstance::get(const StringName &p_name, Variant &r_ret) const { Variant name = p_name; const Variant *args[1] = { &name }; - Variant::CallError err; + Callable::CallError err; Variant ret = const_cast<GDScriptFunction *>(E->get())->call(const_cast<GDScriptInstance *>(this), (const Variant **)args, 1, err); - if (err.error == Variant::CallError::CALL_OK && ret.get_type() != Variant::NIL) { + if (err.error == Callable::CallError::CALL_OK && ret.get_type() != Variant::NIL) { r_ret = ret; return true; } @@ -1210,9 +1209,9 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const const Map<StringName, GDScriptFunction *>::Element *E = sptr->member_functions.find(GDScriptLanguage::get_singleton()->strings._get_property_list); if (E) { - Variant::CallError err; + Callable::CallError err; Variant ret = const_cast<GDScriptFunction *>(E->get())->call(const_cast<GDScriptInstance *>(this), NULL, 0, err); - if (err.error == Variant::CallError::CALL_OK) { + if (err.error == Callable::CallError::CALL_OK) { ERR_FAIL_COND_MSG(ret.get_type() != Variant::ARRAY, "Wrong type for _get_property_list, must be an array of dictionaries."); @@ -1297,7 +1296,7 @@ bool GDScriptInstance::has_method(const StringName &p_method) const { return false; } -Variant GDScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant GDScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { GDScript *sptr = script.ptr(); while (sptr) { @@ -1307,14 +1306,14 @@ Variant GDScriptInstance::call(const StringName &p_method, const Variant **p_arg } sptr = sptr->_base; } - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } void GDScriptInstance::call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount) { GDScript *sptr = script.ptr(); - Variant::CallError ce; + Callable::CallError ce; while (sptr) { Map<StringName, GDScriptFunction *>::Element *E = sptr->member_functions.find(p_method); @@ -1330,7 +1329,7 @@ void GDScriptInstance::_ml_call_reversed(GDScript *sptr, const StringName &p_met if (sptr->_base) _ml_call_reversed(sptr->_base, p_method, p_args, p_argcount); - Variant::CallError ce; + Callable::CallError ce; Map<StringName, GDScriptFunction *>::Element *E = sptr->member_functions.find(p_method); if (E) { @@ -1355,9 +1354,9 @@ void GDScriptInstance::notification(int p_notification) { while (sptr) { Map<StringName, GDScriptFunction *>::Element *E = sptr->member_functions.find(GDScriptLanguage::get_singleton()->strings._notification); if (E) { - Variant::CallError err; + Callable::CallError err; E->get()->call(this, args, 1, err); - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { //print error about notification call } } @@ -1367,9 +1366,9 @@ void GDScriptInstance::notification(int p_notification) { String GDScriptInstance::to_string(bool *r_valid) { if (has_method(CoreStringNames::get_singleton()->_to_string)) { - Variant::CallError ce; + Callable::CallError ce; Variant ret = call(CoreStringNames::get_singleton()->_to_string, NULL, 0, ce); - if (ce.error == Variant::CallError::CALL_OK) { + if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { if (r_valid) *r_valid = false; diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 103de3304e..6598a0023b 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -73,7 +73,6 @@ class GDScript : public Script { friend class GDScriptFunctions; friend class GDScriptLanguage; - Variant _static_ref; //used for static call Ref<GDScriptNativeClass> native; Ref<GDScript> base; GDScript *_base; //fast pointer access @@ -116,7 +115,7 @@ class GDScript : public Script { String fully_qualified_name; SelfList<GDScript> script_list; - GDScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error); + GDScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error); void _set_subclass_path(Ref<GDScript> &p_sc, const String &p_path); @@ -141,7 +140,7 @@ protected: bool _set(const StringName &p_name, const Variant &p_value); void _get_property_list(List<PropertyInfo> *p_properties) const; - Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); //void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount); static void _bind_methods(); @@ -170,7 +169,7 @@ public: const Map<StringName, GDScriptFunction *> &debug_get_member_functions() const; //this is debug only StringName debug_get_member_by_index(int p_idx) const; - Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual bool can_instance() const; virtual Ref<Script> get_base_script() const; @@ -262,7 +261,7 @@ public: virtual void get_method_list(List<MethodInfo> *p_list) const; virtual bool has_method(const StringName &p_method) const; - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual void call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount); virtual void call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount); diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index fba1b992ec..4bd425f999 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -2076,10 +2076,10 @@ Error GDScriptCompiler::_parse_class_blocks(GDScript *p_script, const GDScriptPa /* STEP 2, INITIALIZE AND CONSTRUCT */ - Variant::CallError ce; + Callable::CallError ce; p_script->initializer->call(instance, NULL, 0, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { //well, tough luck, not goinna do anything here } } diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 52527b7da3..1bc1aae0d2 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -905,10 +905,10 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G argptr.push_back(&args[i]); } - Variant::CallError ce; + Callable::CallError ce; Variant ret = mb->call(baseptr, (const Variant **)argptr.ptr(), argptr.size(), ce); - if (ce.error == Variant::CallError::CALL_OK && ret.get_type() != Variant::NIL) { + if (ce.error == Callable::CallError::CALL_OK && ret.get_type() != Variant::NIL) { if (ret.get_type() != Variant::OBJECT || ret.operator Object *() != NULL) { r_type = _type_from_variant(ret); found = true; @@ -1060,7 +1060,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G StringName id = index.value; found = _guess_identifier_type_from_base(c, base, id, r_type); } else if (!found && index.type.kind == GDScriptParser::DataType::BUILTIN) { - Variant::CallError err; + Callable::CallError err; Variant base_val = Variant::construct(base.type.builtin_type, NULL, 0, err); bool valid = false; Variant res = base_val.get(index.value, &valid); @@ -1114,7 +1114,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G break; } - Variant::CallError ce; + Callable::CallError ce; bool v1_use_value = p1.value.get_type() != Variant::NIL && p1.value.get_type() != Variant::OBJECT; Variant v1 = (v1_use_value) ? p1.value : Variant::construct(p1.type.builtin_type, NULL, 0, ce); bool v2_use_value = p2.value.get_type() != Variant::NIL && p2.value.get_type() != Variant::OBJECT; @@ -1124,7 +1124,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G v2 = 1; v2_use_value = false; } - if (vop == Variant::OP_DIVIDE && v2.get_type() == Variant::REAL) { + if (vop == Variant::OP_DIVIDE && v2.get_type() == Variant::FLOAT) { v2 = 1.0; v2_use_value = false; } @@ -1533,10 +1533,10 @@ static bool _guess_identifier_type_from_base(GDScriptCompletionContext &p_contex return false; } break; case GDScriptParser::DataType::BUILTIN: { - Variant::CallError err; + Callable::CallError err; Variant tmp = Variant::construct(base_type.builtin_type, NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { return false; } bool valid = false; @@ -1703,9 +1703,9 @@ static bool _guess_method_return_type_from_base(GDScriptCompletionContext &p_con return false; } break; case GDScriptParser::DataType::BUILTIN: { - Variant::CallError err; + Callable::CallError err; Variant tmp = Variant::construct(base_type.builtin_type, NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { return false; } @@ -2088,9 +2088,9 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context return; } break; case GDScriptParser::DataType::BUILTIN: { - Variant::CallError err; + Callable::CallError err; Variant tmp = Variant::construct(base_type.builtin_type, NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { return; } @@ -2172,8 +2172,8 @@ static void _find_identifiers(const GDScriptCompletionContext &p_context, bool p } static const char *_type_names[Variant::VARIANT_MAX] = { - "null", "bool", "int", "float", "String", "Vector2", "Rect2", "Vector3", "Transform2D", "Plane", "Quat", "AABB", "Basis", "Transform", - "Color", "NodePath", "RID", "Object", "Dictionary", "Array", "PackedByteArray", "PackedIntArray", "PackedRealArray", "PackedStringArray", + "null", "bool", "int", "float", "String", "Vector2", "Vector2i", "Rect2", "Rect2i", "Vector3", "Vector3i", "Transform2D", "Plane", "Quat", "AABB", "Basis", "Transform", + "Color", "StringName", "NodePath", "RID", "Object", "Callable", "Signal", "Dictionary", "Array", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "PackedFloat32Array", "PackedFloat64Array", "PackedStringArray", "PackedVector2Array", "PackedVector3Array", "PackedColorArray" }; @@ -2372,9 +2372,9 @@ static void _find_call_arguments(const GDScriptCompletionContext &p_context, con } break; case GDScriptParser::DataType::BUILTIN: { if (base.get_type() == Variant::NIL) { - Variant::CallError err; + Callable::CallError err; base = Variant::construct(base_type.builtin_type, NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { return; } } @@ -2565,7 +2565,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path } break; case GDScriptParser::COMPLETION_FUNCTION: { is_function = true; - FALLTHROUGH; + [[fallthrough]]; } case GDScriptParser::COMPLETION_IDENTIFIER: { _find_identifiers(context, is_function, options); @@ -2608,7 +2608,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path } break; case GDScriptParser::COMPLETION_METHOD: { is_function = true; - FALLTHROUGH; + [[fallthrough]]; } case GDScriptParser::COMPLETION_INDEX: { const GDScriptParser::Node *node = parser.get_completion_node(); @@ -3219,9 +3219,9 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co v_ref.instance(); v = v_ref; } else { - Variant::CallError err; + Callable::CallError err; v = Variant::construct(base_type.builtin_type, NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { break; } } @@ -3330,7 +3330,7 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol case GDScriptParser::COMPLETION_PARENT_FUNCTION: case GDScriptParser::COMPLETION_FUNCTION: { is_function = true; - FALLTHROUGH; + [[fallthrough]]; } case GDScriptParser::COMPLETION_IDENTIFIER: { @@ -3462,7 +3462,7 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol } break; case GDScriptParser::COMPLETION_METHOD: { is_function = true; - FALLTHROUGH; + [[fallthrough]]; } case GDScriptParser::COMPLETION_INDEX: { const GDScriptParser::Node *node = parser.get_completion_node(); diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index cbf7d81a61..27857ea91f 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -34,7 +34,7 @@ #include "gdscript.h" #include "gdscript_functions.h" -Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant *p_stack, String &r_error) const { +Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant &static_ref, Variant *p_stack, String &r_error) const { int address = p_address & ADDR_MASK; @@ -52,7 +52,7 @@ Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_insta } break; case ADDR_TYPE_CLASS: { - return &p_script->_static_ref; + return &static_ref; } break; case ADDR_TYPE_MEMBER: { #ifdef DEBUG_ENABLED @@ -160,11 +160,11 @@ static String _get_var_type(const Variant *p_var) { } #endif // DEBUG_ENABLED -String GDScriptFunction::_get_call_error(const Variant::CallError &p_err, const String &p_where, const Variant **argptrs) const { +String GDScriptFunction::_get_call_error(const Callable::CallError &p_err, const String &p_where, const Variant **argptrs) const { String err_text; - if (p_err.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) { + if (p_err.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) { int errorarg = p_err.argument; // Handle the Object to Object case separately as we don't have further class details. #ifdef DEBUG_ENABLED @@ -173,15 +173,15 @@ String GDScriptFunction::_get_call_error(const Variant::CallError &p_err, const } else #endif // DEBUG_ENABLED { - err_text = "Invalid type in " + p_where + ". Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(p_err.expected) + "."; + err_text = "Invalid type in " + p_where + ". Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(Variant::Type(p_err.expected)) + "."; } - } else if (p_err.error == Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { + } else if (p_err.error == Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { err_text = "Invalid call to " + p_where + ". Expected " + itos(p_err.argument) + " arguments."; - } else if (p_err.error == Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { + } else if (p_err.error == Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { err_text = "Invalid call to " + p_where + ". Expected " + itos(p_err.argument) + " arguments."; - } else if (p_err.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) { + } else if (p_err.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) { err_text = "Invalid call. Nonexistent " + p_where + "."; - } else if (p_err.error == Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) { + } else if (p_err.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) { err_text = "Attempt to call " + p_where + " on a null instance."; } else { err_text = "Bug, call error: #" + itos(p_err.error); @@ -258,7 +258,7 @@ String GDScriptFunction::_get_call_error(const Variant::CallError &p_err, const #define OPCODE_OUT break #endif -Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Variant::CallError &r_err, CallState *p_state) { +Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Callable::CallError &r_err, CallState *p_state) { OPCODES_TABLE; @@ -267,9 +267,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a return Variant(); } - r_err.error = Variant::CallError::CALL_OK; + r_err.error = Callable::CallError::CALL_OK; Variant self; + Variant static_ref; Variant retvalue; Variant *stack = NULL; Variant **call_args; @@ -305,13 +306,13 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a if (p_argcount > _argument_count) { - r_err.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_err.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_err.argument = _argument_count; return Variant(); } else if (p_argcount < _argument_count - _default_arg_count) { - r_err.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_err.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_err.argument = _argument_count - _default_arg_count; return Variant(); } else { @@ -340,7 +341,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a memnew_placement(&stack[i], Variant); continue; } else { - r_err.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_err.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_err.argument = i; r_err.expected = argument_types[i].kind == GDScriptDataType::BUILTIN ? argument_types[i].builtin_type : Variant::OBJECT; return Variant(); @@ -404,10 +405,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #define CHECK_SPACE(m_space) \ GD_ERR_BREAK((ip + m_space) > _code_size) -#define GET_VARIANT_PTR(m_v, m_code_ofs) \ - Variant *m_v; \ - m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, stack, err_text); \ - if (unlikely(!m_v)) \ +#define GET_VARIANT_PTR(m_v, m_code_ofs) \ + Variant *m_v; \ + m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, static_ref, stack, err_text); \ + if (unlikely(!m_v)) \ OPCODE_BREAK; #else @@ -415,7 +416,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #define CHECK_SPACE(m_space) #define GET_VARIANT_PTR(m_v, m_code_ofs) \ Variant *m_v; \ - m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, stack, err_text); + m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, script, self, static_ref, stack, err_text); #endif @@ -791,7 +792,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #ifdef DEBUG_ENABLED if (Variant::can_convert_strict(src->get_type(), var_type)) { #endif // DEBUG_ENABLED - Variant::CallError ce; + Callable::CallError ce; *dst = Variant::construct(var_type, const_cast<const Variant **>(&src), 1, ce); } else { #ifdef DEBUG_ENABLED @@ -897,11 +898,11 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a GD_ERR_BREAK(to_type < 0 || to_type >= Variant::VARIANT_MAX); - Variant::CallError err; + Callable::CallError err; *dst = Variant::construct(to_type, (const Variant **)&src, 1, err); #ifdef DEBUG_ENABLED - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { err_text = "Invalid cast: could not convert value to '" + Variant::get_type_name(to_type) + "'."; OPCODE_BREAK; } @@ -1000,11 +1001,11 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a } GET_VARIANT_PTR(dst, 3 + argc); - Variant::CallError err; + Callable::CallError err; *dst = Variant::construct(t, (const Variant **)argptrs, argc, err); #ifdef DEBUG_ENABLED - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { err_text = _get_call_error(err, "'" + Variant::get_type_name(t) + "' constructor", (const Variant **)argptrs); OPCODE_BREAK; @@ -1091,7 +1092,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a } #endif - Variant::CallError err; + Callable::CallError err; if (call_ret) { GET_VARIANT_PTR(ret, argc); @@ -1105,7 +1106,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a function_call_time += OS::get_singleton()->get_ticks_usec() - call_time; } - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { String methodstr = *methodname; String basestr = _get_var_type(base); @@ -1113,13 +1114,13 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a if (methodstr == "call") { if (argc >= 1) { methodstr = String(*argptrs[0]) + " (via call)"; - if (err.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) { + if (err.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) { err.argument += 1; } } } else if (methodstr == "free") { - if (err.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) { + if (err.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) { if (base->is_ref()) { err_text = "Attempted to free a reference."; @@ -1160,12 +1161,12 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a GET_VARIANT_PTR(dst, argc); - Variant::CallError err; + Callable::CallError err; GDScriptFunctions::call(func, (const Variant **)argptrs, argc, *dst, err); #ifdef DEBUG_ENABLED - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { String methodstr = GDScriptFunctions::get_func_name(func); if (dst->get_type() == Variant::STRING) { @@ -1223,7 +1224,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a break; } - Variant::CallError err; + Callable::CallError err; if (E) { @@ -1234,23 +1235,23 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a MethodBind *mb = ClassDB::get_method(gds->native->get_name(), *methodname); if (!mb) { - err.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + err.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; } else { *dst = mb->call(p_instance->owner, (const Variant **)argptrs, argc, err); } } else { - err.error = Variant::CallError::CALL_OK; + err.error = Callable::CallError::CALL_OK; } } else { if (*methodname != GDScriptLanguage::get_singleton()->strings._init) { - err.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + err.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; } else { - err.error = Variant::CallError::CALL_OK; + err.error = Callable::CallError::CALL_OK; } } - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { String methodstr = *methodname; err_text = _get_call_error(err, "function '" + methodstr + "'", (const Variant **)argptrs); @@ -1331,7 +1332,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a OPCODE_BREAK; } - Error err = obj->connect(signal, gdfs.ptr(), "_signal_callback", varray(gdfs), Object::CONNECT_ONESHOT); + Error err = obj->connect_compat(signal, gdfs.ptr(), "_signal_callback", varray(gdfs), Object::CONNECT_ONESHOT); if (err != OK) { err_text = "Error connecting to signal: " + signal + " during yield()."; OPCODE_BREAK; @@ -1340,7 +1341,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a Object *obj = argobj->operator Object *(); String signal = argname->operator String(); - obj->connect(signal, gdfs.ptr(), "_signal_callback", varray(gdfs), Object::CONNECT_ONESHOT); + obj->connect_compat(signal, gdfs.ptr(), "_signal_callback", varray(gdfs), Object::CONNECT_ONESHOT); #endif } @@ -1805,13 +1806,13 @@ GDScriptFunction::~GDScriptFunction() { ///////////////////// -Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { Variant arg; - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; if (p_argcount == 0) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; return Variant(); } else if (p_argcount == 1) { @@ -1829,7 +1830,7 @@ Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_ar Ref<GDScriptFunctionState> self = *p_args[p_argcount - 1]; if (self.is_null()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = p_argcount - 1; r_error.expected = Variant::OBJECT; return Variant(); @@ -1864,7 +1865,7 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) { } state.result = p_arg; - Variant::CallError err; + Callable::CallError err; Variant ret = function->call(NULL, NULL, 0, err, &state); bool completed = true; diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index 7b7bcbaac9..34019e563d 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -265,8 +265,8 @@ private: List<StackDebug> stack_debug; - _FORCE_INLINE_ Variant *_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant *p_stack, String &r_error) const; - _FORCE_INLINE_ String _get_call_error(const Variant::CallError &p_err, const String &p_where, const Variant **argptrs) const; + _FORCE_INLINE_ Variant *_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant &static_ref, Variant *p_stack, String &r_error) const; + _FORCE_INLINE_ String _get_call_error(const Callable::CallError &p_err, const String &p_where, const Variant **argptrs) const; friend class GDScriptLanguage; @@ -339,7 +339,7 @@ public: return default_arguments[p_idx]; } - Variant call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Variant::CallError &r_err, CallState *p_state = NULL); + Variant call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Callable::CallError &r_err, CallState *p_state = NULL); _FORCE_INLINE_ MultiplayerAPI::RPCMode get_rpc_mode() const { return rpc_mode; } GDScriptFunction(); @@ -352,7 +352,7 @@ class GDScriptFunctionState : public Reference { friend class GDScriptFunction; GDScriptFunction *function; GDScriptFunction::CallState state; - Variant _signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error); Ref<GDScriptFunctionState> first_state; protected: diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index bd887fd303..aaa308f40f 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -139,32 +139,32 @@ const char *GDScriptFunctions::get_func_name(Function p_func) { return _names[p_func]; } -void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_count, Variant &r_ret, Variant::CallError &r_error) { +void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_count, Variant &r_ret, Callable::CallError &r_error) { - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; #ifdef DEBUG_ENABLED -#define VALIDATE_ARG_COUNT(m_count) \ - if (p_arg_count < m_count) { \ - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; \ - r_error.argument = m_count; \ - r_ret = Variant(); \ - return; \ - } \ - if (p_arg_count > m_count) { \ - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; \ - r_error.argument = m_count; \ - r_ret = Variant(); \ - return; \ +#define VALIDATE_ARG_COUNT(m_count) \ + if (p_arg_count < m_count) { \ + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; \ + r_error.argument = m_count; \ + r_ret = Variant(); \ + return; \ + } \ + if (p_arg_count > m_count) { \ + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; \ + r_error.argument = m_count; \ + r_ret = Variant(); \ + return; \ } -#define VALIDATE_ARG_NUM(m_arg) \ - if (!p_args[m_arg]->is_num()) { \ - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; \ - r_error.argument = m_arg; \ - r_error.expected = Variant::REAL; \ - r_ret = Variant(); \ - return; \ +#define VALIDATE_ARG_NUM(m_arg) \ + if (!p_args[m_arg]->is_num()) { \ + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \ + r_error.argument = m_arg; \ + r_error.expected = Variant::FLOAT; \ + r_ret = Variant(); \ + return; \ } #else @@ -272,15 +272,15 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ int64_t i = *p_args[0]; r_ret = ABS(i); - } else if (p_args[0]->get_type() == Variant::REAL) { + } else if (p_args[0]->get_type() == Variant::FLOAT) { double r = *p_args[0]; r_ret = Math::abs(r); } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::REAL; + r_error.expected = Variant::FLOAT; r_ret = Variant(); } } break; @@ -290,15 +290,15 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ int64_t i = *p_args[0]; r_ret = i < 0 ? -1 : (i > 0 ? +1 : 0); - } else if (p_args[0]->get_type() == Variant::REAL) { + } else if (p_args[0]->get_type() == Variant::FLOAT) { real_t r = *p_args[0]; r_ret = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0); } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::REAL; + r_error.expected = Variant::FLOAT; r_ret = Variant(); } } break; @@ -360,12 +360,12 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ VALIDATE_ARG_COUNT(3); VALIDATE_ARG_NUM(2); const double t = (double)*p_args[2]; - switch (p_args[0]->get_type() == p_args[1]->get_type() ? p_args[0]->get_type() : Variant::REAL) { + switch (p_args[0]->get_type() == p_args[1]->get_type() ? p_args[0]->get_type() : Variant::FLOAT) { case Variant::VECTOR2: { r_ret = ((Vector2)*p_args[0]).linear_interpolate((Vector2)*p_args[1], t); } break; case Variant::VECTOR3: { - r_ret = ((Vector3)*p_args[0]).linear_interpolate((Vector3)*p_args[1], t); + r_ret = (p_args[0]->operator Vector3()).linear_interpolate(p_args[1]->operator Vector3(), t); } break; case Variant::COLOR: { r_ret = ((Color)*p_args[0]).linear_interpolate((Color)*p_args[1], t); @@ -585,7 +585,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Ref<WeakRef> wref = memnew(WeakRef); r_ret = wref; } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; r_ret = Variant(); @@ -596,7 +596,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ VALIDATE_ARG_COUNT(2); if (p_args[0]->get_type() != Variant::OBJECT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; r_ret = Variant(); @@ -604,7 +604,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } if (p_args[1]->get_type() != Variant::STRING && p_args[1]->get_type() != Variant::NODE_PATH) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::STRING; r_ret = Variant(); @@ -626,7 +626,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (type < 0 || type >= Variant::VARIANT_MAX) { r_ret = RTR("Invalid type argument to convert(), use TYPE_* constants."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::INT; return; @@ -660,7 +660,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; r_ret = Variant(); @@ -671,7 +671,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (str.length() != 1) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; r_ret = RTR("Expected a string of length 1 (a character)."); @@ -683,7 +683,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } break; case TEXT_STR: { if (p_arg_count < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; r_ret = Variant(); @@ -785,7 +785,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case PUSH_ERROR: { VALIDATE_ARG_COUNT(1); if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; r_ret = Variant(); @@ -799,7 +799,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case PUSH_WARNING: { VALIDATE_ARG_COUNT(1); if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; r_ret = Variant(); @@ -819,7 +819,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case STR_TO_VAR: { VALIDATE_ARG_COUNT(1); if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; r_ret = Variant(); @@ -837,17 +837,17 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case VAR_TO_BYTES: { bool full_objects = false; if (p_arg_count < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; r_ret = Variant(); return; } else if (p_arg_count > 2) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = 2; r_ret = Variant(); } else if (p_arg_count == 2) { if (p_args[1]->get_type() != Variant::BOOL) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::BOOL; r_ret = Variant(); @@ -860,7 +860,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ int len; Error err = encode_variant(*p_args[0], NULL, len, full_objects); if (err) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::NIL; r_ret = "Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID)."; @@ -877,17 +877,17 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case BYTES_TO_VAR: { bool allow_objects = false; if (p_arg_count < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; r_ret = Variant(); return; } else if (p_arg_count > 2) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = 2; r_ret = Variant(); } else if (p_arg_count == 2) { if (p_args[1]->get_type() != Variant::BOOL) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::BOOL; r_ret = Variant(); @@ -897,7 +897,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } if (p_args[0]->get_type() != Variant::PACKED_BYTE_ARRAY) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::PACKED_BYTE_ARRAY; r_ret = Variant(); @@ -911,7 +911,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Error err = decode_variant(ret, r, varr.size(), NULL, allow_objects); if (err != OK) { r_ret = RTR("Not enough bytes for decoding bytes, or invalid format."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::PACKED_BYTE_ARRAY; return; @@ -927,7 +927,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case 0: { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; r_ret = Variant(); @@ -943,7 +943,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } Error err = arr.resize(count); if (err != OK) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_ret = Variant(); return; } @@ -969,7 +969,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } Error err = arr.resize(to - from); if (err != OK) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_ret = Variant(); return; } @@ -989,7 +989,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (incr == 0) { r_ret = RTR("Step argument is zero!"); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return; } @@ -1016,7 +1016,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Error err = arr.resize(count); if (err != OK) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_ret = Variant(); return; } @@ -1038,7 +1038,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } break; default: { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = 3; r_ret = Variant(); @@ -1049,7 +1049,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case RESOURCE_LOAD: { VALIDATE_ARG_COUNT(1); if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; r_ret = Variant(); @@ -1065,7 +1065,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (p_args[0]->get_type() == Variant::NIL) { r_ret = Variant(); } else if (p_args[0]->get_type() != Variant::OBJECT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_ret = Variant(); } else { @@ -1076,7 +1076,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ } else if (!obj->get_script_instance() || obj->get_script_instance()->get_language() != GDScriptLanguage::get_singleton()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::DICTIONARY; r_ret = RTR("Not a script with an instance"); @@ -1087,7 +1087,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Ref<GDScript> base = ins->get_script(); if (base.is_null()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::DICTIONARY; r_ret = RTR("Not based on a script"); @@ -1105,7 +1105,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ sname.invert(); if (!p->path.is_resource_file()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::DICTIONARY; r_ret = Variant(); @@ -1137,7 +1137,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (p_args[0]->get_type() != Variant::DICTIONARY) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::DICTIONARY; r_ret = Variant(); @@ -1149,7 +1149,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (!d.has("@path")) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; r_ret = RTR("Invalid instance dictionary format (missing @path)"); @@ -1160,7 +1160,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Ref<Script> scr = ResourceLoader::load(d["@path"]); if (!scr.is_valid()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; r_ret = RTR("Invalid instance dictionary format (can't load script at @path)"); @@ -1171,7 +1171,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (!gdscr.is_valid()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; r_ret = Variant(); @@ -1189,7 +1189,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ gdscr = gdscr->subclasses[sub.get_name(i)]; if (!gdscr.is_valid()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; r_ret = Variant(); @@ -1215,7 +1215,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ VALIDATE_ARG_COUNT(1); if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; r_ret = Variant(); @@ -1239,7 +1239,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ VALIDATE_ARG_COUNT(1); if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; r_ret = Variant(); @@ -1271,14 +1271,14 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case COLOR8: { if (p_arg_count < 3) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 3; r_ret = Variant(); return; } if (p_arg_count > 4) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = 4; r_ret = Variant(); @@ -1302,21 +1302,21 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case COLORN: { if (p_arg_count < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; r_ret = Variant(); return; } if (p_arg_count > 2) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = 2; r_ret = Variant(); return; } if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_ret = Variant(); } else { @@ -1359,8 +1359,8 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ case INSTANCE_FROM_ID: { VALIDATE_ARG_COUNT(1); - if (p_args[0]->get_type() != Variant::INT && p_args[0]->get_type() != Variant::REAL) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + if (p_args[0]->get_type() != Variant::INT && p_args[0]->get_type() != Variant::FLOAT) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::INT; r_ret = Variant(); @@ -1395,14 +1395,24 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Vector<uint8_t> d = *p_args[0]; r_ret = d.size(); } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { - Vector<int> d = *p_args[0]; + Vector<int32_t> d = *p_args[0]; r_ret = d.size(); } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_INT64_ARRAY: { - Vector<real_t> d = *p_args[0]; + Vector<int64_t> d = *p_args[0]; + r_ret = d.size(); + } break; + case Variant::PACKED_FLOAT32_ARRAY: { + + Vector<float> d = *p_args[0]; + r_ret = d.size(); + } break; + case Variant::PACKED_FLOAT64_ARRAY: { + + Vector<double> d = *p_args[0]; r_ret = d.size(); } break; case Variant::PACKED_STRING_ARRAY: { @@ -1426,7 +1436,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ r_ret = d.size(); } break; default: { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; r_ret = Variant(); @@ -1530,69 +1540,69 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { switch (p_func) { case MATH_SIN: { - MethodInfo mi("sin", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("sin", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_COS: { - MethodInfo mi("cos", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("cos", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_TAN: { - MethodInfo mi("tan", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("tan", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_SINH: { - MethodInfo mi("sinh", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("sinh", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_COSH: { - MethodInfo mi("cosh", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("cosh", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_TANH: { - MethodInfo mi("tanh", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("tanh", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_ASIN: { - MethodInfo mi("asin", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("asin", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_ACOS: { - MethodInfo mi("acos", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("acos", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_ATAN: { - MethodInfo mi("atan", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("atan", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_ATAN2: { - MethodInfo mi("atan2", PropertyInfo(Variant::REAL, "y"), PropertyInfo(Variant::REAL, "x")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("atan2", PropertyInfo(Variant::FLOAT, "y"), PropertyInfo(Variant::FLOAT, "x")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_SQRT: { - MethodInfo mi("sqrt", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("sqrt", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_FMOD: { - MethodInfo mi("fmod", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("fmod", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_FPOSMOD: { - MethodInfo mi("fposmod", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("fposmod", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_POSMOD: { @@ -1601,114 +1611,114 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { return mi; } break; case MATH_FLOOR: { - MethodInfo mi("floor", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("floor", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_CEIL: { - MethodInfo mi("ceil", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("ceil", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_ROUND: { - MethodInfo mi("round", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("round", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_ABS: { - MethodInfo mi("abs", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("abs", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_SIGN: { - MethodInfo mi("sign", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("sign", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_POW: { - MethodInfo mi("pow", PropertyInfo(Variant::REAL, "base"), PropertyInfo(Variant::REAL, "exp")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("pow", PropertyInfo(Variant::FLOAT, "base"), PropertyInfo(Variant::FLOAT, "exp")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_LOG: { - MethodInfo mi("log", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("log", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_EXP: { - MethodInfo mi("exp", PropertyInfo(Variant::REAL, "s")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("exp", PropertyInfo(Variant::FLOAT, "s")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_ISNAN: { - MethodInfo mi("is_nan", PropertyInfo(Variant::REAL, "s")); + MethodInfo mi("is_nan", PropertyInfo(Variant::FLOAT, "s")); mi.return_val.type = Variant::BOOL; return mi; } break; case MATH_ISINF: { - MethodInfo mi("is_inf", PropertyInfo(Variant::REAL, "s")); + MethodInfo mi("is_inf", PropertyInfo(Variant::FLOAT, "s")); mi.return_val.type = Variant::BOOL; return mi; } break; case MATH_ISEQUALAPPROX: { - MethodInfo mi("is_equal_approx", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b")); + MethodInfo mi("is_equal_approx", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b")); mi.return_val.type = Variant::BOOL; return mi; } break; case MATH_ISZEROAPPROX: { - MethodInfo mi("is_zero_approx", PropertyInfo(Variant::REAL, "s")); + MethodInfo mi("is_zero_approx", PropertyInfo(Variant::FLOAT, "s")); mi.return_val.type = Variant::BOOL; return mi; } break; case MATH_EASE: { - MethodInfo mi("ease", PropertyInfo(Variant::REAL, "s"), PropertyInfo(Variant::REAL, "curve")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("ease", PropertyInfo(Variant::FLOAT, "s"), PropertyInfo(Variant::FLOAT, "curve")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_STEP_DECIMALS: { - MethodInfo mi("step_decimals", PropertyInfo(Variant::REAL, "step")); + MethodInfo mi("step_decimals", PropertyInfo(Variant::FLOAT, "step")); mi.return_val.type = Variant::INT; return mi; } break; case MATH_STEPIFY: { - MethodInfo mi("stepify", PropertyInfo(Variant::REAL, "s"), PropertyInfo(Variant::REAL, "step")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("stepify", PropertyInfo(Variant::FLOAT, "s"), PropertyInfo(Variant::FLOAT, "step")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_LERP: { - MethodInfo mi("lerp", PropertyInfo(Variant::NIL, "from"), PropertyInfo(Variant::NIL, "to"), PropertyInfo(Variant::REAL, "weight")); + MethodInfo mi("lerp", PropertyInfo(Variant::NIL, "from"), PropertyInfo(Variant::NIL, "to"), PropertyInfo(Variant::FLOAT, "weight")); mi.return_val.type = Variant::NIL; mi.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; return mi; } break; case MATH_LERP_ANGLE: { - MethodInfo mi("lerp_angle", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("lerp_angle", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_INVERSE_LERP: { - MethodInfo mi("inverse_lerp", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("inverse_lerp", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_RANGE_LERP: { - MethodInfo mi("range_lerp", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "istart"), PropertyInfo(Variant::REAL, "istop"), PropertyInfo(Variant::REAL, "ostart"), PropertyInfo(Variant::REAL, "ostop")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("range_lerp", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "istart"), PropertyInfo(Variant::FLOAT, "istop"), PropertyInfo(Variant::FLOAT, "ostart"), PropertyInfo(Variant::FLOAT, "ostop")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_SMOOTHSTEP: { - MethodInfo mi("smoothstep", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("smoothstep", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "weight")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_MOVE_TOWARD: { - MethodInfo mi("move_toward", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "delta")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("move_toward", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to"), PropertyInfo(Variant::FLOAT, "delta")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_DECTIME: { - MethodInfo mi("dectime", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "amount"), PropertyInfo(Variant::REAL, "step")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("dectime", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "amount"), PropertyInfo(Variant::FLOAT, "step")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_RANDOMIZE: { @@ -1723,12 +1733,12 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { } break; case MATH_RANDF: { MethodInfo mi("randf"); - mi.return_val.type = Variant::REAL; + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_RANDOM: { - MethodInfo mi("rand_range", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("rand_range", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_SEED: { @@ -1742,32 +1752,32 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { return mi; } break; case MATH_DEG2RAD: { - MethodInfo mi("deg2rad", PropertyInfo(Variant::REAL, "deg")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("deg2rad", PropertyInfo(Variant::FLOAT, "deg")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_RAD2DEG: { - MethodInfo mi("rad2deg", PropertyInfo(Variant::REAL, "rad")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("rad2deg", PropertyInfo(Variant::FLOAT, "rad")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_LINEAR2DB: { - MethodInfo mi("linear2db", PropertyInfo(Variant::REAL, "nrg")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("linear2db", PropertyInfo(Variant::FLOAT, "nrg")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_DB2LINEAR: { - MethodInfo mi("db2linear", PropertyInfo(Variant::REAL, "db")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("db2linear", PropertyInfo(Variant::FLOAT, "db")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case MATH_POLAR2CARTESIAN: { - MethodInfo mi("polar2cartesian", PropertyInfo(Variant::REAL, "r"), PropertyInfo(Variant::REAL, "th")); + MethodInfo mi("polar2cartesian", PropertyInfo(Variant::FLOAT, "r"), PropertyInfo(Variant::FLOAT, "th")); mi.return_val.type = Variant::VECTOR2; return mi; } break; case MATH_CARTESIAN2POLAR: { - MethodInfo mi("cartesian2polar", PropertyInfo(Variant::REAL, "x"), PropertyInfo(Variant::REAL, "y")); + MethodInfo mi("cartesian2polar", PropertyInfo(Variant::FLOAT, "x"), PropertyInfo(Variant::FLOAT, "y")); mi.return_val.type = Variant::VECTOR2; return mi; } break; @@ -1777,24 +1787,24 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { return mi; } break; case MATH_WRAPF: { - MethodInfo mi("wrapf", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "min"), PropertyInfo(Variant::REAL, "max")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("wrapf", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "min"), PropertyInfo(Variant::FLOAT, "max")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case LOGIC_MAX: { - MethodInfo mi("max", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("max", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case LOGIC_MIN: { - MethodInfo mi("min", PropertyInfo(Variant::REAL, "a"), PropertyInfo(Variant::REAL, "b")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("min", PropertyInfo(Variant::FLOAT, "a"), PropertyInfo(Variant::FLOAT, "b")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case LOGIC_CLAMP: { - MethodInfo mi("clamp", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "min"), PropertyInfo(Variant::REAL, "max")); - mi.return_val.type = Variant::REAL; + MethodInfo mi("clamp", PropertyInfo(Variant::FLOAT, "value"), PropertyInfo(Variant::FLOAT, "min"), PropertyInfo(Variant::FLOAT, "max")); + mi.return_val.type = Variant::FLOAT; return mi; } break; case LOGIC_NEAREST_PO2: { @@ -2012,7 +2022,7 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { } break; case COLORN: { - MethodInfo mi("ColorN", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::REAL, "alpha")); + MethodInfo mi("ColorN", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::FLOAT, "alpha")); mi.default_arguments.push_back(1.0f); mi.return_val.type = Variant::COLOR; return mi; diff --git a/modules/gdscript/gdscript_functions.h b/modules/gdscript/gdscript_functions.h index 8b97194ed6..2c6dc02913 100644 --- a/modules/gdscript/gdscript_functions.h +++ b/modules/gdscript/gdscript_functions.h @@ -129,7 +129,7 @@ public: }; static const char *get_func_name(Function p_func); - static void call(Function p_func, const Variant **p_args, int p_arg_count, Variant &r_ret, Variant::CallError &r_error); + static void call(Function p_func, const Variant **p_args, int p_arg_count, Variant &r_ret, Callable::CallError &r_error); static bool is_deterministic(Function p_func); static MethodInfo get_info(Function p_func); }; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 33c6a55bfb..0382944efd 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -793,7 +793,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s } _add_warning(GDScriptWarning::UNASSIGNED_VARIABLE_OP_ASSIGN, -1, identifier.operator String()); } - FALLTHROUGH; + [[fallthrough]]; } case GDScriptTokenizer::TK_OP_ASSIGN: { lv->assignments += 1; @@ -1739,7 +1739,7 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to vptr = (const Variant **)&ptrs[0]; } - Variant::CallError ce; + Callable::CallError ce; Variant v; if (op->arguments[0]->type == Node::TYPE_TYPE) { @@ -1751,7 +1751,7 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to GDScriptFunctions::call(func, vptr, ptrs.size(), v, ce); } - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { String errwhere; if (op->arguments[0]->type == Node::TYPE_TYPE) { @@ -1765,16 +1765,16 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to switch (ce.error) { - case Variant::CallError::CALL_ERROR_INVALID_ARGUMENT: { + case Callable::CallError::CALL_ERROR_INVALID_ARGUMENT: { _set_error("Invalid argument (#" + itos(ce.argument + 1) + ") for " + errwhere + "."); } break; - case Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { + case Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: { _set_error("Too many arguments for " + errwhere + "."); } break; - case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { + case Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: { _set_error("Too few arguments for " + errwhere + "."); } break; @@ -2766,13 +2766,12 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { } #endif // DEBUG_ENABLED switch (token) { - case GDScriptTokenizer::TK_EOF: + case GDScriptTokenizer::TK_EOF: { p_block->end_line = tokenizer->get_token_line(); + return; // End of file! + } break; case GDScriptTokenizer::TK_ERROR: { - return; //go back - - //end of file! - + return; } break; case GDScriptTokenizer::TK_NEWLINE: { @@ -3109,7 +3108,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { args.push_back(op->arguments[i]); if (constant && op->arguments[i]->type == Node::TYPE_CONSTANT) { ConstantNode *c = static_cast<ConstantNode *>(op->arguments[i]); - if (c->value.get_type() == Variant::REAL || c->value.get_type() == Variant::INT) { + if (c->value.get_type() == Variant::FLOAT || c->value.get_type() == Variant::INT) { constants.push_back(c->value); constant = true; } @@ -3525,11 +3524,12 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { case GDScriptTokenizer::TK_CURSOR: { tokenizer->advance(); } break; - case GDScriptTokenizer::TK_EOF: + case GDScriptTokenizer::TK_EOF: { p_class->end_line = tokenizer->get_token_line(); + return; // End of file! + } break; case GDScriptTokenizer::TK_ERROR: { - return; //go back - //end of file! + return; // Go back. } break; case GDScriptTokenizer::TK_NEWLINE: { if (!_parse_newline()) { @@ -3719,7 +3719,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { return; } - FALLTHROUGH; + [[fallthrough]]; } case GDScriptTokenizer::TK_PR_FUNCTION: { @@ -4220,9 +4220,9 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { break; } - FALLTHROUGH; + [[fallthrough]]; } - case Variant::REAL: { + case Variant::FLOAT: { if (tokenizer->get_token() == GDScriptTokenizer::TK_IDENTIFIER && tokenizer->get_token_identifier() == "EASE") { current_export.hint = PROPERTY_HINT_EXP_EASING; @@ -4809,7 +4809,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { } #ifdef TOOLS_ENABLED - Variant::CallError ce; + Callable::CallError ce; member.default_value = Variant::construct(member._export.type, NULL, 0, ce); #endif @@ -4878,7 +4878,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { if (cn->value.get_type() != Variant::NIL) { if (member._export.type != Variant::NIL && cn->value.get_type() != member._export.type) { if (Variant::can_convert(cn->value.get_type(), member._export.type)) { - Variant::CallError err; + Callable::CallError err; const Variant *args = &cn->value; cn->value = Variant::construct(member._export.type, &args, 1, err); } else { @@ -5489,7 +5489,7 @@ String GDScriptParser::DataType::to_string() const { if (!gds_class.empty()) { return gds_class; } - FALLTHROUGH; + [[fallthrough]]; } case SCRIPT: { if (is_meta_type) { @@ -5933,9 +5933,9 @@ GDScriptParser::DataType GDScriptParser::_get_operation_type(const Variant::Oper a_ref.instance(); a = a_ref; } else { - Variant::CallError err; + Callable::CallError err; a = Variant::construct(a_type, NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { r_valid = false; return DataType(); } @@ -5946,19 +5946,19 @@ GDScriptParser::DataType GDScriptParser::_get_operation_type(const Variant::Oper b_ref.instance(); b = b_ref; } else { - Variant::CallError err; + Callable::CallError err; b = Variant::construct(b_type, NULL, 0, err); - if (err.error != Variant::CallError::CALL_OK) { + if (err.error != Callable::CallError::CALL_OK) { r_valid = false; return DataType(); } } // Avoid division by zero - if (a_type == Variant::INT || a_type == Variant::REAL) { + if (a_type == Variant::INT || a_type == Variant::FLOAT) { Variant::evaluate(Variant::OP_ADD, a, 1, a, r_valid); } - if (b_type == Variant::INT || b_type == Variant::REAL) { + if (b_type == Variant::INT || b_type == Variant::FLOAT) { Variant::evaluate(Variant::OP_ADD, b, 1, b, r_valid); } if (a_type == Variant::STRING && b_type != Variant::ARRAY) { @@ -6218,7 +6218,7 @@ GDScriptParser::Node *GDScriptParser::_get_default_value_for_type(const DataType result = alloc_node<DictionaryNode>(); } else { ConstantNode *c = alloc_node<ConstantNode>(); - Variant::CallError err; + Callable::CallError err; c->value = Variant::construct(p_type.builtin_type, NULL, 0, err); result = c; } @@ -6531,7 +6531,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { result.has_type = false; } break; default: { - Variant::CallError err; + Callable::CallError err; Variant temp = Variant::construct(base_type.builtin_type, NULL, 0, err); bool valid = false; @@ -6598,14 +6598,16 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { // Expect int or real as index case Variant::PACKED_BYTE_ARRAY: case Variant::PACKED_COLOR_ARRAY: - case Variant::PACKED_INT_ARRAY: - case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: case Variant::PACKED_STRING_ARRAY: case Variant::PACKED_VECTOR2_ARRAY: case Variant::PACKED_VECTOR3_ARRAY: case Variant::ARRAY: case Variant::STRING: { - error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL; + error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::FLOAT; } break; // Expect String only case Variant::RECT2: @@ -6621,7 +6623,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { case Variant::TRANSFORM2D: case Variant::BASIS: case Variant::TRANSFORM: { - error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::REAL && + error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::FLOAT && index_type.builtin_type != Variant::STRING; } break; // Expect String or int @@ -6648,15 +6650,17 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { case Variant::DICTIONARY: case Variant::PACKED_BYTE_ARRAY: case Variant::PACKED_COLOR_ARRAY: - case Variant::PACKED_INT_ARRAY: - case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: case Variant::PACKED_STRING_ARRAY: case Variant::PACKED_VECTOR2_ARRAY: case Variant::PACKED_VECTOR3_ARRAY: { break; } default: { - Variant::CallError err; + Callable::CallError err; Variant temp = Variant::construct(base_type.builtin_type, NULL, 0, err); bool valid = false; @@ -6691,7 +6695,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { case Variant::NIL: case Variant::BOOL: case Variant::INT: - case Variant::REAL: + case Variant::FLOAT: case Variant::NODE_PATH: case Variant::_RID: { _set_error("Can't index on a value of type \"" + base_type.to_string() + "\".", op->line); @@ -6699,15 +6703,17 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) { } break; // Return int case Variant::PACKED_BYTE_ARRAY: - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: { result.builtin_type = Variant::INT; } break; // Return real - case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: case Variant::VECTOR2: case Variant::VECTOR3: case Variant::QUAT: { - result.builtin_type = Variant::REAL; + result.builtin_type = Variant::FLOAT; } break; // Return color case Variant::PACKED_COLOR_ARRAY: { @@ -7002,7 +7008,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat break; } else { #ifdef DEBUG_ENABLED - if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_types[i].kind == DataType::BUILTIN && par_types[i].builtin_type == Variant::REAL) { + if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_types[i].kind == DataType::BUILTIN && par_types[i].builtin_type == Variant::FLOAT) { _add_warning(GDScriptWarning::NARROWING_CONVERSION, p_call->line, Variant::get_type_name(tn->vtype)); } if (par_types[i].may_yield && p_call->arguments[i + 1]->type == Node::TYPE_OPERATOR) { @@ -7095,7 +7101,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat } if (base_type.kind == DataType::BUILTIN) { - Variant::CallError err; + Callable::CallError err; Variant tmp = Variant::construct(base_type.builtin_type, NULL, 0, err); if (check_types) { @@ -7245,7 +7251,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat _mark_line_as_unsafe(p_call->line); } } else { - if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_type.kind == DataType::BUILTIN && par_type.builtin_type == Variant::REAL) { + if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_type.kind == DataType::BUILTIN && par_type.builtin_type == Variant::FLOAT) { _add_warning(GDScriptWarning::NARROWING_CONVERSION, p_call->line, callee_name); } } @@ -8103,7 +8109,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) { lv->assign = convert_call; lv->assign_op->arguments.write[1] = convert_call; #ifdef DEBUG_ENABLED - if (lv->datatype.builtin_type == Variant::INT && assign_type.builtin_type == Variant::REAL) { + if (lv->datatype.builtin_type == Variant::INT && assign_type.builtin_type == Variant::FLOAT) { _add_warning(GDScriptWarning::NARROWING_CONVERSION, lv->line); } #endif // DEBUG_ENABLED @@ -8240,7 +8246,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) { type_match = true; // Since we are converting, the type is matching } #ifdef DEBUG_ENABLED - if (lh_type.builtin_type == Variant::INT && rh_type.builtin_type == Variant::REAL) { + if (lh_type.builtin_type == Variant::INT && rh_type.builtin_type == Variant::FLOAT) { _add_warning(GDScriptWarning::NARROWING_CONVERSION, op->line); } #endif // DEBUG_ENABLED @@ -8345,7 +8351,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) { if (cn->value.get_type() == Variant::STRING) { break; } - FALLTHROUGH; + [[fallthrough]]; } default: { _mark_line_as_safe(statement->line); diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index b30f81959e..9064998d32 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -146,12 +146,15 @@ static const _bit _type_list[] = { //types { Variant::BOOL, "bool" }, { Variant::INT, "int" }, - { Variant::REAL, "float" }, + { Variant::FLOAT, "float" }, { Variant::STRING, "String" }, { Variant::VECTOR2, "Vector2" }, + { Variant::VECTOR2I, "Vector2i" }, { Variant::RECT2, "Rect2" }, + { Variant::RECT2I, "Rect2i" }, { Variant::TRANSFORM2D, "Transform2D" }, { Variant::VECTOR3, "Vector3" }, + { Variant::VECTOR3I, "Vector3i" }, { Variant::AABB, "AABB" }, { Variant::PLANE, "Plane" }, { Variant::QUAT, "Quat" }, @@ -160,12 +163,17 @@ static const _bit _type_list[] = { { Variant::COLOR, "Color" }, { Variant::_RID, "RID" }, { Variant::OBJECT, "Object" }, + { Variant::STRING_NAME, "StringName" }, { Variant::NODE_PATH, "NodePath" }, { Variant::DICTIONARY, "Dictionary" }, + { Variant::CALLABLE, "Callable" }, + { Variant::SIGNAL, "Signal" }, { Variant::ARRAY, "Array" }, { Variant::PACKED_BYTE_ARRAY, "PackedByteArray" }, - { Variant::PACKED_INT_ARRAY, "PackedIntArray" }, - { Variant::PACKED_REAL_ARRAY, "PackedRealArray" }, + { Variant::PACKED_INT32_ARRAY, "PackedInt32Array" }, + { Variant::PACKED_INT64_ARRAY, "PackedInt64Array" }, + { Variant::PACKED_FLOAT32_ARRAY, "PackedFloat32Array" }, + { Variant::PACKED_FLOAT64_ARRAY, "PackedFloat64Array" }, { Variant::PACKED_STRING_ARRAY, "PackedStringArray" }, { Variant::PACKED_VECTOR2_ARRAY, "PackedVector2Array" }, { Variant::PACKED_VECTOR3_ARRAY, "PackedVector3Array" }, @@ -337,7 +345,7 @@ StringName GDScriptTokenizer::get_token_literal(int p_offset) const { default: { } } - } + } break; case TK_OP_AND: case TK_OP_OR: break; // Don't get into default, since they can be non-literal @@ -475,7 +483,7 @@ void GDScriptTokenizerText::_advance() { } while (true) { - bool is_node_path = false; + bool is_string_name = false; StringMode string_mode = STRING_DOUBLE_QUOTE; switch (GETCHAR(0)) { @@ -533,7 +541,7 @@ void GDScriptTokenizerText::_advance() { ignore_warnings = true; } #endif // DEBUG_ENABLED - FALLTHROUGH; + [[fallthrough]]; } case '\n': { line++; @@ -749,8 +757,8 @@ void GDScriptTokenizerText::_advance() { return; } INCPOS(1); - is_node_path = true; - FALLTHROUGH; + is_string_name = true; + [[fallthrough]]; case '\'': case '"': { @@ -860,8 +868,8 @@ void GDScriptTokenizerText::_advance() { } INCPOS(i); - if (is_node_path) { - _make_constant(NodePath(str)); + if (is_string_name) { + _make_constant(StringName(str)); } else { _make_constant(str); } diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index b2da5dfdbc..2243a7b81d 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -32,32 +32,107 @@ #include "core/io/json.h" #include "core/os/copymem.h" #include "core/project_settings.h" +#include "editor/editor_log.h" #include "editor/editor_node.h" GDScriptLanguageProtocol *GDScriptLanguageProtocol::singleton = NULL; -void GDScriptLanguageProtocol::on_data_received(int p_id) { - lastest_client_id = p_id; - Ref<WebSocketPeer> peer = server->get_peer(p_id); - PackedByteArray data; - if (OK == peer->get_packet_buffer(data)) { - String message; - message.parse_utf8((const char *)data.ptr(), data.size()); - if (message.begins_with("Content-Length:")) return; - String output = process_message(message); +Error GDScriptLanguageProtocol::LSPeer::handle_data() { + int read = 0; + // Read headers + if (!has_header) { + while (true) { + if (req_pos >= LSP_MAX_BUFFER_SIZE) { + req_pos = 0; + ERR_FAIL_COND_V_MSG(true, ERR_OUT_OF_MEMORY, "Response header too big"); + } + Error err = connection->get_partial_data(&req_buf[req_pos], 1, read); + if (err != OK) + return FAILED; + else if (read != 1) // Busy, wait until next poll + return ERR_BUSY; + char *r = (char *)req_buf; + int l = req_pos; + + // End of headers + if (l > 3 && r[l] == '\n' && r[l - 1] == '\r' && r[l - 2] == '\n' && r[l - 3] == '\r') { + r[l - 3] = '\0'; // Null terminate to read string + String header; + header.parse_utf8(r); + content_length = header.substr(16).to_int(); + has_header = true; + req_pos = 0; + break; + } + req_pos++; + } + } + if (has_header) { + while (req_pos < content_length) { + if (req_pos >= LSP_MAX_BUFFER_SIZE) { + req_pos = 0; + has_header = false; + ERR_FAIL_COND_V_MSG(req_pos >= LSP_MAX_BUFFER_SIZE, ERR_OUT_OF_MEMORY, "Response content too big"); + } + Error err = connection->get_partial_data(&req_buf[req_pos], 1, read); + if (err != OK) + return FAILED; + else if (read != 1) + return ERR_BUSY; + req_pos++; + } + + // Parse data + String msg; + msg.parse_utf8((const char *)req_buf, req_pos); + + // Reset to read again + req_pos = 0; + has_header = false; + + // Response + String output = GDScriptLanguageProtocol::get_singleton()->process_message(msg); if (!output.empty()) { - CharString charstr = output.utf8(); - peer->put_packet((const uint8_t *)charstr.ptr(), charstr.length()); + res_queue.push_back(output.utf8()); } } + return OK; } -void GDScriptLanguageProtocol::on_client_connected(int p_id, const String &p_protocal) { - clients.set(p_id, server->get_peer(p_id)); +Error GDScriptLanguageProtocol::LSPeer::send_data() { + int sent = 0; + if (!res_queue.empty()) { + CharString c_res = res_queue[0]; + if (res_sent < c_res.size()) { + Error err = connection->put_partial_data((const uint8_t *)c_res.get_data() + res_sent, c_res.size() - res_sent - 1, sent); + if (err != OK) { + return err; + } + res_sent += sent; + } + // Response sent + if (res_sent >= c_res.size() - 1) { + res_sent = 0; + res_queue.remove(0); + } + } + return OK; +} + +Error GDScriptLanguageProtocol::on_client_connected() { + Ref<StreamPeerTCP> tcp_peer = server->take_connection(); + ERR_FAIL_COND_V_MSG(clients.size() >= LSP_MAX_CLIENTS, FAILED, "Max client limits reached"); + Ref<LSPeer> peer = memnew(LSPeer); + peer->connection = tcp_peer; + clients.set(next_client_id, peer); + next_client_id++; + EditorNode::get_log()->add_message("Connection Taken", EditorLog::MSG_TYPE_EDITOR); + return OK; } -void GDScriptLanguageProtocol::on_client_disconnected(int p_id, bool p_was_clean_close) { - clients.erase(p_id); +void GDScriptLanguageProtocol::on_client_disconnected(const int &p_client_id) { + clients.erase(p_client_id); + EditorNode::get_log()->add_message("Disconnected", EditorLog::MSG_TYPE_EDITOR); } String GDScriptLanguageProtocol::process_message(const String &p_text) { @@ -83,11 +158,9 @@ String GDScriptLanguageProtocol::format_output(const String &p_text) { void GDScriptLanguageProtocol::_bind_methods() { ClassDB::bind_method(D_METHOD("initialize", "params"), &GDScriptLanguageProtocol::initialize); ClassDB::bind_method(D_METHOD("initialized", "params"), &GDScriptLanguageProtocol::initialized); - ClassDB::bind_method(D_METHOD("on_data_received"), &GDScriptLanguageProtocol::on_data_received); ClassDB::bind_method(D_METHOD("on_client_connected"), &GDScriptLanguageProtocol::on_client_connected); ClassDB::bind_method(D_METHOD("on_client_disconnected"), &GDScriptLanguageProtocol::on_client_disconnected); - ClassDB::bind_method(D_METHOD("notify_all_clients", "p_method", "p_params"), &GDScriptLanguageProtocol::notify_all_clients, DEFVAL(Variant())); - ClassDB::bind_method(D_METHOD("notify_client", "p_method", "p_params", "p_client"), &GDScriptLanguageProtocol::notify_client, DEFVAL(Variant()), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("notify_client", "p_method", "p_params"), &GDScriptLanguageProtocol::notify_client, DEFVAL(Variant()), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("is_smart_resolve_enabled"), &GDScriptLanguageProtocol::is_smart_resolve_enabled); ClassDB::bind_method(D_METHOD("get_text_document"), &GDScriptLanguageProtocol::get_text_document); ClassDB::bind_method(D_METHOD("get_workspace"), &GDScriptLanguageProtocol::get_workspace); @@ -116,11 +189,12 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) { Dictionary params; params["path"] = workspace->root; Dictionary request = make_notification("gdscrip_client/changeWorkspace", params); - if (Ref<WebSocketPeer> *peer = clients.getptr(lastest_client_id)) { + + Ref<LSPeer> peer = clients.get(latest_client_id); + if (peer != NULL) { String msg = JSON::print(request); msg = format_output(msg); - CharString charstr = msg.utf8(); - (*peer)->put_packet((const uint8_t *)charstr.ptr(), charstr.length()); + (*peer)->res_queue.push_back(msg.utf8()); } } @@ -153,61 +227,59 @@ void GDScriptLanguageProtocol::initialized(const Variant &p_params) { } void GDScriptLanguageProtocol::poll() { - server->poll(); + if (server->is_connection_available()) { + on_client_connected(); + } + const int *id = NULL; + while ((id = clients.next(id))) { + Ref<LSPeer> peer = clients.get(*id); + StreamPeerTCP::Status status = peer->connection->get_status(); + if (status == StreamPeerTCP::STATUS_NONE || status == StreamPeerTCP::STATUS_ERROR) { + on_client_disconnected(*id); + id = NULL; + } else { + if (peer->connection->get_available_bytes() > 0) { + latest_client_id = *id; + Error err = peer->handle_data(); + if (err != OK && err != ERR_BUSY) { + on_client_disconnected(*id); + id = NULL; + } + } + Error err = peer->send_data(); + if (err != OK && err != ERR_BUSY) { + on_client_disconnected(*id); + id = NULL; + } + } + } } Error GDScriptLanguageProtocol::start(int p_port, const IP_Address &p_bind_ip) { - if (server == NULL) { - server = dynamic_cast<WebSocketServer *>(ClassDB::instance("WebSocketServer")); - ERR_FAIL_COND_V(!server, FAILED); - server->set_buffers(8192, 1024, 8192, 1024); // 8mb should be way more than enough - server->connect("data_received", this, "on_data_received"); - server->connect("client_connected", this, "on_client_connected"); - server->connect("client_disconnected", this, "on_client_disconnected"); - } - server->set_bind_ip(p_bind_ip); - return server->listen(p_port); + return server->listen(p_port, p_bind_ip); } void GDScriptLanguageProtocol::stop() { - const int *ptr = clients.next(NULL); - while (ptr) { - clients.get(*ptr)->close(); - ptr = clients.next(ptr); + const int *id = NULL; + while ((id = clients.next(id))) { + Ref<LSPeer> peer = clients.get(*id); + peer->connection->disconnect_from_host(); } - server->stop(); - clients.clear(); -} - -void GDScriptLanguageProtocol::notify_all_clients(const String &p_method, const Variant &p_params) { - Dictionary message = make_notification(p_method, p_params); - String msg = JSON::print(message); - msg = format_output(msg); - CharString charstr = msg.utf8(); - const int *p_id = clients.next(NULL); - while (p_id != NULL) { - Ref<WebSocketPeer> peer = clients.get(*p_id); - (*peer)->put_packet((const uint8_t *)charstr.ptr(), charstr.length()); - p_id = clients.next(p_id); - } + server->stop(); } -void GDScriptLanguageProtocol::notify_client(const String &p_method, const Variant &p_params, int p_client) { - - if (p_client == -1) { - p_client = lastest_client_id; +void GDScriptLanguageProtocol::notify_client(const String &p_method, const Variant &p_params, int p_client_id) { + if (p_client_id == -1) { + p_client_id = latest_client_id; } - - Ref<WebSocketPeer> *peer = clients.getptr(p_client); + Ref<LSPeer> peer = clients.get(p_client_id); ERR_FAIL_COND(peer == NULL); Dictionary message = make_notification(p_method, p_params); String msg = JSON::print(message); msg = format_output(msg); - CharString charstr = msg.utf8(); - - (*peer)->put_packet((const uint8_t *)charstr.ptr(), charstr.length()); + peer->res_queue.push_back(msg.utf8()); } bool GDScriptLanguageProtocol::is_smart_resolve_enabled() const { @@ -219,7 +291,7 @@ bool GDScriptLanguageProtocol::is_goto_native_symbols_enabled() const { } GDScriptLanguageProtocol::GDScriptLanguageProtocol() { - server = NULL; + server.instance(); singleton = this; _initialized = false; workspace.instance(); @@ -228,9 +300,6 @@ GDScriptLanguageProtocol::GDScriptLanguageProtocol() { set_scope("completionItem", text_document.ptr()); set_scope("workspace", workspace.ptr()); workspace->root = ProjectSettings::get_singleton()->get_resource_path(); -} - -GDScriptLanguageProtocol::~GDScriptLanguageProtocol() { - memdelete(server); - server = NULL; + latest_client_id = 0; + next_client_id = 0; } diff --git a/modules/gdscript/language_server/gdscript_language_protocol.h b/modules/gdscript/language_server/gdscript_language_protocol.h index 52c680ab19..3f0ae36af2 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.h +++ b/modules/gdscript/language_server/gdscript_language_protocol.h @@ -31,16 +31,36 @@ #ifndef GDSCRIPT_PROTOCAL_SERVER_H #define GDSCRIPT_PROTOCAL_SERVER_H +#include "core/io/stream_peer.h" +#include "core/io/stream_peer_tcp.h" +#include "core/io/tcp_server.h" #include "gdscript_text_document.h" #include "gdscript_workspace.h" #include "lsp.hpp" #include "modules/jsonrpc/jsonrpc.h" -#include "modules/websocket/websocket_peer.h" -#include "modules/websocket/websocket_server.h" + +#define LSP_MAX_BUFFER_SIZE 4194304 +#define LSP_MAX_CLIENTS 8 class GDScriptLanguageProtocol : public JSONRPC { GDCLASS(GDScriptLanguageProtocol, JSONRPC) +private: + struct LSPeer : Reference { + Ref<StreamPeerTCP> connection; + + uint8_t req_buf[LSP_MAX_BUFFER_SIZE]; + int req_pos = 0; + bool has_header = false; + bool has_content = false; + int content_length = 0; + Vector<CharString> res_queue; + int res_sent = 0; + + Error handle_data(); + Error send_data(); + }; + enum LSPErrorCode { RequestCancelled = -32800, ContentModified = -32801, @@ -48,16 +68,16 @@ class GDScriptLanguageProtocol : public JSONRPC { static GDScriptLanguageProtocol *singleton; - HashMap<int, Ref<WebSocketPeer> > clients; - WebSocketServer *server; - int lastest_client_id; + HashMap<int, Ref<LSPeer> > clients; + Ref<TCP_Server> server; + int latest_client_id; + int next_client_id; Ref<GDScriptTextDocument> text_document; Ref<GDScriptWorkspace> workspace; - void on_data_received(int p_id); - void on_client_connected(int p_id, const String &p_protocal); - void on_client_disconnected(int p_id, bool p_was_clean_close); + Error on_client_connected(); + void on_client_disconnected(const int &p_client_id); String process_message(const String &p_text); String format_output(const String &p_text); @@ -80,14 +100,12 @@ public: Error start(int p_port, const IP_Address &p_bind_ip); void stop(); - void notify_all_clients(const String &p_method, const Variant &p_params = Variant()); - void notify_client(const String &p_method, const Variant &p_params = Variant(), int p_client = -1); + void notify_client(const String &p_method, const Variant &p_params = Variant(), int p_client_id = -1); bool is_smart_resolve_enabled() const; bool is_goto_native_symbols_enabled() const; GDScriptLanguageProtocol(); - ~GDScriptLanguageProtocol(); }; #endif diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index 1c0590cff1..ea54784f96 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -33,8 +33,11 @@ #include "../gdscript_parser.h" #include "core/project_settings.h" #include "core/script_language.h" +#include "editor/editor_file_system.h" #include "editor/editor_help.h" +#include "editor/editor_node.h" #include "gdscript_language_protocol.h" +#include "scene/resources/packed_scene.h" void GDScriptWorkspace::_bind_methods() { ClassDB::bind_method(D_METHOD("symbol"), &GDScriptWorkspace::symbol); @@ -373,6 +376,46 @@ void GDScriptWorkspace::publish_diagnostics(const String &p_path) { GDScriptLanguageProtocol::get_singleton()->notify_client("textDocument/publishDiagnostics", params); } +void GDScriptWorkspace::_get_owners(EditorFileSystemDirectory *efsd, String p_path, List<String> &owners) { + if (!efsd) + return; + + for (int i = 0; i < efsd->get_subdir_count(); i++) { + _get_owners(efsd->get_subdir(i), p_path, owners); + } + + for (int i = 0; i < efsd->get_file_count(); i++) { + + Vector<String> deps = efsd->get_file_deps(i); + bool found = false; + for (int j = 0; j < deps.size(); j++) { + if (deps[j] == p_path) { + found = true; + break; + } + } + if (!found) + continue; + + owners.push_back(efsd->get_file_path(i)); + } +} + +Node *GDScriptWorkspace::_get_owner_node(String p_path) { + Node *owner_node = NULL; + List<String> owners; + + _get_owners(EditorFileSystem::get_singleton()->get_filesystem(), p_path, owners); + + if (owners.size() > 0) { + NodePath owner_path = owners[0]; + Ref<PackedScene> owner_res = ResourceLoader::load(owner_path); + owner_node = owner_res->instance(PackedScene::GEN_EDIT_STATE_DISABLED); + } + + return owner_node; +} + void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<ScriptCodeCompletionOption> *r_options) { String path = get_file_path(p_params.textDocument.uri); @@ -380,8 +423,12 @@ void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<S bool forced = false; if (const ExtendGDScriptParser *parser = get_parse_result(path)) { + Node *owner_node = _get_owner_node(path); String code = parser->get_text_for_completion(p_params.position); - GDScriptLanguage::get_singleton()->complete_code(code, path, NULL, r_options, forced, call_hint); + GDScriptLanguage::get_singleton()->complete_code(code, path, owner_node, r_options, forced, call_hint); + if (owner_node) { + memdelete(owner_node); + } } } diff --git a/modules/gdscript/language_server/gdscript_workspace.h b/modules/gdscript/language_server/gdscript_workspace.h index 146a5cb7c9..8b46d345d9 100644 --- a/modules/gdscript/language_server/gdscript_workspace.h +++ b/modules/gdscript/language_server/gdscript_workspace.h @@ -33,12 +33,17 @@ #include "../gdscript_parser.h" #include "core/variant.h" +#include "editor/editor_file_system.h" #include "gdscript_extend_parser.h" #include "lsp.hpp" class GDScriptWorkspace : public Reference { GDCLASS(GDScriptWorkspace, Reference); +private: + void _get_owners(EditorFileSystemDirectory *efsd, String p_path, List<String> &owners); + Node *_get_owner_node(String p_path); + protected: static void _bind_methods(); void remove_cache_parser(const String &p_path); diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index ba0449c046..84075f76fd 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -874,7 +874,7 @@ void GridMap::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_x"), "set_center_x", "get_center_x"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_y"), "set_center_y", "get_center_y"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cell_center_z"), "set_center_z", "get_center_z"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell_scale"), "set_cell_scale", "get_cell_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell_scale"), "set_cell_scale", "get_cell_scale"); ADD_GROUP("Collision", "collision_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_layer", "get_collision_layer"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 43f5feb388..761771a02c 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -954,7 +954,7 @@ void GridMapEditor::update_palette() { void GridMapEditor::edit(GridMap *p_gridmap) { if (!p_gridmap && node) - node->disconnect("cell_size_changed", this, "_draw_grids"); + node->disconnect_compat("cell_size_changed", this, "_draw_grids"); node = p_gridmap; @@ -988,7 +988,7 @@ void GridMapEditor::edit(GridMap *p_gridmap) { update_grid(); _update_clip(); - node->connect("cell_size_changed", this, "_draw_grids"); + node->connect_compat("cell_size_changed", this, "_draw_grids"); } void GridMapEditor::_update_clip() { @@ -1077,8 +1077,8 @@ 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"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); + mesh_library_palette->connect_compat("item_selected", this, "_item_selected_cbk"); for (int i = 0; i < 3; i++) { grid[i] = VS::get_singleton()->mesh_create(); @@ -1094,7 +1094,7 @@ void GridMapEditor::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { - get_tree()->disconnect("node_removed", this, "_node_removed"); + get_tree()->disconnect_compat("node_removed", this, "_node_removed"); _clear_clipboard_data(); for (int i = 0; i < 3; i++) { @@ -1241,9 +1241,9 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { floor->get_line_edit()->add_constant_override("minimum_spaces", 16); spatial_editor_hb->add_child(floor); - floor->connect("value_changed", this, "_floor_changed"); - floor->connect("mouse_exited", this, "_floor_mouse_exited"); - floor->get_line_edit()->connect("mouse_exited", this, "_floor_mouse_exited"); + floor->connect_compat("value_changed", this, "_floor_changed"); + floor->connect_compat("mouse_exited", this, "_floor_mouse_exited"); + floor->get_line_edit()->connect_compat("mouse_exited", this, "_floor_mouse_exited"); spatial_editor_hb->add_child(memnew(VSeparator)); @@ -1300,7 +1300,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { settings_vbc->add_margin_child(TTR("Pick Distance:"), settings_pick_distance); clip_mode = CLIP_DISABLED; - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); HBoxContainer *hb = memnew(HBoxContainer); add_child(hb); @@ -1310,22 +1310,22 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { search_box->set_h_size_flags(SIZE_EXPAND_FILL); search_box->set_placeholder(TTR("Filter meshes")); hb->add_child(search_box); - search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("gui_input", this, "_sbox_input"); + search_box->connect_compat("text_changed", this, "_text_changed"); + search_box->connect_compat("gui_input", this, "_sbox_input"); mode_thumbnail = memnew(ToolButton); mode_thumbnail->set_toggle_mode(true); mode_thumbnail->set_pressed(true); mode_thumbnail->set_icon(p_editor->get_gui_base()->get_icon("FileThumbnail", "EditorIcons")); hb->add_child(mode_thumbnail); - mode_thumbnail->connect("pressed", this, "_set_display_mode", varray(DISPLAY_THUMBNAIL)); + mode_thumbnail->connect_compat("pressed", this, "_set_display_mode", varray(DISPLAY_THUMBNAIL)); mode_list = memnew(ToolButton); mode_list->set_toggle_mode(true); mode_list->set_pressed(false); mode_list->set_icon(p_editor->get_gui_base()->get_icon("FileList", "EditorIcons")); hb->add_child(mode_list); - mode_list->connect("pressed", this, "_set_display_mode", varray(DISPLAY_LIST)); + mode_list->connect_compat("pressed", this, "_set_display_mode", varray(DISPLAY_LIST)); size_slider = memnew(HSlider); size_slider->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1333,7 +1333,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { size_slider->set_max(4.0f); size_slider->set_step(0.1f); size_slider->set_value(1.0f); - size_slider->connect("value_changed", this, "_icon_size_changed"); + size_slider->connect_compat("value_changed", this, "_icon_size_changed"); add_child(size_slider); EDITOR_DEF("editors/grid_map/preview_size", 64); @@ -1343,7 +1343,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { mesh_library_palette = memnew(ItemList); add_child(mesh_library_palette); mesh_library_palette->set_v_size_flags(SIZE_EXPAND_FILL); - mesh_library_palette->connect("gui_input", this, "_mesh_library_palette_input"); + mesh_library_palette->connect_compat("gui_input", this, "_mesh_library_palette_input"); info_message = memnew(Label); info_message->set_text(TTR("Give a MeshLibrary resource to this GridMap to use its meshes.")); diff --git a/modules/mbedtls/dtls_server_mbedtls.cpp b/modules/mbedtls/dtls_server_mbedtls.cpp index c4ac69e9ab..215b511758 100644 --- a/modules/mbedtls/dtls_server_mbedtls.cpp +++ b/modules/mbedtls/dtls_server_mbedtls.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/mbedtls/dtls_server_mbedtls.h b/modules/mbedtls/dtls_server_mbedtls.h index 180ab7d84c..d61ab3179e 100644 --- a/modules/mbedtls/dtls_server_mbedtls.h +++ b/modules/mbedtls/dtls_server_mbedtls.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/mbedtls/packet_peer_mbed_dtls.cpp b/modules/mbedtls/packet_peer_mbed_dtls.cpp index 134bd54801..bdf36ad1b1 100755 --- a/modules/mbedtls/packet_peer_mbed_dtls.cpp +++ b/modules/mbedtls/packet_peer_mbed_dtls.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/mbedtls/packet_peer_mbed_dtls.h b/modules/mbedtls/packet_peer_mbed_dtls.h index bd0856abe8..26c4543785 100755 --- a/modules/mbedtls/packet_peer_mbed_dtls.h +++ b/modules/mbedtls/packet_peer_mbed_dtls.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/mobile_vr/mobile_vr_interface.cpp b/modules/mobile_vr/mobile_vr_interface.cpp index afa8766bce..2f1d95cd42 100644 --- a/modules/mobile_vr/mobile_vr_interface.cpp +++ b/modules/mobile_vr/mobile_vr_interface.cpp @@ -221,13 +221,13 @@ void MobileVRInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("set_k2", "k"), &MobileVRInterface::set_k2); ClassDB::bind_method(D_METHOD("get_k2"), &MobileVRInterface::get_k2); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "eye_height", PROPERTY_HINT_RANGE, "0.0,3.0,0.1"), "set_eye_height", "get_eye_height"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "iod", PROPERTY_HINT_RANGE, "4.0,10.0,0.1"), "set_iod", "get_iod"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "display_width", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_width", "get_display_width"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "display_to_lens", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_to_lens", "get_display_to_lens"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "oversample", PROPERTY_HINT_RANGE, "1.0,2.0,0.1"), "set_oversample", "get_oversample"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "k1", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k1", "get_k1"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "k2", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k2", "get_k2"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "eye_height", PROPERTY_HINT_RANGE, "0.0,3.0,0.1"), "set_eye_height", "get_eye_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "iod", PROPERTY_HINT_RANGE, "4.0,10.0,0.1"), "set_iod", "get_iod"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "display_width", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_width", "get_display_width"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "display_to_lens", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_to_lens", "get_display_to_lens"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "oversample", PROPERTY_HINT_RANGE, "1.0,2.0,0.1"), "set_oversample", "get_oversample"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "k1", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k1", "get_k1"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "k2", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k2", "get_k2"); } void MobileVRInterface::set_eye_height(const real_t p_eye_height) { diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 15415d7655..5c1c098e3e 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -411,7 +411,7 @@ static String variant_type_to_managed_name(const String &p_var_type_name) { if (p_var_type_name == Variant::get_type_name(Variant::OBJECT)) return "Godot.Object"; - if (p_var_type_name == Variant::get_type_name(Variant::REAL)) { + if (p_var_type_name == Variant::get_type_name(Variant::FLOAT)) { #ifdef REAL_T_IS_DOUBLE return "double"; #else @@ -430,9 +430,9 @@ static String variant_type_to_managed_name(const String &p_var_type_name) { if (p_var_type_name == Variant::get_type_name(Variant::PACKED_BYTE_ARRAY)) return "byte[]"; - if (p_var_type_name == Variant::get_type_name(Variant::PACKED_INT_ARRAY)) + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_INT32_ARRAY)) return "int[]"; - if (p_var_type_name == Variant::get_type_name(Variant::PACKED_REAL_ARRAY)) { + if (p_var_type_name == Variant::get_type_name(Variant::PACKED_FLOAT32_ARRAY)) { #ifdef REAL_T_IS_DOUBLE return "double[]"; #else @@ -1720,7 +1720,7 @@ bool CSharpInstance::has_method(const StringName &p_method) const { return false; } -Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { ERR_FAIL_COND_V(!script.is_valid(), Variant()); @@ -1729,7 +1729,7 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, MonoObject *mono_object = get_mono_object(); if (!mono_object) { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; ERR_FAIL_V(Variant()); } @@ -1741,7 +1741,7 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, if (method) { MonoObject *return_value = method->invoke(mono_object, p_args); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; if (return_value) { return GDMonoMarshal::mono_object_to_variant(return_value); @@ -1753,7 +1753,7 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, top = top->get_parent_class(); } - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } @@ -2704,11 +2704,11 @@ void CSharpScript::_clear() { script_class = NULL; } -Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (unlikely(GDMono::get_singleton() == NULL)) { // Probably not the best error but eh. - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); } @@ -2904,7 +2904,7 @@ StringName CSharpScript::get_instance_base_type() const { return StringName(); } -CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error) { +CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error) { GD_MONO_ASSERT_THREAD_ATTACHED; @@ -2968,7 +2968,7 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg CRASH_COND(die == true); p_owner->set_script_instance(NULL); - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; ERR_FAIL_V_MSG(NULL, "Failed to allocate memory for the object."); } @@ -2994,14 +2994,14 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg return instance; } -Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; ERR_FAIL_NULL_V(native, Variant()); @@ -3049,7 +3049,7 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) { GD_MONO_SCOPE_THREAD_ATTACH; - Variant::CallError unchecked_error; + Callable::CallError unchecked_error; return _create_instance(NULL, 0, p_this, Object::cast_to<Reference>(p_this) != NULL, unchecked_error); } diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 8ee741b4d2..627218eaf5 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -141,8 +141,8 @@ class CSharpScript : public Script { static int _try_get_member_export_hint(IMonoClassMember *p_member, ManagedType p_type, Variant::Type p_variant_type, bool p_allow_generics, PropertyHint &r_hint, String &r_hint_string); #endif - CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error); - Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error); + Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error); // Do not use unless you know what you are doing friend void GDMonoInternals::tie_managed_to_unmanaged(MonoObject *, Object *); @@ -154,7 +154,7 @@ class CSharpScript : public Script { protected: static void _bind_methods(); - Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual void _resource_path_changed(); bool _get(const StringName &p_name, Variant &r_ret) const; bool _set(const StringName &p_name, const Variant &p_value); @@ -265,7 +265,7 @@ public: /* TODO */ virtual void get_method_list(List<MethodInfo> *p_list) const {} virtual bool has_method(const StringName &p_method) const; - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual void call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount); virtual void call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount); diff --git a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs index 4c76d2abf1..bd7eb59913 100644 --- a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs @@ -172,7 +172,7 @@ namespace GodotTools return; // Notify running game for hot-reload - Internal.ScriptEditorDebuggerReloadScripts(); + Internal.EditorDebuggerNodeReloadScripts(); // Hot-reload in the editor GodotSharpEditor.Instance.GetNode<HotReloadAssemblyWatcher>("HotReloadAssemblyWatcher").RestartTimer(); diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs index c3db52aa9e..af8d070cbd 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.IO; using Godot; +using GodotTools.Ides.Rider; using GodotTools.Internals; using Directory = System.IO.Directory; using Environment = System.Environment; @@ -54,6 +55,12 @@ namespace GodotTools.Build return msbuildPath; } + case BuildManager.BuildTool.JetBrainsMsBuild: + var editorPath = (string)editorSettings.GetSetting(RiderPathManager.EditorPathSettingName); + if (!File.Exists(editorPath)) + throw new FileNotFoundException($"Cannot find Rider executable. Tried with path: {editorPath}"); + var riderDir = new FileInfo(editorPath).Directory.Parent; + return Path.Combine(riderDir.FullName, @"tools\MSBuild\Current\Bin\MSBuild.exe"); default: throw new IndexOutOfRangeException("Invalid build tool in editor settings"); } diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs index fa6bf4dafd..69a8c9cf4a 100644 --- a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using GodotTools.Build; +using GodotTools.Ides.Rider; using GodotTools.Internals; using GodotTools.Utils; using static GodotTools.Internals.Globals; @@ -16,6 +17,7 @@ namespace GodotTools public const string PropNameMsbuildMono = "MSBuild (Mono)"; public const string PropNameMsbuildVs = "MSBuild (VS Build Tools)"; + public const string PropNameMsbuildJetBrains = "MSBuild (JetBrains Rider)"; public const string MsBuildIssuesFileName = "msbuild_issues.csv"; public const string MsBuildLogFileName = "msbuild_log.txt"; @@ -23,7 +25,8 @@ namespace GodotTools public enum BuildTool { MsBuildMono, - MsBuildVs + MsBuildVs, + JetBrainsMsBuild } private static void RemoveOldIssuesFile(BuildInfo buildInfo) @@ -181,7 +184,7 @@ namespace GodotTools var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, config); // Add Godot defines - string constants = buildTool == BuildTool.MsBuildVs ? "GodotDefineConstants=\"" : "GodotDefineConstants=\\\""; + string constants = buildTool != BuildTool.MsBuildMono ? "GodotDefineConstants=\"" : "GodotDefineConstants=\\\""; foreach (var godotDefine in godotDefines) constants += $"GODOT_{godotDefine.ToUpper().Replace("-", "_").Replace(" ", "_").Replace(";", "_")};"; @@ -189,7 +192,7 @@ namespace GodotTools if (Internal.GodotIsRealTDouble()) constants += "GODOT_REAL_T_IS_DOUBLE;"; - constants += buildTool == BuildTool.MsBuildVs ? "\"" : "\\\""; + constants += buildTool != BuildTool.MsBuildMono ? "\"" : "\\\""; buildInfo.CustomProperties.Add(constants); @@ -245,18 +248,22 @@ namespace GodotTools public static void Initialize() { // Build tool settings - - EditorDef("mono/builds/build_tool", OS.IsWindows ? BuildTool.MsBuildVs : BuildTool.MsBuildMono); - var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings(); - + var msbuild = BuildTool.MsBuildMono; + if (OS.IsWindows) + msbuild = RiderPathManager.IsRider((string) editorSettings.GetSetting(RiderPathManager.EditorPathSettingName)) + ? BuildTool.JetBrainsMsBuild + : BuildTool.MsBuildVs; + + EditorDef("mono/builds/build_tool", msbuild); + editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary { ["type"] = Godot.Variant.Type.Int, ["name"] = "mono/builds/build_tool", ["hint"] = Godot.PropertyHint.Enum, ["hint_string"] = OS.IsWindows ? - $"{PropNameMsbuildMono},{PropNameMsbuildVs}" : + $"{PropNameMsbuildMono},{PropNameMsbuildVs},{PropNameMsbuildJetBrains}" : $"{PropNameMsbuildMono}" }); diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs index 9038333d38..5965e0fbcf 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs @@ -11,6 +11,10 @@ using Environment = System.Environment; using File = System.IO.File; using Path = System.IO.Path; using OS = GodotTools.Utils.OS; +// ReSharper disable UnassignedField.Local +// ReSharper disable InconsistentNaming +// ReSharper disable UnassignedField.Global +// ReSharper disable MemberHidesStaticFromOuterClass namespace GodotTools.Ides.Rider { @@ -131,28 +135,45 @@ namespace GodotTools.Ides.Rider if (OS.IsWindows) { var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); - return Path.Combine(localAppData, @"JetBrains\Toolbox\apps\Rider"); + return GetToolboxRiderRootPath(localAppData); } if (OS.IsOSX) { var home = Environment.GetEnvironmentVariable("HOME"); - if (!string.IsNullOrEmpty(home)) - { - return Path.Combine(home, @"Library/Application Support/JetBrains/Toolbox/apps/Rider"); - } + if (string.IsNullOrEmpty(home)) + return string.Empty; + var localAppData = Path.Combine(home, @"Library/Application Support"); + return GetToolboxRiderRootPath(localAppData); } if (OS.IsUnixLike()) { var home = Environment.GetEnvironmentVariable("HOME"); - if (!string.IsNullOrEmpty(home)) - { - return Path.Combine(home, @".local/share/JetBrains/Toolbox/apps/Rider"); - } + if (string.IsNullOrEmpty(home)) + return string.Empty; + var localAppData = Path.Combine(home, @".local/share"); + return GetToolboxRiderRootPath(localAppData); + } + + return string.Empty; + } + + + private static string GetToolboxRiderRootPath(string localAppData) + { + var toolboxPath = Path.Combine(localAppData, @"JetBrains\Toolbox"); + var settingsJson = Path.Combine(toolboxPath, ".settings.json"); + + if (File.Exists(settingsJson)) + { + var path = SettingsJson.GetInstallLocationFromJson(File.ReadAllText(settingsJson)); + if (!string.IsNullOrEmpty(path)) + toolboxPath = path; } - throw new Exception("Unexpected OS."); + var toolboxRiderRootPath = Path.Combine(toolboxPath, @"apps\Rider"); + return toolboxRiderRootPath; } internal static ProductInfo GetBuildVersion(string path) @@ -226,8 +247,8 @@ namespace GodotTools.Ides.Rider { try { - // use history.json - last entry stands for the active build https://jetbrains.slack.com/archives/C07KNP99D/p1547807024066500?thread_ts=1547731708.057700&cid=C07KNP99D - var historyFile = Path.Combine(channelDir, ".history.json"); + // use history.json - last entry stands for the active build https://jetbrains.slack.com/archives/C07KNP99D/p1547807024066500?thread_ts=1547731708.057700&cid=C07KNP99D + var historyFile = Path.Combine(channelDir, ".history.json"); if (File.Exists(historyFile)) { var json = File.ReadAllText(historyFile); @@ -255,14 +276,14 @@ namespace GodotTools.Ides.Rider } } - // changes in toolbox json files format may brake the logic above, so return all found Rider installations - return Directory.GetDirectories(channelDir) - .SelectMany(buildDir => GetExecutablePaths(dirName, searchPattern, isMac, buildDir)); + // changes in toolbox json files format may brake the logic above, so return all found Rider installations + return Directory.GetDirectories(channelDir) + .SelectMany(buildDir => GetExecutablePaths(dirName, searchPattern, isMac, buildDir)); } catch (Exception e) { - // do not write to Debug.Log, just log it. - Logger.Warn($"Failed to get RiderPath from {channelDir}", e); + // do not write to Debug.Log, just log it. + Logger.Warn($"Failed to get RiderPath from {channelDir}", e); } return new string[0]; @@ -289,6 +310,27 @@ namespace GodotTools.Ides.Rider #pragma warning disable 0649 [Serializable] + class SettingsJson + { + public string install_location; + + [CanBeNull] + public static string GetInstallLocationFromJson(string json) + { + try + { + return JsonConvert.DeserializeObject<SettingsJson>(json).install_location; + } + catch (Exception) + { + Logger.Warn($"Failed to get install_location from json {json}"); + } + + return null; + } + } + + [Serializable] class ToolboxHistory { public List<ItemNode> history; @@ -372,7 +414,6 @@ namespace GodotTools.Ides.Rider [Serializable] class ActiveApplication { - // ReSharper disable once InconsistentNaming public List<string> builds; } @@ -380,6 +421,7 @@ namespace GodotTools.Ides.Rider public struct RiderInfo { + // ReSharper disable once NotAccessedField.Global public bool IsToolbox; public string Presentation; public Version BuildNumber; diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs index 558a242bf9..ee5677a6a8 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathManager.cs @@ -9,13 +9,13 @@ namespace GodotTools.Ides.Rider { public static class RiderPathManager { - private static readonly string editorPathSettingName = "mono/editor/editor_path_optional"; + public static readonly string EditorPathSettingName = "mono/editor/editor_path_optional"; private static string GetRiderPathFromSettings() { var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings(); - if (editorSettings.HasSetting(editorPathSettingName)) - return (string)editorSettings.GetSetting(editorPathSettingName); + if (editorSettings.HasSetting(EditorPathSettingName)) + return (string)editorSettings.GetSetting(EditorPathSettingName); return null; } @@ -25,22 +25,22 @@ namespace GodotTools.Ides.Rider var editor = (ExternalEditorId)editorSettings.GetSetting("mono/editor/external_editor"); if (editor == ExternalEditorId.Rider) { - if (!editorSettings.HasSetting(editorPathSettingName)) + if (!editorSettings.HasSetting(EditorPathSettingName)) { - Globals.EditorDef(editorPathSettingName, "Optional"); + Globals.EditorDef(EditorPathSettingName, "Optional"); editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary { ["type"] = Variant.Type.String, - ["name"] = editorPathSettingName, + ["name"] = EditorPathSettingName, ["hint"] = PropertyHint.File, ["hint_string"] = "" }); } - var riderPath = (string)editorSettings.GetSetting(editorPathSettingName); + var riderPath = (string)editorSettings.GetSetting(EditorPathSettingName); if (IsRiderAndExists(riderPath)) { - Globals.EditorDef(editorPathSettingName, riderPath); + Globals.EditorDef(EditorPathSettingName, riderPath); return; } @@ -50,17 +50,15 @@ namespace GodotTools.Ides.Rider return; var newPath = paths.Last().Path; - Globals.EditorDef(editorPathSettingName, newPath); - editorSettings.SetSetting(editorPathSettingName, newPath); + Globals.EditorDef(EditorPathSettingName, newPath); + editorSettings.SetSetting(EditorPathSettingName, newPath); } } - private static bool IsRider(string path) + public static bool IsRider(string path) { if (string.IsNullOrEmpty(path)) - { return false; - } var fileInfo = new FileInfo(path); var filename = fileInfo.Name.ToLowerInvariant(); @@ -81,8 +79,8 @@ namespace GodotTools.Ides.Rider return null; var newPath = paths.Last().Path; - editorSettings.SetSetting(editorPathSettingName, newPath); - Globals.EditorDef(editorPathSettingName, newPath); + editorSettings.SetSetting(EditorPathSettingName, newPath); + Globals.EditorDef(EditorPathSettingName, newPath); return newPath; } diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs index de361ba844..2e121ba879 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs @@ -34,7 +34,7 @@ namespace GodotTools.Internals public static void ReloadAssemblies(bool softReload) => internal_ReloadAssemblies(softReload); - public static void ScriptEditorDebuggerReloadScripts() => internal_ScriptEditorDebuggerReloadScripts(); + public static void EditorDebuggerNodeReloadScripts() => internal_EditorDebuggerNodeReloadScripts(); public static bool ScriptEditorEdit(Resource resource, int line, int col, bool grabFocus = true) => internal_ScriptEditorEdit(resource, line, col, grabFocus); @@ -88,7 +88,7 @@ namespace GodotTools.Internals private static extern void internal_ReloadAssemblies(bool softReload); [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void internal_ScriptEditorDebuggerReloadScripts(); + private static extern void internal_EditorDebuggerNodeReloadScripts(); [MethodImpl(MethodImplOptions.InternalCall)] private static extern bool internal_ScriptEditorEdit(Resource resource, int line, int col, bool grabFocus); diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 0724d72ce6..908c72c591 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -505,9 +505,9 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf xml_output.append("</c>"); } else if (tag == "PackedByteArray") { xml_output.append("<see cref=\"byte\"/>"); - } else if (tag == "PackedIntArray") { + } else if (tag == "PackedInt32Array") { xml_output.append("<see cref=\"int\"/>"); - } else if (tag == "PackedRealArray") { + } else if (tag == "PackedFloat32Array") { #ifdef REAL_T_IS_DOUBLE xml_output.append("<see cref=\"double\"/>"); #else @@ -2054,7 +2054,7 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte } if (p_imethod.is_vararg) { - p_output.append("\tVariant::CallError vcall_error;\n\t"); + p_output.append("\tCallable::CallError vcall_error;\n\t"); if (!ret_void) { // See the comment on the C_LOCAL_VARARG_RET declaration @@ -2383,7 +2383,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() { } else { if (return_info.type == Variant::INT) { imethod.return_type.cname = _get_int_type_name_from_meta(m ? m->get_argument_meta(-1) : GodotTypeInfo::METADATA_NONE); - } else if (return_info.type == Variant::REAL) { + } else if (return_info.type == Variant::FLOAT) { imethod.return_type.cname = _get_float_type_name_from_meta(m ? m->get_argument_meta(-1) : GodotTypeInfo::METADATA_NONE); } else { imethod.return_type.cname = Variant::get_type_name(return_info.type); @@ -2410,7 +2410,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() { } else { if (arginfo.type == Variant::INT) { iarg.type.cname = _get_int_type_name_from_meta(m ? m->get_argument_meta(i) : GodotTypeInfo::METADATA_NONE); - } else if (arginfo.type == Variant::REAL) { + } else if (arginfo.type == Variant::FLOAT) { iarg.type.cname = _get_float_type_name_from_meta(m ? m->get_argument_meta(i) : GodotTypeInfo::METADATA_NONE); } else { iarg.type.cname = Variant::get_type_name(arginfo.type); @@ -2581,7 +2581,7 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar r_iarg.default_argument = "(%s)" + r_iarg.default_argument; } break; - case Variant::REAL: + case Variant::FLOAT: #ifndef REAL_T_IS_DOUBLE r_iarg.default_argument += "f"; #endif @@ -2629,8 +2629,10 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar break; case Variant::ARRAY: case Variant::PACKED_BYTE_ARRAY: - case Variant::PACKED_INT_ARRAY: - case Variant::PACKED_REAL_ARRAY: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: case Variant::PACKED_STRING_ARRAY: case Variant::PACKED_VECTOR2_ARRAY: case Variant::PACKED_VECTOR3_ARRAY: @@ -2914,13 +2916,13 @@ void BindingsGenerator::_populate_builtin_type_interfaces() { #define INSERT_ARRAY(m_type, m_proxy_t) INSERT_ARRAY_FULL(m_type, m_type, m_proxy_t) - INSERT_ARRAY(PackedIntArray, int); + INSERT_ARRAY(PackedInt32Array, int); INSERT_ARRAY_FULL(PackedByteArray, PackedByteArray, byte); #ifdef REAL_T_IS_DOUBLE - INSERT_ARRAY(PackedRealArray, double); + INSERT_ARRAY(PackedFloat32Array, double); #else - INSERT_ARRAY(PackedRealArray, float); + INSERT_ARRAY(PackedFloat32Array, float); #endif INSERT_ARRAY(PackedStringArray, string); diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp index c8d20e80be..31996a03d0 100644 --- a/modules/mono/editor/editor_internal_calls.cpp +++ b/modules/mono/editor/editor_internal_calls.cpp @@ -36,10 +36,10 @@ #include "core/os/os.h" #include "core/version.h" +#include "editor/debugger/editor_debugger_node.h" #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/plugins/script_editor_plugin.h" -#include "editor/script_editor_debugger.h" #include "main/main.h" #include "../csharp_script.h" @@ -305,8 +305,8 @@ void godot_icall_Internal_ReloadAssemblies(MonoBoolean p_soft_reload) { #endif } -void godot_icall_Internal_ScriptEditorDebuggerReloadScripts() { - ScriptEditor::get_singleton()->get_debugger()->reload_scripts(); +void godot_icall_Internal_EditorDebuggerNodeReloadScripts() { + EditorDebuggerNode::get_singleton()->reload_scripts(); } MonoBoolean godot_icall_Internal_ScriptEditorEdit(MonoObject *p_resource, int32_t p_line, int32_t p_col, MonoBoolean p_grab_focus) { @@ -348,9 +348,9 @@ void godot_icall_Internal_EditorRunStop() { } void godot_icall_Internal_ScriptEditorDebugger_ReloadScripts() { - ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - if (sed) { - sed->reload_scripts(); + EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); + if (ed) { + ed->reload_scripts(); } } @@ -446,7 +446,7 @@ void register_editor_internal_calls() { mono_add_internal_call("GodotTools.Internals.Internal::internal_GetEditorApiHash", (void *)godot_icall_Internal_GetEditorApiHash); mono_add_internal_call("GodotTools.Internals.Internal::internal_IsAssembliesReloadingNeeded", (void *)godot_icall_Internal_IsAssembliesReloadingNeeded); mono_add_internal_call("GodotTools.Internals.Internal::internal_ReloadAssemblies", (void *)godot_icall_Internal_ReloadAssemblies); - mono_add_internal_call("GodotTools.Internals.Internal::internal_ScriptEditorDebuggerReloadScripts", (void *)godot_icall_Internal_ScriptEditorDebuggerReloadScripts); + mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorDebuggerNodeReloadScripts", (void *)godot_icall_Internal_EditorDebuggerNodeReloadScripts); mono_add_internal_call("GodotTools.Internals.Internal::internal_ScriptEditorEdit", (void *)godot_icall_Internal_ScriptEditorEdit); mono_add_internal_call("GodotTools.Internals.Internal::internal_EditorNodeShowScriptScreen", (void *)godot_icall_Internal_EditorNodeShowScriptScreen); mono_add_internal_call("GodotTools.Internals.Internal::internal_GetScriptsMetadataOrNothing", (void *)godot_icall_Internal_GetScriptsMetadataOrNothing); diff --git a/modules/mono/glue/base_object_glue.cpp b/modules/mono/glue/base_object_glue.cpp index 8dfb5b7147..8c77220b85 100644 --- a/modules/mono/glue/base_object_glue.cpp +++ b/modules/mono/glue/base_object_glue.cpp @@ -189,12 +189,12 @@ MonoBoolean godot_icall_DynamicGodotObject_InvokeMember(Object *p_ptr, MonoStrin args.set(i, &arg_store.get(i)); } - Variant::CallError error; + Callable::CallError error; Variant result = p_ptr->call(StringName(name), args.ptr(), argc, error); *r_result = GDMonoMarshal::variant_to_mono_object(result); - return error.error == Variant::CallError::CALL_OK; + return error.error == Callable::CallError::CALL_OK; } MonoBoolean godot_icall_DynamicGodotObject_GetMember(Object *p_ptr, MonoString *p_name, MonoObject **r_result) { diff --git a/modules/mono/glue/gd_glue.cpp b/modules/mono/glue/gd_glue.cpp index a6273a60ac..cdacd90538 100644 --- a/modules/mono/glue/gd_glue.cpp +++ b/modules/mono/glue/gd_glue.cpp @@ -55,9 +55,9 @@ MonoObject *godot_icall_GD_bytes2var(MonoArray *p_bytes, MonoBoolean p_allow_obj MonoObject *godot_icall_GD_convert(MonoObject *p_what, int32_t p_type) { Variant what = GDMonoMarshal::mono_object_to_variant(p_what); const Variant *args[1] = { &what }; - Variant::CallError ce; + Callable::CallError ce; Variant ret = Variant::construct(Variant::Type(p_type), args, 1, ce); - ERR_FAIL_COND_V(ce.error != Variant::CallError::CALL_OK, NULL); + ERR_FAIL_COND_V(ce.error != Callable::CallError::CALL_OK, NULL); return GDMonoMarshal::variant_to_mono_object(ret); } diff --git a/modules/mono/mono_gd/gd_mono_field.cpp b/modules/mono/mono_gd/gd_mono_field.cpp index 21d78483ee..03b56c9949 100644 --- a/modules/mono/mono_gd/gd_mono_field.cpp +++ b/modules/mono/mono_gd/gd_mono_field.cpp @@ -252,12 +252,12 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ } if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) { - SET_FROM_ARRAY(PackedIntArray); + SET_FROM_ARRAY(PackedInt32Array); break; } if (array_type->eklass == REAL_T_MONOCLASS) { - SET_FROM_ARRAY(PackedRealArray); + SET_FROM_ARRAY(PackedFloat32Array); break; } @@ -370,7 +370,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ int32_t val = p_value.operator signed int(); mono_field_set_value(p_object, mono_field, &val); } break; - case Variant::REAL: { + case Variant::FLOAT: { #ifdef REAL_T_IS_DOUBLE double val = p_value.operator double(); mono_field_set_value(p_object, mono_field, &val); @@ -437,11 +437,11 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ case Variant::PACKED_BYTE_ARRAY: { SET_FROM_ARRAY(PackedByteArray); } break; - case Variant::PACKED_INT_ARRAY: { - SET_FROM_ARRAY(PackedIntArray); + case Variant::PACKED_INT32_ARRAY: { + SET_FROM_ARRAY(PackedInt32Array); } break; - case Variant::PACKED_REAL_ARRAY: { - SET_FROM_ARRAY(PackedRealArray); + case Variant::PACKED_FLOAT32_ARRAY: { + SET_FROM_ARRAY(PackedFloat32Array); } break; case Variant::PACKED_STRING_ARRAY: { SET_FROM_ARRAY(PackedStringArray); diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index 63890f6066..695be64d6e 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -60,9 +60,9 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type) { return Variant::INT; case MONO_TYPE_R4: - return Variant::REAL; + return Variant::FLOAT; case MONO_TYPE_R8: - return Variant::REAL; + return Variant::FLOAT; case MONO_TYPE_STRING: { return Variant::STRING; @@ -116,10 +116,10 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type) { return Variant::PACKED_BYTE_ARRAY; if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) - return Variant::PACKED_INT_ARRAY; + return Variant::PACKED_INT32_ARRAY; if (array_type->eklass == REAL_T_MONOCLASS) - return Variant::PACKED_REAL_ARRAY; + return Variant::PACKED_FLOAT32_ARRAY; if (array_type->eklass == CACHED_CLASS_RAW(String)) return Variant::PACKED_STRING_ARRAY; @@ -494,10 +494,10 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty return (MonoObject *)PackedByteArray_to_mono_array(p_var->operator PackedByteArray()); if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) - return (MonoObject *)PackedIntArray_to_mono_array(p_var->operator PackedIntArray()); + return (MonoObject *)PackedInt32Array_to_mono_array(p_var->operator PackedInt32Array()); if (array_type->eklass == REAL_T_MONOCLASS) - return (MonoObject *)PackedRealArray_to_mono_array(p_var->operator PackedRealArray()); + return (MonoObject *)PackedFloat32Array_to_mono_array(p_var->operator PackedFloat32Array()); if (array_type->eklass == CACHED_CLASS_RAW(String)) return (MonoObject *)PackedStringArray_to_mono_array(p_var->operator PackedStringArray()); @@ -577,7 +577,7 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty int32_t val = p_var->operator signed int(); return BOX_INT32(val); } - case Variant::REAL: { + case Variant::FLOAT: { #ifdef REAL_T_IS_DOUBLE double val = p_var->operator double(); return BOX_DOUBLE(val); @@ -640,10 +640,10 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty return GDMonoUtils::create_managed_from(p_var->operator Array(), CACHED_CLASS(Array)); case Variant::PACKED_BYTE_ARRAY: return (MonoObject *)PackedByteArray_to_mono_array(p_var->operator PackedByteArray()); - case Variant::PACKED_INT_ARRAY: - return (MonoObject *)PackedIntArray_to_mono_array(p_var->operator PackedIntArray()); - case Variant::PACKED_REAL_ARRAY: - return (MonoObject *)PackedRealArray_to_mono_array(p_var->operator PackedRealArray()); + case Variant::PACKED_INT32_ARRAY: + return (MonoObject *)PackedInt32Array_to_mono_array(p_var->operator PackedInt32Array()); + case Variant::PACKED_FLOAT32_ARRAY: + return (MonoObject *)PackedFloat32Array_to_mono_array(p_var->operator PackedFloat32Array()); case Variant::PACKED_STRING_ARRAY: return (MonoObject *)PackedStringArray_to_mono_array(p_var->operator PackedStringArray()); case Variant::PACKED_VECTOR2_ARRAY: @@ -788,10 +788,10 @@ Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type return mono_array_to_PackedByteArray((MonoArray *)p_obj); if (array_type->eklass == CACHED_CLASS_RAW(int32_t)) - return mono_array_to_PackedIntArray((MonoArray *)p_obj); + return mono_array_to_PackedInt32Array((MonoArray *)p_obj); if (array_type->eklass == REAL_T_MONOCLASS) - return mono_array_to_PackedRealArray((MonoArray *)p_obj); + return mono_array_to_PackedFloat32Array((MonoArray *)p_obj); if (array_type->eklass == CACHED_CLASS_RAW(String)) return mono_array_to_PackedStringArray((MonoArray *)p_obj); @@ -987,7 +987,7 @@ Array mono_array_to_Array(MonoArray *p_array) { // TODO: Use memcpy where possible -MonoArray *PackedIntArray_to_mono_array(const PackedIntArray &p_array) { +MonoArray *PackedInt32Array_to_mono_array(const PackedInt32Array &p_array) { const int *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), CACHED_CLASS_RAW(int32_t), p_array.size()); @@ -999,8 +999,8 @@ MonoArray *PackedIntArray_to_mono_array(const PackedIntArray &p_array) { return ret; } -PackedIntArray mono_array_to_PackedIntArray(MonoArray *p_array) { - PackedIntArray ret; +PackedInt32Array mono_array_to_PackedInt32Array(MonoArray *p_array) { + PackedInt32Array ret; if (!p_array) return ret; int length = mono_array_length(p_array); @@ -1041,7 +1041,7 @@ PackedByteArray mono_array_to_PackedByteArray(MonoArray *p_array) { return ret; } -MonoArray *PackedRealArray_to_mono_array(const PackedRealArray &p_array) { +MonoArray *PackedFloat32Array_to_mono_array(const PackedFloat32Array &p_array) { const real_t *r = p_array.ptr(); MonoArray *ret = mono_array_new(mono_domain_get(), REAL_T_MONOCLASS, p_array.size()); @@ -1053,8 +1053,8 @@ MonoArray *PackedRealArray_to_mono_array(const PackedRealArray &p_array) { return ret; } -PackedRealArray mono_array_to_PackedRealArray(MonoArray *p_array) { - PackedRealArray ret; +PackedFloat32Array mono_array_to_PackedFloat32Array(MonoArray *p_array) { + PackedFloat32Array ret; if (!p_array) return ret; int length = mono_array_length(p_array); diff --git a/modules/mono/mono_gd/gd_mono_marshal.h b/modules/mono/mono_gd/gd_mono_marshal.h index d3527109ff..5db59522ce 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.h +++ b/modules/mono/mono_gd/gd_mono_marshal.h @@ -127,20 +127,20 @@ String mono_object_to_variant_string(MonoObject *p_obj, MonoException **r_exc); MonoArray *Array_to_mono_array(const Array &p_array); Array mono_array_to_Array(MonoArray *p_array); -// PackedIntArray +// PackedInt32Array -MonoArray *PackedIntArray_to_mono_array(const PackedIntArray &p_array); -PackedIntArray mono_array_to_PackedIntArray(MonoArray *p_array); +MonoArray *PackedInt32Array_to_mono_array(const PackedInt32Array &p_array); +PackedInt32Array mono_array_to_PackedInt32Array(MonoArray *p_array); // PackedByteArray MonoArray *PackedByteArray_to_mono_array(const PackedByteArray &p_array); PackedByteArray mono_array_to_PackedByteArray(MonoArray *p_array); -// PackedRealArray +// PackedFloat32Array -MonoArray *PackedRealArray_to_mono_array(const PackedRealArray &p_array); -PackedRealArray mono_array_to_PackedRealArray(MonoArray *p_array); +MonoArray *PackedFloat32Array_to_mono_array(const PackedFloat32Array &p_array); +PackedFloat32Array mono_array_to_PackedFloat32Array(MonoArray *p_array); // PackedStringArray diff --git a/modules/mono/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp index 05077a00c4..ae6625a6c6 100644 --- a/modules/mono/mono_gd/gd_mono_utils.cpp +++ b/modules/mono/mono_gd/gd_mono_utils.cpp @@ -38,7 +38,7 @@ #include "core/reference.h" #ifdef TOOLS_ENABLED -#include "editor/script_editor_debugger.h" +#include "editor/debugger/script_editor_debugger.h" #endif #include "../csharp_script.h" diff --git a/modules/mono/signal_awaiter_utils.cpp b/modules/mono/signal_awaiter_utils.cpp index b85d5f2fd9..718bc2bb93 100644 --- a/modules/mono/signal_awaiter_utils.cpp +++ b/modules/mono/signal_awaiter_utils.cpp @@ -51,7 +51,7 @@ Error connect_signal_awaiter(Object *p_source, const String &p_signal, Object *p Vector<Variant> binds; binds.push_back(sa_con); - Error err = p_source->connect(p_signal, sa_con.ptr(), + Error err = p_source->connect_compat(p_signal, sa_con.ptr(), CSharpLanguage::get_singleton()->get_string_names()._signal_callback, binds, Object::CONNECT_ONESHOT); @@ -65,7 +65,7 @@ Error connect_signal_awaiter(Object *p_source, const String &p_signal, Object *p } } // namespace SignalAwaiterUtils -Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { #ifdef DEBUG_ENABLED ERR_FAIL_COND_V_MSG(conn_target_id.is_valid() && !ObjectDB::get_instance(conn_target_id), Variant(), @@ -73,7 +73,7 @@ Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argc #endif if (p_argcount < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; return Variant(); } @@ -81,7 +81,7 @@ Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argc Ref<SignalAwaiterHandle> self = *p_args[p_argcount - 1]; if (self.is_null()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = p_argcount - 1; r_error.expected = Variant::OBJECT; return Variant(); diff --git a/modules/mono/signal_awaiter_utils.h b/modules/mono/signal_awaiter_utils.h index a9956ad5ba..012f6e5bb3 100644 --- a/modules/mono/signal_awaiter_utils.h +++ b/modules/mono/signal_awaiter_utils.h @@ -49,7 +49,7 @@ class SignalAwaiterHandle : public MonoGCHandle { ObjectID conn_target_id; #endif - Variant _signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error); protected: static void _bind_methods(); diff --git a/modules/opensimplex/noise_texture.cpp b/modules/opensimplex/noise_texture.cpp index 19aa281a72..d60099e676 100644 --- a/modules/opensimplex/noise_texture.cpp +++ b/modules/opensimplex/noise_texture.cpp @@ -84,7 +84,7 @@ void NoiseTexture::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "height", PROPERTY_HINT_RANGE, "1,2048,1,or_greater"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "seamless"), "set_seamless", "get_seamless"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "as_normalmap"), "set_as_normalmap", "is_normalmap"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bump_strength", PROPERTY_HINT_RANGE, "0,32,0.1,or_greater"), "set_bump_strength", "get_bump_strength"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bump_strength", PROPERTY_HINT_RANGE, "0,32,0.1,or_greater"), "set_bump_strength", "get_bump_strength"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "noise", PROPERTY_HINT_RESOURCE_TYPE, "OpenSimplexNoise"), "set_noise", "get_noise"); } @@ -184,11 +184,11 @@ void NoiseTexture::set_noise(Ref<OpenSimplexNoise> p_noise) { if (p_noise == noise) return; if (noise.is_valid()) { - noise->disconnect(CoreStringNames::get_singleton()->changed, this, "_queue_update"); + noise->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_queue_update"); } noise = p_noise; if (noise.is_valid()) { - noise->connect(CoreStringNames::get_singleton()->changed, this, "_queue_update"); + noise->connect_compat(CoreStringNames::get_singleton()->changed, this, "_queue_update"); } _queue_update(); } diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp index bd2dbd74a8..238faa4130 100644 --- a/modules/opensimplex/open_simplex_noise.cpp +++ b/modules/opensimplex/open_simplex_noise.cpp @@ -186,9 +186,9 @@ void OpenSimplexNoise::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed"); ADD_PROPERTY(PropertyInfo(Variant::INT, "octaves", PROPERTY_HINT_RANGE, vformat("1,%d,1", MAX_OCTAVES)), "set_octaves", "get_octaves"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "persistence", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistence", "get_persistence"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "persistence", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistence", "get_persistence"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity"); } float OpenSimplexNoise::get_noise_1d(float x) { diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 6224db90e7..054ed088df 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -267,7 +267,7 @@ void AudioStreamOGGVorbis::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_data", "get_data"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "loop_offset"), "set_loop_offset", "get_loop_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "loop_offset"), "set_loop_offset", "get_loop_offset"); } AudioStreamOGGVorbis::AudioStreamOGGVorbis() { diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp index ec89f2ac76..13d96541e3 100644 --- a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp +++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp @@ -73,7 +73,7 @@ String ResourceImporterOGGVorbis::get_preset_name(int p_idx) const { void ResourceImporterOGGVorbis::get_import_options(List<ImportOption> *r_options, int p_preset) const { r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "loop"), true)); - r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "loop_offset"), 0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "loop_offset"), 0)); } Error ResourceImporterOGGVorbis::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) { diff --git a/modules/visual_script/doc_classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml index 9cd79aa781..db1ef2adc6 100644 --- a/modules/visual_script/doc_classes/VisualScript.xml +++ b/modules/visual_script/doc_classes/VisualScript.xml @@ -15,7 +15,7 @@ <method name="add_custom_signal"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Add a custom signal with the specified name to the VisualScript. @@ -24,7 +24,7 @@ <method name="add_function"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Add a function with the specified name to the VisualScript. @@ -33,7 +33,7 @@ <method name="add_node"> <return type="void"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="id" type="int"> </argument> @@ -48,7 +48,7 @@ <method name="add_variable"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="default_value" type="Variant" default="null"> </argument> @@ -61,7 +61,7 @@ <method name="custom_signal_add_argument"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="type" type="int" enum="Variant.Type"> </argument> @@ -76,7 +76,7 @@ <method name="custom_signal_get_argument_count" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Get the count of a custom signal's arguments. @@ -85,7 +85,7 @@ <method name="custom_signal_get_argument_name" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="argidx" type="int"> </argument> @@ -96,7 +96,7 @@ <method name="custom_signal_get_argument_type" qualifiers="const"> <return type="int" enum="Variant.Type"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="argidx" type="int"> </argument> @@ -107,7 +107,7 @@ <method name="custom_signal_remove_argument"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="argidx" type="int"> </argument> @@ -118,7 +118,7 @@ <method name="custom_signal_set_argument_name"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="argidx" type="int"> </argument> @@ -131,7 +131,7 @@ <method name="custom_signal_set_argument_type"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="argidx" type="int"> </argument> @@ -144,7 +144,7 @@ <method name="custom_signal_swap_argument"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="argidx" type="int"> </argument> @@ -157,7 +157,7 @@ <method name="data_connect"> <return type="void"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="from_node" type="int"> </argument> @@ -174,7 +174,7 @@ <method name="data_disconnect"> <return type="void"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="from_node" type="int"> </argument> @@ -191,7 +191,7 @@ <method name="get_function_node_id" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns the id of a function's entry point node. @@ -200,7 +200,7 @@ <method name="get_function_scroll" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns the position of the center of the screen for a given function. @@ -209,7 +209,7 @@ <method name="get_node" qualifiers="const"> <return type="VisualScriptNode"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="id" type="int"> </argument> @@ -220,7 +220,7 @@ <method name="get_node_position" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="id" type="int"> </argument> @@ -231,7 +231,7 @@ <method name="get_variable_default_value" qualifiers="const"> <return type="Variant"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns the default (initial) value of a variable. @@ -240,7 +240,7 @@ <method name="get_variable_export" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns whether a variable is exported. @@ -249,7 +249,7 @@ <method name="get_variable_info" qualifiers="const"> <return type="Dictionary"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns the information for a given variable as a dictionary. The information includes its name, type, hint and usage. @@ -258,7 +258,7 @@ <method name="has_custom_signal" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns whether a signal exists with the specified name. @@ -267,7 +267,7 @@ <method name="has_data_connection" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="from_node" type="int"> </argument> @@ -284,7 +284,7 @@ <method name="has_function" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns whether a function exists with the specified name. @@ -293,7 +293,7 @@ <method name="has_node" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="id" type="int"> </argument> @@ -304,7 +304,7 @@ <method name="has_sequence_connection" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="from_node" type="int"> </argument> @@ -319,7 +319,7 @@ <method name="has_variable" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Returns whether a variable exists with the specified name. @@ -328,7 +328,7 @@ <method name="remove_custom_signal"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Remove a custom signal with the given name. @@ -337,7 +337,7 @@ <method name="remove_function"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Remove a specific function and its nodes from the script. @@ -346,7 +346,7 @@ <method name="remove_node"> <return type="void"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="id" type="int"> </argument> @@ -357,7 +357,7 @@ <method name="remove_variable"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <description> Remove a variable with the given name. @@ -366,9 +366,9 @@ <method name="rename_custom_signal"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="new_name" type="String"> + <argument index="1" name="new_name" type="StringName"> </argument> <description> Change the name of a custom signal. @@ -377,9 +377,9 @@ <method name="rename_function"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="new_name" type="String"> + <argument index="1" name="new_name" type="StringName"> </argument> <description> Change the name of a function. @@ -388,9 +388,9 @@ <method name="rename_variable"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> - <argument index="1" name="new_name" type="String"> + <argument index="1" name="new_name" type="StringName"> </argument> <description> Change the name of a variable. @@ -399,7 +399,7 @@ <method name="sequence_connect"> <return type="void"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="from_node" type="int"> </argument> @@ -415,7 +415,7 @@ <method name="sequence_disconnect"> <return type="void"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="from_node" type="int"> </argument> @@ -430,7 +430,7 @@ <method name="set_function_scroll"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="ofs" type="Vector2"> </argument> @@ -441,7 +441,7 @@ <method name="set_instance_base_type"> <return type="void"> </return> - <argument index="0" name="type" type="String"> + <argument index="0" name="type" type="StringName"> </argument> <description> Set the base type of the script. @@ -450,7 +450,7 @@ <method name="set_node_position"> <return type="void"> </return> - <argument index="0" name="func" type="String"> + <argument index="0" name="func" type="StringName"> </argument> <argument index="1" name="id" type="int"> </argument> @@ -463,7 +463,7 @@ <method name="set_variable_default_value"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="value" type="Variant"> </argument> @@ -474,7 +474,7 @@ <method name="set_variable_export"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="enable" type="bool"> </argument> @@ -485,7 +485,7 @@ <method name="set_variable_info"> <return type="void"> </return> - <argument index="0" name="name" type="String"> + <argument index="0" name="name" type="StringName"> </argument> <argument index="1" name="value" type="Dictionary"> </argument> diff --git a/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml b/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml index c8e391c4a1..4d07f878a2 100644 --- a/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml @@ -14,7 +14,7 @@ <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type" default="0"> The type to get the constant from. </member> - <member name="constant" type="String" setter="set_basic_type_constant" getter="get_basic_type_constant"> + <member name="constant" type="StringName" setter="set_basic_type_constant" getter="get_basic_type_constant"> The name of the constant to return. </member> </members> diff --git a/modules/visual_script/doc_classes/VisualScriptClassConstant.xml b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml index cf35808823..de5d731cc0 100644 --- a/modules/visual_script/doc_classes/VisualScriptClassConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml @@ -15,10 +15,10 @@ <methods> </methods> <members> - <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default=""Object""> + <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@"Object""> The constant's parent class. </member> - <member name="constant" type="String" setter="set_class_constant" getter="get_class_constant" default=""""> + <member name="constant" type="StringName" setter="set_class_constant" getter="get_class_constant" default="@"""> The constant to return. See the given class for its available constants. </member> </members> diff --git a/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml b/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml index 60a19ac7a7..5c9c8d3eca 100644 --- a/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml +++ b/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml @@ -15,7 +15,7 @@ <methods> </methods> <members> - <member name="signal" type="String" setter="set_signal" getter="get_signal" default=""""> + <member name="signal" type="StringName" setter="set_signal" getter="get_signal" default="@"""> The signal to emit. </member> </members> diff --git a/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml index 16c3af7ab2..2d0fac1fa0 100644 --- a/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml @@ -11,19 +11,19 @@ <members> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script"> </member> - <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default=""Object""> + <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@"Object""> </member> <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type"> </member> <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptFunctionCall.CallMode" default="0"> </member> - <member name="function" type="String" setter="set_function" getter="get_function" default=""""> + <member name="function" type="StringName" setter="set_function" getter="get_function" default="@"""> </member> <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path"> </member> <member name="rpc_call_mode" type="int" setter="set_rpc_call_mode" getter="get_rpc_call_mode" enum="VisualScriptFunctionCall.RPCCallMode" default="0"> </member> - <member name="singleton" type="String" setter="set_singleton" getter="get_singleton"> + <member name="singleton" type="StringName" setter="set_singleton" getter="get_singleton"> </member> <member name="use_default_args" type="int" setter="set_use_default_args" getter="get_use_default_args"> </member> diff --git a/modules/visual_script/doc_classes/VisualScriptInputAction.xml b/modules/visual_script/doc_classes/VisualScriptInputAction.xml index 0b6325bf0a..6c296fdb4b 100644 --- a/modules/visual_script/doc_classes/VisualScriptInputAction.xml +++ b/modules/visual_script/doc_classes/VisualScriptInputAction.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="action" type="String" setter="set_action_name" getter="get_action_name" default=""""> + <member name="action" type="StringName" setter="set_action_name" getter="get_action_name" default="@"""> </member> <member name="mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="VisualScriptInputAction.Mode" default="0"> </member> diff --git a/modules/visual_script/doc_classes/VisualScriptLocalVar.xml b/modules/visual_script/doc_classes/VisualScriptLocalVar.xml index 6c31ae1a30..c3741eea89 100644 --- a/modules/visual_script/doc_classes/VisualScriptLocalVar.xml +++ b/modules/visual_script/doc_classes/VisualScriptLocalVar.xml @@ -18,7 +18,7 @@ <member name="type" type="int" setter="set_var_type" getter="get_var_type" enum="Variant.Type" default="0"> The local variable's type. </member> - <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" default=""new_local""> + <member name="var_name" type="StringName" setter="set_var_name" getter="get_var_name" default="@"new_local""> The local variable's name. </member> </members> diff --git a/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml b/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml index 0a9a509958..619bbb90ca 100644 --- a/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml +++ b/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml @@ -20,7 +20,7 @@ <member name="type" type="int" setter="set_var_type" getter="get_var_type" enum="Variant.Type" default="0"> The local variable's type. </member> - <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" default=""new_local""> + <member name="var_name" type="StringName" setter="set_var_name" getter="get_var_name" default="@"new_local""> The local variable's name. </member> </members> diff --git a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml index cf436116b8..f13d449064 100644 --- a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml @@ -11,15 +11,15 @@ <members> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script"> </member> - <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default=""Object""> + <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@"Object""> </member> <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type"> </member> - <member name="index" type="String" setter="set_index" getter="get_index"> + <member name="index" type="StringName" setter="set_index" getter="get_index"> </member> <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path"> </member> - <member name="property" type="String" setter="set_property" getter="get_property" default=""""> + <member name="property" type="StringName" setter="set_property" getter="get_property" default="@"""> </member> <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptPropertyGet.CallMode" default="0"> </member> diff --git a/modules/visual_script/doc_classes/VisualScriptPropertySet.xml b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml index 357b4b9f5c..629576e261 100644 --- a/modules/visual_script/doc_classes/VisualScriptPropertySet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml @@ -13,15 +13,15 @@ </member> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script"> </member> - <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default=""Object""> + <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@"Object""> </member> <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type"> </member> - <member name="index" type="String" setter="set_index" getter="get_index"> + <member name="index" type="StringName" setter="set_index" getter="get_index"> </member> <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path"> </member> - <member name="property" type="String" setter="set_property" getter="get_property" default=""""> + <member name="property" type="StringName" setter="set_property" getter="get_property" default="@"""> </member> <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptPropertySet.CallMode" default="0"> </member> diff --git a/modules/visual_script/doc_classes/VisualScriptTypeCast.xml b/modules/visual_script/doc_classes/VisualScriptTypeCast.xml index 43fe9d16ea..80a8d31041 100644 --- a/modules/visual_script/doc_classes/VisualScriptTypeCast.xml +++ b/modules/visual_script/doc_classes/VisualScriptTypeCast.xml @@ -11,7 +11,7 @@ <members> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" default=""""> </member> - <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default=""Object""> + <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@"Object""> </member> </members> <constants> diff --git a/modules/visual_script/doc_classes/VisualScriptVariableGet.xml b/modules/visual_script/doc_classes/VisualScriptVariableGet.xml index 0746ab293e..d182e14e4d 100644 --- a/modules/visual_script/doc_classes/VisualScriptVariableGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptVariableGet.xml @@ -15,7 +15,7 @@ <methods> </methods> <members> - <member name="var_name" type="String" setter="set_variable" getter="get_variable" default=""""> + <member name="var_name" type="StringName" setter="set_variable" getter="get_variable" default="@"""> The variable's name. </member> </members> diff --git a/modules/visual_script/doc_classes/VisualScriptVariableSet.xml b/modules/visual_script/doc_classes/VisualScriptVariableSet.xml index e7d83e60ab..3bd392dd85 100644 --- a/modules/visual_script/doc_classes/VisualScriptVariableSet.xml +++ b/modules/visual_script/doc_classes/VisualScriptVariableSet.xml @@ -16,7 +16,7 @@ <methods> </methods> <members> - <member name="var_name" type="String" setter="set_variable" getter="get_variable" default=""""> + <member name="var_name" type="StringName" setter="set_variable" getter="get_variable" default="@"""> The variable's name. </member> </members> diff --git a/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml b/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml index 8f6941ce1e..483cdfeaf8 100644 --- a/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml +++ b/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml @@ -9,13 +9,13 @@ <methods> </methods> <members> - <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" default=""Object""> + <member name="base_type" type="StringName" setter="set_base_type" getter="get_base_type" default="@"Object""> </member> <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptYieldSignal.CallMode" default="0"> </member> <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path"> </member> - <member name="signal" type="String" setter="set_signal" getter="get_signal" default=""""> + <member name="signal" type="StringName" setter="set_signal" getter="get_signal" default="@"""> </member> </members> <constants> diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 762566e9ae..70f650cfd3 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -88,11 +88,11 @@ void VisualScriptNode::validate_input_default_values() { continue; } else { //not the same, reconvert - Variant::CallError ce; + Callable::CallError ce; Variant existing = default_input_values[i]; const Variant *existingp = &existing; default_input_values[i] = Variant::construct(expected, &existingp, 1, ce, false); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { //could not convert? force.. default_input_values[i] = Variant::construct(expected, NULL, 0, ce, false); } @@ -198,7 +198,7 @@ void VisualScript::remove_function(const StringName &p_name) { for (Map<int, Function::NodeData>::Element *E = functions[p_name].nodes.front(); E; E = E->next()) { - E->get().node->disconnect("ports_changed", this, "_node_ports_changed"); + E->get().node->disconnect_compat("ports_changed", this, "_node_ports_changed"); E->get().node->scripts_used.erase(this); } @@ -340,7 +340,7 @@ void VisualScript::add_node(const StringName &p_func, int p_id, const Ref<Visual nd.pos = p_pos; Ref<VisualScriptNode> vsn = p_node; - vsn->connect("ports_changed", this, "_node_ports_changed", varray(p_id)); + vsn->connect_compat("ports_changed", this, "_node_ports_changed", varray(p_id)); vsn->scripts_used.insert(this); vsn->validate_input_default_values(); // Validate when fully loaded @@ -389,7 +389,7 @@ void VisualScript::remove_node(const StringName &p_func, int p_id) { func.function_id = -1; //revert to invalid } - func.nodes[p_id].node->disconnect("ports_changed", this, "_node_ports_changed"); + func.nodes[p_id].node->disconnect_compat("ports_changed", this, "_node_ports_changed"); func.nodes[p_id].node->scripts_used.erase(this); func.nodes.erase(p_id); @@ -1560,7 +1560,7 @@ bool VisualScriptInstance::has_method(const StringName &p_method) const { //#define VSDEBUG(m_text) print_line(m_text) #define VSDEBUG(m_text) -void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int p_pass, int *pass_stack, const Variant **input_args, Variant **output_args, Variant *variant_stack, Variant::CallError &r_error, String &error_str, VisualScriptNodeInstance **r_error_node) { +void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int p_pass, int *pass_stack, const Variant **input_args, Variant **output_args, Variant *variant_stack, Callable::CallError &r_error, String &error_str, VisualScriptNodeInstance **r_error_node) { ERR_FAIL_COND(node->pass_idx == -1); @@ -1577,7 +1577,7 @@ void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int for (int i = 0; i < dc; i++) { _dependency_step(deps[i], p_pass, pass_stack, input_args, output_args, variant_stack, r_error, error_str, r_error_node); - if (r_error.error != Variant::CallError::CALL_OK) + if (r_error.error != Callable::CallError::CALL_OK) return; } } @@ -1602,12 +1602,12 @@ void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int node->step(input_args, output_args, VisualScriptNodeInstance::START_MODE_BEGIN_SEQUENCE, working_mem, r_error, error_str); //ignore return - if (r_error.error != Variant::CallError::CALL_OK) { + if (r_error.error != Callable::CallError::CALL_OK) { *r_error_node = node; } } -Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p_stack, int p_stack_size, VisualScriptNodeInstance *p_node, int p_flow_stack_pos, int p_pass, bool p_resuming_yield, Variant::CallError &r_error) { +Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p_stack, int p_stack_size, VisualScriptNodeInstance *p_node, int p_flow_stack_pos, int p_pass, bool p_resuming_yield, Callable::CallError &r_error) { Map<StringName, Function>::Element *F = functions.find(p_method); ERR_FAIL_COND_V(!F, Variant()); @@ -1669,7 +1669,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p for (int i = 0; i < dc; i++) { _dependency_step(deps[i], p_pass, pass_stack, input_args, output_args, variant_stack, r_error, error_str, &node); - if (r_error.error != Variant::CallError::CALL_OK) { + if (r_error.error != Callable::CallError::CALL_OK) { error = true; current_node_id = node->id; break; @@ -1729,7 +1729,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p int ret = node->step(input_args, output_args, start_mode, working_mem, r_error, error_str); - if (r_error.error != Variant::CallError::CALL_OK) { + if (r_error.error != Callable::CallError::CALL_OK) { //use error from step error = true; break; @@ -1738,7 +1738,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p if (ret & VisualScriptNodeInstance::STEP_YIELD_BIT) { //yielded! if (node->get_working_memory_size() == 0) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; error_str = RTR("A node yielded without working memory, please read the docs on how to yield properly!"); error = true; break; @@ -1747,7 +1747,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p Ref<VisualScriptFunctionState> state = *working_mem; if (!state.is_valid()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; error_str = RTR("Node yielded, but did not return a function state in the first working memory."); error = true; break; @@ -1766,7 +1766,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p state->pass = p_pass; copymem(state->stack.ptrw(), p_stack, p_stack_size); //step 2, run away, return directly - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; #ifdef DEBUG_ENABLED //will re-enter later, so exiting @@ -1809,7 +1809,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p if (ret & VisualScriptNodeInstance::STEP_EXIT_FUNCTION_BIT) { if (node->get_working_memory_size() == 0) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; error_str = RTR("Return value must be assigned to first element of node working memory! Fix your node please."); error = true; } else { @@ -1826,7 +1826,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p if ((ret == output || ret & VisualScriptNodeInstance::STEP_FLAG_PUSH_STACK_BIT) && node->sequence_output_count) { //if no exit bit was set, and has sequence outputs, guess next node if (output >= node->sequence_output_count) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; error_str = RTR("Node returned an invalid sequence output: ") + itos(output); error = true; break; @@ -1888,7 +1888,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p } if (!found) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; error_str = RTR("Found sequence bit but not the node in the stack, report bug!"); error = true; break; @@ -1900,7 +1900,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p } else { // check for stack overflow if (flow_stack_pos + 1 >= flow_max) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; error_str = RTR("Stack overflow with stack depth: ") + itos(output); error = true; break; @@ -1952,22 +1952,22 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p String err_func = p_method; int err_line = current_node_id; //not a line but it works as one - if (node && (r_error.error != Variant::CallError::CALL_ERROR_INVALID_METHOD || error_str == String())) { + if (node && (r_error.error != Callable::CallError::CALL_ERROR_INVALID_METHOD || error_str == String())) { if (error_str != String()) { error_str += " "; } - if (r_error.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) { + if (r_error.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) { int errorarg = r_error.argument; - error_str += "Cannot convert argument " + itos(errorarg + 1) + " to " + Variant::get_type_name(r_error.expected) + "."; - } else if (r_error.error == Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { + error_str += "Cannot convert argument " + itos(errorarg + 1) + " to " + Variant::get_type_name(Variant::Type(r_error.expected)) + "."; + } else if (r_error.error == Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { error_str += "Expected " + itos(r_error.argument) + " arguments."; - } else if (r_error.error == Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { + } else if (r_error.error == Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { error_str += "Expected " + itos(r_error.argument) + " arguments."; - } else if (r_error.error == Variant::CallError::CALL_ERROR_INVALID_METHOD) { + } else if (r_error.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) { error_str += "Invalid Call."; - } else if (r_error.error == Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) { + } else if (r_error.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) { error_str += "Base Instance is null"; } } @@ -2000,13 +2000,13 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p return return_value; } -Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - r_error.error = Variant::CallError::CALL_OK; //ok by default + r_error.error = Callable::CallError::CALL_OK; //ok by default Map<StringName, Function>::Element *F = functions.find(p_method); if (!F) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } @@ -2048,7 +2048,7 @@ Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p Map<int, VisualScriptNodeInstance *>::Element *E = instances.find(f->node); if (!E) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; ERR_FAIL_V_MSG(Variant(), "No VisualScriptFunction node in function."); } @@ -2062,14 +2062,14 @@ Variant VisualScriptInstance::call(const StringName &p_method, const Variant **p VSDEBUG("ARGUMENTS: " + itos(f->argument_count) = " RECEIVED: " + itos(p_argcount)); if (p_argcount < f->argument_count) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = node->get_input_port_count(); return Variant(); } if (p_argcount > f->argument_count) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = node->get_input_port_count(); return Variant(); @@ -2094,15 +2094,15 @@ void VisualScriptInstance::notification(int p_notification) { Variant what = p_notification; const Variant *whatp = &what; - Variant::CallError ce; + Callable::CallError ce; call(VisualScriptLanguage::singleton->notification, &whatp, 1, ce); //do as call } String VisualScriptInstance::to_string(bool *r_valid) { if (has_method(CoreStringNames::get_singleton()->_to_string)) { - Variant::CallError ce; + Callable::CallError ce; Variant ret = call(CoreStringNames::get_singleton()->_to_string, NULL, 0, ce); - if (ce.error == Variant::CallError::CALL_OK) { + if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { if (r_valid) *r_valid = false; @@ -2408,7 +2408,7 @@ VisualScriptInstance::~VisualScriptInstance() { ///////////////////// -Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { ERR_FAIL_COND_V(function == StringName(), Variant()); @@ -2419,12 +2419,12 @@ Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int #endif - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; Array args; if (p_argcount == 0) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; return Variant(); } else if (p_argcount == 1) { @@ -2439,13 +2439,13 @@ Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int Ref<VisualScriptFunctionState> self = *p_args[p_argcount - 1]; //hi, I'm myself, needed this to remain alive. if (self.is_null()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = p_argcount - 1; r_error.expected = Variant::OBJECT; return Variant(); } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; Variant *working_mem = ((Variant *)stack.ptr()) + working_mem_index; @@ -2463,7 +2463,7 @@ void VisualScriptFunctionState::connect_to_signal(Object *p_obj, const String &p binds.push_back(p_binds[i]); } binds.push_back(Ref<VisualScriptFunctionState>(this)); //add myself on the back to avoid dying from unreferencing - p_obj->connect(p_signal, this, "_signal_callback", binds, CONNECT_ONESHOT); + p_obj->connect_compat(p_signal, this, "_signal_callback", binds, CONNECT_ONESHOT); } bool VisualScriptFunctionState::is_valid() const { @@ -2481,8 +2481,8 @@ Variant VisualScriptFunctionState::resume(Array p_args) { #endif - Variant::CallError r_error; - r_error.error = Variant::CallError::CALL_OK; + Callable::CallError r_error; + r_error.error = Callable::CallError::CALL_OK; Variant *working_mem = ((Variant *)stack.ptr()) + working_mem_index; diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index cc77f9d891..08b84bce1d 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -155,7 +155,7 @@ public: virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) = 0; //do a step, return which sequence port to go out + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) = 0; //do a step, return which sequence port to go out Ref<VisualScriptNode> get_base_node() { return Ref<VisualScriptNode>(base); } @@ -408,8 +408,8 @@ class VisualScriptInstance : public ScriptInstance { StringName source; - void _dependency_step(VisualScriptNodeInstance *node, int p_pass, int *pass_stack, const Variant **input_args, Variant **output_args, Variant *variant_stack, Variant::CallError &r_error, String &error_str, VisualScriptNodeInstance **r_error_node); - Variant _call_internal(const StringName &p_method, void *p_stack, int p_stack_size, VisualScriptNodeInstance *p_node, int p_flow_stack_pos, int p_pass, bool p_resuming_yield, Variant::CallError &r_error); + void _dependency_step(VisualScriptNodeInstance *node, int p_pass, int *pass_stack, const Variant **input_args, Variant **output_args, Variant *variant_stack, Callable::CallError &r_error, String &error_str, VisualScriptNodeInstance **r_error_node); + Variant _call_internal(const StringName &p_method, void *p_stack, int p_stack_size, VisualScriptNodeInstance *p_node, int p_flow_stack_pos, int p_pass, bool p_resuming_yield, Callable::CallError &r_error); //Map<StringName,Function> functions; friend class VisualScriptFunctionState; //for yield @@ -422,7 +422,7 @@ public: virtual void get_method_list(List<MethodInfo> *p_list) const; virtual bool has_method(const StringName &p_method) const; - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual void notification(int p_notification); String to_string(bool *r_valid); @@ -487,7 +487,7 @@ class VisualScriptFunctionState : public Reference { int flow_stack_pos; int pass; - Variant _signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _signal_callback(const Variant **p_args, int p_argcount, Callable::CallError &r_error); protected: static void _bind_methods(); diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index e6c95c38b8..07f152efd4 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -277,22 +277,22 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_EXP: case MATH_ISNAN: case MATH_ISINF: { - return PropertyInfo(Variant::REAL, "s"); + return PropertyInfo(Variant::FLOAT, "s"); } break; case MATH_ATAN2: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "y"); + return PropertyInfo(Variant::FLOAT, "y"); else - return PropertyInfo(Variant::REAL, "x"); + return PropertyInfo(Variant::FLOAT, "x"); } break; case MATH_FMOD: case MATH_FPOSMOD: case LOGIC_MAX: case LOGIC_MIN: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "a"); + return PropertyInfo(Variant::FLOAT, "a"); else - return PropertyInfo(Variant::REAL, "b"); + return PropertyInfo(Variant::FLOAT, "b"); } break; case MATH_POSMOD: { if (p_idx == 0) @@ -302,63 +302,63 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const } break; case MATH_POW: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "base"); + return PropertyInfo(Variant::FLOAT, "base"); else - return PropertyInfo(Variant::REAL, "exp"); + return PropertyInfo(Variant::FLOAT, "exp"); } break; case MATH_EASE: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "s"); + return PropertyInfo(Variant::FLOAT, "s"); else - return PropertyInfo(Variant::REAL, "curve"); + return PropertyInfo(Variant::FLOAT, "curve"); } break; case MATH_STEP_DECIMALS: { - return PropertyInfo(Variant::REAL, "step"); + return PropertyInfo(Variant::FLOAT, "step"); } break; case MATH_STEPIFY: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "s"); + return PropertyInfo(Variant::FLOAT, "s"); else - return PropertyInfo(Variant::REAL, "steps"); + return PropertyInfo(Variant::FLOAT, "steps"); } break; case MATH_LERP: case MATH_LERP_ANGLE: case MATH_INVERSE_LERP: case MATH_SMOOTHSTEP: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "from"); + return PropertyInfo(Variant::FLOAT, "from"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "to"); + return PropertyInfo(Variant::FLOAT, "to"); else - return PropertyInfo(Variant::REAL, "weight"); + return PropertyInfo(Variant::FLOAT, "weight"); } break; case MATH_RANGE_LERP: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "value"); + return PropertyInfo(Variant::FLOAT, "value"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "istart"); + return PropertyInfo(Variant::FLOAT, "istart"); else if (p_idx == 2) - return PropertyInfo(Variant::REAL, "istop"); + return PropertyInfo(Variant::FLOAT, "istop"); else if (p_idx == 3) - return PropertyInfo(Variant::REAL, "ostart"); + return PropertyInfo(Variant::FLOAT, "ostart"); else - return PropertyInfo(Variant::REAL, "ostop"); + return PropertyInfo(Variant::FLOAT, "ostop"); } break; case MATH_MOVE_TOWARD: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "from"); + return PropertyInfo(Variant::FLOAT, "from"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "to"); + return PropertyInfo(Variant::FLOAT, "to"); else - return PropertyInfo(Variant::REAL, "delta"); + return PropertyInfo(Variant::FLOAT, "delta"); } break; case MATH_DECTIME: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "value"); + return PropertyInfo(Variant::FLOAT, "value"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "amount"); + return PropertyInfo(Variant::FLOAT, "amount"); else - return PropertyInfo(Variant::REAL, "step"); + return PropertyInfo(Variant::FLOAT, "step"); } break; case MATH_RANDOMIZE: case MATH_RAND: @@ -367,37 +367,37 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const } break; case MATH_RANDOM: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "from"); + return PropertyInfo(Variant::FLOAT, "from"); else - return PropertyInfo(Variant::REAL, "to"); + return PropertyInfo(Variant::FLOAT, "to"); } break; case MATH_SEED: case MATH_RANDSEED: { return PropertyInfo(Variant::INT, "seed"); } break; case MATH_DEG2RAD: { - return PropertyInfo(Variant::REAL, "deg"); + return PropertyInfo(Variant::FLOAT, "deg"); } break; case MATH_RAD2DEG: { - return PropertyInfo(Variant::REAL, "rad"); + return PropertyInfo(Variant::FLOAT, "rad"); } break; case MATH_LINEAR2DB: { - return PropertyInfo(Variant::REAL, "nrg"); + return PropertyInfo(Variant::FLOAT, "nrg"); } break; case MATH_DB2LINEAR: { - return PropertyInfo(Variant::REAL, "db"); + return PropertyInfo(Variant::FLOAT, "db"); } break; case MATH_POLAR2CARTESIAN: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "r"); + return PropertyInfo(Variant::FLOAT, "r"); else - return PropertyInfo(Variant::REAL, "th"); + return PropertyInfo(Variant::FLOAT, "th"); } break; case MATH_CARTESIAN2POLAR: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "x"); + return PropertyInfo(Variant::FLOAT, "x"); else - return PropertyInfo(Variant::REAL, "y"); + return PropertyInfo(Variant::FLOAT, "y"); } break; case MATH_WRAP: { if (p_idx == 0) @@ -410,11 +410,11 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_WRAPF: case LOGIC_CLAMP: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "value"); + return PropertyInfo(Variant::FLOAT, "value"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "min"); + return PropertyInfo(Variant::FLOAT, "min"); else - return PropertyInfo(Variant::REAL, "max"); + return PropertyInfo(Variant::FLOAT, "max"); } break; case LOGIC_NEAREST_PO2: { return PropertyInfo(Variant::INT, "value"); @@ -475,7 +475,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const if (p_idx == 0) return PropertyInfo(Variant::STRING, "name"); else - return PropertyInfo(Variant::REAL, "alpha"); + return PropertyInfo(Variant::FLOAT, "alpha"); } break; case FUNC_MAX: { } @@ -504,7 +504,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_FPOSMOD: case MATH_FLOOR: case MATH_CEIL: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_POSMOD: case MATH_ROUND: { @@ -519,14 +519,14 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_POW: case MATH_LOG: case MATH_EXP: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_ISNAN: case MATH_ISINF: { t = Variant::BOOL; } break; case MATH_EASE: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_STEP_DECIMALS: { t = Variant::INT; @@ -539,7 +539,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_SMOOTHSTEP: case MATH_MOVE_TOWARD: case MATH_DECTIME: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_RANDOMIZE: { @@ -551,7 +551,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons } break; case MATH_RANDF: case MATH_RANDOM: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_SEED: { @@ -568,7 +568,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_LINEAR2DB: case MATH_WRAPF: case MATH_DB2LINEAR: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_POLAR2CARTESIAN: case MATH_CARTESIAN2POLAR: { @@ -675,15 +675,15 @@ VisualScriptBuiltinFunc::BuiltinFunc VisualScriptBuiltinFunc::get_func() { return func; } -#define VALIDATE_ARG_NUM(m_arg) \ - if (!p_inputs[m_arg]->is_num()) { \ - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; \ - r_error.argument = m_arg; \ - r_error.expected = Variant::REAL; \ - return; \ +#define VALIDATE_ARG_NUM(m_arg) \ + if (!p_inputs[m_arg]->is_num()) { \ + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \ + r_error.argument = m_arg; \ + r_error.expected = Variant::FLOAT; \ + return; \ } -void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Variant::CallError &r_error, String &r_error_str) { +void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Callable::CallError &r_error, String &r_error_str) { switch (p_func) { case VisualScriptBuiltinFunc::MATH_SIN: { @@ -781,15 +781,15 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in int64_t i = *p_inputs[0]; *r_return = ABS(i); - } else if (p_inputs[0]->get_type() == Variant::REAL) { + } else if (p_inputs[0]->get_type() == Variant::FLOAT) { real_t r = *p_inputs[0]; *r_return = Math::abs(r); } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::REAL; + r_error.expected = Variant::FLOAT; } } break; case VisualScriptBuiltinFunc::MATH_SIGN: { @@ -798,15 +798,15 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in int64_t i = *p_inputs[0]; *r_return = i < 0 ? -1 : (i > 0 ? +1 : 0); - } else if (p_inputs[0]->get_type() == Variant::REAL) { + } else if (p_inputs[0]->get_type() == Variant::FLOAT) { real_t r = *p_inputs[0]; *r_return = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0); } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::REAL; + r_error.expected = Variant::FLOAT; } } break; case VisualScriptBuiltinFunc::MATH_POW: { @@ -1047,7 +1047,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in if (p_inputs[0]->get_type() != Variant::OBJECT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; @@ -1081,7 +1081,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in if (p_inputs[0]->get_type() != Variant::OBJECT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::OBJECT; @@ -1089,7 +1089,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in } if (p_inputs[1]->get_type() != Variant::STRING && p_inputs[1]->get_type() != Variant::NODE_PATH) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::STRING; @@ -1111,7 +1111,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in if (type < 0 || type >= Variant::VARIANT_MAX) { r_error_str = RTR("Invalid type argument to convert(), use TYPE_* constants."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::INT; return; @@ -1141,7 +1141,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in case VisualScriptBuiltinFunc::TEXT_ORD: { if (p_inputs[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; @@ -1151,7 +1151,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in String str = p_inputs[0]->operator String(); if (str.length() != 1) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; *r_return = "Expected a string of length 1 (a character)."; @@ -1197,7 +1197,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in case VisualScriptBuiltinFunc::STR_TO_VAR: { if (p_inputs[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; @@ -1212,7 +1212,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in Error err = VariantParser::parse(&ss, *r_return, errs, line); if (err != OK) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; *r_return = "Parse error at line " + itos(line) + ": " + errs; @@ -1223,7 +1223,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in case VisualScriptBuiltinFunc::VAR_TO_BYTES: { if (p_inputs[1]->get_type() != Variant::BOOL) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::BOOL; return; @@ -1233,7 +1233,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in bool full_objects = *p_inputs[1]; Error err = encode_variant(*p_inputs[0], NULL, len, full_objects); if (err) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::NIL; r_error_str = "Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID)."; @@ -1250,13 +1250,13 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in case VisualScriptBuiltinFunc::BYTES_TO_VAR: { if (p_inputs[0]->get_type() != Variant::PACKED_BYTE_ARRAY) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::PACKED_BYTE_ARRAY; return; } if (p_inputs[1]->get_type() != Variant::BOOL) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::BOOL; return; @@ -1270,7 +1270,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in Error err = decode_variant(ret, r, varr.size(), NULL, allow_objects); if (err != OK) { r_error_str = RTR("Not enough bytes for decoding bytes, or invalid format."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::PACKED_BYTE_ARRAY; return; @@ -1306,7 +1306,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { VisualScriptBuiltinFunc::exec_func(func, p_inputs, p_outputs[0], r_error, r_error_str); return 0; diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h index d0787b3dd3..d950f858d4 100644 --- a/modules/visual_script/visual_script_builtin_funcs.h +++ b/modules/visual_script/visual_script_builtin_funcs.h @@ -112,7 +112,7 @@ public: static int get_func_argument_count(BuiltinFunc p_func); static String get_func_name(BuiltinFunc p_func); - static void exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Variant::CallError &r_error, String &r_error_str); + static void exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant *r_return, Callable::CallError &r_error, String &r_error_str); static BuiltinFunc find_function(const String &p_string); private: diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 8725563c9b..0bbef066a4 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -346,7 +346,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::BOOL: color = Color(0.55, 0.65, 0.94); break; case Variant::INT: color = Color(0.49, 0.78, 0.94); break; - case Variant::REAL: color = Color(0.38, 0.85, 0.96); break; + case Variant::FLOAT: color = Color(0.38, 0.85, 0.96); break; case Variant::STRING: color = Color(0.42, 0.65, 0.93); break; case Variant::VECTOR2: color = Color(0.74, 0.57, 0.95); break; @@ -367,8 +367,10 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::ARRAY: color = Color(0.88, 0.88, 0.88); break; case Variant::PACKED_BYTE_ARRAY: color = Color(0.67, 0.96, 0.78); break; - case Variant::PACKED_INT_ARRAY: color = Color(0.69, 0.86, 0.96); break; - case Variant::PACKED_REAL_ARRAY: color = Color(0.59, 0.91, 0.97); break; + case Variant::PACKED_INT32_ARRAY: color = Color(0.69, 0.86, 0.96); break; + case Variant::PACKED_FLOAT32_ARRAY: color = Color(0.59, 0.91, 0.97); break; + case Variant::PACKED_INT64_ARRAY: color = Color(0.69, 0.86, 0.96); break; + case Variant::PACKED_FLOAT64_ARRAY: color = Color(0.59, 0.91, 0.97); break; case Variant::PACKED_STRING_ARRAY: color = Color(0.62, 0.77, 0.95); break; case Variant::PACKED_VECTOR2_ARRAY: color = Color(0.82, 0.7, 0.96); break; case Variant::PACKED_VECTOR3_ARRAY: color = Color(0.87, 0.61, 0.95); break; @@ -383,7 +385,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::BOOL: color = Color(0.43, 0.56, 0.92); break; case Variant::INT: color = Color(0.31, 0.7, 0.91); break; - case Variant::REAL: color = Color(0.15, 0.8, 0.94); break; + case Variant::FLOAT: color = Color(0.15, 0.8, 0.94); break; case Variant::STRING: color = Color(0.27, 0.56, 0.91); break; case Variant::VECTOR2: color = Color(0.68, 0.46, 0.93); break; @@ -404,8 +406,10 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::ARRAY: color = Color(0.45, 0.45, 0.45); break; case Variant::PACKED_BYTE_ARRAY: color = Color(0.38, 0.92, 0.6); break; - case Variant::PACKED_INT_ARRAY: color = Color(0.38, 0.73, 0.92); break; - case Variant::PACKED_REAL_ARRAY: color = Color(0.25, 0.83, 0.95); break; + case Variant::PACKED_INT32_ARRAY: color = Color(0.38, 0.73, 0.92); break; + case Variant::PACKED_FLOAT32_ARRAY: color = Color(0.25, 0.83, 0.95); break; + case Variant::PACKED_INT64_ARRAY: color = Color(0.38, 0.73, 0.92); break; + case Variant::PACKED_FLOAT64_ARRAY: color = Color(0.25, 0.83, 0.95); break; case Variant::PACKED_STRING_ARRAY: color = Color(0.38, 0.62, 0.92); break; case Variant::PACKED_VECTOR2_ARRAY: color = Color(0.62, 0.36, 0.92); break; case Variant::PACKED_VECTOR3_ARRAY: color = Color(0.79, 0.35, 0.92); break; @@ -521,8 +525,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedIntArray", "EditorIcons"), - Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedInt32Array", "EditorIcons"), + Control::get_icon("PackedFloat32Array", "EditorIcons"), Control::get_icon("PackedStringArray", "EditorIcons"), Control::get_icon("PackedVector2Array", "EditorIcons"), Control::get_icon("PackedVector3Array", "EditorIcons"), @@ -556,8 +560,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->set_meta("__vnode", node); gnode->set_name(itos(E->get())); - gnode->connect("dragged", this, "_node_moved", varray(E->get())); - gnode->connect("close_request", this, "_remove_node", varray(E->get()), CONNECT_DEFERRED); + gnode->connect_compat("dragged", this, "_node_moved", varray(E->get())); + gnode->connect_compat("close_request", this, "_remove_node", varray(E->get()), CONNECT_DEFERRED); if (E->get() != script->get_function_node_id(F->get())) { //function can't be erased @@ -575,7 +579,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Button *btn = memnew(Button); btn->set_text(TTR("Add Input Port")); hbnc->add_child(btn); - btn->connect("pressed", this, "_add_input_port", varray(E->get()), CONNECT_DEFERRED); + btn->connect_compat("pressed", this, "_add_input_port", varray(E->get()), CONNECT_DEFERRED); } if (nd_list->is_output_port_editable()) { if (nd_list->is_input_port_editable()) @@ -584,7 +588,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Button *btn = memnew(Button); btn->set_text(TTR("Add Output Port")); hbnc->add_child(btn); - btn->connect("pressed", this, "_add_output_port", varray(E->get()), CONNECT_DEFERRED); + btn->connect_compat("pressed", this, "_add_output_port", varray(E->get()), CONNECT_DEFERRED); } gnode->add_child(hbnc); } else if (Object::cast_to<VisualScriptExpression>(node.ptr())) { @@ -594,7 +598,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { line_edit->set_expand_to_text_length(true); line_edit->add_font_override("font", get_font("source", "EditorFonts")); gnode->add_child(line_edit); - line_edit->connect("text_changed", this, "_expression_text_changed", varray(E->get())); + line_edit->connect_compat("text_changed", this, "_expression_text_changed", varray(E->get())); } else { String text = node->get_text(); if (!text.empty()) { @@ -610,7 +614,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->set_comment(true); gnode->set_resizable(true); gnode->set_custom_minimum_size(vsc->get_size() * EDSCALE); - gnode->connect("resize_request", this, "_comment_node_resized", varray(E->get())); + gnode->connect_compat("resize_request", this, "_comment_node_resized", varray(E->get())); } if (node_styles.has(node->get_category())) { @@ -619,16 +623,24 @@ void VisualScriptEditor::_update_graph(int p_only_id) { sbf = EditorNode::get_singleton()->get_theme_base()->get_theme()->get_stylebox("comment", "GraphNode"); Color c = sbf->get_border_color(); + Color ic = c; c.a = 1; if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { - Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0); + Color mono_color; + if (((c.r + c.g + c.b) / 3) < 0.7) { + mono_color = Color(1.0, 1.0, 1.0); + ic = Color(0.0, 0.0, 0.0, 0.7); + } else { + mono_color = Color(0.0, 0.0, 0.0); + ic = Color(1.0, 1.0, 1.0, 0.7); + } mono_color.a = 0.85; c = mono_color; } gnode->add_color_override("title_color", c); c.a = 0.7; gnode->add_color_override("close_color", c); - gnode->add_color_override("resizer_color", c); + gnode->add_color_override("resizer_color", ic); gnode->add_style_override("frame", sbf); } @@ -720,8 +732,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) { name_box->set_custom_minimum_size(Size2(60 * EDSCALE, 0)); name_box->set_text(left_name); name_box->set_expand_to_text_length(true); - name_box->connect("resized", this, "_update_node_size", varray(E->get())); - name_box->connect("focus_exited", this, "_port_name_focus_out", varray(name_box, E->get(), i, true)); + name_box->connect_compat("resized", this, "_update_node_size", varray(E->get())); + name_box->connect_compat("focus_exited", this, "_port_name_focus_out", varray(name_box, E->get(), i, true)); } else { hbc->add_child(memnew(Label(left_name))); } @@ -734,13 +746,13 @@ void VisualScriptEditor::_update_graph(int p_only_id) { opbtn->select(left_type); opbtn->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); hbc->add_child(opbtn); - opbtn->connect("item_selected", this, "_change_port_type", varray(E->get(), i, true), CONNECT_DEFERRED); + opbtn->connect_compat("item_selected", this, "_change_port_type", varray(E->get(), i, true), CONNECT_DEFERRED); } Button *rmbtn = memnew(Button); rmbtn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); hbc->add_child(rmbtn); - rmbtn->connect("pressed", this, "_remove_input_port", varray(E->get(), i), CONNECT_DEFERRED); + rmbtn->connect_compat("pressed", this, "_remove_input_port", varray(E->get(), i), CONNECT_DEFERRED); } else { hbc->add_child(memnew(Label(left_name))); } @@ -753,14 +765,14 @@ void VisualScriptEditor::_update_graph(int p_only_id) { if (value.get_type() != left_type) { //different type? for now convert //not the same, reconvert - Variant::CallError ce; + Callable::CallError ce; const Variant *existingp = &value; value = Variant::construct(left_type, &existingp, 1, ce, false); } if (left_type == Variant::COLOR) { button->set_custom_minimum_size(Size2(30, 0) * EDSCALE); - button->connect("draw", this, "_draw_color_over_button", varray(button, value)); + button->connect_compat("draw", this, "_draw_color_over_button", varray(button, value)); } else if (left_type == Variant::OBJECT && Ref<Resource>(value).is_valid()) { Ref<Resource> res = value; @@ -776,7 +788,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { button->set_text(value); } - button->connect("pressed", this, "_default_value_edited", varray(button, E->get(), i)); + button->connect_compat("pressed", this, "_default_value_edited", varray(button, E->get(), i)); hbc2->add_child(button); } } else { @@ -802,7 +814,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Button *rmbtn = memnew(Button); rmbtn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); hbc->add_child(rmbtn); - rmbtn->connect("pressed", this, "_remove_output_port", varray(E->get(), i), CONNECT_DEFERRED); + rmbtn->connect_compat("pressed", this, "_remove_output_port", varray(E->get(), i), CONNECT_DEFERRED); if (nd_list->is_output_port_type_editable()) { OptionButton *opbtn = memnew(OptionButton); @@ -812,7 +824,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { opbtn->select(right_type); opbtn->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); hbc->add_child(opbtn); - opbtn->connect("item_selected", this, "_change_port_type", varray(E->get(), i, false), CONNECT_DEFERRED); + opbtn->connect_compat("item_selected", this, "_change_port_type", varray(E->get(), i, false), CONNECT_DEFERRED); } if (nd_list->is_output_port_name_editable()) { @@ -821,8 +833,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) { name_box->set_custom_minimum_size(Size2(60 * EDSCALE, 0)); name_box->set_text(right_name); name_box->set_expand_to_text_length(true); - name_box->connect("resized", this, "_update_node_size", varray(E->get())); - name_box->connect("focus_exited", this, "_port_name_focus_out", varray(name_box, E->get(), i, false)); + name_box->connect_compat("resized", this, "_update_node_size", varray(E->get())); + name_box->connect_compat("focus_exited", this, "_port_name_focus_out", varray(name_box, E->get(), i, false)); } else { hbc->add_child(memnew(Label(right_name))); } @@ -977,8 +989,8 @@ void VisualScriptEditor::_update_members() { Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedIntArray", "EditorIcons"), - Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedInt32Array", "EditorIcons"), + Control::get_icon("PackedFloat32Array", "EditorIcons"), Control::get_icon("PackedStringArray", "EditorIcons"), Control::get_icon("PackedVector2Array", "EditorIcons"), Control::get_icon("PackedVector3Array", "EditorIcons"), @@ -1225,7 +1237,7 @@ void VisualScriptEditor::_add_func_input() { LineEdit *name_box = memnew(LineEdit); name_box->set_h_size_flags(SIZE_EXPAND_FILL); name_box->set_text("input"); - name_box->connect("focus_entered", this, "_deselect_input_names"); + name_box->connect_compat("focus_entered", this, "_deselect_input_names"); hbox->add_child(name_box); Label *type_label = memnew(Label); @@ -1252,7 +1264,7 @@ void VisualScriptEditor::_add_func_input() { func_input_vbox->add_child(hbox); hbox->set_meta("id", hbox->get_position_in_parent()); - delete_button->connect("pressed", this, "_remove_func_input", varray(hbox)); + delete_button->connect_compat("pressed", this, "_remove_func_input", varray(hbox)); name_box->select_all(); name_box->grab_focus(); @@ -2408,7 +2420,7 @@ void VisualScriptEditor::set_edited_resource(const RES &p_res) { variable_editor->script = script; variable_editor->undo_redo = undo_redo; - script->connect("node_ports_changed", this, "_node_ports_changed"); + script->connect_compat("node_ports_changed", this, "_node_ports_changed"); default_func = script->get_default_func(); @@ -2910,8 +2922,8 @@ void VisualScriptEditor::_graph_connected(const String &p_from, int p_from_slot, if (to_type != Variant::NIL && from_type != Variant::NIL && to_type != from_type) { // add a constructor node between the ports bool exceptions = false; // true if there are any exceptions - exceptions = exceptions || (to_type == Variant::INT && from_type == Variant::REAL); - exceptions = exceptions || (to_type == Variant::REAL && from_type == Variant::INT); + exceptions = exceptions || (to_type == Variant::INT && from_type == Variant::FLOAT); + exceptions = exceptions || (to_type == Variant::FLOAT && from_type == Variant::INT); if (Variant::can_convert(from_type, to_type) && !exceptions) { MethodInfo mi; mi.name = Variant::get_type_name(to_type); @@ -3851,7 +3863,7 @@ void VisualScriptEditor::_default_value_edited(Node *p_button, int p_id, int p_i Variant existing = vsn->get_default_input_value(p_input_port); if (pinfo.type != Variant::NIL && existing.get_type() != pinfo.type) { - Variant::CallError ce; + Callable::CallError ce; const Variant *existingp = &existing; existing = Variant::construct(pinfo.type, &existingp, 1, ce, false); } @@ -3904,9 +3916,9 @@ void VisualScriptEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - variable_editor->connect("changed", this, "_update_members"); - signal_editor->connect("changed", this, "_update_members"); - FALLTHROUGH; + variable_editor->connect_compat("changed", this, "_update_members"); + signal_editor->connect_compat("changed", this, "_update_members"); + [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { if (p_what != NOTIFICATION_READY && !is_visible_in_tree()) { @@ -4697,7 +4709,7 @@ VisualScriptEditor::VisualScriptEditor() { edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/create_function"), EDIT_CREATE_FUNCTION); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/refresh_nodes"), REFRESH_GRAPH); - edit_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + edit_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); members_section = memnew(VBoxContainer); // Add but wait until done setting up this. @@ -4707,7 +4719,7 @@ VisualScriptEditor::VisualScriptEditor() { CheckButton *tool_script_check = memnew(CheckButton); tool_script_check->set_text(TTR("Make Tool:")); members_section->add_child(tool_script_check); - tool_script_check->connect("pressed", this, "_toggle_tool_script"); + tool_script_check->connect_compat("pressed", this, "_toggle_tool_script"); /// Members /// @@ -4715,11 +4727,11 @@ VisualScriptEditor::VisualScriptEditor() { members_section->add_margin_child(TTR("Members:"), members, true); members->set_custom_minimum_size(Size2(0, 50 * EDSCALE)); members->set_hide_root(true); - members->connect("button_pressed", this, "_member_button"); - members->connect("item_edited", this, "_member_edited"); - members->connect("cell_selected", this, "_member_selected", varray(), CONNECT_DEFERRED); - members->connect("gui_input", this, "_members_gui_input"); - members->connect("item_rmb_selected", this, "_member_rmb_selected"); + members->connect_compat("button_pressed", this, "_member_button"); + members->connect_compat("item_edited", this, "_member_edited"); + members->connect_compat("cell_selected", this, "_member_selected", varray(), CONNECT_DEFERRED); + members->connect_compat("gui_input", this, "_members_gui_input"); + members->connect_compat("item_rmb_selected", this, "_member_rmb_selected"); members->set_allow_rmb_select(true); members->set_allow_reselect(true); members->set_hide_folding(true); @@ -4727,13 +4739,13 @@ VisualScriptEditor::VisualScriptEditor() { member_popup = memnew(PopupMenu); add_child(member_popup); - member_popup->connect("id_pressed", this, "_member_option"); + member_popup->connect_compat("id_pressed", this, "_member_option"); function_name_edit = memnew(PopupDialog); function_name_box = memnew(LineEdit); function_name_edit->add_child(function_name_box); function_name_edit->set_h_size_flags(SIZE_EXPAND); - function_name_box->connect("gui_input", this, "_fn_name_box_input"); + function_name_box->connect_compat("gui_input", this, "_fn_name_box_input"); function_name_box->set_expand_to_text_length(true); add_child(function_name_edit); @@ -4743,15 +4755,15 @@ VisualScriptEditor::VisualScriptEditor() { add_child(graph); graph->set_v_size_flags(Control::SIZE_EXPAND_FILL); graph->set_anchors_and_margins_preset(Control::PRESET_WIDE); - graph->connect("node_selected", this, "_node_selected"); - graph->connect("_begin_node_move", this, "_begin_node_move"); - graph->connect("_end_node_move", this, "_end_node_move"); - graph->connect("delete_nodes_request", this, "_on_nodes_delete"); - graph->connect("duplicate_nodes_request", this, "_on_nodes_duplicate"); - graph->connect("gui_input", this, "_graph_gui_input"); + graph->connect_compat("node_selected", this, "_node_selected"); + graph->connect_compat("_begin_node_move", this, "_begin_node_move"); + graph->connect_compat("_end_node_move", this, "_end_node_move"); + graph->connect_compat("delete_nodes_request", this, "_on_nodes_delete"); + graph->connect_compat("duplicate_nodes_request", this, "_on_nodes_duplicate"); + graph->connect_compat("gui_input", this, "_graph_gui_input"); graph->set_drag_forwarding(this); graph->hide(); - graph->connect("scroll_offset_changed", this, "_graph_ofs_changed"); + graph->connect_compat("scroll_offset_changed", this, "_graph_ofs_changed"); /// Add Buttons to Top Bar/Zoom bar. HBoxContainer *graph_hbc = graph->get_zoom_hbox(); @@ -4761,18 +4773,18 @@ VisualScriptEditor::VisualScriptEditor() { graph_hbc->add_child(base_lbl); base_type_select = memnew(Button); - base_type_select->connect("pressed", this, "_change_base_type"); + base_type_select->connect_compat("pressed", this, "_change_base_type"); graph_hbc->add_child(base_type_select); Button *add_nds = memnew(Button); add_nds->set_text(TTR("Add Nodes...")); graph_hbc->add_child(add_nds); - add_nds->connect("pressed", this, "_add_node_dialog"); + add_nds->connect_compat("pressed", this, "_add_node_dialog"); Button *fn_btn = memnew(Button); fn_btn->set_text(TTR("Add Function...")); graph_hbc->add_child(fn_btn); - fn_btn->connect("pressed", this, "_create_function_dialog"); + fn_btn->connect_compat("pressed", this, "_create_function_dialog"); // Add Function Dialog. VBoxContainer *function_vb = memnew(VBoxContainer); @@ -4790,7 +4802,7 @@ VisualScriptEditor::VisualScriptEditor() { func_name_box->set_h_size_flags(SIZE_EXPAND_FILL); func_name_box->set_placeholder(TTR("function_name")); func_name_box->set_text(""); - func_name_box->connect("focus_entered", this, "_deselect_input_names"); + func_name_box->connect_compat("focus_entered", this, "_deselect_input_names"); func_name_hbox->add_child(func_name_box); // Add minor setting for function if needed, here! @@ -4800,7 +4812,7 @@ VisualScriptEditor::VisualScriptEditor() { Button *add_input_button = memnew(Button); add_input_button->set_h_size_flags(SIZE_EXPAND_FILL); add_input_button->set_text(TTR("Add Input")); - add_input_button->connect("pressed", this, "_add_func_input"); + add_input_button->connect_compat("pressed", this, "_add_func_input"); function_vb->add_child(add_input_button); func_input_scroll = memnew(ScrollContainer); @@ -4816,7 +4828,7 @@ VisualScriptEditor::VisualScriptEditor() { function_create_dialog->set_title(TTR("Create Function")); function_create_dialog->add_child(function_vb); function_create_dialog->get_ok()->set_text(TTR("Create")); - function_create_dialog->get_ok()->connect("pressed", this, "_create_function"); + function_create_dialog->get_ok()->connect_compat("pressed", this, "_create_function"); add_child(function_create_dialog); select_func_text = memnew(Label); @@ -4836,7 +4848,7 @@ VisualScriptEditor::VisualScriptEditor() { hint_text_timer = memnew(Timer); hint_text_timer->set_wait_time(4); - hint_text_timer->connect("timeout", this, "_hide_timer"); + hint_text_timer->connect_compat("timeout", this, "_hide_timer"); add_child(hint_text_timer); // Allowed casts (connections). @@ -4854,9 +4866,9 @@ VisualScriptEditor::VisualScriptEditor() { graph->add_valid_left_disconnect_type(TYPE_SEQUENCE); - graph->connect("connection_request", this, "_graph_connected"); - graph->connect("disconnection_request", this, "_graph_disconnected"); - graph->connect("connection_to_empty", this, "_graph_connect_to_empty"); + graph->connect_compat("connection_request", this, "_graph_connected"); + graph->connect_compat("disconnection_request", this, "_graph_disconnected"); + graph->connect_compat("connection_to_empty", this, "_graph_connect_to_empty"); edit_signal_dialog = memnew(AcceptDialog); edit_signal_dialog->get_ok()->set_text(TTR("Close")); @@ -4880,7 +4892,7 @@ VisualScriptEditor::VisualScriptEditor() { select_base_type = memnew(CreateDialog); select_base_type->set_base_type("Object"); // Anything goes. - select_base_type->connect("create", this, "_change_base_type_callback"); + select_base_type->connect_compat("create", this, "_change_base_type_callback"); add_child(select_base_type); undo_redo = EditorNode::get_singleton()->get_undo_redo(); @@ -4892,22 +4904,22 @@ VisualScriptEditor::VisualScriptEditor() { default_value_edit = memnew(CustomPropertyEditor); add_child(default_value_edit); - default_value_edit->connect("variant_changed", this, "_default_value_changed"); + default_value_edit->connect_compat("variant_changed", this, "_default_value_changed"); method_select = memnew(VisualScriptPropertySelector); add_child(method_select); - method_select->connect("selected", this, "_selected_method"); + method_select->connect_compat("selected", this, "_selected_method"); error_line = -1; new_connect_node_select = memnew(VisualScriptPropertySelector); add_child(new_connect_node_select); new_connect_node_select->set_resizable(true); - new_connect_node_select->connect("selected", this, "_selected_connect_node"); - new_connect_node_select->get_cancel()->connect("pressed", this, "_cancel_connect_node"); + new_connect_node_select->connect_compat("selected", this, "_selected_connect_node"); + new_connect_node_select->get_cancel()->connect_compat("pressed", this, "_cancel_connect_node"); new_virtual_method_select = memnew(VisualScriptPropertySelector); add_child(new_virtual_method_select); - new_virtual_method_select->connect("selected", this, "_selected_new_virtual_method"); + new_virtual_method_select->connect_compat("selected", this, "_selected_new_virtual_method"); } VisualScriptEditor::~VisualScriptEditor() { diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 63880df21d..23d1c8ccc0 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -1229,7 +1229,7 @@ public: //virtual int get_working_memory_size() const { return 0; } //execute by parsing the tree directly - virtual bool _execute(const Variant **p_inputs, VisualScriptExpression::ENode *p_node, Variant &r_ret, String &r_error_str, Variant::CallError &ce) { + virtual bool _execute(const Variant **p_inputs, VisualScriptExpression::ENode *p_node, Variant &r_ret, String &r_error_str, Callable::CallError &ce) { switch (p_node->type) { case VisualScriptExpression::ENode::TYPE_INPUT: { @@ -1371,7 +1371,7 @@ public: r_ret = Variant::construct(constructor->data_type, (const Variant **)argp.ptr(), argp.size(), ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { r_error_str = "Invalid arguments to construct '" + Variant::get_type_name(constructor->data_type) + "'."; return true; } @@ -1398,7 +1398,7 @@ public: VisualScriptBuiltinFunc::exec_func(bifunc->func, (const Variant **)argp.ptr(), &r_ret, ce, r_error_str); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { r_error_str = "Builtin Call Failed. " + r_error_str; return true; } @@ -1430,7 +1430,7 @@ public: r_ret = base.call(call->method, (const Variant **)argp.ptr(), argp.size(), ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { r_error_str = "On call to '" + String(call->method) + "':"; return true; } @@ -1440,24 +1440,24 @@ public: return false; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (!expression->root || expression->error_set) { r_error_str = expression->error_str; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return 0; } bool error = _execute(p_inputs, expression->root, *p_outputs[0], r_error_str, r_error); - if (error && r_error.error == Variant::CallError::CALL_OK) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + if (error && r_error.error == Callable::CallError::CALL_OK) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; } #ifdef DEBUG_ENABLED if (!error && expression->output_type != Variant::NIL && !Variant::can_convert_strict(p_outputs[0]->get_type(), expression->output_type)) { r_error_str += "Can't convert expression result from " + Variant::get_type_name(p_outputs[0]->get_type()) + " to " + Variant::get_type_name(expression->output_type) + "."; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; } #endif diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index 213dc897af..475893e86d 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -135,7 +135,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (with_value) { *p_working_mem = *p_inputs[0]; @@ -237,7 +237,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (p_start_mode == START_MODE_CONTINUE_SEQUENCE) return 2; @@ -323,7 +323,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { bool keep_going = p_inputs[0]->operator bool(); @@ -410,7 +410,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (p_start_mode == START_MODE_BEGIN_SEQUENCE) { p_working_mem[0] = *p_inputs[0]; @@ -418,7 +418,7 @@ public: bool can_iter = p_inputs[0]->iter_init(p_working_mem[1], valid); if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("Input type not iterable: ") + Variant::get_type_name(p_inputs[0]->get_type()); return 0; } @@ -429,7 +429,7 @@ public: *p_outputs[0] = p_working_mem[0].iter_get(p_working_mem[1], valid); if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("Iterator became invalid"); return 0; } @@ -440,7 +440,7 @@ public: bool can_iter = p_working_mem[0].iter_next(p_working_mem[1], valid); if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("Iterator became invalid: ") + Variant::get_type_name(p_inputs[0]->get_type()); return 0; } @@ -451,7 +451,7 @@ public: *p_outputs[0] = p_working_mem[0].iter_get(p_working_mem[1], valid); if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("Iterator became invalid"); return 0; } @@ -549,7 +549,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (p_start_mode == START_MODE_BEGIN_SEQUENCE) { @@ -645,7 +645,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return false; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (p_start_mode == START_MODE_CONTINUE_SEQUENCE) { return case_count; //exit @@ -836,14 +836,14 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return false; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { Object *obj = *p_inputs[0]; *p_outputs[0] = Variant(); if (!obj) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Instance is null"; return 0; } @@ -861,7 +861,7 @@ public: } Ref<Script> cast_script = Ref<Resource>(ResourceCache::get(script)); if (!cast_script.is_valid()) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Script path is not a script: " + script; return 1; } diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 63c36ae431..011432ef39 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -788,7 +788,7 @@ public: return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { switch (call_mode) { @@ -808,14 +808,14 @@ public: Node *node = Object::cast_to<Node>(instance->get_owner_ptr()); if (!node) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Base object is not a Node!"; return 0; } Node *another = node->get_node(node_path); if (!another) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Path does not lead Node!"; return 0; } @@ -846,7 +846,7 @@ public: } else if (returns == 1) { v.call(function, p_inputs + 1, input_args, r_error); } else { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid returns count for call_mode == CALL_MODE_INSTANCE"; return 0; } @@ -866,7 +866,7 @@ public: Object *object = Engine::get_singleton()->get_singleton_object(singleton); if (!object) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid singleton name: '" + String(singleton) + "'"; return 0; } @@ -884,7 +884,7 @@ public: if (!validate) { //ignore call errors if validation is disabled - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; r_error_str = String(); } @@ -1020,7 +1020,7 @@ void VisualScriptPropertySet::_adjust_input_index(PropertyInfo &pinfo) const { if (index != StringName()) { Variant v; - Variant::CallError ce; + Callable::CallError ce; v = Variant::construct(pinfo.type, NULL, 0, ce); Variant i = v.get(index); pinfo.type = i.get_type(); @@ -1167,7 +1167,7 @@ void VisualScriptPropertySet::_update_cache() { //not super efficient.. Variant v; - Variant::CallError ce; + Callable::CallError ce; v = Variant::construct(basic_type, NULL, 0, ce); List<PropertyInfo> pinfo; @@ -1409,7 +1409,7 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const { if (property.name == "index") { - Variant::CallError ce; + Callable::CallError ce; Variant v = Variant::construct(type_cache.type, NULL, 0, ce); List<PropertyInfo> plist; v.get_property_list(&plist); @@ -1578,7 +1578,7 @@ public: } } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { switch (call_mode) { @@ -1597,7 +1597,7 @@ public: } if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid set value '" + String(*p_inputs[0]) + "' on property '" + String(property) + "' of type " + object->get_class(); } } break; @@ -1605,14 +1605,14 @@ public: Node *node = Object::cast_to<Node>(instance->get_owner_ptr()); if (!node) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Base object is not a Node!"; return 0; } Node *another = node->get_node(node_path); if (!another) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Path does not lead Node!"; return 0; } @@ -1629,7 +1629,7 @@ public: } if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid set value '" + String(*p_inputs[0]) + "' on property '" + String(property) + "' of type " + another->get_class(); } @@ -1651,7 +1651,7 @@ public: } if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid set value '" + String(*p_inputs[1]) + "' (" + Variant::get_type_name(p_inputs[1]->get_type()) + ") on property '" + String(property) + "' of type " + Variant::get_type_name(v.get_type()); } @@ -1875,7 +1875,7 @@ void VisualScriptPropertyGet::_update_cache() { //not super efficient.. Variant v; - Variant::CallError ce; + Callable::CallError ce; v = Variant::construct(basic_type, NULL, 0, ce); List<PropertyInfo> pinfo; @@ -2124,7 +2124,7 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const { if (property.name == "index") { - Variant::CallError ce; + Callable::CallError ce; Variant v = Variant::construct(type_cache, NULL, 0, ce); List<PropertyInfo> plist; v.get_property_list(&plist); @@ -2211,7 +2211,7 @@ public: VisualScriptPropertyGet *node; VisualScriptInstance *instance; - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { switch (call_mode) { @@ -2228,7 +2228,7 @@ public: } if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("Invalid index property name."); return 0; } @@ -2237,14 +2237,14 @@ public: Node *node = Object::cast_to<Node>(instance->get_owner_ptr()); if (!node) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("Base object is not a Node!"); return 0; } Node *another = node->get_node(node_path); if (!another) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("Path does not lead Node!"); return 0; } @@ -2258,7 +2258,7 @@ public: } if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = vformat(RTR("Invalid index property name '%s' in node %s."), String(property), another->get_name()); return 0; } @@ -2275,7 +2275,7 @@ public: } if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("Invalid index property name."); } }; @@ -2434,7 +2434,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { Object *obj = instance->get_owner_ptr(); @@ -2500,7 +2500,7 @@ void register_visual_script_func_nodes() { Variant::Type t = Variant::Type(i); String type_name = Variant::get_type_name(t); - Variant::CallError ce; + Callable::CallError ce; Variant vt = Variant::construct(t, NULL, 0, ce); List<MethodInfo> ml; vt.get_method_list(&ml); diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index dc49ed72d0..4a9a6bdb1d 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -285,7 +285,7 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { int ac = node->get_argument_count(); @@ -294,7 +294,7 @@ public: Variant::Type expected = node->get_argument_type(i); if (expected != Variant::NIL) { if (!Variant::can_convert_strict(p_inputs[i]->get_type(), expected)) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.expected = expected; r_error.argument = i; return 0; @@ -762,7 +762,7 @@ public: int input_count = 0; virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (input_count > 0) { Array arr; @@ -1031,7 +1031,7 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { bool valid; if (unary) { @@ -1043,7 +1043,7 @@ public: if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; if (p_outputs[0]->get_type() == Variant::STRING) { r_error_str = *p_outputs[0]; } else { @@ -1165,7 +1165,7 @@ class VisualScriptNodeInstanceSelect : public VisualScriptNodeInstance { public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { bool cond = *p_inputs[0]; if (cond) @@ -1285,10 +1285,10 @@ public: VisualScriptInstance *instance; StringName variable; - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (!instance->get_variable(variable, p_outputs[0])) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("VariableGet not found in script: ") + "'" + String(variable) + "'"; return 0; } @@ -1407,11 +1407,11 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (!instance->set_variable(variable, *p_inputs[0])) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = RTR("VariableSet not found in script: ") + "'" + String(variable) + "'"; } @@ -1482,7 +1482,7 @@ void VisualScriptConstant::set_constant_type(Variant::Type p_type) { return; type = p_type; - Variant::CallError ce; + Callable::CallError ce; value = Variant::construct(type, NULL, 0, ce); ports_changed_notify(); _change_notify(); @@ -1537,7 +1537,7 @@ public: Variant constant; //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_outputs[0] = constant; return 0; @@ -1642,7 +1642,7 @@ public: Ref<Resource> preload; //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_outputs[0] = preload; return 0; @@ -1710,13 +1710,13 @@ class VisualScriptNodeInstanceIndexGet : public VisualScriptNodeInstance { public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { bool valid; *p_outputs[0] = p_inputs[0]->get(*p_inputs[1], &valid); if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid get: " + p_inputs[0]->get_construct_string(); } return 0; @@ -1785,14 +1785,14 @@ class VisualScriptNodeInstanceIndexSet : public VisualScriptNodeInstance { public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { bool valid; *p_outputs[0] = *p_inputs[0]; p_outputs[0]->set(*p_inputs[1], *p_inputs[2], &valid); if (!valid) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid set: " + p_inputs[1]->get_construct_string(); } return 0; @@ -1866,7 +1866,7 @@ public: int index; //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_outputs[0] = GlobalConstants::get_global_constant_value(index); return 0; @@ -1991,11 +1991,11 @@ public: bool valid; //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (!valid) { r_error_str = "Invalid constant name, pick a valid class constant."; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; } *p_outputs[0] = value; @@ -2140,11 +2140,11 @@ public: bool valid; //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (!valid) { r_error_str = "Invalid constant name, pick a valid basic type constant."; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; } *p_outputs[0] = value; @@ -2259,7 +2259,7 @@ PropertyInfo VisualScriptMathConstant::get_input_value_port_info(int p_idx) cons PropertyInfo VisualScriptMathConstant::get_output_value_port_info(int p_idx) const { - return PropertyInfo(Variant::REAL, const_name[constant]); + return PropertyInfo(Variant::FLOAT, const_name[constant]); } String VisualScriptMathConstant::get_caption() const { @@ -2283,7 +2283,7 @@ public: float value; //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_outputs[0] = value; return 0; @@ -2389,7 +2389,7 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_outputs[0] = singleton; return 0; @@ -2512,18 +2512,18 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { Node *node = Object::cast_to<Node>(instance->get_owner_ptr()); if (!node) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Base object is not a Node!"; return 0; } Node *another = node->get_node(path); if (!another) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Path does not lead Node!"; return 0; } @@ -2696,18 +2696,18 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { Node *node = Object::cast_to<Node>(instance->get_owner_ptr()); if (!node) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Base object is not a Node!"; return 0; } SceneTree *tree = node->get_tree(); if (!tree) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Attempt to get SceneTree while node is not in the active tree."; return 0; } @@ -2803,7 +2803,7 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_outputs[0] = path; return 0; @@ -2885,7 +2885,7 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_outputs[0] = instance->get_owner_ptr(); return 0; @@ -3022,13 +3022,13 @@ public: int work_mem_size; virtual int get_working_memory_size() const { return work_mem_size; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (node->get_script_instance()) { #ifdef DEBUG_ENABLED if (!node->get_script_instance()->has_method(VisualScriptLanguage::singleton->_step)) { r_error_str = RTR("Custom node has no _step() method, can't process graph."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return 0; } #endif @@ -3055,13 +3055,13 @@ public: Variant ret = node->get_script_instance()->call(VisualScriptLanguage::singleton->_step, in_values, out_values, p_start_mode, work_mem); if (ret.get_type() == Variant::STRING) { r_error_str = ret; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return 0; } else if (ret.is_num()) { ret_out = ret; } else { r_error_str = RTR("Invalid return value from _step(), must be integer (seq out), or string (error)."); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return 0; } @@ -3144,7 +3144,7 @@ void VisualScriptCustomNode::_bind_methods() { } VisualScriptCustomNode::VisualScriptCustomNode() { - connect("script_changed", this, "_script_changed"); + connect_compat("script_changed", this, "_script_changed"); } ////////////////////////////////////////// @@ -3237,11 +3237,11 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (!valid) { r_error_str = "Node requires a script with a _subcall(<args>) method to work."; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return 0; } *p_outputs[0] = subcall->call(VisualScriptLanguage::singleton->_subcall, p_inputs, input_args, r_error); @@ -3368,7 +3368,7 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { return 0; } @@ -3483,11 +3483,11 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { - Variant::CallError ce; + Callable::CallError ce; *p_outputs[0] = Variant::construct(type, p_inputs, argcount, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { r_error_str = "Invalid arguments for constructor"; } @@ -3612,7 +3612,7 @@ public: StringName name; virtual int get_working_memory_size() const { return 1; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_outputs[0] = *p_working_mem; return 0; @@ -3733,7 +3733,7 @@ public: StringName name; virtual int get_working_memory_size() const { return 1; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { *p_working_mem = *p_inputs[0]; *p_outputs[0] = *p_working_mem; @@ -3868,7 +3868,7 @@ public: StringName action; VisualScriptInputAction::Mode mode; - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { switch (mode) { case VisualScriptInputAction::MODE_PRESSED: { @@ -4007,7 +4007,7 @@ void VisualScriptDeconstruct::_update_elements() { elements.clear(); Variant v; - Variant::CallError ce; + Callable::CallError ce; v = Variant::construct(type, NULL, 0, ce); List<PropertyInfo> pinfo; @@ -4065,7 +4065,7 @@ public: //virtual int get_working_memory_size() const { return 0; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { Variant in = *p_inputs[0]; @@ -4074,7 +4074,7 @@ public: *p_outputs[i] = in.get(outputs[i], &valid); if (!valid) { r_error_str = "Can't obtain element '" + String(outputs[i]) + "' from " + Variant::get_type_name(in.get_type()); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return 0; } } diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index ffcd355fa0..20bad364dc 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -120,8 +120,10 @@ void VisualScriptPropertySelector::_update_search() { Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedIntArray", "EditorIcons"), - Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedInt32Array", "EditorIcons"), + Control::get_icon("PackedFloat32Array", "EditorIcons"), + Control::get_icon("PackedInt64Array", "EditorIcons"), + Control::get_icon("PackedFloat64Array", "EditorIcons"), Control::get_icon("PackedStringArray", "EditorIcons"), Control::get_icon("PackedVector2Array", "EditorIcons"), Control::get_icon("PackedVector3Array", "EditorIcons"), @@ -193,7 +195,7 @@ void VisualScriptPropertySelector::_update_search() { { if (type != Variant::NIL) { Variant v; - Variant::CallError ce; + Callable::CallError ce; v = Variant::construct(type, NULL, 0, ce); v.get_method_list(&methods); } else { @@ -279,7 +281,7 @@ void VisualScriptPropertySelector::_update_search() { if (type == Variant::BOOL) { get_visual_node_names("operators/logic/", Set<String>(), found, root, search_box); } - if (type == Variant::BOOL || type == Variant::INT || type == Variant::REAL || type == Variant::VECTOR2 || type == Variant::VECTOR3) { + if (type == Variant::BOOL || type == Variant::INT || type == Variant::FLOAT || type == Variant::VECTOR2 || type == Variant::VECTOR3) { get_visual_node_names("operators/math/", Set<String>(), found, root, search_box); } } @@ -355,7 +357,7 @@ void VisualScriptPropertySelector::get_visual_node_names(const String &root_filt continue; } - bool in_modifier = false | p_modifiers.empty(); + bool in_modifier = p_modifiers.empty(); for (Set<String>::Element *F = p_modifiers.front(); F && in_modifier; F = F->next()) { if (E->get().findn(F->get()) != -1) in_modifier = true; @@ -520,7 +522,7 @@ void VisualScriptPropertySelector::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - connect("confirmed", this, "_confirmed"); + connect_compat("confirmed", this, "_confirmed"); } } @@ -703,23 +705,23 @@ VisualScriptPropertySelector::VisualScriptPropertySelector() { //set_child_rect(vbc); search_box = memnew(LineEdit); vbc->add_margin_child(TTR("Search:"), search_box); - search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("gui_input", this, "_sbox_input"); + search_box->connect_compat("text_changed", this, "_text_changed"); + search_box->connect_compat("gui_input", this, "_sbox_input"); search_options = memnew(Tree); vbc->add_margin_child(TTR("Matches:"), search_options, true); get_ok()->set_text(TTR("Open")); get_ok()->set_disabled(true); register_text_enter(search_box); set_hide_on_ok(false); - search_options->connect("item_activated", this, "_confirmed"); - search_options->connect("cell_selected", this, "_item_selected"); + search_options->connect_compat("item_activated", this, "_confirmed"); + search_options->connect_compat("cell_selected", this, "_item_selected"); search_options->set_hide_root(true); search_options->set_hide_folding(true); virtuals_only = false; seq_connect = false; help_bit = memnew(EditorHelpBit); vbc->add_margin_child(TTR("Description:"), help_bit); - help_bit->connect("request_hide", this, "_closed"); + help_bit->connect_compat("request_hide", this, "_closed"); search_options->set_columns(3); search_options->set_column_expand(1, false); search_options->set_column_expand(2, false); diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 877d5836d2..858074742e 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -99,7 +99,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return false; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (p_start_mode == START_MODE_RESUME_YIELD) { return 0; //resuming yield @@ -109,7 +109,7 @@ public: SceneTree *tree = Object::cast_to<SceneTree>(OS::get_singleton()->get_main_loop()); if (!tree) { r_error_str = "Main Loop is not SceneTree"; - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return 0; } @@ -188,7 +188,7 @@ void VisualScriptYield::_bind_methods() { ClassDB::bind_method(D_METHOD("get_wait_time"), &VisualScriptYield::get_wait_time); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Frame,Physics Frame,Time", PROPERTY_USAGE_NOEDITOR), "set_yield_mode", "get_yield_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time"), "set_wait_time", "get_wait_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time"), "set_wait_time", "get_wait_time"); BIND_ENUM_CONSTANT(YIELD_FRAME); BIND_ENUM_CONSTANT(YIELD_PHYSICS_FRAME); @@ -509,7 +509,7 @@ public: //virtual bool is_output_port_unsequenced(int p_idx) const { return false; } //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; } - virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { + virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { if (p_start_mode == START_MODE_RESUME_YIELD) { return 0; //resuming yield @@ -529,14 +529,14 @@ public: Node *node = Object::cast_to<Node>(instance->get_owner_ptr()); if (!node) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Base object is not a Node!"; return 0; } Node *another = node->get_node(node_path); if (!another) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Path does not lead Node!"; return 0; } @@ -548,7 +548,7 @@ public: object = *p_inputs[0]; if (!object) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Supplied instance input is null."; return 0; } diff --git a/platform/android/api/api.cpp b/platform/android/api/api.cpp index 2146c5409b..7efb545524 100644 --- a/platform/android/api/api.cpp +++ b/platform/android/api/api.cpp @@ -62,14 +62,14 @@ void JavaClassWrapper::_bind_methods() { #if !defined(ANDROID_ENABLED) -Variant JavaClass::call(const StringName &, const Variant **, int, Variant::CallError &) { +Variant JavaClass::call(const StringName &, const Variant **, int, Callable::CallError &) { return Variant(); } JavaClass::JavaClass() { } -Variant JavaObject::call(const StringName &, const Variant **, int, Variant::CallError &) { +Variant JavaObject::call(const StringName &, const Variant **, int, Callable::CallError &) { return Variant(); } diff --git a/platform/android/api/java_class_wrapper.h b/platform/android/api/java_class_wrapper.h index 2b13be2de4..48b581958b 100644 --- a/platform/android/api/java_class_wrapper.h +++ b/platform/android/api/java_class_wrapper.h @@ -113,12 +113,12 @@ class JavaClass : public Reference { break; case ARG_TYPE_FLOAT | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_FLOAT: - r_type = Variant::REAL; + r_type = Variant::FLOAT; likelihood = 1.0; break; case ARG_TYPE_DOUBLE | ARG_NUMBER_CLASS_BIT: case ARG_TYPE_DOUBLE: - r_type = Variant::REAL; + r_type = Variant::FLOAT; likelihood = 0.5; break; case ARG_TYPE_STRING: r_type = Variant::STRING; break; @@ -134,23 +134,23 @@ class JavaClass : public Reference { likelihood = 0.5; break; case ARG_ARRAY_BIT | ARG_TYPE_SHORT: - r_type = Variant::PACKED_INT_ARRAY; + r_type = Variant::PACKED_INT32_ARRAY; likelihood = 0.3; break; case ARG_ARRAY_BIT | ARG_TYPE_INT: - r_type = Variant::PACKED_INT_ARRAY; + r_type = Variant::PACKED_INT32_ARRAY; likelihood = 1.0; break; case ARG_ARRAY_BIT | ARG_TYPE_LONG: - r_type = Variant::PACKED_INT_ARRAY; + r_type = Variant::PACKED_INT32_ARRAY; likelihood = 0.5; break; case ARG_ARRAY_BIT | ARG_TYPE_FLOAT: - r_type = Variant::PACKED_REAL_ARRAY; + r_type = Variant::PACKED_FLOAT32_ARRAY; likelihood = 1.0; break; case ARG_ARRAY_BIT | ARG_TYPE_DOUBLE: - r_type = Variant::PACKED_REAL_ARRAY; + r_type = Variant::PACKED_FLOAT32_ARRAY; likelihood = 0.5; break; case ARG_ARRAY_BIT | ARG_TYPE_STRING: r_type = Variant::PACKED_STRING_ARRAY; break; @@ -160,7 +160,7 @@ class JavaClass : public Reference { _FORCE_INLINE_ static bool _convert_object_to_variant(JNIEnv *env, jobject obj, Variant &var, uint32_t p_sig); - bool _call_method(JavaObject *p_instance, const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error, Variant &ret); + bool _call_method(JavaObject *p_instance, const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error, Variant &ret); friend class JavaClassWrapper; Map<StringName, List<MethodInfo> > methods; @@ -168,7 +168,7 @@ class JavaClass : public Reference { #endif public: - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); JavaClass(); }; @@ -185,7 +185,7 @@ class JavaObject : public Reference { #endif public: - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); #ifdef ANDROID_ENABLED JavaObject(const Ref<JavaClass> &p_base, jobject *p_instance); diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 2679d9db92..50bf671a84 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -337,7 +337,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { Vector<String> props = dp.split("\n"); String vendor; String device; - d.description + "Device ID: " + d.id + "\n"; + d.description = "Device ID: " + d.id + "\n"; d.api_level = 0; for (int j = 0; j < props.size(); j++) { diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp index fe2fd89710..9e9b17fb99 100644 --- a/platform/android/java_class_wrapper.cpp +++ b/platform/android/java_class_wrapper.cpp @@ -32,7 +32,7 @@ #include "string_android.h" #include "thread_jandroid.h" -bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error, Variant &ret) { +bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error, Variant &ret) { Map<StringName, List<MethodInfo> >::Element *M = methods.find(p_method); if (!M) @@ -44,20 +44,20 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, for (List<MethodInfo>::Element *E = M->get().front(); E; E = E->next()) { if (!p_instance && !E->get()._static) { - r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; continue; } int pc = E->get().param_types.size(); if (pc > p_argcount) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = pc; continue; } if (pc < p_argcount) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = pc; continue; } @@ -97,7 +97,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, case ARG_TYPE_DOUBLE: { if (!p_args[i]->is_num()) - arg_expected = Variant::REAL; + arg_expected = Variant::FLOAT; } break; case ARG_TYPE_STRING: { @@ -141,7 +141,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, } if (arg_expected != Variant::NIL) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = i; r_error.expected = arg_expected; valid = false; @@ -158,7 +158,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, if (!method) return true; //no version convinces - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; jvalue *argv = NULL; @@ -405,7 +405,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, } } - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; bool success = true; switch (method->return_type) { @@ -501,7 +501,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, if (!_convert_object_to_variant(env, obj, ret, method->return_type)) { ret = Variant(); - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; success = false; } env->DeleteLocalRef(obj); @@ -517,7 +517,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, return success; } -Variant JavaClass::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant JavaClass::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { Variant ret; bool found = _call_method(NULL, p_method, p_args, p_argcount, r_error, ret); @@ -533,7 +533,7 @@ JavaClass::JavaClass() { ///////////////////// -Variant JavaObject::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant JavaObject::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { return Variant(); } diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index d3d8304faf..900a452024 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -99,7 +99,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a v.val.i = *p_arg; }; } break; - case Variant::REAL: { + case Variant::FLOAT: { if (force_jobject) { @@ -182,7 +182,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a v.obj = jdict; } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { Vector<int> array = *p_arg; jintArray arr = env->NewIntArray(array.size()); @@ -201,7 +201,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a v.obj = arr; } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_FLOAT32_ARRAY: { Vector<float> array = *p_arg; jfloatArray arr = env->NewFloatArray(array.size()); @@ -211,6 +211,10 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a v.obj = arr; } break; +#ifndef _MSC_VER +#warning This is missing 64 bits arrays, I have no idea how to do it in JNI +#endif + default: { v.val.i = 0; @@ -319,7 +323,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) { jdoubleArray arr = (jdoubleArray)obj; int fCount = env->GetArrayLength(arr); - PackedRealArray sarr; + PackedFloat32Array sarr; sarr.resize(fCount); real_t *w = sarr.ptrw(); @@ -337,7 +341,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) { jfloatArray arr = (jfloatArray)obj; int fCount = env->GetArrayLength(arr); - PackedRealArray sarr; + PackedFloat32Array sarr; sarr.resize(fCount); real_t *w = sarr.ptrw(); @@ -411,30 +415,30 @@ class JNISingleton : public Object { Map<StringName, MethodData> method_map; public: - virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { + virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { ERR_FAIL_COND_V(!instance, Variant()); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; Map<StringName, MethodData>::Element *E = method_map.find(p_method); if (!E) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; return Variant(); } int ac = E->get().argtypes.size(); if (ac < p_argcount) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = ac; return Variant(); } if (ac > p_argcount) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; r_error.argument = ac; return Variant(); } @@ -443,7 +447,7 @@ public: if (!Variant::can_convert(p_args[i]->get_type(), E->get().argtypes[i])) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = i; r_error.expected = E->get().argtypes[i]; } @@ -487,7 +491,7 @@ public: ret = env->CallIntMethodA(instance, E->get().method, v); } break; - case Variant::REAL: { + case Variant::FLOAT: { ret = env->CallFloatMethodA(instance, E->get().method, v); } break; @@ -505,7 +509,7 @@ public: env->DeleteLocalRef(arr); } break; - case Variant::PACKED_INT_ARRAY: { + case Variant::PACKED_INT32_ARRAY: { jintArray arr = (jintArray)env->CallObjectMethodA(instance, E->get().method, v); @@ -519,7 +523,7 @@ public: ret = sarr; env->DeleteLocalRef(arr); } break; - case Variant::PACKED_REAL_ARRAY: { + case Variant::PACKED_FLOAT32_ARRAY: { jfloatArray arr = (jfloatArray)env->CallObjectMethodA(instance, E->get().method, v); @@ -534,6 +538,9 @@ public: env->DeleteLocalRef(arr); } break; +#ifndef _MSC_VER +#warning This is missing 64 bits arrays, I have no idea how to do it in JNI +#endif case Variant::DICTIONARY: { jobject obj = env->CallObjectMethodA(instance, E->get().method, v); @@ -1246,12 +1253,12 @@ static Variant::Type get_jni_type(const String &p_type) { { "void", Variant::NIL }, { "boolean", Variant::BOOL }, { "int", Variant::INT }, - { "float", Variant::REAL }, - { "double", Variant::REAL }, + { "float", Variant::FLOAT }, + { "double", Variant::FLOAT }, { "java.lang.String", Variant::STRING }, - { "[I", Variant::PACKED_INT_ARRAY }, + { "[I", Variant::PACKED_INT32_ARRAY }, { "[B", Variant::PACKED_BYTE_ARRAY }, - { "[F", Variant::PACKED_REAL_ARRAY }, + { "[F", Variant::PACKED_FLOAT32_ARRAY }, { "[Ljava.lang.String;", Variant::PACKED_STRING_ARRAY }, { "org.godotengine.godot.Dictionary", Variant::DICTIONARY }, { NULL, Variant::NIL } @@ -1370,7 +1377,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *en env->DeleteLocalRef(obj); }; - Variant::CallError err; + Callable::CallError err; obj->call(str_method, (const Variant **)vptr, count, err); // something diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub index fa1b124561..1f82f51888 100644 --- a/platform/iphone/SCsub +++ b/platform/iphone/SCsub @@ -14,6 +14,7 @@ iphone_lib = [ 'in_app_store.mm', 'icloud.mm', 'ios.mm', + 'vulkan_context_iphone.mm', ] env_ios = env.Clone() diff --git a/platform/iphone/app_delegate.h b/platform/iphone/app_delegate.h index b4454aab11..6b3b7ad5bc 100644 --- a/platform/iphone/app_delegate.h +++ b/platform/iphone/app_delegate.h @@ -28,13 +28,20 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#if defined(OPENGL_ENABLED) #import "gl_view.h" +#endif #import "view_controller.h" #import <UIKit/UIKit.h> #import <CoreMotion/CoreMotion.h> +#if defined(OPENGL_ENABLED) @interface AppDelegate : NSObject <UIApplicationDelegate, GLViewDelegate> { +#endif +#if defined(VULKAN_ENABLED) +@interface AppDelegate : NSObject <UIApplicationDelegate> { +#endif //@property (strong, nonatomic) UIWindow *window; ViewController *view_controller; bool is_focus_out; diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 4de321fa04..acc3e5d4e0 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -32,7 +32,9 @@ #include "core/project_settings.h" #include "drivers/coreaudio/audio_driver_coreaudio.h" +#if defined(OPENGL_ENABLED) #import "gl_view.h" +#endif #include "main/main.h" #include "os_iphone.h" @@ -412,10 +414,12 @@ static void on_focus_in(ViewController *view_controller, bool *is_focus_out) { OS::VideoMode _get_video_mode() { int backingWidth; int backingHeight; +#if defined(OPENGL_ENABLED) glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth); glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight); +#endif OS::VideoMode vm; vm.fullscreen = true; @@ -426,7 +430,7 @@ OS::VideoMode _get_video_mode() { }; static int frame_count = 0; -- (void)drawView:(GLView *)view; +- (void)drawView:(UIView *)view; { switch (frame_count) { @@ -634,6 +638,7 @@ static int frame_count = 0; return FALSE; }; +#if defined(OPENGL_ENABLED) // WARNING: We must *always* create the GLView after we have constructed the // OS with iphone_main. This allows the GLView to access project settings so // it can properly initialize the OpenGL context @@ -642,7 +647,7 @@ static int frame_count = 0; view_controller = [[ViewController alloc] init]; view_controller.view = glView; - window.rootViewController = view_controller; + _set_keep_screen_on(bool(GLOBAL_DEF("display/window/energy_saving/keep_screen_on", true)) ? YES : NO); glView.useCADisplayLink = @@ -650,6 +655,13 @@ static int frame_count = 0; printf("cadisaplylink: %d", glView.useCADisplayLink); glView.animationInterval = 1.0 / kRenderingFrequency; [glView startAnimation]; +#endif + +#if defined(VULKAN_ENABLED) + view_controller = [[ViewController alloc] init]; +#endif + + window.rootViewController = view_controller; // Show the window [window makeKeyAndVisible]; diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index f646b8b1d5..e01950c1db 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -23,6 +23,7 @@ def get_opts(): return [ ('IPHONEPATH', 'Path to iPhone toolchain', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'), ('IPHONESDK', 'Path to the iPhone SDK', ''), + BoolVariable('use_static_mvk', 'Link MoltenVK statically as Level-0 driver (better portability) or use Vulkan ICD loader (enables validation layers)', False), BoolVariable('game_center', 'Support for game center', True), BoolVariable('store_kit', 'Support for in-app store', True), BoolVariable('icloud', 'Support for iCloud', True), @@ -149,7 +150,7 @@ def configure(env): '-framework', 'Foundation', '-framework', 'GameController', '-framework', 'MediaPlayer', - '-framework', 'OpenGLES', + '-framework', 'Metal', '-framework', 'QuartzCore', '-framework', 'Security', '-framework', 'SystemConfiguration', @@ -170,11 +171,18 @@ def configure(env): env.Append(CPPDEFINES=['ICLOUD_ENABLED']) env.Prepend(CPPPATH=['$IPHONESDK/usr/include', - '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers', '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers', ]) env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate' env.Prepend(CPPPATH=['#platform/iphone']) - env.Append(CPPDEFINES=['IPHONE_ENABLED', 'UNIX_ENABLED', 'GLES_ENABLED', 'COREAUDIO_ENABLED']) + env.Append(CPPDEFINES=['IPHONE_ENABLED', 'UNIX_ENABLED', 'COREAUDIO_ENABLED']) + + env.Append(CPPDEFINES=['VULKAN_ENABLED']) + env.Append(LINKFLAGS=['-framework', 'IOSurface']) + if (env['use_static_mvk']): + env.Append(LINKFLAGS=['-framework', 'MoltenVK']) + env['builtin_vulkan'] = False + elif not env['builtin_vulkan']: + env.Append(LIBS=['vulkan']) diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index 696f61f954..99d539d4ff 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -198,11 +198,11 @@ void GameCenter::request_achievement_descriptions() { ret["type"] = "achievement_descriptions"; if (error == nil) { ret["result"] = "ok"; - PoolStringArray names; - PoolStringArray titles; - PoolStringArray unachieved_descriptions; - PoolStringArray achieved_descriptions; - PoolIntArray maximum_points; + PackedStringArray names; + PackedStringArray titles; + PackedStringArray unachieved_descriptions; + PackedStringArray achieved_descriptions; + PackedInt32Array maximum_points; Array hidden; Array replayable; @@ -253,8 +253,8 @@ void GameCenter::request_achievements() { ret["type"] = "achievements"; if (error == nil) { ret["result"] = "ok"; - PoolStringArray names; - PoolRealArray percentages; + PackedStringArray names; + PackedFloat32Array percentages; for (int i = 0; i < [achievements count]; i++) { diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index f846043dde..251f78f2da 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -80,13 +80,13 @@ Variant nsobject_to_variant(NSObject *object) { const char *str = [(NSString *)object UTF8String]; return String::utf8(str != NULL ? str : ""); } else if ([object isKindOfClass:[NSData class]]) { - PoolByteArray ret; + PackedByteArray ret; NSData *data = (NSData *)object; if ([data length] > 0) { ret.resize([data length]); { - PoolByteArray::Write w = ret.write(); - copymem(w.ptr(), [data bytes], [data length]); + // PackedByteArray::Write w = ret.write(); + copymem((void *)ret.ptr(), [data bytes], [data length]); } } return ret; @@ -184,10 +184,10 @@ NSObject *variant_to_nsobject(Variant v) { [result addObject:value]; } return result; - } else if (v.get_type() == Variant::POOL_BYTE_ARRAY) { - PoolByteArray arr = v; - PoolByteArray::Read r = arr.read(); - NSData *result = [NSData dataWithBytes:r.ptr() length:arr.size()]; + } else if (v.get_type() == Variant::PACKED_BYTE_ARRAY) { + PackedByteArray arr = v; + // PackedByteArray::Read r = arr.read(); + NSData *result = [NSData dataWithBytes:arr.ptr() length:arr.size()]; return result; } WARN_PRINT(String("Could not add unsupported type to iCloud: '" + Variant::get_type_name(v.get_type()) + "'").utf8().get_data()); @@ -315,7 +315,7 @@ ICloud::ICloud() { Dictionary ret; ret["type"] = "key_value_changed"; - //PoolStringArray result_keys; + //PackedStringArray result_keys; //Array result_values; Dictionary keyValues; String reason = ""; diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index 855ab195b0..a8a887824f 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -85,12 +85,12 @@ void InAppStore::_bind_methods() { Dictionary ret; ret["type"] = "product_info"; ret["result"] = "ok"; - PoolStringArray titles; - PoolStringArray descriptions; - PoolRealArray prices; - PoolStringArray ids; - PoolStringArray localized_prices; - PoolStringArray currency_codes; + PackedStringArray titles; + PackedStringArray descriptions; + PackedFloat32Array prices; + PackedStringArray ids; + PackedStringArray localized_prices; + PackedStringArray currency_codes; for (NSUInteger i = 0; i < [products count]; i++) { @@ -113,7 +113,7 @@ void InAppStore::_bind_methods() { ret["localized_prices"] = localized_prices; ret["currency_codes"] = currency_codes; - PoolStringArray invalid_ids; + PackedStringArray invalid_ids; for (NSString *ipid in response.invalidProductIdentifiers) { @@ -133,7 +133,7 @@ Error InAppStore::request_product_info(Variant p_params) { Dictionary params = p_params; ERR_FAIL_COND_V(!params.has("product_ids"), ERR_INVALID_PARAMETER); - PoolStringArray pids = params["product_ids"]; + PackedStringArray pids = params["product_ids"]; printf("************ request product info! %i\n", pids.size()); NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:pids.size()] autorelease]; diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 634062f46b..db203ff2b3 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -32,7 +32,16 @@ #include "os_iphone.h" +#if defined(OPENGL_ENABLED) #include "drivers/gles2/rasterizer_gles2.h" +#endif + +#if defined(VULKAN_ENABLED) +#include "servers/visual/rasterizer_rd/rasterizer_rd.h" +// #import <QuartzCore/CAMetalLayer.h> +#include <vulkan/vulkan_metal.h> +#endif + #include "servers/visual/visual_server_raster.h" #include "servers/visual/visual_server_wrap_mt.h" @@ -101,7 +110,9 @@ int OSIPhone::get_current_video_driver() const { } Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) { + video_driver_index = p_video_driver; +#if defined(OPENGL_ENABLED) bool gl_initialization_error = false; // FIXME: Add Vulkan support via MoltenVK. Add fallback code back? @@ -118,19 +129,25 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p "Unable to initialize video driver"); return ERR_UNAVAILABLE; } +#endif - video_driver_index = p_video_driver; +#if defined(VULKAN_ENABLED) + RasterizerRD::make_current(); +#endif + + visual_server = memnew(VisualServerRaster); // FIXME: Reimplement threaded rendering if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { visual_server = memnew(VisualServerWrapMT(visual_server, false)); } - visual_server->init(); //visual_server->cursor_set_visible(false, 0); +#if defined(OPENGL_ENABLED) // reset this to what it should be, it will have been set to 0 after visual_server->init() is called RasterizerStorageGLES2::system_fbo = gl_view_base_fb; +#endif AudioDriverManager::initialize(p_audio_driver); @@ -437,9 +454,10 @@ bool OSIPhone::can_draw() const { }; int OSIPhone::set_base_framebuffer(int p_fb) { - +#if defined(OPENGL_ENABLED) // gl_view_base_fb has not been updated yet RasterizerStorageGLES2::system_fbo = p_fb; +#endif return 0; }; diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index d2d96181f5..f42679e754 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -46,6 +46,11 @@ #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" +#if defined(VULKAN_ENABLED) +#include "drivers/vulkan/rendering_device_vulkan.h" +#include "platform/iphone/vulkan_context_iphone.h" +#endif + class OSIPhone : public OS_Unix { private: @@ -74,6 +79,10 @@ private: MainLoop *main_loop; +#if defined(VULKAN_ENABLED) + VulkanContextIPhone *context_vulkan; + RenderingDeviceVulkan *rendering_device_vulkan; +#endif VideoMode video_mode; virtual int get_video_driver_count() const; diff --git a/platform/iphone/vulkan_context_iphone.h b/platform/iphone/vulkan_context_iphone.h new file mode 100644 index 0000000000..200057e14d --- /dev/null +++ b/platform/iphone/vulkan_context_iphone.h @@ -0,0 +1,48 @@ +/*************************************************************************/ +/* vulkan_context_osx.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef VULKAN_CONTEXT_IPHONE_H +#define VULKAN_CONTEXT_IPHONE_H + +#include "drivers/vulkan/vulkan_context.h" +// #import <UIKit/UIKit.h> + +class VulkanContextIPhone : public VulkanContext { + + virtual const char *_get_platform_surface_extension() const; + +public: + int window_create(void *p_window, int p_width, int p_height); + + VulkanContextIPhone(); + ~VulkanContextIPhone(); +}; + +#endif // VULKAN_CONTEXT_IPHONE_H diff --git a/platform/iphone/vulkan_context_iphone.mm b/platform/iphone/vulkan_context_iphone.mm new file mode 100644 index 0000000000..f49b85c097 --- /dev/null +++ b/platform/iphone/vulkan_context_iphone.mm @@ -0,0 +1,56 @@ +/*************************************************************************/ +/* vulkan_context_osx.mm */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "vulkan_context_iphone.h" +#include <vulkan/vulkan_ios.h> + +const char *VulkanContextIPhone::_get_platform_surface_extension() const { + return VK_MVK_IOS_SURFACE_EXTENSION_NAME; +} + +int VulkanContextIPhone::window_create(void *p_window, int p_width, int p_height) { + + VkIOSSurfaceCreateInfoMVK createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK; + createInfo.pNext = NULL; + createInfo.flags = 0; + createInfo.pView = p_window; + + VkSurfaceKHR surface; + VkResult err = vkCreateIOSSurfaceMVK(_get_instance(), &createInfo, NULL, &surface); + ERR_FAIL_COND_V(err, -1); + return _window_create(surface, p_width, p_height); +} + +VulkanContextIPhone::VulkanContextIPhone() { +} + +VulkanContextIPhone::~VulkanContextIPhone() { +} diff --git a/platform/javascript/javascript_eval.cpp b/platform/javascript/javascript_eval.cpp index ab045d359b..44cce28d57 100644 --- a/platform/javascript/javascript_eval.cpp +++ b/platform/javascript/javascript_eval.cpp @@ -81,7 +81,7 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) { case 'number': setValue(PTR, eval_ret, 'double'); - return 3; // REAL + return 3; // FLOAT case 'string': var array_len = lengthBytesUTF8(eval_ret)+1; @@ -128,7 +128,7 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) { switch (return_type) { case Variant::BOOL: return js_data.b; - case Variant::REAL: + case Variant::FLOAT: return js_data.d; case Variant::STRING: { String str = String::utf8(js_data.s); diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 0b164a2c56..12ca5c10dc 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -164,5 +164,5 @@ def configure(env): #env.Append(CPPDEFINES=['GLES_ENABLED', 'OPENGL_ENABLED']) - env.Append(CCFLAGS=['-mmacosx-version-min=10.11']) - env.Append(LINKFLAGS=['-mmacosx-version-min=10.11']) + env.Append(CCFLAGS=['-mmacosx-version-min=10.12']) + env.Append(LINKFLAGS=['-mmacosx-version-min=10.12']) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index be25cab40b..f2e5f9369c 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -747,7 +747,7 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { const Vector2 pos = get_mouse_pos([event locationInWindow], backingScaleFactor); mm->set_position(pos); mm->set_pressure([event pressure]); - if ([event subtype] == NSTabletPointEventSubtype) { + if ([event subtype] == NSEventSubtypeTabletPoint) { const NSPoint p = [event tilt]; mm->set_tilt(Vector2(p.x, p.y)); } @@ -1757,7 +1757,7 @@ void OS_OSX::alert(const String &p_alert, const String &p_title) { [window addButtonWithTitle:@"OK"]; [window setMessageText:ns_title]; [window setInformativeText:ns_alert]; - [window setAlertStyle:NSWarningAlertStyle]; + [window setAlertStyle:NSAlertStyleWarning]; // Display it, then release [window runModal]; diff --git a/platform/server/detect.py b/platform/server/detect.py index d82df77957..ef94dc436c 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -32,6 +32,7 @@ def get_opts(): return [ BoolVariable('use_llvm', 'Use the LLVM compiler', False), BoolVariable('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', False), + BoolVariable('use_coverage', 'Test Godot coverage', False), BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), BoolVariable('use_asan', 'Use LLVM/GCC compiler address sanitizer (ASAN))', False), BoolVariable('use_lsan', 'Use LLVM/GCC compiler leak sanitizer (LSAN))', False), @@ -99,6 +100,9 @@ def configure(env): env.Append(CPPDEFINES=['TYPED_METHOD_BIND']) env.extra_suffix = ".llvm" + env.extra_suffix + if env['use_coverage']: + env.Append(CCFLAGS=['-ftest-coverage', '-fprofile-arcs']) + env.Append(LINKFLAGS=['-ftest-coverage', '-fprofile-arcs']) if env['use_ubsan'] or env['use_asan'] or env['use_lsan'] or env['use_tsan']: env.extra_suffix += "s" diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index c0a4813596..8a66332ff1 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -31,7 +31,6 @@ #include "os_server.h" #include "core/print_string.h" -#include "drivers/dummy/audio_driver_dummy.h" #include "drivers/dummy/rasterizer_dummy.h" #include "drivers/dummy/texture_loader_dummy.h" #include "servers/visual/visual_server_raster.h" diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index b9cd277657..716a637993 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -34,6 +34,7 @@ #include "os_windows.h" #include "core/io/marshalls.h" +#include "core/script_language.h" #include "core/version_generated.gen.h" #if defined(OPENGL_ENABLED) @@ -708,7 +709,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; } } - FALLTHROUGH; + [[fallthrough]]; case WM_MBUTTONDOWN: case WM_MBUTTONUP: case WM_RBUTTONDOWN: @@ -983,7 +984,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (wParam==VK_WIN) TODO wtf is this? meta_mem=uMsg==WM_KEYDOWN; */ - FALLTHROUGH; + [[fallthrough]]; } case WM_CHAR: { diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 9d5affcb3c..cd22ee9ff6 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -61,6 +61,7 @@ def get_opts(): BoolVariable('use_lld', 'Use the LLD linker', False), BoolVariable('use_thinlto', 'Use ThinLTO', False), BoolVariable('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', False), + BoolVariable('use_coverage', 'Test Godot coverage', False), BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), BoolVariable('use_asan', 'Use LLVM/GCC compiler address sanitizer (ASAN))', False), BoolVariable('use_lsan', 'Use LLVM/GCC compiler leak sanitizer (LSAN))', False), @@ -141,6 +142,10 @@ def configure(env): print("Using LLD with GCC is not supported yet, try compiling with 'use_llvm=yes'.") sys.exit(255) + if env['use_coverage']: + env.Append(CCFLAGS=['-ftest-coverage', '-fprofile-arcs']) + env.Append(LINKFLAGS=['-ftest-coverage', '-fprofile-arcs']) + if env['use_ubsan'] or env['use_asan'] or env['use_lsan'] or env['use_tsan']: env.extra_suffix += "s" @@ -179,18 +184,10 @@ def configure(env): env.Append(CCFLAGS=['-pipe']) env.Append(LINKFLAGS=['-pipe']) - # Check for gcc version >= 6 before adding -no-pie - if using_gcc(env): - version = get_compiler_version(env) - if version != None and version[0] >= '6': - env.Append(CCFLAGS=['-fpie']) - env.Append(LINKFLAGS=['-no-pie']) - # Do the same for clang should be fine with Clang 4 and higher - if using_clang(env): - version = get_compiler_version(env) - if version != None and version[0] >= '4': - env.Append(CCFLAGS=['-fpie']) - env.Append(LINKFLAGS=['-no-pie']) + # -fpie and -no-pie is supported on GCC 6+ and Clang 4+, both below our + # minimal requirements. + env.Append(CCFLAGS=['-fpie']) + env.Append(LINKFLAGS=['-no-pie']) ## Dependencies diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index b98820d5ac..d4d008d488 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -475,10 +475,10 @@ void AnimatedSprite::_notification(int p_what) { void AnimatedSprite::set_sprite_frames(const Ref<SpriteFrames> &p_frames) { if (frames.is_valid()) - frames->disconnect("changed", this, "_res_changed"); + frames->disconnect_compat("changed", this, "_res_changed"); frames = p_frames; if (frames.is_valid()) - frames->connect("changed", this, "_res_changed"); + frames->connect_compat("changed", this, "_res_changed"); if (!frames.is_valid()) { frame = 0; @@ -742,13 +742,13 @@ void AnimatedSprite::_bind_methods() { ADD_GROUP("Animation", ""); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation"), "set_animation", "get_animation"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "animation"), "set_animation", "get_animation"); ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale"), "set_speed_scale", "get_speed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing"), "_set_playing", "_is_playing"); ADD_GROUP("Lighting", ""); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "specular_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_specular_color", "get_specular_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess"); ADD_GROUP("Offset", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset"); diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index b661db2e52..eef8c58f78 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -171,8 +171,8 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i E->get().rc = 0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid)); if (E->get().in_tree) { emit_signal(SceneStringNames::get_singleton()->body_entered, node); } @@ -198,8 +198,8 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i if (E->get().rc == 0) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); if (E->get().in_tree) emit_signal(SceneStringNames::get_singleton()->body_exited, obj); } @@ -273,8 +273,8 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i E->get().rc = 0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree, make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree, make_binds(objid)); if (E->get().in_tree) { emit_signal(SceneStringNames::get_singleton()->area_entered, node); } @@ -300,8 +300,8 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i if (E->get().rc == 0) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree); if (E->get().in_tree) emit_signal(SceneStringNames::get_singleton()->area_exited, obj); } @@ -337,8 +337,8 @@ void Area2D::_clear_monitoring() { continue; //ERR_CONTINUE(!node); - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); if (!E->get().in_tree) continue; @@ -367,8 +367,8 @@ void Area2D::_clear_monitoring() { continue; //ERR_CONTINUE(!node); - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree); if (!E->get().in_tree) continue; @@ -660,11 +660,11 @@ void Area2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "space_override", PROPERTY_HINT_ENUM, "Disabled,Combine,Combine-Replace,Replace,Replace-Combine"), "set_space_override_mode", "get_space_override_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "gravity_point"), "set_gravity_is_point", "is_gravity_a_point"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "gravity_vec"), "set_gravity_vector", "get_gravity_vector"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.001"), "set_gravity", "get_gravity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.001"), "set_gravity", "get_gravity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable"); @@ -674,7 +674,7 @@ void Area2D::_bind_methods() { ADD_GROUP("Audio Bus", "audio_bus_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_bus_override"), "set_audio_bus_override", "is_overriding_audio_bus"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus_name", "get_audio_bus_name"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus_name", "get_audio_bus_name"); BIND_ENUM_CONSTANT(SPACE_OVERRIDE_DISABLED); BIND_ENUM_CONSTANT(SPACE_OVERRIDE_COMBINE); diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index fd654cbf60..901fd1e126 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -515,14 +515,14 @@ void AudioStreamPlayer2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_bus_layout_changed"), &AudioStreamPlayer2D::_bus_layout_changed); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE, "-80,24"), "set_volume_db", "get_volume_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume_db", PROPERTY_HINT_RANGE, "-80,24"), "set_volume_db", "get_volume_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "is_playing"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stream_paused", PROPERTY_HINT_NONE, ""), "set_stream_paused", "get_stream_paused"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_EXP_RANGE, "1,4096,1,or_greater"), "set_max_distance", "get_max_distance"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_attenuation", "get_attenuation"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_distance", PROPERTY_HINT_EXP_RANGE, "1,4096,1,or_greater"), "set_max_distance", "get_max_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_attenuation", "get_attenuation"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask"); ADD_SIGNAL(MethodInfo("finished")); @@ -545,7 +545,7 @@ AudioStreamPlayer2D::AudioStreamPlayer2D() { stream_paused = false; stream_paused_fade_in = false; stream_paused_fade_out = false; - AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed"); + AudioServer::get_singleton()->connect_compat("bus_layout_changed", this, "_bus_layout_changed"); } AudioStreamPlayer2D::~AudioStreamPlayer2D() { diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 7ec770597e..1419fb561e 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -753,17 +753,17 @@ void Camera2D::_bind_methods() { ADD_GROUP("Smoothing", "smoothing_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smoothing_enabled"), "set_enable_follow_smoothing", "is_follow_smoothing_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "smoothing_speed"), "set_follow_smoothing", "get_follow_smoothing"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "smoothing_speed"), "set_follow_smoothing", "get_follow_smoothing"); ADD_GROUP("Offset", "offset_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset_h", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_h_offset", "get_h_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset_v", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_v_offset", "get_v_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "offset_h", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_h_offset", "get_h_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "offset_v", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_v_offset", "get_v_offset"); ADD_GROUP("Drag Margin", "drag_margin_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_LEFT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_top", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_TOP); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_right", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_RIGHT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "drag_margin_bottom", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_BOTTOM); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "drag_margin_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_LEFT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "drag_margin_top", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_TOP); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "drag_margin_right", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_RIGHT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "drag_margin_bottom", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_margin", "get_drag_margin", MARGIN_BOTTOM); ADD_GROUP("Editor", "editor_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_draw_screen"), "set_screen_drawing_enabled", "is_screen_drawing_enabled"); diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 72cafb911b..942b63898d 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -1263,9 +1263,9 @@ void CanvasItem::_bind_methods() { BIND_ENUM_CONSTANT(TEXTURE_FILTER_PARENT_NODE); BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST); BIND_ENUM_CONSTANT(TEXTURE_FILTER_LINEAR); - BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS); + BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST_WITH_MIPMAPS); BIND_ENUM_CONSTANT(TEXTURE_FILTER_LINEAR_WITH_MIPMAPS); - BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC); + BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC); BIND_ENUM_CONSTANT(TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC); BIND_ENUM_CONSTANT(TEXTURE_FILTER_MAX); @@ -1353,7 +1353,7 @@ void CanvasItem::_update_texture_filter_changed(bool p_propagate) { case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST; break; case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR; break; case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS; break; - case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS; break; + case Viewport::DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: texture_filter_cache = VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS; break; default: { } } diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index 822e679a86..3cd8e6ef74 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -170,9 +170,9 @@ public: TEXTURE_FILTER_PARENT_NODE, TEXTURE_FILTER_NEAREST, TEXTURE_FILTER_LINEAR, - TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS, + TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, - TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC, + TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, TEXTURE_FILTER_MAX }; diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 72af0fcb2a..4edf92197e 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -308,7 +308,7 @@ void CollisionPolygon2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1"), "set_one_way_collision_margin", "get_one_way_collision_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1"), "set_one_way_collision_margin", "get_one_way_collision_margin"); BIND_ENUM_CONSTANT(BUILD_SOLIDS); BIND_ENUM_CONSTANT(BUILD_SEGMENTS); diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index bb975350a6..d37f8c5caa 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -149,7 +149,7 @@ void CollisionShape2D::_notification(int p_what) { void CollisionShape2D::set_shape(const Ref<Shape2D> &p_shape) { if (shape.is_valid()) - shape->disconnect("changed", this, "_shape_changed"); + shape->disconnect_compat("changed", this, "_shape_changed"); shape = p_shape; update(); if (parent) { @@ -160,7 +160,7 @@ void CollisionShape2D::set_shape(const Ref<Shape2D> &p_shape) { } if (shape.is_valid()) - shape->connect("changed", this, "_shape_changed"); + shape->connect_compat("changed", this, "_shape_changed"); update_configuration_warning(); } @@ -242,7 +242,7 @@ void CollisionShape2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D"), "set_shape", "get_shape"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1"), "set_one_way_collision_margin", "get_one_way_collision_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1"), "set_one_way_collision_margin", "get_one_way_collision_margin"); } CollisionShape2D::CollisionShape2D() { diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 922ee0c208..35df6c8945 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -212,12 +212,12 @@ void CPUParticles2D::set_texture(const Ref<Texture2D> &p_texture) { return; if (texture.is_valid()) - texture->disconnect(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); + texture->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); texture = p_texture; if (texture.is_valid()) - texture->connect(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); + texture->connect_compat(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); update(); _update_mesh_texture(); @@ -1053,13 +1053,13 @@ void CPUParticles2D::_set_redraw(bool p_redraw) { update_mutex->lock(); #endif if (redraw) { - VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); + VS::get_singleton()->connect_compat("frame_pre_draw", this, "_update_render_thread"); VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), true); VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1); } else { - if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_update_render_thread")) { - VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); + if (VS::get_singleton()->is_connected_compat("frame_pre_draw", this, "_update_render_thread")) { + VS::get_singleton()->disconnect_compat("frame_pre_draw", this, "_update_render_thread"); } VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false); @@ -1273,13 +1273,13 @@ void CPUParticles2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting"); ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_EXP_RANGE, "1,1000000,1"), "set_amount", "get_amount"); ADD_GROUP("Time", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); @@ -1346,7 +1346,7 @@ void CPUParticles2D::_bind_methods() { ADD_GROUP("Emission Shape", "emission_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_shape", PROPERTY_HINT_ENUM, "Point,Sphere,Box,Points,Directed Points"), "set_emission_shape", "get_emission_shape"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "emission_rect_extents"), "set_emission_rect_extents", "get_emission_rect_extents"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "emission_points"), "set_emission_points", "get_emission_points"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "emission_normals"), "set_emission_normals", "get_emission_normals"); @@ -1355,58 +1355,58 @@ void CPUParticles2D::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_align_y"), "set_particle_flag", "get_particle_flag", FLAG_ALIGN_Y_TO_VELOCITY); ADD_GROUP("Direction", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "direction"), "set_direction", "get_direction"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread"); ADD_GROUP("Gravity", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "gravity"), "set_gravity", "get_gravity"); ADD_GROUP("Initial Velocity", "initial_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY); ADD_GROUP("Angular Velocity", "angular_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angular_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANGULAR_VELOCITY); ADD_GROUP("Orbit Velocity", "orbit_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "orbit_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ORBIT_VELOCITY); ADD_GROUP("Linear Accel", "linear_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "linear_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_LINEAR_ACCEL); ADD_GROUP("Radial Accel", "radial_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "radial_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_RADIAL_ACCEL); ADD_GROUP("Tangential Accel", "tangential_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "tangential_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_TANGENTIAL_ACCEL); ADD_GROUP("Damping", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "damping_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_DAMPING); ADD_GROUP("Angle", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angle_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANGLE); ADD_GROUP("Scale", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_amount", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_amount_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_amount", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_amount_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "scale_amount_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_SCALE); ADD_GROUP("Color", ""); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "color_ramp", PROPERTY_HINT_RESOURCE_TYPE, "Gradient"), "set_color_ramp", "get_color_ramp"); ADD_GROUP("Hue Variation", "hue_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "hue_variation_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_HUE_VARIATION); ADD_GROUP("Animation", "anim_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_speed_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_SPEED); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_OFFSET); BIND_ENUM_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY); diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 656ff45654..9cc9ab25ac 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -158,7 +158,7 @@ void Joint2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_a", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "CollisionObject2D"), "set_node_a", "get_node_a"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_b", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "CollisionObject2D"), "set_node_b", "get_node_b"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bias", PROPERTY_HINT_RANGE, "0,0.9,0.001"), "set_bias", "get_bias"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bias", PROPERTY_HINT_RANGE, "0,0.9,0.001"), "set_bias", "get_bias"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_collision"), "set_exclude_nodes_from_collision", "get_exclude_nodes_from_collision"); } @@ -215,7 +215,7 @@ void PinJoint2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_softness", "softness"), &PinJoint2D::set_softness); ClassDB::bind_method(D_METHOD("get_softness"), &PinJoint2D::get_softness); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "softness", PROPERTY_HINT_EXP_RANGE, "0.00,16,0.01"), "set_softness", "get_softness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "softness", PROPERTY_HINT_EXP_RANGE, "0.00,16,0.01"), "set_softness", "get_softness"); } PinJoint2D::PinJoint2D() { @@ -285,8 +285,8 @@ void GrooveJoint2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_initial_offset", "offset"), &GrooveJoint2D::set_initial_offset); ClassDB::bind_method(D_METHOD("get_initial_offset"), &GrooveJoint2D::get_initial_offset); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_length", "get_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "initial_offset", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_initial_offset", "get_initial_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_length", "get_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "initial_offset", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_initial_offset", "get_initial_offset"); } GrooveJoint2D::GrooveJoint2D() { @@ -394,10 +394,10 @@ void DampedSpringJoint2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_damping", "damping"), &DampedSpringJoint2D::set_damping); ClassDB::bind_method(D_METHOD("get_damping"), &DampedSpringJoint2D::get_damping); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_length", "get_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rest_length", PROPERTY_HINT_EXP_RANGE, "0,65535,1"), "set_rest_length", "get_rest_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "stiffness", PROPERTY_HINT_EXP_RANGE, "0.1,64,0.1"), "set_stiffness", "get_stiffness"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_EXP_RANGE, "0.01,16,0.01"), "set_damping", "get_damping"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length", PROPERTY_HINT_EXP_RANGE, "1,65535,1"), "set_length", "get_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rest_length", PROPERTY_HINT_EXP_RANGE, "0,65535,1"), "set_rest_length", "get_rest_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "stiffness", PROPERTY_HINT_EXP_RANGE, "0.1,64,0.1"), "set_stiffness", "get_stiffness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "damping", PROPERTY_HINT_EXP_RANGE, "0.01,16,0.01"), "set_damping", "get_damping"); } DampedSpringJoint2D::DampedSpringJoint2D() { diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 0b66d34ece..e61b1fa339 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -426,12 +426,12 @@ void Light2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_only"), "set_editor_only", "is_editor_only"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_texture_offset", "get_texture_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "texture_scale", PROPERTY_HINT_RANGE, "0.01,50,0.01"), "set_texture_scale", "get_texture_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_scale", PROPERTY_HINT_RANGE, "0.01,50,0.01"), "set_texture_scale", "get_texture_scale"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy"); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Add,Sub,Mix,Mask"), "set_mode", "get_mode"); ADD_GROUP("Range", "range_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "range_height", PROPERTY_HINT_RANGE, "-2048,2048,0.1,or_lesser,or_greater"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "range_height", PROPERTY_HINT_RANGE, "-2048,2048,0.1,or_lesser,or_greater"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::INT, "range_z_min", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_range_min", "get_z_range_min"); ADD_PROPERTY(PropertyInfo(Variant::INT, "range_z_max", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_range_max", "get_z_range_max"); ADD_PROPERTY(PropertyInfo(Variant::INT, "range_layer_min", PROPERTY_HINT_RANGE, "-512,512,1"), "set_layer_range_min", "get_layer_range_min"); @@ -443,7 +443,7 @@ void Light2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color"), "set_shadow_color", "get_shadow_color"); ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_buffer_size", PROPERTY_HINT_RANGE, "32,16384,1"), "set_shadow_buffer_size", "get_shadow_buffer_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_filter", PROPERTY_HINT_ENUM, "None,PCF5,PCF13"), "set_shadow_filter", "get_shadow_filter"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_filter_smooth", PROPERTY_HINT_RANGE, "0,64,0.1"), "set_shadow_smooth", "get_shadow_smooth"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shadow_filter_smooth", PROPERTY_HINT_RANGE, "0,64,0.1"), "set_shadow_smooth", "get_shadow_smooth"); ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_item_cull_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_item_shadow_cull_mask", "get_item_shadow_cull_mask"); BIND_ENUM_CONSTANT(MODE_ADD); diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index c000346a1a..019eeb9563 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -234,7 +234,7 @@ void LightOccluder2D::set_occluder_polygon(const Ref<OccluderPolygon2D> &p_polyg #ifdef DEBUG_ENABLED if (occluder_polygon.is_valid()) - occluder_polygon->disconnect("changed", this, "_poly_changed"); + occluder_polygon->disconnect_compat("changed", this, "_poly_changed"); #endif occluder_polygon = p_polygon; @@ -245,7 +245,7 @@ void LightOccluder2D::set_occluder_polygon(const Ref<OccluderPolygon2D> &p_polyg #ifdef DEBUG_ENABLED if (occluder_polygon.is_valid()) - occluder_polygon->connect("changed", this, "_poly_changed"); + occluder_polygon->connect_compat("changed", this, "_poly_changed"); update(); #endif } diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp index 3c457b7df0..dd0af21c16 100644 --- a/scene/2d/line_2d.cpp +++ b/scene/2d/line_2d.cpp @@ -101,14 +101,14 @@ float Line2D::get_width() const { void Line2D::set_curve(const Ref<Curve> &p_curve) { // Cleanup previous connection if any if (_curve.is_valid()) { - _curve->disconnect(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); + _curve->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); } _curve = p_curve; // Connect to the curve so the line will update when it is changed if (_curve.is_valid()) { - _curve->connect(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); + _curve->connect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); } update(); @@ -171,14 +171,14 @@ void Line2D::set_gradient(const Ref<Gradient> &p_gradient) { // Cleanup previous connection if any if (_gradient.is_valid()) { - _gradient->disconnect(CoreStringNames::get_singleton()->changed, this, "_gradient_changed"); + _gradient->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_gradient_changed"); } _gradient = p_gradient; // Connect to the gradient so the line will update when the ColorRamp is changed if (_gradient.is_valid()) { - _gradient->connect(CoreStringNames::get_singleton()->changed, this, "_gradient_changed"); + _gradient->connect_compat(CoreStringNames::get_singleton()->changed, this, "_gradient_changed"); } update(); @@ -401,7 +401,7 @@ void Line2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_antialiased"), &Line2D::get_antialiased); ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "points"), "set_points", "get_points"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "width"), "set_width", "get_width"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "width"), "set_width", "get_width"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "width_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve", "get_curve"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "default_color"), "set_default_color", "get_default_color"); ADD_GROUP("Fill", ""); @@ -413,7 +413,7 @@ void Line2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "begin_cap_mode", PROPERTY_HINT_ENUM, "None,Box,Round"), "set_begin_cap_mode", "get_begin_cap_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "end_cap_mode", PROPERTY_HINT_ENUM, "None,Box,Round"), "set_end_cap_mode", "get_end_cap_mode"); ADD_GROUP("Border", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sharp_limit"), "set_sharp_limit", "get_sharp_limit"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sharp_limit"), "set_sharp_limit", "get_sharp_limit"); ADD_PROPERTY(PropertyInfo(Variant::INT, "round_precision"), "set_round_precision", "get_round_precision"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "antialiased"), "set_antialiased", "get_antialiased"); diff --git a/scene/2d/navigation_2d.cpp b/scene/2d/navigation_2d.cpp index 45574d4a5a..bbabfa16c7 100644 --- a/scene/2d/navigation_2d.cpp +++ b/scene/2d/navigation_2d.cpp @@ -44,8 +44,8 @@ void Navigation2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_edge_connection_margin", "margin"), &Navigation2D::set_edge_connection_margin); ClassDB::bind_method(D_METHOD("get_edge_connection_margin"), &Navigation2D::get_edge_connection_margin); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell_size"), "set_cell_size", "get_cell_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "edge_connection_margin"), "set_edge_connection_margin", "get_edge_connection_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell_size"), "set_cell_size", "get_cell_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "edge_connection_margin"), "set_edge_connection_margin", "get_edge_connection_margin"); } void Navigation2D::_notification(int p_what) { @@ -88,3 +88,7 @@ Navigation2D::Navigation2D() { set_cell_size(10); // Ten pixels set_edge_connection_margin(100); } + +Navigation2D::~Navigation2D() { + Navigation2DServer::get_singleton()->free(map); +} diff --git a/scene/2d/navigation_2d.h b/scene/2d/navigation_2d.h index 16e20d8f9b..5520f5006e 100644 --- a/scene/2d/navigation_2d.h +++ b/scene/2d/navigation_2d.h @@ -66,6 +66,7 @@ public: RID get_closest_point_owner(const Vector2 &p_point) const; Navigation2D(); + ~Navigation2D(); }; #endif // NAVIGATION_2D_H diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index d019d72bc9..f5fe113f29 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -74,13 +74,13 @@ void NavigationAgent2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_avoidance_done", "new_velocity"), &NavigationAgent2D::_avoidance_done); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01"), "set_target_desired_distance", "get_target_desired_distance"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.1,500,0.01"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "neighbor_dist", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_neighbor_dist", "get_neighbor_dist"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01"), "set_target_desired_distance", "get_target_desired_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.1,500,0.01"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "neighbor_dist", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_neighbor_dist", "get_neighbor_dist"); ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,1"), "set_max_neighbors", "get_max_neighbors"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_horizon", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_time_horizon", "get_time_horizon"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_speed", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_max_speed", "get_max_speed"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "path_max_distance", PROPERTY_HINT_RANGE, "10,100,1"), "set_path_max_distance", "get_path_max_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_horizon", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_time_horizon", "get_time_horizon"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_speed", PROPERTY_HINT_RANGE, "0.1,100000,0.01"), "set_max_speed", "get_max_speed"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_max_distance", PROPERTY_HINT_RANGE, "10,100,1"), "set_path_max_distance", "get_path_max_distance"); ADD_SIGNAL(MethodInfo("path_changed")); ADD_SIGNAL(MethodInfo("target_reached")); diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 678e5f113a..6754c1c9a6 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -503,14 +503,14 @@ void NavigationPolygonInstance::set_navigation_polygon(const Ref<NavigationPolyg } if (navpoly.is_valid()) { - navpoly->disconnect(CoreStringNames::get_singleton()->changed, this, "_navpoly_changed"); + navpoly->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_navpoly_changed"); } navpoly = p_navpoly; Navigation2DServer::get_singleton()->region_set_navpoly(region, p_navpoly); if (navpoly.is_valid()) { - navpoly->connect(CoreStringNames::get_singleton()->changed, this, "_navpoly_changed"); + navpoly->connect_compat(CoreStringNames::get_singleton()->changed, this, "_navpoly_changed"); } _navpoly_changed(); diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 7deebe9b27..df21538609 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -440,14 +440,14 @@ void Node2D::_bind_methods() { ADD_GROUP("Transform", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position"), "set_position", "get_position"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "scale"), "set_scale", "get_scale"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform", PROPERTY_HINT_NONE, "", 0), "set_transform", "get_transform"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_position", PROPERTY_HINT_NONE, "", 0), "set_global_position", "get_global_position"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rotation", PROPERTY_HINT_NONE, "", 0), "set_global_rotation", "get_global_rotation"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rotation_degrees", PROPERTY_HINT_NONE, "", 0), "set_global_rotation_degrees", "get_global_rotation_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rotation", PROPERTY_HINT_NONE, "", 0), "set_global_rotation", "get_global_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rotation_degrees", PROPERTY_HINT_NONE, "", 0), "set_global_rotation_degrees", "get_global_rotation_degrees"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_scale", PROPERTY_HINT_NONE, "", 0), "set_global_scale", "get_global_scale"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform"); diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index d3bc7b6a5a..2ba2fd8f79 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -384,12 +384,12 @@ void Particles2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting"); ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_EXP_RANGE, "1,1000000,1"), "set_amount", "get_amount"); ADD_GROUP("Time", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index d83c163b4c..9ef3d0ca4f 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -134,13 +134,13 @@ void Path2D::_curve_changed() { void Path2D::set_curve(const Ref<Curve2D> &p_curve) { if (curve.is_valid()) { - curve->disconnect("changed", this, "_curve_changed"); + curve->disconnect_compat("changed", this, "_curve_changed"); } curve = p_curve; if (curve.is_valid()) { - curve->connect("changed", this, "_curve_changed"); + curve->connect_compat("changed", this, "_curve_changed"); } _curve_changed(); @@ -308,14 +308,14 @@ void PathFollow2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_lookahead", "lookahead"), &PathFollow2D::set_lookahead); ClassDB::bind_method(D_METHOD("get_lookahead"), &PathFollow2D::get_lookahead); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_lesser,or_greater"), "set_offset", "get_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_lesser,or_greater"), "set_offset", "get_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "h_offset"), "set_h_offset", "get_h_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "v_offset"), "set_v_offset", "get_v_offset"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotate"), "set_rotate", "is_rotating"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cubic_interp"), "set_cubic_interpolation", "get_cubic_interpolation"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lookahead", PROPERTY_HINT_RANGE, "0.001,1024.0,0.001"), "set_lookahead", "get_lookahead"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lookahead", PROPERTY_HINT_RANGE, "0.001,1024.0,0.001"), "set_lookahead", "get_lookahead"); } void PathFollow2D::set_offset(float p_offset) { diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 29bfc39477..aae37014b3 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -192,14 +192,14 @@ real_t StaticBody2D::get_constant_angular_velocity() const { void StaticBody2D::set_physics_material_override(const Ref<PhysicsMaterial> &p_physics_material_override) { if (physics_material_override.is_valid()) { - if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics")) - physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); + if (physics_material_override->is_connected_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics")) + physics_material_override->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); } physics_material_override = p_physics_material_override; if (physics_material_override.is_valid()) { - physics_material_override->connect(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); + physics_material_override->connect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); } _reload_physics_characteristics(); } @@ -221,7 +221,7 @@ void StaticBody2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_reload_physics_characteristics"), &StaticBody2D::_reload_physics_characteristics); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "constant_linear_velocity"), "set_constant_linear_velocity", "get_constant_linear_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "constant_angular_velocity"), "set_constant_angular_velocity", "get_constant_angular_velocity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "constant_angular_velocity"), "set_constant_angular_velocity", "get_constant_angular_velocity"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "physics_material_override", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsMaterial"), "set_physics_material_override", "get_physics_material_override"); } @@ -311,8 +311,8 @@ void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shap //E->get().rc=0; E->get().in_scene = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid)); if (E->get().in_scene) { emit_signal(SceneStringNames::get_singleton()->body_entered, node); } @@ -340,8 +340,8 @@ void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shap if (E->get().shapes.empty()) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); if (in_scene) emit_signal(SceneStringNames::get_singleton()->body_exited, node); } @@ -545,14 +545,14 @@ real_t RigidBody2D::get_weight() const { void RigidBody2D::set_physics_material_override(const Ref<PhysicsMaterial> &p_physics_material_override) { if (physics_material_override.is_valid()) { - if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics")) - physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); + if (physics_material_override->is_connected_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics")) + physics_material_override->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); } physics_material_override = p_physics_material_override; if (physics_material_override.is_valid()) { - physics_material_override->connect(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); + physics_material_override->connect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); } _reload_physics_characteristics(); } @@ -775,8 +775,8 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); } } @@ -906,11 +906,11 @@ void RigidBody2D::_bind_methods() { BIND_VMETHOD(MethodInfo("_integrate_forces", PropertyInfo(Variant::OBJECT, "state", PROPERTY_HINT_RESOURCE_TYPE, "Physics2DDirectBodyState"))); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Rigid,Static,Character,Kinematic"), "set_mode", "get_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "inertia", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", 0), "set_inertia", "get_inertia"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", PROPERTY_USAGE_EDITOR), "set_weight", "get_weight"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inertia", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", 0), "set_inertia", "get_inertia"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", PROPERTY_USAGE_EDITOR), "set_weight", "get_weight"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "physics_material_override", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsMaterial"), "set_physics_material_override", "get_physics_material_override"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_scale", PROPERTY_HINT_RANGE, "-128,128,0.01"), "set_gravity_scale", "get_gravity_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_scale", PROPERTY_HINT_RANGE, "-128,128,0.01"), "set_gravity_scale", "get_gravity_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "custom_integrator"), "set_use_custom_integrator", "is_using_custom_integrator"); ADD_PROPERTY(PropertyInfo(Variant::INT, "continuous_cd", PROPERTY_HINT_ENUM, "Disabled,Cast Ray,Cast Shape"), "set_continuous_collision_detection_mode", "get_continuous_collision_detection_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "contacts_reported", PROPERTY_HINT_RANGE, "0,64,1,or_greater"), "set_max_contacts_reported", "get_max_contacts_reported"); @@ -919,13 +919,13 @@ void RigidBody2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "can_sleep"), "set_can_sleep", "is_able_to_sleep"); ADD_GROUP("Linear", "linear_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "linear_velocity"), "set_linear_velocity", "get_linear_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); ADD_GROUP("Angular", "angular_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_velocity"), "set_angular_velocity", "get_angular_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_velocity"), "set_angular_velocity", "get_angular_velocity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); ADD_GROUP("Applied Forces", "applied_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "applied_force"), "set_applied_force", "get_applied_force"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "applied_torque"), "set_applied_torque", "get_applied_torque"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "applied_torque"), "set_applied_torque", "get_applied_torque"); ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape"))); ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape"))); @@ -1357,7 +1357,7 @@ void KinematicBody2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_direct_state_changed"), &KinematicBody2D::_direct_state_changed); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "motion/sync_to_physics"), "set_sync_to_physics", "is_sync_to_physics_enabled"); } diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 67269134ef..258292e316 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -120,11 +120,11 @@ void Polygon2D::_notification(int p_what) { if (new_skeleton_id != current_skeleton_id) { Object *old_skeleton = ObjectDB::get_instance(current_skeleton_id); if (old_skeleton) { - old_skeleton->disconnect("bone_setup_changed", this, "_skeleton_bone_setup_changed"); + old_skeleton->disconnect_compat("bone_setup_changed", this, "_skeleton_bone_setup_changed"); } if (skeleton_node) { - skeleton_node->connect("bone_setup_changed", this, "_skeleton_bone_setup_changed"); + skeleton_node->connect_compat("bone_setup_changed", this, "_skeleton_bone_setup_changed"); } current_skeleton_id = new_skeleton_id; @@ -700,19 +700,19 @@ void Polygon2D::_bind_methods() { ADD_GROUP("Texture2D", "texture_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "texture_offset"), "set_texture_offset", "get_texture_offset"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "texture_scale"), "set_texture_scale", "get_texture_scale"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "texture_rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater"), "set_texture_rotation_degrees", "get_texture_rotation_degrees"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "texture_rotation", PROPERTY_HINT_NONE, "", 0), "set_texture_rotation", "get_texture_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_rotation_degrees", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater"), "set_texture_rotation_degrees", "get_texture_rotation_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_rotation", PROPERTY_HINT_NONE, "", 0), "set_texture_rotation", "get_texture_rotation"); ADD_GROUP("Lighting", ""); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_normal_map", "get_normal_map"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "specular_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_specular_map", "get_specular_map"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "specular_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_specular_color", "get_specular_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess"); ADD_GROUP("Skeleton", ""); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "skeleton", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Skeleton2D"), "set_skeleton", "get_skeleton"); ADD_GROUP("Invert", "invert_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "invert_enable"), "set_invert", "get_invert"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "invert_border", PROPERTY_HINT_RANGE, "0.1,16384,0.1"), "set_invert_border", "get_invert_border"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "invert_border", PROPERTY_HINT_RANGE, "0.1,16384,0.1"), "set_invert_border", "get_invert_border"); ADD_GROUP("Data", ""); ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon"); diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp index cdeb905c0c..9e95a55d9f 100644 --- a/scene/2d/position_2d.cpp +++ b/scene/2d/position_2d.cpp @@ -96,7 +96,7 @@ void Position2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_gizmo_extents", "extents"), &Position2D::set_gizmo_extents); ClassDB::bind_method(D_METHOD("_get_gizmo_extents"), &Position2D::get_gizmo_extents); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gizmo_extents", PROPERTY_HINT_RANGE, "0,1000,0.1,or_greater", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_INTERNAL), "_set_gizmo_extents", "_get_gizmo_extents"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gizmo_extents", PROPERTY_HINT_RANGE, "0,1000,0.1,or_greater", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_INTERNAL), "_set_gizmo_extents", "_get_gizmo_extents"); } Position2D::Position2D() { diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp index 6f64464cc9..9ebaf23c3a 100644 --- a/scene/2d/skeleton_2d.cpp +++ b/scene/2d/skeleton_2d.cpp @@ -90,7 +90,7 @@ void Bone2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_default_length"), &Bone2D::get_default_length); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "rest"), "set_rest", "get_rest"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "default_length", PROPERTY_HINT_RANGE, "1,1024,1"), "set_default_length", "get_default_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "default_length", PROPERTY_HINT_RANGE, "1,1024,1"), "set_default_length", "get_default_length"); } void Bone2D::set_rest(const Transform2D &p_rest) { diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 2fe39ca104..a5648053c4 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -142,12 +142,12 @@ void Sprite::set_texture(const Ref<Texture2D> &p_texture) { return; if (texture.is_valid()) - texture->disconnect(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); + texture->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); texture = p_texture; if (texture.is_valid()) - texture->connect(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); + texture->connect_compat(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); update(); emit_signal("texture_changed"); @@ -502,7 +502,7 @@ void Sprite::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_normal_map", "get_normal_map"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "specular_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_specular_map", "get_specular_map"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "specular_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_specular_color", "get_specular_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shininess", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_shininess", "get_shininess"); ADD_GROUP("Offset", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset"); diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 57b11fa069..60ad8c7a74 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -177,7 +177,7 @@ void TileMap::_update_quadrant_transform() { void TileMap::set_tileset(const Ref<TileSet> &p_tileset) { if (tile_set.is_valid()) { - tile_set->disconnect("changed", this, "_recreate_quadrants"); + tile_set->disconnect_compat("changed", this, "_recreate_quadrants"); tile_set->remove_change_receptor(this); } @@ -185,7 +185,7 @@ void TileMap::set_tileset(const Ref<TileSet> &p_tileset) { tile_set = p_tileset; if (tile_set.is_valid()) { - tile_set->connect("changed", this, "_recreate_quadrants"); + tile_set->connect_compat("changed", this, "_recreate_quadrants"); tile_set->add_change_receptor(this); } else { clear(); @@ -853,7 +853,7 @@ void TileMap::_set_celld(const Vector2 &p_pos, const Dictionary &p_data) { Variant v_pos_x = p_pos.x, v_pos_y = p_pos.y, v_tile = p_data["id"], v_flip_h = p_data["flip_h"], v_flip_v = p_data["flip_y"], v_transpose = p_data["transpose"], v_autotile_coord = p_data["auto_coord"]; const Variant *args[7] = { &v_pos_x, &v_pos_y, &v_tile, &v_flip_h, &v_flip_v, &v_transpose, &v_autotile_coord }; - Variant::CallError ce; + Callable::CallError ce; call("set_cell", args, 7, ce); } @@ -1909,8 +1909,8 @@ void TileMap::_bind_methods() { ADD_GROUP("Collision", "collision_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collision_use_parent", PROPERTY_HINT_NONE, ""), "set_collision_use_parent", "get_collision_use_parent"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collision_use_kinematic", PROPERTY_HINT_NONE, ""), "set_collision_use_kinematic", "get_collision_use_kinematic"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision_friction", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_collision_friction", "get_collision_friction"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision_bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_collision_bounce", "get_collision_bounce"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision_friction", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_collision_friction", "get_collision_friction"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision_bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_collision_bounce", "get_collision_bounce"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_layer", "get_collision_layer"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_mask", "get_collision_mask"); diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index beff74f496..7ca165985e 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -69,12 +69,12 @@ Ref<BitMap> TouchScreenButton::get_bitmask() const { void TouchScreenButton::set_shape(const Ref<Shape2D> &p_shape) { if (shape.is_valid()) - shape->disconnect("changed", this, "update"); + shape->disconnect_compat("changed", this, "update"); shape = p_shape; if (shape.is_valid()) - shape->connect("changed", this, "update"); + shape->connect_compat("changed", this, "update"); update(); } @@ -404,7 +404,7 @@ void TouchScreenButton::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shape_centered"), "set_shape_centered", "is_shape_centered"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shape_visible"), "set_shape_visible", "is_shape_visible"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "passby_press"), "set_passby_press", "is_passby_press_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "action"), "set_action", "get_action"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "action"), "set_action", "get_action"); ADD_PROPERTY(PropertyInfo(Variant::INT, "visibility_mode", PROPERTY_HINT_ENUM, "Always,TouchScreen Only"), "set_visibility_mode", "get_visibility_mode"); ADD_SIGNAL(MethodInfo("pressed")); diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 0ac725b7dd..3bfaf1f95c 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -224,7 +224,7 @@ void VisibilityEnabler2D::_find_nodes(Node *p_node) { if (add) { - p_node->connect(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed", varray(p_node), CONNECT_ONESHOT); + p_node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed", varray(p_node), CONNECT_ONESHOT); nodes[p_node] = meta; _change_node_state(p_node, false); } @@ -267,7 +267,7 @@ void VisibilityEnabler2D::_notification(int p_what) { if (!visible) _change_node_state(E->key(), true); - E->key()->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed"); + E->key()->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed"); } nodes.clear(); diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 62908e2b0f..265b42ab5e 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -170,8 +170,8 @@ void Area::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, int E->get().rc = 0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid)); if (E->get().in_tree) { emit_signal(SceneStringNames::get_singleton()->body_entered, node); } @@ -197,8 +197,8 @@ void Area::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, int if (E->get().rc == 0) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); if (E->get().in_tree) emit_signal(SceneStringNames::get_singleton()->body_exited, obj); } @@ -244,8 +244,8 @@ void Area::_clear_monitoring() { emit_signal(SceneStringNames::get_singleton()->body_exited, node); - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); } } @@ -274,8 +274,8 @@ void Area::_clear_monitoring() { emit_signal(SceneStringNames::get_singleton()->area_exited, obj); - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree); } } } @@ -363,8 +363,8 @@ void Area::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, int E->get().rc = 0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree, make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree, make_binds(objid)); if (E->get().in_tree) { emit_signal(SceneStringNames::get_singleton()->area_entered, node); } @@ -390,8 +390,8 @@ void Area::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, int if (E->get().rc == 0) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree); if (E->get().in_tree) { emit_signal(SceneStringNames::get_singleton()->area_exited, obj); } @@ -706,11 +706,11 @@ void Area::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "space_override", PROPERTY_HINT_ENUM, "Disabled,Combine,Combine-Replace,Replace,Replace-Combine"), "set_space_override_mode", "get_space_override_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "gravity_point"), "set_gravity_is_point", "is_gravity_a_point"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_distance_scale", PROPERTY_HINT_EXP_RANGE, "0,1024,0.001,or_greater"), "set_gravity_distance_scale", "get_gravity_distance_scale"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "gravity_vec"), "set_gravity_vector", "get_gravity_vector"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_gravity", "get_gravity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_gravity", "get_gravity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_damp", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,128,1"), "set_priority", "get_priority"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitoring"), "set_monitoring", "is_monitoring"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "monitorable"), "set_monitorable", "is_monitorable"); @@ -719,12 +719,12 @@ void Area::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); ADD_GROUP("Audio Bus", "audio_bus_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_bus_override"), "set_audio_bus_override", "is_overriding_audio_bus"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus", "get_audio_bus"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus", "get_audio_bus"); ADD_GROUP("Reverb Bus", "reverb_bus_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reverb_bus_enable"), "set_use_reverb_bus", "is_using_reverb_bus"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "reverb_bus_name", PROPERTY_HINT_ENUM, ""), "set_reverb_bus", "get_reverb_bus"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_amount", "get_reverb_amount"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_uniformity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_uniformity", "get_reverb_uniformity"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "reverb_bus_name", PROPERTY_HINT_ENUM, ""), "set_reverb_bus", "get_reverb_bus"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "reverb_bus_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_amount", "get_reverb_amount"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "reverb_bus_uniformity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_uniformity", "get_reverb_uniformity"); BIND_ENUM_CONSTANT(SPACE_OVERRIDE_DISABLED); BIND_ENUM_CONSTANT(SPACE_OVERRIDE_COMBINE); diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index 8d1556ef1c..bf85a8bd53 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -252,7 +252,7 @@ void ARVRController::_bind_methods() { ClassDB::bind_method(D_METHOD("get_rumble"), &ARVRController::get_rumble); ClassDB::bind_method(D_METHOD("set_rumble", "rumble"), &ARVRController::set_rumble); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rumble", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_rumble", "get_rumble"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rumble", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_rumble", "get_rumble"); ADD_PROPERTY_DEFAULT("rumble", 0.0); ClassDB::bind_method(D_METHOD("get_mesh"), &ARVRController::get_mesh); @@ -544,7 +544,7 @@ String ARVROrigin::get_configuration_warning() const { void ARVROrigin::_bind_methods() { ClassDB::bind_method(D_METHOD("set_world_scale", "world_scale"), &ARVROrigin::set_world_scale); ClassDB::bind_method(D_METHOD("get_world_scale"), &ARVROrigin::get_world_scale); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "world_scale"), "set_world_scale", "get_world_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "world_scale"), "set_world_scale", "get_world_scale"); }; void ARVROrigin::set_tracked_camera(ARVRCamera *p_tracked_camera) { diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index ae70e2e1ac..461ac1748b 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -98,11 +98,18 @@ static const Vector3 speaker_directions[7] = { void AudioStreamPlayer3D::_calc_output_vol(const Vector3 &source_dir, real_t tightness, AudioStreamPlayer3D::Output &output) { unsigned int speaker_count; // only main speakers (no LFE) switch (AudioServer::get_singleton()->get_speaker_mode()) { - default: //fallthrough - case AudioServer::SPEAKER_MODE_STEREO: speaker_count = 2; break; - case AudioServer::SPEAKER_SURROUND_31: speaker_count = 3; break; - case AudioServer::SPEAKER_SURROUND_51: speaker_count = 5; break; - case AudioServer::SPEAKER_SURROUND_71: speaker_count = 7; break; + case AudioServer::SPEAKER_MODE_STEREO: + speaker_count = 2; + break; + case AudioServer::SPEAKER_SURROUND_31: + speaker_count = 3; + break; + case AudioServer::SPEAKER_SURROUND_51: + speaker_count = 5; + break; + case AudioServer::SPEAKER_SURROUND_71: + speaker_count = 7; + break; } Spcap spcap(speaker_count, speaker_directions); //TODO: should only be created/recreated once the speaker mode / speaker positions changes @@ -113,18 +120,19 @@ void AudioStreamPlayer3D::_calc_output_vol(const Vector3 &source_dir, real_t tig case AudioServer::SPEAKER_SURROUND_71: output.vol[3].l = volumes[5]; // side-left output.vol[3].r = volumes[6]; // side-right - //fallthrough + [[fallthrough]]; case AudioServer::SPEAKER_SURROUND_51: output.vol[2].l = volumes[3]; // rear-left output.vol[2].r = volumes[4]; // rear-right - //fallthrough + [[fallthrough]]; case AudioServer::SPEAKER_SURROUND_31: output.vol[1].r = 1.0; // LFE - always full power output.vol[1].l = volumes[2]; // center - //fallthrough + [[fallthrough]]; case AudioServer::SPEAKER_MODE_STEREO: output.vol[0].r = volumes[1]; // front-right output.vol[0].l = volumes[0]; // front-left + break; } } @@ -1004,24 +1012,24 @@ void AudioStreamPlayer3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream"); ADD_PROPERTY(PropertyInfo(Variant::INT, "attenuation_model", PROPERTY_HINT_ENUM, "Inverse,InverseSquare,Log,Disabled"), "set_attenuation_model", "get_attenuation_model"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.1"), "set_unit_size", "get_unit_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.1"), "set_unit_size", "get_unit_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "is_playing"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stream_paused", PROPERTY_HINT_NONE, ""), "set_stream_paused", "get_stream_paused"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_EXP_RANGE, "0,4096,1,or_greater"), "set_max_distance", "get_max_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_distance", PROPERTY_HINT_EXP_RANGE, "0,4096,1,or_greater"), "set_max_distance", "get_max_distance"); ADD_PROPERTY(PropertyInfo(Variant::INT, "out_of_range_mode", PROPERTY_HINT_ENUM, "Mix,Pause"), "set_out_of_range_mode", "get_out_of_range_mode"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask"); ADD_GROUP("Emission Angle", "emission_angle"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emission_angle_enabled"), "set_emission_angle_enabled", "is_emission_angle_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_degrees", PROPERTY_HINT_RANGE, "0.1,90,0.1"), "set_emission_angle", "get_emission_angle"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_filter_attenuation_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_emission_angle_filter_attenuation_db", "get_emission_angle_filter_attenuation_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_angle_degrees", PROPERTY_HINT_RANGE, "0.1,90,0.1"), "set_emission_angle", "get_emission_angle"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_angle_filter_attenuation_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_emission_angle_filter_attenuation_db", "get_emission_angle_filter_attenuation_db"); ADD_GROUP("Attenuation Filter", "attenuation_filter_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_attenuation_filter_db", "get_attenuation_filter_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "attenuation_filter_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_attenuation_filter_db", "get_attenuation_filter_db"); ADD_GROUP("Doppler", "doppler_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Physics"), "set_doppler_tracking", "get_doppler_tracking"); @@ -1068,7 +1076,7 @@ AudioStreamPlayer3D::AudioStreamPlayer3D() { stream_paused_fade_out = false; velocity_tracker.instance(); - AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed"); + AudioServer::get_singleton()->connect_compat("bus_layout_changed", this, "_bus_layout_changed"); set_disable_scale(true); } AudioStreamPlayer3D::~AudioStreamPlayer3D() { diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp index a6b92d5ee6..73b1d450f0 100644 --- a/scene/3d/baked_lightmap.cpp +++ b/scene/3d/baked_lightmap.cpp @@ -174,7 +174,7 @@ void BakedLightmapData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::AABB, "bounds", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_bounds", "get_bounds"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "cell_space_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_cell_space_transform", "get_cell_space_transform"); ADD_PROPERTY(PropertyInfo(Variant::INT, "cell_subdiv", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_cell_subdiv", "get_cell_subdiv"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "octree", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_octree", "get_octree"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "user_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_user_data", "_get_user_data"); } @@ -819,16 +819,16 @@ void BakedLightmap::_bind_methods() { ClassDB::set_method_flags(get_class_static(), _scs_create("debug_bake"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR); ADD_GROUP("Bake", "bake_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_bake_cell_size", "get_bake_cell_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_bake_cell_size", "get_bake_cell_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_quality", PROPERTY_HINT_ENUM, "Low,Medium,High"), "set_bake_quality", "get_bake_quality"); ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_mode", PROPERTY_HINT_ENUM, "ConeTrace,RayTrace"), "set_bake_mode", "get_bake_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_energy", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_energy", "get_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_energy", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_energy", "get_energy"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "bake_hdr"), "set_hdr", "is_hdr"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "bake_extents"), "set_extents", "get_extents"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_default_texels_per_unit"), "set_bake_default_texels_per_unit", "get_bake_default_texels_per_unit"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_default_texels_per_unit"), "set_bake_default_texels_per_unit", "get_bake_default_texels_per_unit"); ADD_GROUP("Capture", "capture_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "capture_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_capture_cell_size", "get_capture_cell_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "capture_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_capture_cell_size", "get_capture_cell_size"); ADD_GROUP("Data", ""); ADD_PROPERTY(PropertyInfo(Variant::STRING, "image_path", PROPERTY_HINT_DIR), "set_image_path", "get_image_path"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "light_data", PROPERTY_HINT_RESOURCE_TYPE, "BakedLightmapData"), "set_light_data", "get_light_data"); diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp index e94e174b92..b1cd9bfe8b 100644 --- a/scene/3d/bone_attachment.cpp +++ b/scene/3d/bone_attachment.cpp @@ -123,5 +123,5 @@ void BoneAttachment::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bone_name", "bone_name"), &BoneAttachment::set_bone_name); ClassDB::bind_method(D_METHOD("get_bone_name"), &BoneAttachment::get_bone_name); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "bone_name"), "set_bone_name", "get_bone_name"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bone_name"), "set_bone_name", "get_bone_name"); } diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index ac8d50c419..741712025c 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -545,16 +545,16 @@ void Camera::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "cull_mask", PROPERTY_HINT_LAYERS_3D_RENDER), "set_cull_mask", "get_cull_mask"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "effects", PROPERTY_HINT_RESOURCE_TYPE, "CameraEffects"), "set_effects", "get_effects"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "h_offset"), "set_h_offset", "get_h_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "v_offset"), "set_v_offset", "get_v_offset"); ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Physics"), "set_doppler_tracking", "get_doppler_tracking"); ADD_PROPERTY(PropertyInfo(Variant::INT, "projection", PROPERTY_HINT_ENUM, "Perspective,Orthogonal,Frustum"), "set_projection", "get_projection"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "current"), "set_current", "is_current"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fov", PROPERTY_HINT_RANGE, "1,179,0.1"), "set_fov", "get_fov"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "size", PROPERTY_HINT_RANGE, "0.1,16384,0.01"), "set_size", "get_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fov", PROPERTY_HINT_RANGE, "1,179,0.1"), "set_fov", "get_fov"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "size", PROPERTY_HINT_RANGE, "0.1,16384,0.01"), "set_size", "get_size"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "frustum_offset"), "set_frustum_offset", "get_frustum_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "near", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01,or_greater"), "set_znear", "get_znear"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "far", PROPERTY_HINT_EXP_RANGE, "0.1,8192,0.1,or_greater"), "set_zfar", "get_zfar"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "near", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01,or_greater"), "set_znear", "get_znear"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "far", PROPERTY_HINT_EXP_RANGE, "0.1,8192,0.1,or_greater"), "set_zfar", "get_zfar"); BIND_ENUM_CONSTANT(PROJECTION_PERSPECTIVE); BIND_ENUM_CONSTANT(PROJECTION_ORTHOGONAL); @@ -926,7 +926,7 @@ void ClippedCamera::_bind_methods() { ClassDB::bind_method(D_METHOD("clear_exceptions"), &ClippedCamera::clear_exceptions); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "margin", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_margin", "get_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_margin", "get_margin"); ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_mode", "get_process_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index 342159d80f..636b859477 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -191,7 +191,7 @@ void CollisionPolygon::_bind_methods() { ClassDB::bind_method(D_METHOD("_is_editable_3d_polygon"), &CollisionPolygon::_is_editable_3d_polygon); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth"), "set_depth", "get_depth"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth"), "set_depth", "get_depth"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon"); } diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index bf2816fd41..d0d775d557 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -152,12 +152,12 @@ void CollisionShape::set_shape(const Ref<Shape> &p_shape) { if (!shape.is_null()) { shape->unregister_owner(this); - shape->disconnect("changed", this, "_shape_changed"); + shape->disconnect_compat("changed", this, "_shape_changed"); } shape = p_shape; if (!shape.is_null()) { shape->register_owner(this); - shape->connect("changed", this, "_shape_changed"); + shape->connect_compat("changed", this, "_shape_changed"); } update_gizmo(); if (parent) { diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index 552c15c86b..cddbe4bbbb 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -1123,12 +1123,12 @@ void CPUParticles::_set_redraw(bool p_redraw) { update_mutex->lock(); #endif if (redraw) { - VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); + VS::get_singleton()->connect_compat("frame_pre_draw", this, "_update_render_thread"); VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true); VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1); } else { - if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_update_render_thread")) { - VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); + if (VS::get_singleton()->is_connected_compat("frame_pre_draw", this, "_update_render_thread")) { + VS::get_singleton()->disconnect_compat("frame_pre_draw", this, "_update_render_thread"); } VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false); VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0); @@ -1327,13 +1327,13 @@ void CPUParticles::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting"); ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_EXP_RANGE, "1,1000000,1"), "set_amount", "get_amount"); ADD_GROUP("Time", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_EXP_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime", PROPERTY_HINT_EXP_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_EXP_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "preprocess", PROPERTY_HINT_EXP_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); @@ -1401,7 +1401,7 @@ void CPUParticles::_bind_methods() { ADD_GROUP("Emission Shape", "emission_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_shape", PROPERTY_HINT_ENUM, "Point,Sphere,Box,Points,Directed Points"), "set_emission_shape", "get_emission_shape"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "emission_box_extents"), "set_emission_box_extents", "get_emission_box_extents"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "emission_points"), "set_emission_points", "get_emission_points"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "emission_normals"), "set_emission_normals", "get_emission_normals"); @@ -1412,59 +1412,59 @@ void CPUParticles::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_disable_z"), "set_particle_flag", "get_particle_flag", FLAG_DISABLE_Z); ADD_GROUP("Direction", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "direction"), "set_direction", "get_direction"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "flatness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_flatness", "get_flatness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "flatness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_flatness", "get_flatness"); ADD_GROUP("Gravity", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "gravity"), "set_gravity", "get_gravity"); ADD_GROUP("Initial Velocity", "initial_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY); ADD_GROUP("Angular Velocity", "angular_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angular_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANGULAR_VELOCITY); ADD_GROUP("Orbit Velocity", "orbit_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "orbit_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ORBIT_VELOCITY); ADD_GROUP("Linear Accel", "linear_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "linear_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_LINEAR_ACCEL); ADD_GROUP("Radial Accel", "radial_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "radial_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_RADIAL_ACCEL); ADD_GROUP("Tangential Accel", "tangential_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "tangential_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_TANGENTIAL_ACCEL); ADD_GROUP("Damping", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param", "get_param", PARAM_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "damping_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_DAMPING); ADD_GROUP("Angle", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angle_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANGLE); ADD_GROUP("Scale", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_amount", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_amount_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_amount", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_amount_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "scale_amount_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_SCALE); ADD_GROUP("Color", ""); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "color_ramp", PROPERTY_HINT_RESOURCE_TYPE, "Gradient"), "set_color_ramp", "get_color_ramp"); ADD_GROUP("Hue Variation", "hue_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "hue_variation_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_HUE_VARIATION); ADD_GROUP("Animation", "anim_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_speed_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_SPEED); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_OFFSET); BIND_ENUM_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY); diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 918646fd9e..c3f039ae85 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -271,13 +271,13 @@ void GIProbeData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_data", "_get_data"); ADD_PROPERTY(PropertyInfo(Variant::INT, "dynamic_range", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_dynamic_range", "get_dynamic_range"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_energy", "get_energy"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_bias", "get_bias"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "normal_bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_normal_bias", "get_normal_bias"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "anisotropy_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_anisotropy_strength", "get_anisotropy_strength"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ao", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao", "get_ao"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ao_size", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_size", "get_ao_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_energy", "get_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_bias", "get_bias"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "normal_bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_normal_bias", "get_normal_bias"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "anisotropy_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_anisotropy_strength", "get_anisotropy_strength"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ao", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao", "get_ao"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ao_size", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_size", "get_ao_size"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_two_bounces"), "set_use_two_bounces", "is_using_two_bounces"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior"), "set_interior", "is_interior"); } diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index baf5ac4be6..592d592a38 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -144,7 +144,7 @@ void InterpolatedCamera::_bind_methods() { ClassDB::bind_method(D_METHOD("is_interpolation_enabled"), &InterpolatedCamera::is_interpolation_enabled); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "target"), "set_target_path", "get_target_path"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed"), "set_speed", "get_speed"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed"), "set_speed", "get_speed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enabled"), "set_interpolation_enabled", "is_interpolation_enabled"); } diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 90d3f71b95..7c922ce1cd 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -253,17 +253,17 @@ void Light::_bind_methods() { ADD_GROUP("Light", "light_"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "light_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_color", "get_color"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "light_energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_param", "get_param", PARAM_ENERGY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "light_indirect_energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_param", "get_param", PARAM_INDIRECT_ENERGY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "light_energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_param", "get_param", PARAM_ENERGY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "light_indirect_energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_param", "get_param", PARAM_INDIRECT_ENERGY); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "light_negative"), "set_negative", "is_negative"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "light_specular", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_SPECULAR); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "light_specular", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_SPECULAR); ADD_PROPERTY(PropertyInfo(Variant::INT, "light_bake_mode", PROPERTY_HINT_ENUM, "Disable,Indirect,All"), "set_bake_mode", "get_bake_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "light_cull_mask", PROPERTY_HINT_LAYERS_3D_RENDER), "set_cull_mask", "get_cull_mask"); ADD_GROUP("Shadow", "shadow_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_enabled"), "set_shadow", "has_shadow"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_shadow_color", "get_shadow_color"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "shadow_bias", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "shadow_contact", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_CONTACT_SHADOW_SIZE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "shadow_bias", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "shadow_contact", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_CONTACT_SHADOW_SIZE); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_reverse_cull_face"), "set_shadow_reverse_cull_face", "get_shadow_reverse_cull_face"); ADD_GROUP("Editor", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_only"), "set_editor_only", "is_editor_only"); @@ -393,15 +393,15 @@ void DirectionalLight::_bind_methods() { ADD_GROUP("Directional Shadow", "directional_shadow_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "directional_shadow_mode", PROPERTY_HINT_ENUM, "Orthogonal,PSSM 2 Splits,PSSM 4 Splits"), "set_shadow_mode", "get_shadow_mode"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_split_1", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_1_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_split_2", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_2_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_split_3", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_3_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_fade_start", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_SHADOW_FADE_START); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "directional_shadow_split_1", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_1_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "directional_shadow_split_2", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_2_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "directional_shadow_split_3", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_3_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "directional_shadow_fade_start", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_SHADOW_FADE_START); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "directional_shadow_blend_splits"), "set_blend_splits", "is_blend_splits_enabled"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_normal_bias", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_SHADOW_NORMAL_BIAS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_bias_split_scale", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS_SPLIT_SCALE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "directional_shadow_normal_bias", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_SHADOW_NORMAL_BIAS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "directional_shadow_bias_split_scale", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS_SPLIT_SCALE); ADD_PROPERTY(PropertyInfo(Variant::INT, "directional_shadow_depth_range", PROPERTY_HINT_ENUM, "Stable,Optimized"), "set_shadow_depth_range", "get_shadow_depth_range"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_max_distance", PROPERTY_HINT_EXP_RANGE, "0,8192,0.1,or_greater"), "set_param", "get_param", PARAM_SHADOW_MAX_DISTANCE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "directional_shadow_max_distance", PROPERTY_HINT_EXP_RANGE, "0,8192,0.1,or_greater"), "set_param", "get_param", PARAM_SHADOW_MAX_DISTANCE); BIND_ENUM_CONSTANT(SHADOW_ORTHOGONAL); BIND_ENUM_CONSTANT(SHADOW_PARALLEL_2_SPLITS); @@ -442,8 +442,8 @@ void OmniLight::_bind_methods() { ClassDB::bind_method(D_METHOD("get_shadow_mode"), &OmniLight::get_shadow_mode); ADD_GROUP("Omni", "omni_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "omni_range", PROPERTY_HINT_EXP_RANGE, "0,4096,0.1,or_greater"), "set_param", "get_param", PARAM_RANGE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "omni_attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_param", "get_param", PARAM_ATTENUATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "omni_range", PROPERTY_HINT_EXP_RANGE, "0,4096,0.1,or_greater"), "set_param", "get_param", PARAM_RANGE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "omni_attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_param", "get_param", PARAM_ATTENUATION); ADD_PROPERTY(PropertyInfo(Variant::INT, "omni_shadow_mode", PROPERTY_HINT_ENUM, "Dual Paraboloid,Cube"), "set_shadow_mode", "get_shadow_mode"); BIND_ENUM_CONSTANT(SHADOW_DUAL_PARABOLOID); @@ -473,8 +473,8 @@ String SpotLight::get_configuration_warning() const { void SpotLight::_bind_methods() { ADD_GROUP("Spot", "spot_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "spot_range", PROPERTY_HINT_EXP_RANGE, "0,4096,0.1,or_greater"), "set_param", "get_param", PARAM_RANGE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "spot_attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_param", "get_param", PARAM_ATTENUATION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "spot_angle", PROPERTY_HINT_RANGE, "0,180,0.1"), "set_param", "get_param", PARAM_SPOT_ANGLE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "spot_angle_attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_param", "get_param", PARAM_SPOT_ATTENUATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "spot_range", PROPERTY_HINT_EXP_RANGE, "0,4096,0.1,or_greater"), "set_param", "get_param", PARAM_RANGE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "spot_attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_param", "get_param", PARAM_ATTENUATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "spot_angle", PROPERTY_HINT_RANGE, "0,180,0.1"), "set_param", "get_param", PARAM_SPOT_ANGLE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "spot_angle_attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), "set_param", "get_param", PARAM_SPOT_ATTENUATION); } diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 3188a8d5b1..06e1202a24 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -96,7 +96,7 @@ void MeshInstance::_get_property_list(List<PropertyInfo> *p_list) const { ls.sort(); for (List<String>::Element *E = ls.front(); E; E = E->next()) { - p_list->push_back(PropertyInfo(Variant::REAL, E->get(), PROPERTY_HINT_RANGE, "0,1,0.00001")); + p_list->push_back(PropertyInfo(Variant::FLOAT, E->get(), PROPERTY_HINT_RANGE, "0,1,0.00001")); } if (mesh.is_valid()) { @@ -112,7 +112,7 @@ void MeshInstance::set_mesh(const Ref<Mesh> &p_mesh) { return; if (mesh.is_valid()) { - mesh->disconnect(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_mesh_changed); + mesh->disconnect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_mesh_changed); materials.clear(); } @@ -129,7 +129,7 @@ void MeshInstance::set_mesh(const Ref<Mesh> &p_mesh) { blend_shape_tracks["blend_shapes/" + String(mesh->get_blend_shape_name(i))] = mt; } - mesh->connect(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_mesh_changed); + mesh->connect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_mesh_changed); materials.resize(mesh->get_surface_count()); set_base(mesh->get_rid()); diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index f2109a2f33..8c543bc97f 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -94,8 +94,8 @@ void Navigation::_bind_methods() { ClassDB::bind_method(D_METHOD("get_edge_connection_margin"), &Navigation::get_edge_connection_margin); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "up_vector"), "set_up_vector", "get_up_vector"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell_size"), "set_cell_size", "get_cell_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "edge_connection_margin"), "set_edge_connection_margin", "get_edge_connection_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell_size"), "set_cell_size", "get_cell_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "edge_connection_margin"), "set_edge_connection_margin", "get_edge_connection_margin"); } void Navigation::_notification(int p_what) { diff --git a/scene/3d/navigation_agent.cpp b/scene/3d/navigation_agent.cpp index 29cdd6f204..728fc947e9 100644 --- a/scene/3d/navigation_agent.cpp +++ b/scene/3d/navigation_agent.cpp @@ -80,14 +80,14 @@ void NavigationAgent::_bind_methods() { ClassDB::bind_method(D_METHOD("_avoidance_done", "new_velocity"), &NavigationAgent::_avoidance_done); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01"), "set_target_desired_distance", "get_target_desired_distance"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.1,100,0.01"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent_height_offset", PROPERTY_HINT_RANGE, "-100.0,100,0.01"), "set_agent_height_offset", "get_agent_height_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "neighbor_dist", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_neighbor_dist", "get_neighbor_dist"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01"), "set_target_desired_distance", "get_target_desired_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.1,100,0.01"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "agent_height_offset", PROPERTY_HINT_RANGE, "-100.0,100,0.01"), "set_agent_height_offset", "get_agent_height_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "neighbor_dist", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_neighbor_dist", "get_neighbor_dist"); ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,1"), "set_max_neighbors", "get_max_neighbors"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_horizon", PROPERTY_HINT_RANGE, "0.01,100,0.01"), "set_time_horizon", "get_time_horizon"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_speed", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_max_speed", "get_max_speed"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "path_max_distance", PROPERTY_HINT_RANGE, "0.01,100,0.1"), "set_path_max_distance", "get_path_max_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_horizon", PROPERTY_HINT_RANGE, "0.01,100,0.01"), "set_time_horizon", "get_time_horizon"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_speed", PROPERTY_HINT_RANGE, "0.1,10000,0.01"), "set_max_speed", "get_max_speed"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_max_distance", PROPERTY_HINT_RANGE, "0.01,100,0.1"), "set_path_max_distance", "get_path_max_distance"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ignore_y"), "set_ignore_y", "get_ignore_y"); ADD_SIGNAL(MethodInfo("path_changed")); diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 787638053c..e502b0c037 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -386,12 +386,12 @@ void Particles::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting"); ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_EXP_RANGE, "1,1000000,1"), "set_amount", "get_amount"); ADD_GROUP("Time", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_EXP_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime", PROPERTY_HINT_EXP_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_EXP_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "preprocess", PROPERTY_HINT_EXP_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index ac012de1ab..0cdcbd9a1f 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -59,13 +59,13 @@ void Path::_curve_changed() { void Path::set_curve(const Ref<Curve3D> &p_curve) { if (curve.is_valid()) { - curve->disconnect("changed", this, "_curve_changed"); + curve->disconnect_compat("changed", this, "_curve_changed"); } curve = p_curve; if (curve.is_valid()) { - curve->connect("changed", this, "_curve_changed"); + curve->connect_compat("changed", this, "_curve_changed"); } _curve_changed(); } @@ -297,10 +297,10 @@ void PathFollow::_bind_methods() { ClassDB::bind_method(D_METHOD("set_loop", "loop"), &PathFollow::set_loop); ClassDB::bind_method(D_METHOD("has_loop"), &PathFollow::has_loop); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_lesser,or_greater"), "set_offset", "get_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_lesser,or_greater"), "set_offset", "get_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "h_offset"), "set_h_offset", "get_h_offset"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "v_offset"), "set_v_offset", "get_v_offset"); ADD_PROPERTY(PropertyInfo(Variant::INT, "rotation_mode", PROPERTY_HINT_ENUM, "None,Y,XY,XYZ,Oriented"), "set_rotation_mode", "get_rotation_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cubic_interp"), "set_cubic_interpolation", "get_cubic_interpolation"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop"); diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 9848125d0f..f483787e49 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -180,14 +180,14 @@ PhysicsBody::PhysicsBody(PhysicsServer::BodyMode p_mode) : void StaticBody::set_physics_material_override(const Ref<PhysicsMaterial> &p_physics_material_override) { if (physics_material_override.is_valid()) { - if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics")) - physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); + if (physics_material_override->is_connected_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics")) + physics_material_override->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); } physics_material_override = p_physics_material_override; if (physics_material_override.is_valid()) { - physics_material_override->connect(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); + physics_material_override->connect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); } _reload_physics_characteristics(); } @@ -322,8 +322,8 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape, //E->get().rc=0; E->get().in_tree = node && node->is_inside_tree(); if (node) { - node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid)); - node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid)); + node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid)); if (E->get().in_tree) { emit_signal(SceneStringNames::get_singleton()->body_entered, node); } @@ -349,8 +349,8 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape, if (E->get().shapes.empty()) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); if (in_tree) emit_signal(SceneStringNames::get_singleton()->body_exited, node); } @@ -550,14 +550,14 @@ real_t RigidBody::get_weight() const { void RigidBody::set_physics_material_override(const Ref<PhysicsMaterial> &p_physics_material_override) { if (physics_material_override.is_valid()) { - if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics")) - physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); + if (physics_material_override->is_connected_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics")) + physics_material_override->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); } physics_material_override = p_physics_material_override; if (physics_material_override.is_valid()) { - physics_material_override->connect(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); + physics_material_override->connect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"); } _reload_physics_characteristics(); } @@ -738,8 +738,8 @@ void RigidBody::set_contact_monitor(bool p_enabled) { if (node) { - node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree); } } @@ -871,10 +871,10 @@ void RigidBody::_bind_methods() { BIND_VMETHOD(MethodInfo("_integrate_forces", PropertyInfo(Variant::OBJECT, "state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectBodyState"))); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Rigid,Static,Character,Kinematic"), "set_mode", "get_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", PROPERTY_USAGE_EDITOR), "set_weight", "get_weight"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01", PROPERTY_USAGE_EDITOR), "set_weight", "get_weight"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "physics_material_override", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsMaterial"), "set_physics_material_override", "get_physics_material_override"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_scale", PROPERTY_HINT_RANGE, "-128,128,0.01"), "set_gravity_scale", "get_gravity_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_scale", PROPERTY_HINT_RANGE, "-128,128,0.01"), "set_gravity_scale", "get_gravity_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "custom_integrator"), "set_use_custom_integrator", "is_using_custom_integrator"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "continuous_cd"), "set_use_continuous_collision_detection", "is_using_continuous_collision_detection"); ADD_PROPERTY(PropertyInfo(Variant::INT, "contacts_reported", PROPERTY_HINT_RANGE, "0,64,1,or_greater"), "set_max_contacts_reported", "get_max_contacts_reported"); @@ -890,10 +890,10 @@ void RigidBody::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "axis_lock_angular_z"), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_ANGULAR_Z); ADD_GROUP("Linear", "linear_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "linear_velocity"), "set_linear_velocity", "get_linear_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_linear_damp", "get_linear_damp"); ADD_GROUP("Angular", "angular_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "angular_velocity"), "set_angular_velocity", "get_angular_velocity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater"), "set_angular_damp", "get_angular_damp"); ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape"))); ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body", PROPERTY_HINT_RESOURCE_TYPE, "Node"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "local_shape"))); @@ -1297,7 +1297,7 @@ void KinematicBody::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "move_lock_y", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_LINEAR_Y); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "move_lock_z", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_axis_lock", "get_axis_lock", PhysicsServer::BODY_AXIS_LINEAR_Z); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); } void KinematicBody::_direct_state_changed(Object *p_state) { @@ -1514,9 +1514,9 @@ bool PhysicalBone::PinJointData::_get(const StringName &p_name, Variant &r_ret) void PhysicalBone::PinJointData::_get_property_list(List<PropertyInfo> *p_list) const { JointData::_get_property_list(p_list); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/damping", PROPERTY_HINT_RANGE, "0.01,8.0,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/impulse_clamp", PROPERTY_HINT_RANGE, "0.0,64.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/damping", PROPERTY_HINT_RANGE, "0.01,8.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/impulse_clamp", PROPERTY_HINT_RANGE, "0.0,64.0,0.01")); } bool PhysicalBone::ConeJointData::_set(const StringName &p_name, const Variant &p_value, RID j) { @@ -1581,11 +1581,11 @@ bool PhysicalBone::ConeJointData::_get(const StringName &p_name, Variant &r_ret) void PhysicalBone::ConeJointData::_get_property_list(List<PropertyInfo> *p_list) const { JointData::_get_property_list(p_list); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/swing_span", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/twist_span", PROPERTY_HINT_RANGE, "-40000,40000,0.1,or_lesser,or_greater")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/bias", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/relaxation", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/swing_span", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/twist_span", PROPERTY_HINT_RANGE, "-40000,40000,0.1,or_lesser,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/bias", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/relaxation", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); } bool PhysicalBone::HingeJointData::_set(const StringName &p_name, const Variant &p_value, RID j) { @@ -1658,11 +1658,11 @@ void PhysicalBone::HingeJointData::_get_property_list(List<PropertyInfo> *p_list JointData::_get_property_list(p_list); p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/angular_limit_enabled")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_relaxation", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_relaxation", PROPERTY_HINT_RANGE, "0.01,16,0.01")); } bool PhysicalBone::SliderJointData::_set(const StringName &p_name, const Variant &p_value, RID j) { @@ -1762,17 +1762,17 @@ bool PhysicalBone::SliderJointData::_get(const StringName &p_name, Variant &r_re void PhysicalBone::SliderJointData::_get_property_list(List<PropertyInfo> *p_list) const { JointData::_get_property_list(p_list); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_upper")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_lower")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_upper")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_lower")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01")); } bool PhysicalBone::SixDOFJointData::_set(const StringName &p_name, const Variant &p_value, RID j) { @@ -1986,26 +1986,26 @@ void PhysicalBone::SixDOFJointData::_get_property_list(List<PropertyInfo> *p_lis const StringName axis_names[] = { "x", "y", "z" }; for (int i = 0; i < 3; ++i) { p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/linear_limit_enabled")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_limit_upper")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_limit_lower")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_limit_upper")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_limit_lower")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/linear_spring_enabled")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_spring_stiffness")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_spring_damping")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_equilibrium_point")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_spring_stiffness")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_spring_damping")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_equilibrium_point")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01")); p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/angular_limit_enabled")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/erp")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/erp")); p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/angular_spring_enabled")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_spring_stiffness")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_spring_damping")); - p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_equilibrium_point")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_spring_stiffness")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_spring_damping")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_equilibrium_point")); } } @@ -2054,10 +2054,10 @@ void PhysicalBone::_get_property_list(List<PropertyInfo> *p_list) const { names += parent->get_bone_name(i); } - p_list->push_back(PropertyInfo(Variant::STRING, "bone_name", PROPERTY_HINT_ENUM, names)); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "bone_name", PROPERTY_HINT_ENUM, names)); } else { - p_list->push_back(PropertyInfo(Variant::STRING, "bone_name")); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "bone_name")); } if (joint_data) { @@ -2169,11 +2169,11 @@ void PhysicalBone::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "body_offset"), "set_body_offset", "get_body_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_weight", "get_weight"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "friction", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_friction", "get_friction"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_bounce", "get_bounce"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_scale", PROPERTY_HINT_RANGE, "-10,10,0.01"), "set_gravity_scale", "get_gravity_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_weight", "get_weight"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "friction", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_friction", "get_friction"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_bounce", "get_bounce"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gravity_scale", PROPERTY_HINT_RANGE, "-10,10,0.01"), "set_gravity_scale", "get_gravity_scale"); BIND_ENUM_CONSTANT(JOINT_TYPE_NONE); BIND_ENUM_CONSTANT(JOINT_TYPE_PIN); diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index eacc6bcc0f..0699e366e0 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -172,9 +172,9 @@ void PinJoint::_bind_methods() { ClassDB::bind_method(D_METHOD("set_param", "param", "value"), &PinJoint::set_param); ClassDB::bind_method(D_METHOD("get_param", "param"), &PinJoint::get_param); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "params/bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01"), "set_param", "get_param", PARAM_BIAS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "params/damping", PROPERTY_HINT_RANGE, "0.01,8.0,0.01"), "set_param", "get_param", PARAM_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "params/impulse_clamp", PROPERTY_HINT_RANGE, "0.0,64.0,0.01"), "set_param", "get_param", PARAM_IMPULSE_CLAMP); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "params/bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01"), "set_param", "get_param", PARAM_BIAS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "params/damping", PROPERTY_HINT_RANGE, "0.01,8.0,0.01"), "set_param", "get_param", PARAM_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "params/impulse_clamp", PROPERTY_HINT_RANGE, "0.0,64.0,0.01"), "set_param", "get_param", PARAM_IMPULSE_CLAMP); BIND_ENUM_CONSTANT(PARAM_BIAS); BIND_ENUM_CONSTANT(PARAM_DAMPING); @@ -257,18 +257,18 @@ void HingeJoint::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_lower_limit", "lower_limit"), &HingeJoint::_set_lower_limit); ClassDB::bind_method(D_METHOD("_get_lower_limit"), &HingeJoint::_get_lower_limit); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "params/bias", PROPERTY_HINT_RANGE, "0.00,0.99,0.01"), "set_param", "get_param", PARAM_BIAS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "params/bias", PROPERTY_HINT_RANGE, "0.00,0.99,0.01"), "set_param", "get_param", PARAM_BIAS); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_limit/enable"), "set_flag", "get_flag", FLAG_USE_LIMIT); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit/upper", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_upper_limit", "_get_upper_limit"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit/lower", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_lower_limit", "_get_lower_limit"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit/bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01"), "set_param", "get_param", PARAM_LIMIT_BIAS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param", "get_param", PARAM_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit/relaxation", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param", "get_param", PARAM_LIMIT_RELAXATION); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit/upper", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_upper_limit", "_get_upper_limit"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit/lower", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_lower_limit", "_get_lower_limit"); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit/bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01"), "set_param", "get_param", PARAM_LIMIT_BIAS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param", "get_param", PARAM_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit/relaxation", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param", "get_param", PARAM_LIMIT_RELAXATION); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "motor/enable"), "set_flag", "get_flag", FLAG_ENABLE_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "motor/target_velocity", PROPERTY_HINT_RANGE, "-200,200,0.01,or_greater,or_lesser"), "set_param", "get_param", PARAM_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "motor/max_impulse", PROPERTY_HINT_RANGE, "0.01,1024,0.01"), "set_param", "get_param", PARAM_MOTOR_MAX_IMPULSE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "motor/target_velocity", PROPERTY_HINT_RANGE, "-200,200,0.01,or_greater,or_lesser"), "set_param", "get_param", PARAM_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "motor/max_impulse", PROPERTY_HINT_RANGE, "0.01,1024,0.01"), "set_param", "get_param", PARAM_MOTOR_MAX_IMPULSE); BIND_ENUM_CONSTANT(PARAM_BIAS); BIND_ENUM_CONSTANT(PARAM_LIMIT_UPPER); @@ -392,29 +392,29 @@ void SliderJoint::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_lower_limit_angular", "lower_limit_angular"), &SliderJoint::_set_lower_limit_angular); ClassDB::bind_method(D_METHOD("_get_lower_limit_angular"), &SliderJoint::_get_lower_limit_angular); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit/upper_distance", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_UPPER); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit/lower_distance", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_LOWER); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motion/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_MOTION_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motion/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_MOTION_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motion/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_MOTION_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_ortho/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_ORTHOGONAL_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_ortho/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_ORTHOGONAL_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_ortho/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_ORTHOGONAL_DAMPING); - - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_upper_limit_angular", "_get_upper_limit_angular"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_lower_limit_angular", "_get_lower_limit_angular"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_LIMIT_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_LIMIT_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motion/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_MOTION_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motion/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_MOTION_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motion/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_MOTION_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_ortho/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_ORTHOGONAL_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_ortho/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_ORTHOGONAL_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_ortho/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_ORTHOGONAL_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit/upper_distance", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_UPPER); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit/lower_distance", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_LOWER); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_LIMIT_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motion/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_MOTION_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motion/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_MOTION_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motion/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_MOTION_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_ortho/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_ORTHOGONAL_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_ortho/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_ORTHOGONAL_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_ortho/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_LINEAR_ORTHOGONAL_DAMPING); + + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_upper_limit_angular", "_get_upper_limit_angular"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_lower_limit_angular", "_get_lower_limit_angular"); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_LIMIT_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_LIMIT_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motion/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_MOTION_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motion/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_MOTION_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motion/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_MOTION_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_ortho/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_ORTHOGONAL_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_ortho/restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_ORTHOGONAL_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_ortho/damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"), "set_param", "get_param", PARAM_ANGULAR_ORTHOGONAL_DAMPING); BIND_ENUM_CONSTANT(PARAM_LINEAR_LIMIT_UPPER); BIND_ENUM_CONSTANT(PARAM_LINEAR_LIMIT_LOWER); @@ -541,12 +541,12 @@ void ConeTwistJoint::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_twist_span", "twist_span"), &ConeTwistJoint::_set_twist_span); ClassDB::bind_method(D_METHOD("_get_twist_span"), &ConeTwistJoint::_get_twist_span); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "swing_span", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_swing_span", "_get_swing_span"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "twist_span", PROPERTY_HINT_RANGE, "-40000,40000,0.1"), "_set_twist_span", "_get_twist_span"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "swing_span", PROPERTY_HINT_RANGE, "-180,180,0.1"), "_set_swing_span", "_get_swing_span"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "twist_span", PROPERTY_HINT_RANGE, "-40000,40000,0.1"), "_set_twist_span", "_get_twist_span"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "bias", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_BIAS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "relaxation", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_RELAXATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "bias", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_BIAS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "relaxation", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"), "set_param", "get_param", PARAM_RELAXATION); BIND_ENUM_CONSTANT(PARAM_SWING_SPAN); BIND_ENUM_CONSTANT(PARAM_TWIST_SPAN); @@ -711,92 +711,92 @@ void Generic6DOFJoint::_bind_methods() { ClassDB::bind_method(D_METHOD("get_precision"), &Generic6DOFJoint::get_precision); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_limit_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_LINEAR_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_x/upper_distance"), "set_param_x", "get_param_x", PARAM_LINEAR_UPPER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_x/lower_distance"), "set_param_x", "get_param_x", PARAM_LINEAR_LOWER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_x/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_x/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_x/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_x/upper_distance"), "set_param_x", "get_param_x", PARAM_LINEAR_UPPER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_x/lower_distance"), "set_param_x", "get_param_x", PARAM_LINEAR_LOWER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_x/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_x/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_x/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_DAMPING); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_motor_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_LINEAR_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_x/target_velocity"), "set_param_x", "get_param_x", PARAM_LINEAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_x/force_limit"), "set_param_x", "get_param_x", PARAM_LINEAR_MOTOR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motor_x/target_velocity"), "set_param_x", "get_param_x", PARAM_LINEAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motor_x/force_limit"), "set_param_x", "get_param_x", PARAM_LINEAR_MOTOR_FORCE_LIMIT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_spring_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_LINEAR_SPRING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_x/stiffness"), "set_param_x", "get_param_x", PARAM_LINEAR_SPRING_STIFFNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_x/damping"), "set_param_x", "get_param_x", PARAM_LINEAR_SPRING_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_x/equilibrium_point"), "set_param_x", "get_param_x", PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_x/stiffness"), "set_param_x", "get_param_x", PARAM_LINEAR_SPRING_STIFFNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_x/damping"), "set_param_x", "get_param_x", PARAM_LINEAR_SPRING_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_x/equilibrium_point"), "set_param_x", "get_param_x", PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_limit_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_ANGULAR_LIMIT); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_x/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_x", "_get_angular_hi_limit_x"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_x/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_x", "_get_angular_lo_limit_x"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_x/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_ANGULAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_x/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_ANGULAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_x/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_ANGULAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_x/force_limit"), "set_param_x", "get_param_x", PARAM_ANGULAR_FORCE_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_x/erp"), "set_param_x", "get_param_x", PARAM_ANGULAR_ERP); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit_x/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_x", "_get_angular_hi_limit_x"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit_x/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_x", "_get_angular_lo_limit_x"); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_x/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_ANGULAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_x/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_ANGULAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_x/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_ANGULAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_x/force_limit"), "set_param_x", "get_param_x", PARAM_ANGULAR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_x/erp"), "set_param_x", "get_param_x", PARAM_ANGULAR_ERP); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motor_x/target_velocity"), "set_param_x", "get_param_x", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motor_x/force_limit"), "set_param_x", "get_param_x", PARAM_ANGULAR_MOTOR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_x/target_velocity"), "set_param_x", "get_param_x", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_x/force_limit"), "set_param_x", "get_param_x", PARAM_ANGULAR_MOTOR_FORCE_LIMIT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_spring_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_ANGULAR_SPRING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_x/stiffness"), "set_param_x", "get_param_x", PARAM_ANGULAR_SPRING_STIFFNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_x/damping"), "set_param_x", "get_param_x", PARAM_ANGULAR_SPRING_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_x/equilibrium_point"), "set_param_x", "get_param_x", PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_x/stiffness"), "set_param_x", "get_param_x", PARAM_ANGULAR_SPRING_STIFFNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_x/damping"), "set_param_x", "get_param_x", PARAM_ANGULAR_SPRING_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_x/equilibrium_point"), "set_param_x", "get_param_x", PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_limit_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_LINEAR_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_y/upper_distance"), "set_param_y", "get_param_y", PARAM_LINEAR_UPPER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_y/lower_distance"), "set_param_y", "get_param_y", PARAM_LINEAR_LOWER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_y/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_y/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_y/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_y/upper_distance"), "set_param_y", "get_param_y", PARAM_LINEAR_UPPER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_y/lower_distance"), "set_param_y", "get_param_y", PARAM_LINEAR_LOWER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_y/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_y/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_y/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_DAMPING); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_motor_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_LINEAR_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_y/target_velocity"), "set_param_y", "get_param_y", PARAM_LINEAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_y/force_limit"), "set_param_y", "get_param_y", PARAM_LINEAR_MOTOR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motor_y/target_velocity"), "set_param_y", "get_param_y", PARAM_LINEAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motor_y/force_limit"), "set_param_y", "get_param_y", PARAM_LINEAR_MOTOR_FORCE_LIMIT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_spring_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_LINEAR_SPRING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_y/stiffness"), "set_param_y", "get_param_y", PARAM_LINEAR_SPRING_STIFFNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_y/damping"), "set_param_y", "get_param_y", PARAM_LINEAR_SPRING_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_y/equilibrium_point"), "set_param_y", "get_param_y", PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_y/stiffness"), "set_param_y", "get_param_y", PARAM_LINEAR_SPRING_STIFFNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_y/damping"), "set_param_y", "get_param_y", PARAM_LINEAR_SPRING_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_y/equilibrium_point"), "set_param_y", "get_param_y", PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_limit_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_ANGULAR_LIMIT); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_y/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_y", "_get_angular_hi_limit_y"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_y/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_y", "_get_angular_lo_limit_y"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_y/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_ANGULAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_y/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_ANGULAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_y/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_ANGULAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_y/force_limit"), "set_param_y", "get_param_y", PARAM_ANGULAR_FORCE_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_y/erp"), "set_param_y", "get_param_y", PARAM_ANGULAR_ERP); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit_y/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_y", "_get_angular_hi_limit_y"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit_y/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_y", "_get_angular_lo_limit_y"); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_y/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_ANGULAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_y/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_ANGULAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_y/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_ANGULAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_y/force_limit"), "set_param_y", "get_param_y", PARAM_ANGULAR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_y/erp"), "set_param_y", "get_param_y", PARAM_ANGULAR_ERP); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motor_y/target_velocity"), "set_param_y", "get_param_y", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motor_y/force_limit"), "set_param_y", "get_param_y", PARAM_ANGULAR_MOTOR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_y/target_velocity"), "set_param_y", "get_param_y", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_y/force_limit"), "set_param_y", "get_param_y", PARAM_ANGULAR_MOTOR_FORCE_LIMIT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_spring_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_ANGULAR_SPRING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_y/stiffness"), "set_param_y", "get_param_y", PARAM_ANGULAR_SPRING_STIFFNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_y/damping"), "set_param_y", "get_param_y", PARAM_ANGULAR_SPRING_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_y/equilibrium_point"), "set_param_y", "get_param_y", PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_y/stiffness"), "set_param_y", "get_param_y", PARAM_ANGULAR_SPRING_STIFFNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_y/damping"), "set_param_y", "get_param_y", PARAM_ANGULAR_SPRING_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_y/equilibrium_point"), "set_param_y", "get_param_y", PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_limit_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_LINEAR_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_z/upper_distance"), "set_param_z", "get_param_z", PARAM_LINEAR_UPPER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_z/lower_distance"), "set_param_z", "get_param_z", PARAM_LINEAR_LOWER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_z/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_z/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_z/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_z/upper_distance"), "set_param_z", "get_param_z", PARAM_LINEAR_UPPER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_z/lower_distance"), "set_param_z", "get_param_z", PARAM_LINEAR_LOWER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_z/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_z/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_limit_z/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_DAMPING); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_motor_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_LINEAR_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_z/target_velocity"), "set_param_z", "get_param_z", PARAM_LINEAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_z/force_limit"), "set_param_z", "get_param_z", PARAM_LINEAR_MOTOR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motor_z/target_velocity"), "set_param_z", "get_param_z", PARAM_LINEAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_motor_z/force_limit"), "set_param_z", "get_param_z", PARAM_LINEAR_MOTOR_FORCE_LIMIT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_spring_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_LINEAR_SPRING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_z/stiffness"), "set_param_z", "get_param_z", PARAM_LINEAR_SPRING_STIFFNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_z/damping"), "set_param_z", "get_param_z", PARAM_LINEAR_SPRING_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_spring_z/equilibrium_point"), "set_param_z", "get_param_z", PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_z/stiffness"), "set_param_z", "get_param_z", PARAM_LINEAR_SPRING_STIFFNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_z/damping"), "set_param_z", "get_param_z", PARAM_LINEAR_SPRING_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_spring_z/equilibrium_point"), "set_param_z", "get_param_z", PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_limit_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_ANGULAR_LIMIT); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_z/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_z", "_get_angular_hi_limit_z"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_z/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_z", "_get_angular_lo_limit_z"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_z/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_ANGULAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_z/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_ANGULAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_z/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_ANGULAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_z/force_limit"), "set_param_z", "get_param_z", PARAM_ANGULAR_FORCE_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_limit_z/erp"), "set_param_z", "get_param_z", PARAM_ANGULAR_ERP); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit_z/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_z", "_get_angular_hi_limit_z"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_limit_z/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_z", "_get_angular_lo_limit_z"); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_z/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_ANGULAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_z/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_ANGULAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_z/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_ANGULAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_z/force_limit"), "set_param_z", "get_param_z", PARAM_ANGULAR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_limit_z/erp"), "set_param_z", "get_param_z", PARAM_ANGULAR_ERP); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motor_z/target_velocity"), "set_param_z", "get_param_z", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_motor_z/force_limit"), "set_param_z", "get_param_z", PARAM_ANGULAR_MOTOR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_z/target_velocity"), "set_param_z", "get_param_z", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_z/force_limit"), "set_param_z", "get_param_z", PARAM_ANGULAR_MOTOR_FORCE_LIMIT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_spring_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_ANGULAR_SPRING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_z/stiffness"), "set_param_z", "get_param_z", PARAM_ANGULAR_SPRING_STIFFNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_z/damping"), "set_param_z", "get_param_z", PARAM_ANGULAR_SPRING_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_spring_z/equilibrium_point"), "set_param_z", "get_param_z", PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_z/stiffness"), "set_param_z", "get_param_z", PARAM_ANGULAR_SPRING_STIFFNESS); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_z/damping"), "set_param_z", "get_param_z", PARAM_ANGULAR_SPRING_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_spring_z/equilibrium_point"), "set_param_z", "get_param_z", PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT); ADD_PROPERTY(PropertyInfo(Variant::INT, "precision", PROPERTY_HINT_RANGE, "1,99999,1"), "set_precision", "get_precision"); diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index 0c44f21e76..3cf8e43ec2 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -239,8 +239,8 @@ void ReflectionProbe::_bind_methods() { ClassDB::bind_method(D_METHOD("get_update_mode"), &ReflectionProbe::get_update_mode); ADD_PROPERTY(PropertyInfo(Variant::INT, "update_mode", PROPERTY_HINT_ENUM, "Once,Always"), "set_update_mode", "get_update_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "intensity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_intensity", "get_intensity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_EXP_RANGE, "0,16384,0.1,or_greater"), "set_max_distance", "get_max_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "intensity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_intensity", "get_intensity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_distance", PROPERTY_HINT_EXP_RANGE, "0,16384,0.1,or_greater"), "set_max_distance", "get_max_distance"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "extents"), "set_extents", "get_extents"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "origin_offset"), "set_origin_offset", "get_origin_offset"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "box_projection"), "set_enable_box_projection", "is_box_projection_enabled"); @@ -250,8 +250,8 @@ void ReflectionProbe::_bind_methods() { ADD_GROUP("Interior", "interior_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior_enable"), "set_as_interior", "is_set_as_interior"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "interior_ambient_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_interior_ambient", "get_interior_ambient"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "interior_ambient_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_interior_ambient_energy", "get_interior_ambient_energy"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "interior_ambient_contrib", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_interior_ambient_probe_contribution", "get_interior_ambient_probe_contribution"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "interior_ambient_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_interior_ambient_energy", "get_interior_ambient_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "interior_ambient_contrib", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_interior_ambient_probe_contribution", "get_interior_ambient_probe_contribution"); BIND_ENUM_CONSTANT(UPDATE_ONCE); BIND_ENUM_CONSTANT(UPDATE_ALWAYS); diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index aa5c439f8a..3ef502cfd3 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -41,6 +41,7 @@ void SkinReference::_skin_changed() { if (skeleton_node) { skeleton_node->_make_dirty(); } + skeleton_version = 0; } void SkinReference::_bind_methods() { @@ -322,10 +323,49 @@ void Skeleton::_notification(int p_what) { if (E->get()->bind_count != bind_count) { VS::get_singleton()->skeleton_allocate(skeleton, bind_count); E->get()->bind_count = bind_count; + E->get()->skin_bone_indices.resize(bind_count); + E->get()->skin_bone_indices_ptrs = E->get()->skin_bone_indices.ptrw(); + } + + if (E->get()->skeleton_version != version) { + + for (uint32_t i = 0; i < bind_count; i++) { + StringName bind_name = skin->get_bind_name(i); + + if (bind_name != StringName()) { + //bind name used, use this + bool found = false; + for (int j = 0; j < len; j++) { + if (bonesptr[j].name == bind_name) { + E->get()->skin_bone_indices_ptrs[i] = j; + found = true; + break; + } + } + + if (!found) { + ERR_PRINT("Skin bind #" + itos(i) + " contains named bind '" + String(bind_name) + "' but Skeleton has no bone by that name."); + E->get()->skin_bone_indices_ptrs[i] = 0; + } + } else if (skin->get_bind_bone(i) >= 0) { + int bind_index = skin->get_bind_bone(i); + if (bind_index >= len) { + ERR_PRINT("Skin bind #" + itos(i) + " contains bone index bind: " + itos(bind_index) + " , which is greater than the skeleton bone count: " + itos(len) + "."); + E->get()->skin_bone_indices_ptrs[i] = 0; + } else { + E->get()->skin_bone_indices_ptrs[i] = bind_index; + } + } else { + ERR_PRINT("Skin bind #" + itos(i) + " does not contain a name nor a bone index."); + E->get()->skin_bone_indices_ptrs[i] = 0; + } + } + + E->get()->skeleton_version = version; } for (uint32_t i = 0; i < bind_count; i++) { - uint32_t bone_index = skin->get_bind_bone(i); + uint32_t bone_index = E->get()->skin_bone_indices_ptrs[i]; ERR_CONTINUE(bone_index >= (uint32_t)len); vs->skeleton_bone_set_transform(skeleton, i, bonesptr[bone_index].pose_global * skin->get_bind_pose(i)); } @@ -388,6 +428,7 @@ void Skeleton::add_bone(const String &p_name) { b.name = p_name; bones.push_back(b); process_order_dirty = true; + version++; _make_dirty(); update_gizmo(); } @@ -539,7 +580,7 @@ void Skeleton::clear_bones() { bones.clear(); process_order_dirty = true; - + version++; _make_dirty(); } @@ -733,7 +774,8 @@ void Skeleton::physical_bones_start_simulation_on(const Array &p_bones) { sim_bones.resize(p_bones.size()); int c = 0; for (int i = sim_bones.size() - 1; 0 <= i; --i) { - if (Variant::STRING == p_bones.get(i).get_type()) { + Variant::Type type = p_bones.get(i).get_type(); + if (Variant::STRING == type || Variant::STRING_NAME == type) { int bone_id = find_bone(p_bones.get(i)); if (bone_id != -1) sim_bones.write[c++] = bone_id; @@ -829,7 +871,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"); + skin->connect_compat("changed", skin_ref.operator->(), "_skin_changed"); _make_dirty(); //skin needs to be updated, so update skeleton @@ -894,6 +936,7 @@ Skeleton::Skeleton() { animate_physical_bones = true; dirty = false; + version = 1; process_order_dirty = true; } diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h index b42c2112e3..76fd96f30a 100644 --- a/scene/3d/skeleton.h +++ b/scene/3d/skeleton.h @@ -51,6 +51,9 @@ class SkinReference : public Reference { RID skeleton; Ref<Skin> skin; uint32_t bind_count = 0; + uint64_t skeleton_version = 0; + Vector<uint32_t> skin_bone_indices; + uint32_t *skin_bone_indices_ptrs; void _skin_changed(); protected: @@ -123,6 +126,8 @@ private: void _make_dirty(); bool dirty; + uint64_t version; + // bind helpers Array _get_bound_child_nodes_to_bone(int p_bone) const { diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp index c297bd2c80..14b1c24fa3 100644 --- a/scene/3d/soft_body.cpp +++ b/scene/3d/soft_body.cpp @@ -174,7 +174,7 @@ void SoftBody::_get_property_list(List<PropertyInfo> *p_list) const { const int pinned_points_indices_size = pinned_points.size(); - p_list->push_back(PropertyInfo(Variant::PACKED_INT_ARRAY, "pinned_points")); + p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "pinned_points")); for (int i = 0; i < pinned_points_indices_size; ++i) { p_list->push_back(PropertyInfo(Variant::INT, "attachments/" + itos(i) + "/point_index")); @@ -376,14 +376,14 @@ void SoftBody::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "parent_collision_ignore", PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE, "Parent collision object"), "set_parent_collision_ignore", "get_parent_collision_ignore"); ADD_PROPERTY(PropertyInfo(Variant::INT, "simulation_precision", PROPERTY_HINT_RANGE, "1,100,1"), "set_simulation_precision", "get_simulation_precision"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "total_mass", PROPERTY_HINT_RANGE, "0.01,10000,1"), "set_total_mass", "get_total_mass"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "linear_stiffness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_linear_stiffness", "get_linear_stiffness"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "areaAngular_stiffness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_areaAngular_stiffness", "get_areaAngular_stiffness"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume_stiffness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_volume_stiffness", "get_volume_stiffness"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pressure_coefficient"), "set_pressure_coefficient", "get_pressure_coefficient"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_damping_coefficient", "get_damping_coefficient"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "drag_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_coefficient", "get_drag_coefficient"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pose_matching_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_pose_matching_coefficient", "get_pose_matching_coefficient"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "total_mass", PROPERTY_HINT_RANGE, "0.01,10000,1"), "set_total_mass", "get_total_mass"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_stiffness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_linear_stiffness", "get_linear_stiffness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "areaAngular_stiffness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_areaAngular_stiffness", "get_areaAngular_stiffness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume_stiffness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_volume_stiffness", "get_volume_stiffness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pressure_coefficient"), "set_pressure_coefficient", "get_pressure_coefficient"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "damping_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_damping_coefficient", "get_damping_coefficient"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "drag_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drag_coefficient", "get_drag_coefficient"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pose_matching_coefficient", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_pose_matching_coefficient", "get_pose_matching_coefficient"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ray_pickable"), "set_ray_pickable", "is_ray_pickable"); } @@ -464,12 +464,12 @@ void SoftBody::prepare_physics_server() { become_mesh_owner(); PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, get_mesh()); - VS::get_singleton()->connect("frame_pre_draw", this, "_draw_soft_mesh"); + VS::get_singleton()->connect_compat("frame_pre_draw", this, "_draw_soft_mesh"); } else { PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, NULL); - if (VS::get_singleton()->is_connected("frame_pre_draw", this, "_draw_soft_mesh")) { - VS::get_singleton()->disconnect("frame_pre_draw", this, "_draw_soft_mesh"); + if (VS::get_singleton()->is_connected_compat("frame_pre_draw", this, "_draw_soft_mesh")) { + VS::get_singleton()->disconnect_compat("frame_pre_draw", this, "_draw_soft_mesh"); } } } diff --git a/scene/3d/spring_arm.cpp b/scene/3d/spring_arm.cpp index bce0535d64..ce277dae5b 100644 --- a/scene/3d/spring_arm.cpp +++ b/scene/3d/spring_arm.cpp @@ -81,8 +81,8 @@ void SpringArm::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"), "set_shape", "get_shape"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "spring_length"), "set_length", "get_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "margin"), "set_margin", "get_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spring_length"), "set_length", "get_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin"), "set_margin", "get_margin"); } float SpringArm::get_length() const { diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 7351b87078..0aa404de7d 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -342,8 +342,8 @@ void SpriteBase3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_h"), "set_flip_h", "is_flipped_h"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_v"), "set_flip_v", "is_flipped_v"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "modulate"), "set_modulate", "get_modulate"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "opacity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_opacity", "get_opacity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pixel_size", PROPERTY_HINT_RANGE, "0.0001,128,0.0001"), "set_pixel_size", "get_pixel_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "opacity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_opacity", "get_opacity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pixel_size", PROPERTY_HINT_RANGE, "0.0001,128,0.0001"), "set_pixel_size", "get_pixel_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "axis", PROPERTY_HINT_ENUM, "X-Axis,Y-Axis,Z-Axis"), "set_axis", "get_axis"); ADD_GROUP("Flags", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "billboard", PROPERTY_HINT_ENUM, "Disabled,Enabled,Y-Billboard"), "set_billboard_mode", "get_billboard_mode"); @@ -531,11 +531,11 @@ void Sprite3D::set_texture(const Ref<Texture2D> &p_texture) { if (p_texture == texture) return; if (texture.is_valid()) { - texture->disconnect(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update); + texture->disconnect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update); } texture = p_texture; if (texture.is_valid()) { - texture->connect(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update); + texture->connect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update); } _queue_update(); } @@ -952,10 +952,10 @@ void AnimatedSprite3D::_notification(int p_what) { void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) { if (frames.is_valid()) - frames->disconnect("changed", this, "_res_changed"); + frames->disconnect_compat("changed", this, "_res_changed"); frames = p_frames; if (frames.is_valid()) - frames->connect("changed", this, "_res_changed"); + frames->connect_compat("changed", this, "_res_changed"); if (!frames.is_valid()) { frame = 0; @@ -1130,7 +1130,7 @@ void AnimatedSprite3D::_bind_methods() { ADD_SIGNAL(MethodInfo("frame_changed")); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation"), "set_animation", "get_animation"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "animation"), "set_animation", "get_animation"); ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing"), "_set_playing", "_is_playing"); } diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 52e50aa84e..c249d844d1 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -282,24 +282,24 @@ void VehicleWheel::_bind_methods() { ClassDB::bind_method(D_METHOD("get_steering"), &VehicleWheel::get_steering); ADD_GROUP("Per-Wheel Motion", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "engine_force", PROPERTY_HINT_RANGE, "0.00,1024.0,0.01,or_greater"), "set_engine_force", "get_engine_force"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "brake", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_brake", "get_brake"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "steering", PROPERTY_HINT_RANGE, "-180,180.0,0.01"), "set_steering", "get_steering"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "engine_force", PROPERTY_HINT_RANGE, "0.00,1024.0,0.01,or_greater"), "set_engine_force", "get_engine_force"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "brake", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_brake", "get_brake"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "steering", PROPERTY_HINT_RANGE, "-180,180.0,0.01"), "set_steering", "get_steering"); ADD_GROUP("VehicleBody Motion", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_as_traction"), "set_use_as_traction", "is_used_as_traction"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_as_steering"), "set_use_as_steering", "is_used_as_steering"); ADD_GROUP("Wheel", "wheel_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wheel_roll_influence"), "set_roll_influence", "get_roll_influence"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wheel_radius"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wheel_rest_length"), "set_suspension_rest_length", "get_suspension_rest_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wheel_friction_slip"), "set_friction_slip", "get_friction_slip"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wheel_roll_influence"), "set_roll_influence", "get_roll_influence"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wheel_radius"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wheel_rest_length"), "set_suspension_rest_length", "get_suspension_rest_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wheel_friction_slip"), "set_friction_slip", "get_friction_slip"); ADD_GROUP("Suspension", "suspension_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "suspension_travel"), "set_suspension_travel", "get_suspension_travel"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "suspension_stiffness"), "set_suspension_stiffness", "get_suspension_stiffness"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "suspension_max_force"), "set_suspension_max_force", "get_suspension_max_force"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "suspension_travel"), "set_suspension_travel", "get_suspension_travel"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "suspension_stiffness"), "set_suspension_stiffness", "get_suspension_stiffness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "suspension_max_force"), "set_suspension_max_force", "get_suspension_max_force"); ADD_GROUP("Damping", "damping_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping_compression"), "set_damping_compression", "get_damping_compression"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping_relaxation"), "set_damping_relaxation", "get_damping_relaxation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "damping_compression"), "set_damping_compression", "get_damping_compression"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "damping_relaxation"), "set_damping_relaxation", "get_damping_relaxation"); } void VehicleWheel::set_engine_force(float p_engine_force) { @@ -974,9 +974,9 @@ void VehicleBody::_bind_methods() { ClassDB::bind_method(D_METHOD("get_steering"), &VehicleBody::get_steering); ADD_GROUP("Motion", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "engine_force", PROPERTY_HINT_RANGE, "0.00,1024.0,0.01,or_greater"), "set_engine_force", "get_engine_force"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "brake", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_brake", "get_brake"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "steering", PROPERTY_HINT_RANGE, "-180,180.0,0.01"), "set_steering", "get_steering"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "engine_force", PROPERTY_HINT_RANGE, "0.00,1024.0,0.01,or_greater"), "set_engine_force", "get_engine_force"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "brake", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_brake", "get_brake"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "steering", PROPERTY_HINT_RANGE, "-180,180.0,0.01"), "set_steering", "get_steering"); } VehicleBody::VehicleBody() { diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index 510442dc1c..3bf9584258 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -170,7 +170,7 @@ void VisibilityEnabler::_find_nodes(Node *p_node) { if (add) { - p_node->connect(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed", varray(p_node), CONNECT_ONESHOT); + p_node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed", varray(p_node), CONNECT_ONESHOT); nodes[p_node] = meta; _change_node_state(p_node, false); } @@ -208,7 +208,7 @@ void VisibilityEnabler::_notification(int p_what) { if (!visible) _change_node_state(E->key(), true); - E->key()->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed"); + E->key()->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed"); } nodes.clear(); diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 5a332fe0f9..73cffe9c89 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -296,7 +296,7 @@ void GeometryInstance::_bind_methods() { ADD_GROUP("Geometry", ""); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_override", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D"), "set_material_override", "get_material_override"); ADD_PROPERTY(PropertyInfo(Variant::INT, "cast_shadow", PROPERTY_HINT_ENUM, "Off,On,Double-Sided,Shadows Only"), "set_cast_shadows_setting", "get_cast_shadows_setting"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "extra_cull_margin", PROPERTY_HINT_RANGE, "0,16384,0.01"), "set_extra_cull_margin", "get_extra_cull_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "extra_cull_margin", PROPERTY_HINT_RANGE, "0,16384,0.01"), "set_extra_cull_margin", "get_extra_cull_margin"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "use_in_baked_light"), "set_flag", "get_flag", FLAG_USE_BAKED_LIGHT); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "use_dynamic_gi"), "set_flag", "get_flag", FLAG_USE_DYNAMIC_GI); diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp index 0f55682427..93ebf88edb 100644 --- a/scene/animation/animation_blend_space_1d.cpp +++ b/scene/animation/animation_blend_space_1d.cpp @@ -31,7 +31,7 @@ #include "animation_blend_space_1d.h" void AnimationNodeBlendSpace1D::get_parameter_list(List<PropertyInfo> *r_list) const { - r_list->push_back(PropertyInfo(Variant::REAL, blend_position)); + r_list->push_back(PropertyInfo(Variant::FLOAT, blend_position)); } Variant AnimationNodeBlendSpace1D::get_parameter_default_value(const StringName &p_parameter) const { return 0; @@ -83,12 +83,12 @@ void AnimationNodeBlendSpace1D::_bind_methods() { for (int i = 0; i < MAX_BLEND_POINTS; i++) { ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "blend_point_" + itos(i) + "/node", PROPERTY_HINT_RESOURCE_TYPE, "AnimationRootNode", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_add_blend_point", "get_blend_point_node", i); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "blend_point_" + itos(i) + "/pos", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_blend_point_position", "get_blend_point_position", i); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "blend_point_" + itos(i) + "/pos", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_blend_point_position", "get_blend_point_position", i); } - ADD_PROPERTY(PropertyInfo(Variant::REAL, "min_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_min_space", "get_min_space"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_max_space", "get_max_space"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "snap", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_snap", "get_snap"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "min_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_min_space", "get_min_space"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_max_space", "get_max_space"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "snap", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_snap", "get_snap"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "value_label", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_value_label", "get_value_label"); } @@ -118,7 +118,7 @@ void AnimationNodeBlendSpace1D::add_blend_point(const Ref<AnimationRootNode> &p_ blend_points[p_at_index].node = p_node; blend_points[p_at_index].position = p_position; - blend_points[p_at_index].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); + blend_points[p_at_index].node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); blend_points_used++; emit_signal("tree_changed"); @@ -135,11 +135,11 @@ void AnimationNodeBlendSpace1D::set_blend_point_node(int p_point, const Ref<Anim ERR_FAIL_COND(p_node.is_null()); if (blend_points[p_point].node.is_valid()) { - blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed"); + blend_points[p_point].node->disconnect_compat("tree_changed", this, "_tree_changed"); } blend_points[p_point].node = p_node; - blend_points[p_point].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); + blend_points[p_point].node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); emit_signal("tree_changed"); } @@ -158,7 +158,7 @@ void AnimationNodeBlendSpace1D::remove_blend_point(int p_point) { ERR_FAIL_INDEX(p_point, blend_points_used); ERR_FAIL_COND(blend_points[p_point].node.is_null()); - blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed"); + blend_points[p_point].node->disconnect_compat("tree_changed", this, "_tree_changed"); for (int i = p_point; i < blend_points_used - 1; i++) { blend_points[i] = blend_points[i + 1]; diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index 0eb8203419..15ecf9fa1e 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -34,7 +34,7 @@ void AnimationNodeBlendSpace2D::get_parameter_list(List<PropertyInfo> *r_list) const { r_list->push_back(PropertyInfo(Variant::VECTOR2, blend_position)); r_list->push_back(PropertyInfo(Variant::INT, closest, PROPERTY_HINT_NONE, "", 0)); - r_list->push_back(PropertyInfo(Variant::REAL, length_internal, PROPERTY_HINT_NONE, "", 0)); + r_list->push_back(PropertyInfo(Variant::FLOAT, length_internal, PROPERTY_HINT_NONE, "", 0)); } Variant AnimationNodeBlendSpace2D::get_parameter_default_value(const StringName &p_parameter) const { if (p_parameter == closest) { @@ -77,7 +77,7 @@ void AnimationNodeBlendSpace2D::add_blend_point(const Ref<AnimationRootNode> &p_ blend_points[p_at_index].node = p_node; blend_points[p_at_index].position = p_position; - blend_points[p_at_index].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); + blend_points[p_at_index].node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); blend_points_used++; _queue_auto_triangles(); @@ -95,10 +95,10 @@ void AnimationNodeBlendSpace2D::set_blend_point_node(int p_point, const Ref<Anim ERR_FAIL_COND(p_node.is_null()); if (blend_points[p_point].node.is_valid()) { - blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed"); + blend_points[p_point].node->disconnect_compat("tree_changed", this, "_tree_changed"); } blend_points[p_point].node = p_node; - blend_points[p_point].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); + blend_points[p_point].node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); emit_signal("tree_changed"); } @@ -114,7 +114,7 @@ void AnimationNodeBlendSpace2D::remove_blend_point(int p_point) { ERR_FAIL_INDEX(p_point, blend_points_used); ERR_FAIL_COND(blend_points[p_point].node.is_null()); - blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed"); + blend_points[p_point].node->disconnect_compat("tree_changed", this, "_tree_changed"); for (int i = 0; i < triangles.size(); i++) { bool erase = false; @@ -650,7 +650,7 @@ void AnimationNodeBlendSpace2D::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::VECTOR2, "blend_point_" + itos(i) + "/pos", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_blend_point_position", "get_blend_point_position", i); } - ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT_ARRAY, "triangles", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_triangles", "_get_triangles"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT32_ARRAY, "triangles", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_triangles", "_get_triangles"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "min_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_min_space", "get_min_space"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "max_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_max_space", "get_max_space"); diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index 5c284cb483..1c99920569 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -44,7 +44,7 @@ StringName AnimationNodeAnimation::get_animation() const { Vector<String> (*AnimationNodeAnimation::get_editable_animation_list)() = NULL; void AnimationNodeAnimation::get_parameter_list(List<PropertyInfo> *r_list) const { - r_list->push_back(PropertyInfo(Variant::REAL, time, PROPERTY_HINT_NONE, "", 0)); + r_list->push_back(PropertyInfo(Variant::FLOAT, time, PROPERTY_HINT_NONE, "", 0)); } void AnimationNodeAnimation::_validate_property(PropertyInfo &property) const { @@ -126,7 +126,7 @@ void AnimationNodeAnimation::_bind_methods() { ClassDB::bind_method(D_METHOD("set_animation", "name"), &AnimationNodeAnimation::set_animation); ClassDB::bind_method(D_METHOD("get_animation"), &AnimationNodeAnimation::get_animation); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation"), "set_animation", "get_animation"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "animation"), "set_animation", "get_animation"); } AnimationNodeAnimation::AnimationNodeAnimation() { @@ -140,9 +140,9 @@ AnimationNodeAnimation::AnimationNodeAnimation() { void AnimationNodeOneShot::get_parameter_list(List<PropertyInfo> *r_list) const { r_list->push_back(PropertyInfo(Variant::BOOL, active)); r_list->push_back(PropertyInfo(Variant::BOOL, prev_active, PROPERTY_HINT_NONE, "", 0)); - r_list->push_back(PropertyInfo(Variant::REAL, time, PROPERTY_HINT_NONE, "", 0)); - r_list->push_back(PropertyInfo(Variant::REAL, remaining, PROPERTY_HINT_NONE, "", 0)); - r_list->push_back(PropertyInfo(Variant::REAL, time_to_restart, PROPERTY_HINT_NONE, "", 0)); + r_list->push_back(PropertyInfo(Variant::FLOAT, time, PROPERTY_HINT_NONE, "", 0)); + r_list->push_back(PropertyInfo(Variant::FLOAT, remaining, PROPERTY_HINT_NONE, "", 0)); + r_list->push_back(PropertyInfo(Variant::FLOAT, time_to_restart, PROPERTY_HINT_NONE, "", 0)); } Variant AnimationNodeOneShot::get_parameter_default_value(const StringName &p_parameter) const { @@ -339,14 +339,14 @@ void AnimationNodeOneShot::_bind_methods() { ClassDB::bind_method(D_METHOD("set_use_sync", "enable"), &AnimationNodeOneShot::set_use_sync); ClassDB::bind_method(D_METHOD("is_using_sync"), &AnimationNodeOneShot::is_using_sync); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fadein_time", PROPERTY_HINT_RANGE, "0,60,0.01,or_greater"), "set_fadein_time", "get_fadein_time"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fadeout_time", PROPERTY_HINT_RANGE, "0,60,0.01,or_greater"), "set_fadeout_time", "get_fadeout_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fadein_time", PROPERTY_HINT_RANGE, "0,60,0.01,or_greater"), "set_fadein_time", "get_fadein_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fadeout_time", PROPERTY_HINT_RANGE, "0,60,0.01,or_greater"), "set_fadeout_time", "get_fadeout_time"); ADD_GROUP("autorestart_", "Auto Restart"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autorestart"), "set_autorestart", "has_autorestart"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "autorestart_delay", PROPERTY_HINT_RANGE, "0,60,0.01,or_greater"), "set_autorestart_delay", "get_autorestart_delay"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "autorestart_random_delay", PROPERTY_HINT_RANGE, "0,60,0.01,or_greater"), "set_autorestart_random_delay", "get_autorestart_random_delay"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "autorestart_delay", PROPERTY_HINT_RANGE, "0,60,0.01,or_greater"), "set_autorestart_delay", "get_autorestart_delay"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "autorestart_random_delay", PROPERTY_HINT_RANGE, "0,60,0.01,or_greater"), "set_autorestart_random_delay", "get_autorestart_random_delay"); ADD_GROUP("", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sync"), "set_use_sync", "is_using_sync"); @@ -379,7 +379,7 @@ AnimationNodeOneShot::AnimationNodeOneShot() { //////////////////////////////////////////////// void AnimationNodeAdd2::get_parameter_list(List<PropertyInfo> *r_list) const { - r_list->push_back(PropertyInfo(Variant::REAL, add_amount, PROPERTY_HINT_RANGE, "0,1,0.01")); + r_list->push_back(PropertyInfo(Variant::FLOAT, add_amount, PROPERTY_HINT_RANGE, "0,1,0.01")); } Variant AnimationNodeAdd2::get_parameter_default_value(const StringName &p_parameter) const { return 0; @@ -431,7 +431,7 @@ AnimationNodeAdd2::AnimationNodeAdd2() { //////////////////////////////////////////////// void AnimationNodeAdd3::get_parameter_list(List<PropertyInfo> *r_list) const { - r_list->push_back(PropertyInfo(Variant::REAL, add_amount, PROPERTY_HINT_RANGE, "-1,1,0.01")); + r_list->push_back(PropertyInfo(Variant::FLOAT, add_amount, PROPERTY_HINT_RANGE, "-1,1,0.01")); } Variant AnimationNodeAdd3::get_parameter_default_value(const StringName &p_parameter) const { return 0; @@ -484,7 +484,7 @@ AnimationNodeAdd3::AnimationNodeAdd3() { ///////////////////////////////////////////// void AnimationNodeBlend2::get_parameter_list(List<PropertyInfo> *r_list) const { - r_list->push_back(PropertyInfo(Variant::REAL, blend_amount, PROPERTY_HINT_RANGE, "0,1,0.01")); + r_list->push_back(PropertyInfo(Variant::FLOAT, blend_amount, PROPERTY_HINT_RANGE, "0,1,0.01")); } Variant AnimationNodeBlend2::get_parameter_default_value(const StringName &p_parameter) const { return 0; //for blend amount @@ -535,7 +535,7 @@ AnimationNodeBlend2::AnimationNodeBlend2() { ////////////////////////////////////// void AnimationNodeBlend3::get_parameter_list(List<PropertyInfo> *r_list) const { - r_list->push_back(PropertyInfo(Variant::REAL, blend_amount, PROPERTY_HINT_RANGE, "-1,1,0.01")); + r_list->push_back(PropertyInfo(Variant::FLOAT, blend_amount, PROPERTY_HINT_RANGE, "-1,1,0.01")); } Variant AnimationNodeBlend3::get_parameter_default_value(const StringName &p_parameter) const { return 0; //for blend amount @@ -583,7 +583,7 @@ AnimationNodeBlend3::AnimationNodeBlend3() { ///////////////////////////////// void AnimationNodeTimeScale::get_parameter_list(List<PropertyInfo> *r_list) const { - r_list->push_back(PropertyInfo(Variant::REAL, scale, PROPERTY_HINT_RANGE, "0,32,0.01,or_greater")); + r_list->push_back(PropertyInfo(Variant::FLOAT, scale, PROPERTY_HINT_RANGE, "0,32,0.01,or_greater")); } Variant AnimationNodeTimeScale::get_parameter_default_value(const StringName &p_parameter) const { return 1.0; //initial timescale @@ -613,7 +613,7 @@ AnimationNodeTimeScale::AnimationNodeTimeScale() { //////////////////////////////////// void AnimationNodeTimeSeek::get_parameter_list(List<PropertyInfo> *r_list) const { - r_list->push_back(PropertyInfo(Variant::REAL, seek_pos, PROPERTY_HINT_RANGE, "-1,3600,0.01,or_greater")); + r_list->push_back(PropertyInfo(Variant::FLOAT, seek_pos, PROPERTY_HINT_RANGE, "-1,3600,0.01,or_greater")); } Variant AnimationNodeTimeSeek::get_parameter_default_value(const StringName &p_parameter) const { return 1.0; //initial timescale @@ -661,8 +661,8 @@ void AnimationNodeTransition::get_parameter_list(List<PropertyInfo> *r_list) con r_list->push_back(PropertyInfo(Variant::INT, current, PROPERTY_HINT_ENUM, anims)); r_list->push_back(PropertyInfo(Variant::INT, prev_current, PROPERTY_HINT_NONE, "", 0)); r_list->push_back(PropertyInfo(Variant::INT, prev, PROPERTY_HINT_NONE, "", 0)); - r_list->push_back(PropertyInfo(Variant::REAL, time, PROPERTY_HINT_NONE, "", 0)); - r_list->push_back(PropertyInfo(Variant::REAL, prev_xfading, PROPERTY_HINT_NONE, "", 0)); + r_list->push_back(PropertyInfo(Variant::FLOAT, time, PROPERTY_HINT_NONE, "", 0)); + r_list->push_back(PropertyInfo(Variant::FLOAT, prev_xfading, PROPERTY_HINT_NONE, "", 0)); } Variant AnimationNodeTransition::get_parameter_default_value(const StringName &p_parameter) const { if (p_parameter == time || p_parameter == prev_xfading) { @@ -829,7 +829,7 @@ void AnimationNodeTransition::_bind_methods() { ClassDB::bind_method(D_METHOD("get_cross_fade_time"), &AnimationNodeTransition::get_cross_fade_time); ADD_PROPERTY(PropertyInfo(Variant::INT, "input_count", PROPERTY_HINT_RANGE, "0,64,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "set_enabled_inputs", "get_enabled_inputs"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "xfade_time", PROPERTY_HINT_RANGE, "0,120,0.01"), "set_cross_fade_time", "get_cross_fade_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "xfade_time", PROPERTY_HINT_RANGE, "0,120,0.01"), "set_cross_fade_time", "get_cross_fade_time"); for (int i = 0; i < MAX_INPUTS; i++) { ADD_PROPERTYI(PropertyInfo(Variant::STRING, "input_" + itos(i) + "/name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_input_caption", "get_input_caption", i); @@ -884,8 +884,8 @@ void AnimationNodeBlendTree::add_node(const StringName &p_name, Ref<AnimationNod emit_changed(); emit_signal("tree_changed"); - p_node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); - p_node->connect("changed", this, "_node_changed", varray(p_name), CONNECT_REFERENCE_COUNTED); + p_node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); + p_node->connect_compat("changed", this, "_node_changed", varray(p_name), CONNECT_REFERENCE_COUNTED); } Ref<AnimationNode> AnimationNodeBlendTree::get_node(const StringName &p_name) const { @@ -947,8 +947,8 @@ void AnimationNodeBlendTree::remove_node(const StringName &p_name) { { Ref<AnimationNode> node = nodes[p_name].node; - node->disconnect("tree_changed", this, "_tree_changed"); - node->disconnect("changed", this, "_node_changed"); + node->disconnect_compat("tree_changed", this, "_tree_changed"); + node->disconnect_compat("changed", this, "_node_changed"); } nodes.erase(p_name); @@ -973,7 +973,7 @@ void AnimationNodeBlendTree::rename_node(const StringName &p_name, const StringN ERR_FAIL_COND(p_name == SceneStringNames::get_singleton()->output); ERR_FAIL_COND(p_new_name == SceneStringNames::get_singleton()->output); - nodes[p_name].node->disconnect("changed", this, "_node_changed"); + nodes[p_name].node->disconnect_compat("changed", this, "_node_changed"); nodes[p_new_name] = nodes[p_name]; nodes.erase(p_name); @@ -988,7 +988,7 @@ void AnimationNodeBlendTree::rename_node(const StringName &p_name, const StringN } } //connection must be done with new name - nodes[p_new_name].node->connect("changed", this, "_node_changed", varray(p_new_name), CONNECT_REFERENCE_COUNTED); + nodes[p_new_name].node->connect_compat("changed", this, "_node_changed", varray(p_new_name), CONNECT_REFERENCE_COUNTED); emit_signal("tree_changed"); } diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index 8d1ffb43cc..16b6813bbe 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -56,7 +56,7 @@ void AnimationCache::_clear_cache() { while (connected_nodes.size()) { - connected_nodes.front()->get()->disconnect("tree_exiting", this, "_node_exit_tree"); + connected_nodes.front()->get()->disconnect_compat("tree_exiting", this, "_node_exit_tree"); connected_nodes.erase(connected_nodes.front()); } path_cache.clear(); @@ -174,7 +174,7 @@ void AnimationCache::_update_cache() { if (!connected_nodes.has(path.node)) { connected_nodes.insert(path.node); - path.node->connect("tree_exiting", this, "_node_exit_tree", Node::make_binds(path.node), CONNECT_ONESHOT); + path.node->connect_compat("tree_exiting", this, "_node_exit_tree", Node::make_binds(path.node), CONNECT_ONESHOT); } } @@ -218,7 +218,7 @@ void AnimationCache::set_track_value(int p_idx, const Variant &p_value) { p.object->set_indexed(p.subpath, p_value); } -void AnimationCache::call_track(int p_idx, const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +void AnimationCache::call_track(int p_idx, const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (cache_dirty) _update_cache(); @@ -283,7 +283,7 @@ void AnimationCache::set_all(float p_time, float p_delta) { Vector<Variant> args = animation->method_track_get_params(i, E->get()); StringName name = animation->method_track_get_name(i, E->get()); - Variant::CallError err; + Callable::CallError err; if (!args.size()) { @@ -313,12 +313,12 @@ void AnimationCache::set_animation(const Ref<Animation> &p_animation) { _clear_cache(); if (animation.is_valid()) - animation->disconnect("changed", this, "_animation_changed"); + animation->disconnect_compat("changed", this, "_animation_changed"); animation = p_animation; if (animation.is_valid()) - animation->connect("changed", this, "_animation_changed"); + animation->connect_compat("changed", this, "_animation_changed"); } void AnimationCache::_bind_methods() { diff --git a/scene/animation/animation_cache.h b/scene/animation/animation_cache.h index 26ad9dfee5..e73b9e2498 100644 --- a/scene/animation/animation_cache.h +++ b/scene/animation/animation_cache.h @@ -79,7 +79,7 @@ protected: public: void set_track_transform(int p_idx, const Transform &p_transform); void set_track_value(int p_idx, const Variant &p_value); - void call_track(int p_idx, const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + void call_track(int p_idx, const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); void set_all(float p_time, float p_delta = 0); diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 59d0d9e87f..9c7dd7cdd7 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -120,8 +120,8 @@ void AnimationNodeStateMachineTransition::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "switch_mode", PROPERTY_HINT_ENUM, "Immediate,Sync,AtEnd"), "set_switch_mode", "get_switch_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "auto_advance"), "set_auto_advance", "has_auto_advance"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "advance_condition"), "set_advance_condition", "get_advance_condition"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "xfade_time", PROPERTY_HINT_RANGE, "0,240,0.01"), "set_xfade_time", "get_xfade_time"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "advance_condition"), "set_advance_condition", "get_advance_condition"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "xfade_time", PROPERTY_HINT_RANGE, "0,240,0.01"), "set_xfade_time", "get_xfade_time"); ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,32,1"), "set_priority", "get_priority"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); @@ -562,7 +562,7 @@ void AnimationNodeStateMachine::add_node(const StringName &p_name, Ref<Animation emit_changed(); emit_signal("tree_changed"); - p_node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); + p_node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); } Ref<AnimationNode> AnimationNodeStateMachine::get_node(const StringName &p_name) const { @@ -611,7 +611,7 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) { ERR_FAIL_COND(node.is_null()); - node->disconnect("tree_changed", this, "_tree_changed"); + node->disconnect_compat("tree_changed", this, "_tree_changed"); } states.erase(p_name); @@ -619,7 +619,7 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) { for (int i = 0; i < transitions.size(); i++) { if (transitions[i].from == p_name || transitions[i].to == p_name) { - transitions.write[i].transition->disconnect("advance_condition_changed", this, "_tree_changed"); + transitions.write[i].transition->disconnect_compat("advance_condition_changed", this, "_tree_changed"); transitions.remove(i); i--; } @@ -722,7 +722,7 @@ void AnimationNodeStateMachine::add_transition(const StringName &p_from, const S tr.to = p_to; tr.transition = p_transition; - tr.transition->connect("advance_condition_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); + tr.transition->connect_compat("advance_condition_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED); transitions.push_back(tr); } @@ -750,7 +750,7 @@ void AnimationNodeStateMachine::remove_transition(const StringName &p_from, cons for (int i = 0; i < transitions.size(); i++) { if (transitions[i].from == p_from && transitions[i].to == p_to) { - transitions.write[i].transition->disconnect("advance_condition_changed", this, "_tree_changed"); + transitions.write[i].transition->disconnect_compat("advance_condition_changed", this, "_tree_changed"); transitions.remove(i); return; } @@ -764,7 +764,7 @@ void AnimationNodeStateMachine::remove_transition(const StringName &p_from, cons void AnimationNodeStateMachine::remove_transition_by_index(int p_transition) { ERR_FAIL_INDEX(p_transition, transitions.size()); - transitions.write[p_transition].transition->disconnect("advance_condition_changed", this, "_tree_changed"); + transitions.write[p_transition].transition->disconnect_compat("advance_condition_changed", this, "_tree_changed"); transitions.remove(p_transition); /*if (playing) { path.clear(); @@ -926,8 +926,8 @@ void AnimationNodeStateMachine::_get_property_list(List<PropertyInfo> *p_list) c } p_list->push_back(PropertyInfo(Variant::ARRAY, "transitions", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); - p_list->push_back(PropertyInfo(Variant::STRING, "start_node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); - p_list->push_back(PropertyInfo(Variant::STRING, "end_node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "start_node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "end_node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::VECTOR2, "graph_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); } diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 4276c145ec..481a4a9958 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -263,8 +263,8 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) { } { - if (!child->is_connected("tree_exiting", this, "_node_removed")) - child->connect("tree_exiting", this, "_node_removed", make_binds(child), CONNECT_ONESHOT); + if (!child->is_connected_compat("tree_exiting", this, "_node_removed")) + child->connect_compat("tree_exiting", this, "_node_removed", make_binds(child), CONNECT_ONESHOT); } TrackNodeCacheKey key; @@ -1007,12 +1007,12 @@ void AnimationPlayer::remove_animation(const StringName &p_name) { void AnimationPlayer::_ref_anim(const Ref<Animation> &p_anim) { - Ref<Animation>(p_anim)->connect(SceneStringNames::get_singleton()->tracks_changed, this, "_animation_changed", varray(), CONNECT_REFERENCE_COUNTED); + Ref<Animation>(p_anim)->connect_compat(SceneStringNames::get_singleton()->tracks_changed, this, "_animation_changed", varray(), CONNECT_REFERENCE_COUNTED); } void AnimationPlayer::_unref_anim(const Ref<Animation> &p_anim) { - Ref<Animation>(p_anim)->disconnect(SceneStringNames::get_singleton()->tracks_changed, this, "_animation_changed"); + Ref<Animation>(p_anim)->disconnect_compat(SceneStringNames::get_singleton()->tracks_changed, this, "_animation_changed"); } void AnimationPlayer::rename_animation(const StringName &p_name, const StringName &p_new_name) { @@ -1682,22 +1682,22 @@ void AnimationPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("advance", "delta"), &AnimationPlayer::advance); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "root_node"), "set_root", "get_root"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_animation", PROPERTY_HINT_ENUM, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_ANIMATE_AS_TRIGGER), "set_current_animation", "get_current_animation"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "assigned_animation", PROPERTY_HINT_NONE, "", 0), "set_assigned_animation", "get_assigned_animation"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "autoplay", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_autoplay", "get_autoplay"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "current_animation_length", PROPERTY_HINT_NONE, "", 0), "", "get_current_animation_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "current_animation_position", PROPERTY_HINT_NONE, "", 0), "", "get_current_animation_position"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "current_animation", PROPERTY_HINT_ENUM, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_ANIMATE_AS_TRIGGER), "set_current_animation", "get_current_animation"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "assigned_animation", PROPERTY_HINT_NONE, "", 0), "set_assigned_animation", "get_assigned_animation"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "autoplay", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_autoplay", "get_autoplay"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "current_animation_length", PROPERTY_HINT_NONE, "", 0), "", "get_current_animation_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "current_animation_position", PROPERTY_HINT_NONE, "", 0), "", "get_current_animation_position"); ADD_GROUP("Playback Options", "playback_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Physics,Idle,Manual"), "set_animation_process_mode", "get_animation_process_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "playback_default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_default_blend_time", "get_default_blend_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "playback_default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_default_blend_time", "get_default_blend_time"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playback_active", PROPERTY_HINT_NONE, "", 0), "set_active", "is_active"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "playback_speed", PROPERTY_HINT_RANGE, "-64,64,0.01"), "set_speed_scale", "get_speed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "playback_speed", PROPERTY_HINT_RANGE, "-64,64,0.01"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::INT, "method_call_mode", PROPERTY_HINT_ENUM, "Deferred,Immediate"), "set_method_call_mode", "get_method_call_mode"); - ADD_SIGNAL(MethodInfo("animation_finished", PropertyInfo(Variant::STRING, "anim_name"))); - ADD_SIGNAL(MethodInfo("animation_changed", PropertyInfo(Variant::STRING, "old_name"), PropertyInfo(Variant::STRING, "new_name"))); - ADD_SIGNAL(MethodInfo("animation_started", PropertyInfo(Variant::STRING, "anim_name"))); + ADD_SIGNAL(MethodInfo("animation_finished", PropertyInfo(Variant::STRING_NAME, "anim_name"))); + ADD_SIGNAL(MethodInfo("animation_changed", PropertyInfo(Variant::STRING_NAME, "old_name"), PropertyInfo(Variant::STRING_NAME, "new_name"))); + ADD_SIGNAL(MethodInfo("animation_started", PropertyInfo(Variant::STRING_NAME, "anim_name"))); ADD_SIGNAL(MethodInfo("caches_cleared")); BIND_ENUM_CONSTANT(ANIMATION_PROCESS_PHYSICS); diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index a08cc0927b..7117b3f5ac 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -433,13 +433,13 @@ void AnimationNode::_bind_methods() { BIND_VMETHOD(MethodInfo(Variant::ARRAY, "get_parameter_list")); BIND_VMETHOD(MethodInfo(Variant::OBJECT, "get_child_by_name", PropertyInfo(Variant::STRING, "name"))); { - MethodInfo mi = MethodInfo(Variant::NIL, "get_parameter_default_value", PropertyInfo(Variant::STRING, "name")); + MethodInfo mi = MethodInfo(Variant::NIL, "get_parameter_default_value", PropertyInfo(Variant::STRING_NAME, "name")); mi.return_val.usage = PROPERTY_USAGE_NIL_IS_VARIANT; BIND_VMETHOD(mi); } - BIND_VMETHOD(MethodInfo("process", PropertyInfo(Variant::REAL, "time"), PropertyInfo(Variant::BOOL, "seek"))); + BIND_VMETHOD(MethodInfo("process", PropertyInfo(Variant::FLOAT, "time"), PropertyInfo(Variant::BOOL, "seek"))); BIND_VMETHOD(MethodInfo(Variant::STRING, "get_caption")); - BIND_VMETHOD(MethodInfo(Variant::STRING, "has_filter")); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "has_filter")); ADD_SIGNAL(MethodInfo("removed_from_graph")); @@ -463,13 +463,13 @@ AnimationNode::AnimationNode() { void AnimationTree::set_tree_root(const Ref<AnimationNode> &p_root) { if (root.is_valid()) { - root->disconnect("tree_changed", this, "_tree_changed"); + root->disconnect_compat("tree_changed", this, "_tree_changed"); } root = p_root; if (root.is_valid()) { - root->connect("tree_changed", this, "_tree_changed"); + root->connect_compat("tree_changed", this, "_tree_changed"); } properties_dirty = true; @@ -582,8 +582,8 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) { continue; } - if (!child->is_connected("tree_exited", this, "_node_removed")) { - child->connect("tree_exited", this, "_node_removed", varray(child)); + if (!child->is_connected_compat("tree_exited", this, "_node_removed")) { + child->connect_compat("tree_exited", this, "_node_removed", varray(child)); } switch (track_type) { @@ -778,12 +778,12 @@ void AnimationTree::_process_graph(float p_delta) { if (last_animation_player.is_valid()) { Object *old_player = ObjectDB::get_instance(last_animation_player); if (old_player) { - old_player->disconnect("caches_cleared", this, "_clear_caches"); + old_player->disconnect_compat("caches_cleared", this, "_clear_caches"); } } if (player) { - player->connect("caches_cleared", this, "_clear_caches"); + player->connect_compat("caches_cleared", this, "_clear_caches"); } last_animation_player = current_animation_player; @@ -1300,7 +1300,7 @@ void AnimationTree::_notification(int p_what) { Object *player = ObjectDB::get_instance(last_animation_player); if (player) { - player->disconnect("caches_cleared", this, "_clear_caches"); + player->disconnect_compat("caches_cleared", this, "_clear_caches"); } } } else if (p_what == NOTIFICATION_ENTER_TREE) { @@ -1308,7 +1308,7 @@ void AnimationTree::_notification(int p_what) { Object *player = ObjectDB::get_instance(last_animation_player); if (player) { - player->connect("caches_cleared", this, "_clear_caches"); + player->connect_compat("caches_cleared", this, "_clear_caches"); } } } diff --git a/scene/animation/root_motion_view.cpp b/scene/animation/root_motion_view.cpp index 1a26131fcb..ce9b8bd213 100644 --- a/scene/animation/root_motion_view.cpp +++ b/scene/animation/root_motion_view.cpp @@ -187,8 +187,8 @@ void RootMotionView::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "animation_path", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "AnimationTree"), "set_animation_path", "get_animation_path"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell_size", PROPERTY_HINT_RANGE, "0.1,16,0.01,or_greater"), "set_cell_size", "get_cell_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.1,16,0.01,or_greater"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell_size", PROPERTY_HINT_RANGE, "0.1,16,0.01,or_greater"), "set_cell_size", "get_cell_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.1,16,0.01,or_greater"), "set_radius", "get_radius"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "zero_y"), "set_zero_y", "get_zero_y"); } diff --git a/scene/animation/skeleton_ik.cpp b/scene/animation/skeleton_ik.cpp index 518c243dd0..5cdb38b5c2 100644 --- a/scene/animation/skeleton_ik.cpp +++ b/scene/animation/skeleton_ik.cpp @@ -390,15 +390,15 @@ void SkeletonIK::_bind_methods() { ClassDB::bind_method(D_METHOD("start", "one_time"), &SkeletonIK::start, DEFVAL(false)); ClassDB::bind_method(D_METHOD("stop"), &SkeletonIK::stop); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "root_bone"), "set_root_bone", "get_root_bone"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "tip_bone"), "set_tip_bone", "get_tip_bone"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "interpolation", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_interpolation", "get_interpolation"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "root_bone"), "set_root_bone", "get_root_bone"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "tip_bone"), "set_tip_bone", "get_tip_bone"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "interpolation", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_interpolation", "get_interpolation"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "target"), "set_target_transform", "get_target_transform"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "override_tip_basis"), "set_override_tip_basis", "is_override_tip_basis"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_magnet"), "set_use_magnet", "is_using_magnet"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "magnet"), "set_magnet_position", "get_magnet_position"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "target_node"), "set_target_node", "get_target_node"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "min_distance"), "set_min_distance", "get_min_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "min_distance"), "set_min_distance", "get_min_distance"); ADD_PROPERTY(PropertyInfo(Variant::INT, "max_iterations"), "set_max_iterations", "get_max_iterations"); } diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index a7f3794a05..4b8b537d43 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -67,7 +67,6 @@ void Tween::_add_pending_command(StringName p_key, const Variant &p_arg1, const count = 0; // Add the specified arguments to the command - // TODO: Make this a switch statement? if (count > 0) cmd.arg[0] = p_arg1; if (count > 1) @@ -97,7 +96,7 @@ void Tween::_process_pending_commands() { // Get the command PendingCommand &cmd = E->get(); - Variant::CallError err; + Callable::CallError err; // Grab all of the arguments for the command Variant *arg[10] = { @@ -157,7 +156,7 @@ void Tween::_get_property_list(List<PropertyInfo> *p_list) const { // Add the property info for the Tween object p_list->push_back(PropertyInfo(Variant::BOOL, "playback/active", PROPERTY_HINT_NONE, "")); p_list->push_back(PropertyInfo(Variant::BOOL, "playback/repeat", PROPERTY_HINT_NONE, "")); - p_list->push_back(PropertyInfo(Variant::REAL, "playback/speed", PROPERTY_HINT_RANGE, "-64,64,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "playback/speed", PROPERTY_HINT_RANGE, "-64,64,0.01")); } void Tween::_notification(int p_what) { @@ -250,14 +249,14 @@ void Tween::_bind_methods() { // Add the Tween signals ADD_SIGNAL(MethodInfo("tween_started", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"))); - ADD_SIGNAL(MethodInfo("tween_step", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"), PropertyInfo(Variant::REAL, "elapsed"), PropertyInfo(Variant::OBJECT, "value"))); + ADD_SIGNAL(MethodInfo("tween_step", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"), PropertyInfo(Variant::FLOAT, "elapsed"), PropertyInfo(Variant::OBJECT, "value"))); ADD_SIGNAL(MethodInfo("tween_completed", PropertyInfo(Variant::OBJECT, "object"), PropertyInfo(Variant::NODE_PATH, "key"))); ADD_SIGNAL(MethodInfo("tween_all_completed")); // Add the properties and tie them to the getters and setters ADD_PROPERTY(PropertyInfo(Variant::BOOL, "repeat"), "set_repeat", "is_repeat"); ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_tween_process_mode", "get_tween_process_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "playback_speed", PROPERTY_HINT_RANGE, "-64,64,0.01"), "set_speed_scale", "get_speed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "playback_speed", PROPERTY_HINT_RANGE, "-64,64,0.01"), "set_speed_scale", "get_speed_scale"); // Bind Idle vs Physics process BIND_ENUM_CONSTANT(TWEEN_PROCESS_PHYSICS); @@ -309,9 +308,9 @@ Variant Tween::_get_initial_val(const InterpolateData &p_data) const { ERR_FAIL_COND_V(!valid, p_data.initial_val); } else { // Call the method and get the initial value from it - Variant::CallError error; + Callable::CallError error; initial_val = object->call(p_data.target_key[0], NULL, 0, error); - ERR_FAIL_COND_V(error.error != Variant::CallError::CALL_OK, p_data.initial_val); + ERR_FAIL_COND_V(error.error != Callable::CallError::CALL_OK, p_data.initial_val); } return initial_val; } @@ -341,12 +340,12 @@ Variant Tween::_get_final_val(const InterpolateData &p_data) const { ERR_FAIL_COND_V(!valid, p_data.initial_val); } else { // We're looking at a method. Call the method on the target object - Variant::CallError error; + Callable::CallError error; final_val = target->call(p_data.target_key[0], NULL, 0, error); - ERR_FAIL_COND_V(error.error != Variant::CallError::CALL_OK, p_data.initial_val); + ERR_FAIL_COND_V(error.error != Callable::CallError::CALL_OK, p_data.initial_val); } - // If we're looking at an INT value, instead convert it to a REAL + // If we're looking at an INT value, instead convert it to a FLOAT // This is better for interpolation if (final_val.get_type() == Variant::INT) final_val = final_val.operator real_t(); @@ -383,12 +382,12 @@ Variant &Tween::_get_delta_val(InterpolateData &p_data) { ERR_FAIL_COND_V(!valid, p_data.initial_val); } else { // We're looking at a method. Call the method on the target object - Variant::CallError error; + Callable::CallError error; final_val = target->call(p_data.target_key[0], NULL, 0, error); - ERR_FAIL_COND_V(error.error != Variant::CallError::CALL_OK, p_data.initial_val); + ERR_FAIL_COND_V(error.error != Callable::CallError::CALL_OK, p_data.initial_val); } - // If we're looking at an INT value, instead convert it to a REAL + // If we're looking at an INT value, instead convert it to a FLOAT // This is better for interpolation if (final_val.get_type() == Variant::INT) final_val = final_val.operator real_t(); @@ -402,7 +401,7 @@ Variant &Tween::_get_delta_val(InterpolateData &p_data) { // Grab the initial value from the data to calculate delta Variant initial_val = _get_initial_val(p_data); - // If we're looking at an INT value, instead convert it to a REAL + // If we're looking at an INT value, instead convert it to a FLOAT // This is better for interpolation if (initial_val.get_type() == Variant::INT) initial_val = initial_val.operator real_t(); @@ -441,8 +440,8 @@ Variant Tween::_run_equation(InterpolateData &p_data) { result = (int)_run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, (int)initial_val, (int)delta_val, p_data.duration); break; - case Variant::REAL: - // Run the REAL specific equation + case Variant::FLOAT: + // Run the FLOAT specific equation result = _run_equation(p_data.trans_type, p_data.ease_type, p_data.elapsed - p_data.delay, (real_t)initial_val, (real_t)delta_val, p_data.duration); break; @@ -459,6 +458,20 @@ Variant Tween::_run_equation(InterpolateData &p_data) { result = r; } break; + case Variant::RECT2: { + // Get the Rect2 for initial and delta value + Rect2 i = initial_val; + Rect2 d = delta_val; + Rect2 r; + + // Execute the equation for the position and size of Rect2 + APPLY_EQUATION(position.x); + APPLY_EQUATION(position.y); + APPLY_EQUATION(size.x); + APPLY_EQUATION(size.y); + result = r; + } break; + case Variant::VECTOR3: { // Get vectors for initial and delta values Vector3 i = initial_val; @@ -473,26 +486,6 @@ Variant Tween::_run_equation(InterpolateData &p_data) { result = r; } break; - case Variant::BASIS: { - // Get the basis for initial and delta values - Basis i = initial_val; - Basis d = delta_val; - Basis r; - - // Execute the equation on all the basis and mutate the r basis - // This uses the custom APPLY_EQUATION macro defined above - APPLY_EQUATION(elements[0][0]); - APPLY_EQUATION(elements[0][1]); - APPLY_EQUATION(elements[0][2]); - APPLY_EQUATION(elements[1][0]); - APPLY_EQUATION(elements[1][1]); - APPLY_EQUATION(elements[1][2]); - APPLY_EQUATION(elements[2][0]); - APPLY_EQUATION(elements[2][1]); - APPLY_EQUATION(elements[2][2]); - result = r; - } break; - case Variant::TRANSFORM2D: { // Get the transforms for initial and delta values Transform2D i = initial_val; @@ -509,6 +502,7 @@ Variant Tween::_run_equation(InterpolateData &p_data) { APPLY_EQUATION(elements[2][1]); result = r; } break; + case Variant::QUAT: { // Get the quaternian for the initial and delta values Quat i = initial_val; @@ -523,6 +517,7 @@ Variant Tween::_run_equation(InterpolateData &p_data) { APPLY_EQUATION(w); result = r; } break; + case Variant::AABB: { // Get the AABB's for the initial and delta values AABB i = initial_val; @@ -539,6 +534,27 @@ Variant Tween::_run_equation(InterpolateData &p_data) { APPLY_EQUATION(size.z); result = r; } break; + + case Variant::BASIS: { + // Get the basis for initial and delta values + Basis i = initial_val; + Basis d = delta_val; + Basis r; + + // Execute the equation on all the basis and mutate the r basis + // This uses the custom APPLY_EQUATION macro defined above + APPLY_EQUATION(elements[0][0]); + APPLY_EQUATION(elements[0][1]); + APPLY_EQUATION(elements[0][2]); + APPLY_EQUATION(elements[1][0]); + APPLY_EQUATION(elements[1][1]); + APPLY_EQUATION(elements[1][2]); + APPLY_EQUATION(elements[2][0]); + APPLY_EQUATION(elements[2][1]); + APPLY_EQUATION(elements[2][2]); + result = r; + } break; + case Variant::TRANSFORM: { // Get the transforms for the initial and delta values Transform i = initial_val; @@ -561,6 +577,7 @@ Variant Tween::_run_equation(InterpolateData &p_data) { APPLY_EQUATION(origin.z); result = r; } break; + case Variant::COLOR: { // Get the Color for initial and delta value Color i = initial_val; @@ -575,6 +592,7 @@ Variant Tween::_run_equation(InterpolateData &p_data) { APPLY_EQUATION(a); result = r; } break; + default: { // If unknown, just return the initial value result = initial_val; @@ -607,7 +625,7 @@ bool Tween::_apply_tween_value(InterpolateData &p_data, Variant &value) { case FOLLOW_METHOD: case TARGETING_METHOD: { // We want to call the method on the target object - Variant::CallError error; + Callable::CallError error; // Do we have a non-nil value passed in? if (value.get_type() != Variant::NIL) { @@ -620,7 +638,7 @@ bool Tween::_apply_tween_value(InterpolateData &p_data, Variant &value) { } // Did we get an error from the function call? - return error.error == Variant::CallError::CALL_OK; + return error.error == Callable::CallError::CALL_OK; } case INTER_CALLBACK: @@ -732,7 +750,7 @@ void Tween::_tween_process(float p_delta) { } } else { // Call the function directly with the arguments - Variant::CallError error; + Callable::CallError error; Variant *arg[5] = { &data.arg[0], &data.arg[1], @@ -1119,8 +1137,8 @@ bool Tween::_calc_delta_val(const Variant &p_initial_val, const Variant &p_final delta_val = (int)final_val - (int)initial_val; break; - case Variant::REAL: - // Convert to REAL and find the delta + case Variant::FLOAT: + // Convert to FLOAT and find the delta delta_val = (real_t)final_val - (real_t)initial_val; break; @@ -1129,26 +1147,18 @@ bool Tween::_calc_delta_val(const Variant &p_initial_val, const Variant &p_final delta_val = final_val.operator Vector2() - initial_val.operator Vector2(); break; + case Variant::RECT2: { + // Build a new Rect2 and use the new position and sizes to make a delta + Rect2 i = initial_val; + Rect2 f = final_val; + delta_val = Rect2(f.position - i.position, f.size - i.size); + } break; + case Variant::VECTOR3: // Convert to Vectors and find the delta delta_val = final_val.operator Vector3() - initial_val.operator Vector3(); break; - case Variant::BASIS: { - // Build a new basis which is the delta between the initial and final values - Basis i = initial_val; - Basis f = final_val; - delta_val = Basis(f.elements[0][0] - i.elements[0][0], - f.elements[0][1] - i.elements[0][1], - f.elements[0][2] - i.elements[0][2], - f.elements[1][0] - i.elements[1][0], - f.elements[1][1] - i.elements[1][1], - f.elements[1][2] - i.elements[1][2], - f.elements[2][0] - i.elements[2][0], - f.elements[2][1] - i.elements[2][1], - f.elements[2][2] - i.elements[2][2]); - } break; - case Variant::TRANSFORM2D: { // Build a new transform which is the difference between the initial and final values Transform2D i = initial_val; @@ -1175,6 +1185,21 @@ bool Tween::_calc_delta_val(const Variant &p_initial_val, const Variant &p_final delta_val = AABB(f.position - i.position, f.size - i.size); } break; + case Variant::BASIS: { + // Build a new basis which is the delta between the initial and final values + Basis i = initial_val; + Basis f = final_val; + delta_val = Basis(f.elements[0][0] - i.elements[0][0], + f.elements[0][1] - i.elements[0][1], + f.elements[0][2] - i.elements[0][2], + f.elements[1][0] - i.elements[1][0], + f.elements[1][1] - i.elements[1][1], + f.elements[1][2] - i.elements[1][2], + f.elements[2][0] - i.elements[2][0], + f.elements[2][1] - i.elements[2][1], + f.elements[2][2] - i.elements[2][2]); + } break; + case Variant::TRANSFORM: { // Build a new transform which is the difference between the initial and final values Transform i = initial_val; @@ -1203,10 +1228,34 @@ bool Tween::_calc_delta_val(const Variant &p_initial_val, const Variant &p_final delta_val = Color(f.r - i.r, f.g - i.g, f.b - i.b, f.a - i.a); } break; - default: - // TODO: Should move away from a 'magic string'? - ERR_PRINT("Invalid param type, except(int/real/vector2/vector/matrix/matrix32/quat/aabb/transform/color)"); + default: { + static Variant::Type supported_types[] = { + Variant::BOOL, + Variant::INT, + Variant::FLOAT, + Variant::VECTOR2, + Variant::RECT2, + Variant::VECTOR3, + Variant::TRANSFORM2D, + Variant::QUAT, + Variant::AABB, + Variant::BASIS, + Variant::TRANSFORM, + Variant::COLOR, + }; + + int length = *(&supported_types + 1) - supported_types; + String error_msg = "Invalid parameter type. Supported types are: "; + for (int i = 0; i < length; i++) { + if (i != 0) { + error_msg += ", "; + } + error_msg += Variant::get_type_name(supported_types[i]); + } + error_msg += "."; + ERR_PRINT(error_msg); return false; + } }; return true; } @@ -1449,7 +1498,7 @@ bool Tween::follow_property(Object *p_object, NodePath p_property, Variant p_ini // TODO: Is this documented? It's really helpful for decluttering tweens if (p_initial_val.get_type() == Variant::NIL) p_initial_val = p_object->get_indexed(p_property.get_subnames()); - // Convert initial INT values to REAL as they are better for interpolation + // Convert initial INT values to FLOAT as they are better for interpolation if (p_initial_val.get_type() == Variant::INT) p_initial_val = p_initial_val.operator real_t(); // Confirm the source and target objects are valid @@ -1475,7 +1524,7 @@ bool Tween::follow_property(Object *p_object, NodePath p_property, Variant p_ini Variant target_val = p_target->get_indexed(p_target_property.get_subnames(), &target_prop_valid); ERR_FAIL_COND_V(!target_prop_valid, false); - // Convert target INT to REAL since it is better for interpolation + // Convert target INT to FLOAT since it is better for interpolation if (target_val.get_type() == Variant::INT) target_val = target_val.operator real_t(); // Verify that the target value and initial value are the same type @@ -1511,7 +1560,7 @@ bool Tween::follow_method(Object *p_object, StringName p_method, Variant p_initi _add_pending_command("follow_method", p_object, p_method, p_initial_val, p_target, p_target_method, p_duration, p_trans_type, p_ease_type, p_delay); return true; } - // Convert initial INT values to REAL as they are better for interpolation + // Convert initial INT values to FLOAT as they are better for interpolation if (p_initial_val.get_type() == Variant::INT) p_initial_val = p_initial_val.operator real_t(); // Verify the source and target objects are valid @@ -1533,11 +1582,11 @@ bool Tween::follow_method(Object *p_object, StringName p_method, Variant p_initi ERR_FAIL_COND_V_MSG(!p_target->has_method(p_target_method), false, "Target has no method named: " + p_target_method + "."); // Call the method to get the target value - Variant::CallError error; + Callable::CallError error; Variant target_val = p_target->call(p_target_method, NULL, 0, error); - ERR_FAIL_COND_V(error.error != Variant::CallError::CALL_OK, false); + ERR_FAIL_COND_V(error.error != Callable::CallError::CALL_OK, false); - // Convert target INT values to REAL as they are better for interpolation + // Convert target INT values to FLOAT as they are better for interpolation if (target_val.get_type() == Variant::INT) target_val = target_val.operator real_t(); ERR_FAIL_COND_V(target_val.get_type() != p_initial_val.get_type(), false); @@ -1575,7 +1624,7 @@ bool Tween::targeting_property(Object *p_object, NodePath p_property, Object *p_ p_property = p_property.get_as_property_path(); p_initial_property = p_initial_property.get_as_property_path(); - // Convert the initial INT values to REAL as they are better for Interpolation + // Convert the initial INT values to FLOAT as they are better for Interpolation if (p_final_val.get_type() == Variant::INT) p_final_val = p_final_val.operator real_t(); // Verify both objects are valid @@ -1601,7 +1650,7 @@ bool Tween::targeting_property(Object *p_object, NodePath p_property, Object *p_ Variant initial_val = p_initial->get_indexed(p_initial_property.get_subnames(), &initial_prop_valid); ERR_FAIL_COND_V(!initial_prop_valid, false); - // Convert the initial INT value to REAL as it is better for interpolation + // Convert the initial INT value to FLOAT as it is better for interpolation if (initial_val.get_type() == Variant::INT) initial_val = initial_val.operator real_t(); ERR_FAIL_COND_V(initial_val.get_type() != p_final_val.get_type(), false); @@ -1641,7 +1690,7 @@ bool Tween::targeting_method(Object *p_object, StringName p_method, Object *p_in return true; } - // Convert final INT values to REAL as they are better for interpolation + // Convert final INT values to FLOAT as they are better for interpolation if (p_final_val.get_type() == Variant::INT) p_final_val = p_final_val.operator real_t(); // Make sure the given objects are valid @@ -1663,11 +1712,11 @@ bool Tween::targeting_method(Object *p_object, StringName p_method, Object *p_in ERR_FAIL_COND_V_MSG(!p_initial->has_method(p_initial_method), false, "Initial Object has no method named: " + p_initial_method + "."); // Call the method to get the initial value - Variant::CallError error; + Callable::CallError error; Variant initial_val = p_initial->call(p_initial_method, NULL, 0, error); - ERR_FAIL_COND_V(error.error != Variant::CallError::CALL_OK, false); + ERR_FAIL_COND_V(error.error != Callable::CallError::CALL_OK, false); - // Convert initial INT values to REAL as they aer better for interpolation + // Convert initial INT values to FLOAT as they aer better for interpolation if (initial_val.get_type() == Variant::INT) initial_val = initial_val.operator real_t(); ERR_FAIL_COND_V(initial_val.get_type() != p_final_val.get_type(), false); diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index 03d96d41fa..d738631d3b 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -411,13 +411,13 @@ void AudioStreamPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_stream_playback"), &AudioStreamPlayer::get_stream_playback); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE, "-80,24"), "set_volume_db", "get_volume_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume_db", PROPERTY_HINT_RANGE, "-80,24"), "set_volume_db", "get_volume_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,4,0.01,or_greater"), "set_pitch_scale", "get_pitch_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "is_playing"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stream_paused", PROPERTY_HINT_NONE, ""), "set_stream_paused", "get_stream_paused"); ADD_PROPERTY(PropertyInfo(Variant::INT, "mix_target", PROPERTY_HINT_ENUM, "Stereo,Surround,Center"), "set_mix_target", "get_mix_target"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); ADD_SIGNAL(MethodInfo("finished")); @@ -441,7 +441,7 @@ AudioStreamPlayer::AudioStreamPlayer() { setstop = false; use_fadeout = false; - AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed"); + AudioServer::get_singleton()->connect_compat("bus_layout_changed", this, "_bus_layout_changed"); } AudioStreamPlayer::~AudioStreamPlayer() { diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp new file mode 100644 index 0000000000..22ff0611a7 --- /dev/null +++ b/scene/debugger/scene_debugger.cpp @@ -0,0 +1,871 @@ +/*************************************************************************/ +/* scene_debugger.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "scene_debugger.h" + +#include "core/io/marshalls.h" +#include "core/script_debugger_remote.h" +#include "scene/main/scene_tree.h" +#include "scene/main/viewport.h" +#include "scene/resources/packed_scene.h" + +void SceneDebugger::initialize() { +#ifdef DEBUG_ENABLED + LiveEditor::singleton = memnew(LiveEditor); + ScriptDebuggerRemote::scene_tree_parse_func = SceneDebugger::parse_message; +#endif +} + +void SceneDebugger::deinitialize() { +#ifdef DEBUG_ENABLED + if (LiveEditor::singleton) { + memdelete(LiveEditor::singleton); + LiveEditor::singleton = NULL; + } +#endif +} + +#ifdef DEBUG_ENABLED +Error SceneDebugger::parse_message(const String &p_msg, const Array &p_args) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return ERR_UNCONFIGURED; + LiveEditor *live_editor = LiveEditor::get_singleton(); + if (!live_editor) + return ERR_UNCONFIGURED; + if (p_msg == "request_scene_tree") { // Scene tree + live_editor->_send_tree(); + + } else if (p_msg == "save_node") { // Save node. + ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA); + _save_node(p_args[0], p_args[1]); + + } else if (p_msg == "inspect_object") { // Object Inspect + ERR_FAIL_COND_V(p_args.size() < 1, ERR_INVALID_DATA); + ObjectID id = p_args[0]; + _send_object_id(id); + + } else if (p_msg == "override_camera_2D:set") { // Camera + ERR_FAIL_COND_V(p_args.size() < 1, ERR_INVALID_DATA); + bool enforce = p_args[0]; + scene_tree->get_root()->enable_canvas_transform_override(enforce); + + } else if (p_msg == "override_camera_2D:transform") { + ERR_FAIL_COND_V(p_args.size() < 1, ERR_INVALID_DATA); + Transform2D transform = p_args[1]; + scene_tree->get_root()->set_canvas_transform_override(transform); + + } else if (p_msg == "override_camera_3D:set") { + ERR_FAIL_COND_V(p_args.size() < 1, ERR_INVALID_DATA); + bool enable = p_args[0]; + scene_tree->get_root()->enable_camera_override(enable); + + } else if (p_msg == "override_camera_3D:transform") { + ERR_FAIL_COND_V(p_args.size() < 5, ERR_INVALID_DATA); + Transform transform = p_args[0]; + bool is_perspective = p_args[1]; + float size_or_fov = p_args[2]; + float near = p_args[3]; + float far = p_args[4]; + if (is_perspective) { + scene_tree->get_root()->set_camera_override_perspective(size_or_fov, near, far); + } else { + scene_tree->get_root()->set_camera_override_orthogonal(size_or_fov, near, far); + } + scene_tree->get_root()->set_camera_override_transform(transform); + + } else if (p_msg == "set_object_property") { + ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA); + _set_object_property(p_args[0], p_args[1], p_args[2]); + + } else if (!p_msg.begins_with("live_")) { // Live edits below. + return ERR_SKIP; + } else if (p_msg == "live_set_root") { + ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA); + live_editor->_root_func(p_args[0], p_args[1]); + + } else if (p_msg == "live_node_path") { + ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA); + live_editor->_node_path_func(p_args[0], p_args[1]); + + } else if (p_msg == "live_res_path") { + ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA); + live_editor->_res_path_func(p_args[0], p_args[1]); + + } else if (p_msg == "live_node_prop_res") { + ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA); + live_editor->_node_set_res_func(p_args[0], p_args[1], p_args[2]); + + } else if (p_msg == "live_node_prop") { + ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA); + live_editor->_node_set_func(p_args[0], p_args[1], p_args[2]); + + } else if (p_msg == "live_res_prop_res") { + ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA); + live_editor->_res_set_res_func(p_args[0], p_args[1], p_args[2]); + + } else if (p_msg == "live_res_prop") { + ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA); + live_editor->_res_set_func(p_args[0], p_args[1], p_args[2]); + + } else if (p_msg == "live_node_call") { + ERR_FAIL_COND_V(p_args.size() < 7, ERR_INVALID_DATA); + live_editor->_node_call_func(p_args[0], p_args[1], p_args[2], p_args[3], p_args[4], p_args[5], p_args[6]); + + } else if (p_msg == "live_res_call") { + ERR_FAIL_COND_V(p_args.size() < 7, ERR_INVALID_DATA); + live_editor->_res_call_func(p_args[0], p_args[1], p_args[2], p_args[3], p_args[4], p_args[5], p_args[6]); + + } else if (p_msg == "live_create_node") { + ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA); + live_editor->_create_node_func(p_args[0], p_args[1], p_args[2]); + + } else if (p_msg == "live_instance_node") { + ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA); + live_editor->_instance_node_func(p_args[0], p_args[1], p_args[2]); + + } else if (p_msg == "live_remove_node") { + ERR_FAIL_COND_V(p_args.size() < 1, ERR_INVALID_DATA); + live_editor->_remove_node_func(p_args[0]); + + } else if (p_msg == "live_remove_and_keep_node") { + ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA); + live_editor->_remove_and_keep_node_func(p_args[0], p_args[1]); + + } else if (p_msg == "live_restore_node") { + ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA); + live_editor->_restore_node_func(p_args[0], p_args[1], p_args[2]); + + } else if (p_msg == "live_duplicate_node") { + ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA); + live_editor->_duplicate_node_func(p_args[0], p_args[1]); + + } else if (p_msg == "live_reparent_node") { + ERR_FAIL_COND_V(p_args.size() < 4, ERR_INVALID_DATA); + live_editor->_reparent_node_func(p_args[0], p_args[1], p_args[2], p_args[3]); + } else { + return ERR_SKIP; + } + return OK; +} + +void SceneDebugger::_save_node(ObjectID id, const String &p_path) { + Node *node = Object::cast_to<Node>(ObjectDB::get_instance(id)); + ERR_FAIL_COND(!node); + + WARN_PRINT("SAVING " + itos(id) + " TO " + p_path); + Ref<PackedScene> ps = memnew(PackedScene); + ps->pack(node); + ResourceSaver::save(p_path, ps); +} + +void SceneDebugger::_send_object_id(ObjectID p_id, int p_max_size) { + SceneDebuggerObject obj(p_id); + if (obj.id.is_null()) + return; + + Array arr; + obj.serialize(arr); + ScriptDebugger::get_singleton()->send_message("inspect_object", arr); +} + +void SceneDebugger::_set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value) { + + Object *obj = ObjectDB::get_instance(p_id); + if (!obj) + return; + + String prop_name = p_property; + if (p_property.begins_with("Members/")) { + Vector<String> ss = p_property.split("/"); + prop_name = ss[ss.size() - 1]; + } + + obj->set(prop_name, p_value); +} + +void SceneDebugger::add_to_cache(const String &p_filename, Node *p_node) { + LiveEditor *debugger = LiveEditor::get_singleton(); + if (!debugger) + return; + + if (ScriptDebugger::get_singleton() && p_filename != String()) { + debugger->live_scene_edit_cache[p_filename].insert(p_node); + } +} +void SceneDebugger::remove_from_cache(const String &p_filename, Node *p_node) { + LiveEditor *debugger = LiveEditor::get_singleton(); + if (!debugger) + return; + + Map<String, Set<Node *> > &edit_cache = debugger->live_scene_edit_cache; + Map<String, Set<Node *> >::Element *E = edit_cache.find(p_filename); + if (E) { + E->get().erase(p_node); + if (E->get().size() == 0) { + edit_cache.erase(E); + } + } + + Map<Node *, Map<ObjectID, Node *> > &remove_list = debugger->live_edit_remove_list; + Map<Node *, Map<ObjectID, Node *> >::Element *F = remove_list.find(p_node); + if (F) { + for (Map<ObjectID, Node *>::Element *G = F->get().front(); G; G = G->next()) { + + memdelete(G->get()); + } + remove_list.erase(F); + } +} + +/// SceneDebuggerObject +SceneDebuggerObject::SceneDebuggerObject(ObjectID p_id) { + id = ObjectID(); + Object *obj = ObjectDB::get_instance(p_id); + if (!obj) + return; + + id = p_id; + class_name = obj->get_class(); + + if (ScriptInstance *si = obj->get_script_instance()) { + // Read script instance constants and variables + if (!si->get_script().is_null()) { + Script *s = si->get_script().ptr(); + _parse_script_properties(s, si); + } + } + + if (Node *node = Object::cast_to<Node>(obj)) { + // Add specialized NodePath info (if inside tree). + if (node->is_inside_tree()) { + PropertyInfo pi(Variant::NODE_PATH, String("Node/path")); + properties.push_back(SceneDebuggerProperty(pi, node->get_path())); + } else { // Can't ask for path if a node is not in tree. + PropertyInfo pi(Variant::STRING, String("Node/path")); + properties.push_back(SceneDebuggerProperty(pi, "[Orphan]")); + } + } else if (Script *s = Object::cast_to<Script>(obj)) { + // Add script constants (no instance). + _parse_script_properties(s, NULL); + } + + // Add base object properties. + List<PropertyInfo> pinfo; + obj->get_property_list(&pinfo, true); + for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) { + if (E->get().usage & (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CATEGORY)) { + properties.push_back(SceneDebuggerProperty(E->get(), obj->get(E->get().name))); + } + } +} + +void SceneDebuggerObject::_parse_script_properties(Script *p_script, ScriptInstance *p_instance) { + typedef Map<const Script *, Set<StringName> > ScriptMemberMap; + typedef Map<const Script *, Map<StringName, Variant> > ScriptConstantsMap; + + ScriptMemberMap members; + if (p_instance) { + members[p_script] = Set<StringName>(); + p_script->get_members(&(members[p_script])); + } + + ScriptConstantsMap constants; + constants[p_script] = Map<StringName, Variant>(); + p_script->get_constants(&(constants[p_script])); + + Ref<Script> base = p_script->get_base_script(); + while (base.is_valid()) { + if (p_instance) { + members[base.ptr()] = Set<StringName>(); + base->get_members(&(members[base.ptr()])); + } + + constants[base.ptr()] = Map<StringName, Variant>(); + base->get_constants(&(constants[base.ptr()])); + + base = base->get_base_script(); + } + + // Members + for (ScriptMemberMap::Element *sm = members.front(); sm; sm = sm->next()) { + for (Set<StringName>::Element *E = sm->get().front(); E; E = E->next()) { + Variant m; + if (p_instance->get(E->get(), m)) { + String script_path = sm->key() == p_script ? "" : sm->key()->get_path().get_file() + "/"; + PropertyInfo pi(m.get_type(), "Members/" + script_path + E->get()); + properties.push_back(SceneDebuggerProperty(pi, m)); + } + } + } + // Constants + for (ScriptConstantsMap::Element *sc = constants.front(); sc; sc = sc->next()) { + for (Map<StringName, Variant>::Element *E = sc->get().front(); E; E = E->next()) { + String script_path = sc->key() == p_script ? "" : sc->key()->get_path().get_file() + "/"; + if (E->value().get_type() == Variant::OBJECT) { + Variant id = ((Object *)E->value())->get_instance_id(); + PropertyInfo pi(id.get_type(), "Constants/" + E->key(), PROPERTY_HINT_OBJECT_ID, "Object"); + properties.push_back(SceneDebuggerProperty(pi, id)); + } else { + PropertyInfo pi(E->value().get_type(), "Constants/" + script_path + E->key()); + properties.push_back(SceneDebuggerProperty(pi, E->value())); + } + } + } +} + +void SceneDebuggerObject::serialize(Array &r_arr, int p_max_size) { + Array send_props; + for (int i = 0; i < properties.size(); i++) { + const PropertyInfo &pi = properties[i].first; + Variant &var = properties[i].second; + + RES res = var; + + if (var.get_type() == Variant::OBJECT && var.is_ref()) { + REF r = var; + if (r.is_valid()) { + res = *r; + } else { + res = RES(); + } + } + + Array prop; + prop.push_back(pi.name); + prop.push_back(pi.type); + + PropertyHint hint = pi.hint; + String hint_string = pi.hint_string; + if (!res.is_null()) { + var = res->get_path(); + } else { //only send information that can be sent.. + int len = 0; //test how big is this to encode + encode_variant(var, NULL, len); + if (len > p_max_size) { //limit to max size + hint = PROPERTY_HINT_OBJECT_TOO_BIG; + hint_string = ""; + var = Variant(); + } + } + prop.push_back(hint); + prop.push_back(hint_string); + prop.push_back(pi.usage); + prop.push_back(var); + send_props.push_back(prop); + } + r_arr.push_back(uint64_t(id)); + r_arr.push_back(class_name); + r_arr.push_back(send_props); +} + +void SceneDebuggerObject::deserialize(const Array &p_arr) { +#define CHECK_TYPE(p_what, p_type) ERR_FAIL_COND(p_what.get_type() != Variant::p_type); + ERR_FAIL_COND(p_arr.size() < 3); + CHECK_TYPE(p_arr[0], INT); + CHECK_TYPE(p_arr[1], STRING); + CHECK_TYPE(p_arr[2], ARRAY); + + id = uint64_t(p_arr[0]); + class_name = p_arr[1]; + Array props = p_arr[2]; + + for (int i = 0; i < props.size(); i++) { + + CHECK_TYPE(props[i], ARRAY); + Array prop = props[i]; + + ERR_FAIL_COND(prop.size() != 6); + CHECK_TYPE(prop[0], STRING); + CHECK_TYPE(prop[1], INT); + CHECK_TYPE(prop[2], INT); + CHECK_TYPE(prop[3], STRING); + CHECK_TYPE(prop[4], INT); + + PropertyInfo pinfo; + pinfo.name = prop[0]; + pinfo.type = Variant::Type(int(prop[1])); + pinfo.hint = PropertyHint(int(prop[2])); + pinfo.hint_string = prop[3]; + pinfo.usage = PropertyUsageFlags(int(prop[4])); + Variant var = prop[5]; + + if (pinfo.type == Variant::OBJECT) { + if (var.is_zero()) { + var = RES(); + } else if (var.get_type() == Variant::OBJECT) { + if (((Object *)var)->is_class("EncodedObjectAsID")) { + var = Object::cast_to<EncodedObjectAsID>(var)->get_object_id(); + pinfo.type = var.get_type(); + pinfo.hint = PROPERTY_HINT_OBJECT_ID; + pinfo.hint_string = "Object"; + } + } + } + properties.push_back(SceneDebuggerProperty(pinfo, var)); + } +} + +/// SceneDebuggerTree +SceneDebuggerTree::SceneDebuggerTree(Node *p_root) { + // Flatten tree into list, depth first, use stack to avoid recursion. + List<Node *> stack; + stack.push_back(p_root); + while (stack.size()) { + Node *n = stack[0]; + stack.pop_front(); + int count = n->get_child_count(); + nodes.push_back(RemoteNode(count, n->get_name(), n->get_class(), n->get_instance_id())); + for (int i = 0; i < count; i++) { + stack.push_front(n->get_child(count - i - 1)); + } + } +} + +void SceneDebuggerTree::serialize(Array &p_arr) { + for (List<RemoteNode>::Element *E = nodes.front(); E; E = E->next()) { + RemoteNode &n = E->get(); + p_arr.push_back(n.child_count); + p_arr.push_back(n.name); + p_arr.push_back(n.type_name); + p_arr.push_back(n.id); + } +} + +void SceneDebuggerTree::deserialize(const Array &p_arr) { + int idx = 0; + while (p_arr.size() > idx) { + ERR_FAIL_COND(p_arr.size() < 4); + CHECK_TYPE(p_arr[idx], INT); + CHECK_TYPE(p_arr[idx + 1], STRING); + CHECK_TYPE(p_arr[idx + 2], STRING); + CHECK_TYPE(p_arr[idx + 3], INT); + nodes.push_back(RemoteNode(p_arr[idx], p_arr[idx + 1], p_arr[idx + 2], p_arr[idx + 3])); + idx += 4; + } +} + +/// LiveEditor +LiveEditor *LiveEditor::singleton = NULL; +LiveEditor *LiveEditor::get_singleton() { + return singleton; +} + +void LiveEditor::_send_tree() { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + Array arr; + // Encoded as a flat list depth fist. + SceneDebuggerTree tree(scene_tree->root); + tree.serialize(arr); + ScriptDebugger::get_singleton()->send_message("scene_tree", arr); +} + +void LiveEditor::_node_path_func(const NodePath &p_path, int p_id) { + + live_edit_node_path_cache[p_id] = p_path; +} + +void LiveEditor::_res_path_func(const String &p_path, int p_id) { + + live_edit_resource_cache[p_id] = p_path; +} + +void LiveEditor::_node_set_func(int p_id, const StringName &p_prop, const Variant &p_value) { + + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + if (!live_edit_node_path_cache.has(p_id)) + return; + + NodePath np = live_edit_node_path_cache[p_id]; + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(np)) + continue; + Node *n2 = n->get_node(np); + + n2->set(p_prop, p_value); + } +} + +void LiveEditor::_node_set_res_func(int p_id, const StringName &p_prop, const String &p_value) { + + RES r = ResourceLoader::load(p_value); + if (!r.is_valid()) + return; + _node_set_func(p_id, p_prop, r); +} +void LiveEditor::_node_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + if (!live_edit_node_path_cache.has(p_id)) + return; + + NodePath np = live_edit_node_path_cache[p_id]; + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(np)) + continue; + Node *n2 = n->get_node(np); + + n2->call(p_method, VARIANT_ARG_PASS); + } +} +void LiveEditor::_res_set_func(int p_id, const StringName &p_prop, const Variant &p_value) { + + if (!live_edit_resource_cache.has(p_id)) + return; + + String resp = live_edit_resource_cache[p_id]; + + if (!ResourceCache::has(resp)) + return; + + RES r = ResourceCache::get(resp); + if (!r.is_valid()) + return; + + r->set(p_prop, p_value); +} +void LiveEditor::_res_set_res_func(int p_id, const StringName &p_prop, const String &p_value) { + + RES r = ResourceLoader::load(p_value); + if (!r.is_valid()) + return; + _res_set_func(p_id, p_prop, r); +} +void LiveEditor::_res_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE) { + + if (!live_edit_resource_cache.has(p_id)) + return; + + String resp = live_edit_resource_cache[p_id]; + + if (!ResourceCache::has(resp)) + return; + + RES r = ResourceCache::get(resp); + if (!r.is_valid()) + return; + + r->call(p_method, VARIANT_ARG_PASS); +} + +void LiveEditor::_root_func(const NodePath &p_scene_path, const String &p_scene_from) { + + live_edit_root = p_scene_path; + live_edit_scene = p_scene_from; +} + +void LiveEditor::_create_node_func(const NodePath &p_parent, const String &p_type, const String &p_name) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(p_parent)) + continue; + Node *n2 = n->get_node(p_parent); + + Node *no = Object::cast_to<Node>(ClassDB::instance(p_type)); + if (!no) { + continue; + } + + no->set_name(p_name); + n2->add_child(no); + } +} +void LiveEditor::_instance_node_func(const NodePath &p_parent, const String &p_path, const String &p_name) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + Ref<PackedScene> ps = ResourceLoader::load(p_path); + + if (!ps.is_valid()) + return; + + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(p_parent)) + continue; + Node *n2 = n->get_node(p_parent); + + Node *no = ps->instance(); + if (!no) { + continue; + } + + no->set_name(p_name); + n2->add_child(no); + } +} +void LiveEditor::_remove_node_func(const NodePath &p_at) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F;) { + + Set<Node *>::Element *N = F->next(); + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(p_at)) + continue; + Node *n2 = n->get_node(p_at); + + memdelete(n2); + + F = N; + } +} +void LiveEditor::_remove_and_keep_node_func(const NodePath &p_at, ObjectID p_keep_id) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F;) { + + Set<Node *>::Element *N = F->next(); + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(p_at)) + continue; + + Node *n2 = n->get_node(p_at); + + n2->get_parent()->remove_child(n2); + + live_edit_remove_list[n][p_keep_id] = n2; + + F = N; + } +} +void LiveEditor::_restore_node_func(ObjectID p_id, const NodePath &p_at, int p_at_pos) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F;) { + + Set<Node *>::Element *N = F->next(); + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(p_at)) + continue; + Node *n2 = n->get_node(p_at); + + Map<Node *, Map<ObjectID, Node *> >::Element *EN = live_edit_remove_list.find(n); + + if (!EN) + continue; + + Map<ObjectID, Node *>::Element *FN = EN->get().find(p_id); + + if (!FN) + continue; + n2->add_child(FN->get()); + + EN->get().erase(FN); + + if (EN->get().size() == 0) { + live_edit_remove_list.erase(EN); + } + + F = N; + } +} +void LiveEditor::_duplicate_node_func(const NodePath &p_at, const String &p_new_name) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(p_at)) + continue; + Node *n2 = n->get_node(p_at); + + Node *dup = n2->duplicate(Node::DUPLICATE_SIGNALS | Node::DUPLICATE_GROUPS | Node::DUPLICATE_SCRIPTS); + + if (!dup) + continue; + + dup->set_name(p_new_name); + n2->get_parent()->add_child(dup); + } +} +void LiveEditor::_reparent_node_func(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) { + SceneTree *scene_tree = SceneTree::get_singleton(); + if (!scene_tree) + return; + + Node *base = NULL; + if (scene_tree->root->has_node(live_edit_root)) + base = scene_tree->root->get_node(live_edit_root); + + Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); + if (!E) + return; //scene not editable + + for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { + + Node *n = F->get(); + + if (base && !base->is_a_parent_of(n)) + continue; + + if (!n->has_node(p_at)) + continue; + Node *nfrom = n->get_node(p_at); + + if (!n->has_node(p_new_place)) + continue; + Node *nto = n->get_node(p_new_place); + + nfrom->get_parent()->remove_child(nfrom); + nfrom->set_name(p_new_name); + + nto->add_child(nfrom); + if (p_at_pos >= 0) + nto->move_child(nfrom, p_at_pos); + } +} + +#endif diff --git a/scene/debugger/scene_debugger.h b/scene/debugger/scene_debugger.h new file mode 100644 index 0000000000..d22f8e8e18 --- /dev/null +++ b/scene/debugger/scene_debugger.h @@ -0,0 +1,151 @@ +/*************************************************************************/ +/* scene_debugger.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef SCENE_DEBUGGER_H +#define SCENE_DEBUGGER_H + +#include "core/array.h" +#include "core/object.h" +#include "core/pair.h" +#include "core/script_language.h" +#include "core/ustring.h" + +class SceneDebugger { + +public: + static void initialize(); + static void deinitialize(); + +#ifdef DEBUG_ENABLED +private: + static void _save_node(ObjectID id, const String &p_path); + static void _set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value); + static void _send_object_id(ObjectID p_id, int p_max_size = 1 << 20); + +public: + static Error parse_message(const String &p_msg, const Array &p_args); + static void add_to_cache(const String &p_filename, Node *p_node); + static void remove_from_cache(const String &p_filename, Node *p_node); +#endif +}; + +#ifdef DEBUG_ENABLED +class SceneDebuggerObject { + +private: + void _parse_script_properties(Script *p_script, ScriptInstance *p_instance); + +public: + typedef Pair<PropertyInfo, Variant> SceneDebuggerProperty; + ObjectID id; + String class_name; + List<SceneDebuggerProperty> properties; + + SceneDebuggerObject(ObjectID p_id); + SceneDebuggerObject() {} + + void serialize(Array &r_arr, int p_max_size = 1 << 20); + void deserialize(const Array &p_arr); +}; + +class SceneDebuggerTree { + +public: + struct RemoteNode { + int child_count; + String name; + String type_name; + ObjectID id; + + RemoteNode(int p_child, const String &p_name, const String &p_type, ObjectID p_id) { + child_count = p_child; + name = p_name; + type_name = p_type; + id = p_id; + } + + RemoteNode() {} + }; + + List<RemoteNode> nodes; + + void serialize(Array &r_arr); + void deserialize(const Array &p_arr); + SceneDebuggerTree(Node *p_root); + SceneDebuggerTree(){}; +}; + +class LiveEditor { + +private: + friend class SceneDebugger; + Map<int, NodePath> live_edit_node_path_cache; + Map<int, String> live_edit_resource_cache; + + NodePath live_edit_root; + String live_edit_scene; + + Map<String, Set<Node *> > live_scene_edit_cache; + Map<Node *, Map<ObjectID, Node *> > live_edit_remove_list; + + void _send_tree(); + + void _node_path_func(const NodePath &p_path, int p_id); + void _res_path_func(const String &p_path, int p_id); + + void _node_set_func(int p_id, const StringName &p_prop, const Variant &p_value); + void _node_set_res_func(int p_id, const StringName &p_prop, const String &p_value); + void _node_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE); + void _res_set_func(int p_id, const StringName &p_prop, const Variant &p_value); + void _res_set_res_func(int p_id, const StringName &p_prop, const String &p_value); + void _res_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE); + void _root_func(const NodePath &p_scene_path, const String &p_scene_from); + + void _create_node_func(const NodePath &p_parent, const String &p_type, const String &p_name); + void _instance_node_func(const NodePath &p_parent, const String &p_path, const String &p_name); + void _remove_node_func(const NodePath &p_at); + void _remove_and_keep_node_func(const NodePath &p_at, ObjectID p_keep_id); + void _restore_node_func(ObjectID p_id, const NodePath &p_at, int p_at_pos); + void _duplicate_node_func(const NodePath &p_at, const String &p_new_name); + void _reparent_node_func(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos); + + LiveEditor() { + singleton = this; + live_edit_root = NodePath("/root"); + }; + + static LiveEditor *singleton; + +public: + static LiveEditor *get_singleton(); +}; +#endif + +#endif diff --git a/scene/debugger/script_debugger_remote.cpp b/scene/debugger/script_debugger_remote.cpp deleted file mode 100644 index 0e61a5746b..0000000000 --- a/scene/debugger/script_debugger_remote.cpp +++ /dev/null @@ -1,1313 +0,0 @@ -/*************************************************************************/ -/* script_debugger_remote.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "script_debugger_remote.h" - -#include "core/engine.h" -#include "core/io/ip.h" -#include "core/io/marshalls.h" -#include "core/os/input.h" -#include "core/os/os.h" -#include "core/project_settings.h" -#include "scene/main/node.h" -#include "scene/main/scene_tree.h" -#include "scene/main/viewport.h" -#include "scene/resources/packed_scene.h" -#include "servers/visual_server.h" - -void ScriptDebuggerRemote::_send_video_memory() { - - List<ResourceUsage> usage; - if (resource_usage_func) - resource_usage_func(&usage); - - usage.sort(); - - packet_peer_stream->put_var("message:video_mem"); - packet_peer_stream->put_var(usage.size() * 4); - - for (List<ResourceUsage>::Element *E = usage.front(); E; E = E->next()) { - - packet_peer_stream->put_var(E->get().path); - packet_peer_stream->put_var(E->get().type); - packet_peer_stream->put_var(E->get().format); - packet_peer_stream->put_var(E->get().vram); - } -} - -Error ScriptDebuggerRemote::connect_to_host(const String &p_host, uint16_t p_port) { - - IP_Address ip; - if (p_host.is_valid_ip_address()) - ip = p_host; - else - ip = IP::get_singleton()->resolve_hostname(p_host); - - int port = p_port; - - const int tries = 6; - int waits[tries] = { 1, 10, 100, 1000, 1000, 1000 }; - - tcp_client->connect_to_host(ip, port); - - for (int i = 0; i < tries; i++) { - - if (tcp_client->get_status() == StreamPeerTCP::STATUS_CONNECTED) { - print_verbose("Remote Debugger: Connected!"); - break; - } else { - - const int ms = waits[i]; - OS::get_singleton()->delay_usec(ms * 1000); - print_verbose("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in " + String::num(ms) + " msec."); - }; - }; - - if (tcp_client->get_status() != StreamPeerTCP::STATUS_CONNECTED) { - - ERR_PRINT("Remote Debugger: Unable to connect. Status: " + String::num(tcp_client->get_status()) + "."); - return FAILED; - }; - - packet_peer_stream->set_stream_peer(tcp_client); - - return OK; -} - -void ScriptDebuggerRemote::_put_variable(const String &p_name, const Variant &p_variable) { - - packet_peer_stream->put_var(p_name); - - Variant var = p_variable; - if (p_variable.get_type() == Variant::OBJECT && p_variable.get_validated_object() == nullptr) { - var = Variant(); - } - - int len = 0; - Error err = encode_variant(var, NULL, len, true); - if (err != OK) - ERR_PRINT("Failed to encode variant."); - - if (len > packet_peer_stream->get_output_buffer_max_size()) { //limit to max size - packet_peer_stream->put_var(Variant()); - } else { - packet_peer_stream->put_var(var); - } -} - -void ScriptDebuggerRemote::_save_node(ObjectID id, const String &p_path) { - - Node *node = Object::cast_to<Node>(ObjectDB::get_instance(id)); - ERR_FAIL_COND(!node); - - Ref<PackedScene> ps = memnew(PackedScene); - ps->pack(node); - ResourceSaver::save(p_path, ps); -} - -void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue, bool p_is_error_breakpoint) { - - //this function is called when there is a debugger break (bug on script) - //or when execution is paused from editor - - if (skip_breakpoints && !p_is_error_breakpoint) - return; - - ERR_FAIL_COND_MSG(!tcp_client->is_connected_to_host(), "Script Debugger failed to connect, but being used anyway."); - - packet_peer_stream->put_var("debug_enter"); - packet_peer_stream->put_var(2); - packet_peer_stream->put_var(p_can_continue); - packet_peer_stream->put_var(p_script->debug_get_error()); - - skip_profile_frame = true; // to avoid super long frame time for the frame - - Input::MouseMode mouse_mode = Input::get_singleton()->get_mouse_mode(); - if (mouse_mode != Input::MOUSE_MODE_VISIBLE) - Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); - - uint64_t loop_begin_usec = 0; - uint64_t loop_time_sec = 0; - while (true) { - loop_begin_usec = OS::get_singleton()->get_ticks_usec(); - - _get_output(); - - if (packet_peer_stream->get_available_packet_count() > 0) { - - Variant var; - Error err = packet_peer_stream->get_var(var); - - ERR_CONTINUE(err != OK); - ERR_CONTINUE(var.get_type() != Variant::ARRAY); - - Array cmd = var; - - ERR_CONTINUE(cmd.size() == 0); - ERR_CONTINUE(cmd[0].get_type() != Variant::STRING); - - String command = cmd[0]; - - if (command == "get_stack_dump") { - - packet_peer_stream->put_var("stack_dump"); - int slc = p_script->debug_get_stack_level_count(); - packet_peer_stream->put_var(slc); - - for (int i = 0; i < slc; i++) { - - Dictionary d; - d["file"] = p_script->debug_get_stack_level_source(i); - d["line"] = p_script->debug_get_stack_level_line(i); - d["function"] = p_script->debug_get_stack_level_function(i); - //d["id"]=p_script->debug_get_stack_level_ - d["id"] = 0; - - packet_peer_stream->put_var(d); - } - - } else if (command == "get_stack_frame_vars") { - - cmd.remove(0); - ERR_CONTINUE(cmd.size() != 1); - int lv = cmd[0]; - - List<String> members; - List<Variant> member_vals; - if (ScriptInstance *inst = p_script->debug_get_stack_level_instance(lv)) { - members.push_back("self"); - member_vals.push_back(inst->get_owner()); - } - p_script->debug_get_stack_level_members(lv, &members, &member_vals); - ERR_CONTINUE(members.size() != member_vals.size()); - - List<String> locals; - List<Variant> local_vals; - p_script->debug_get_stack_level_locals(lv, &locals, &local_vals); - ERR_CONTINUE(locals.size() != local_vals.size()); - - List<String> globals; - List<Variant> globals_vals; - p_script->debug_get_globals(&globals, &globals_vals); - ERR_CONTINUE(globals.size() != globals_vals.size()); - - packet_peer_stream->put_var("stack_frame_vars"); - packet_peer_stream->put_var(3 + (locals.size() + members.size() + globals.size()) * 2); - - { //locals - packet_peer_stream->put_var(locals.size()); - - List<String>::Element *E = locals.front(); - List<Variant>::Element *F = local_vals.front(); - - while (E) { - _put_variable(E->get(), F->get()); - - E = E->next(); - F = F->next(); - } - } - - { //members - packet_peer_stream->put_var(members.size()); - - List<String>::Element *E = members.front(); - List<Variant>::Element *F = member_vals.front(); - - while (E) { - - _put_variable(E->get(), F->get()); - - E = E->next(); - F = F->next(); - } - } - - { //globals - packet_peer_stream->put_var(globals.size()); - - List<String>::Element *E = globals.front(); - List<Variant>::Element *F = globals_vals.front(); - - while (E) { - _put_variable(E->get(), F->get()); - - E = E->next(); - F = F->next(); - } - } - - } else if (command == "step") { - - set_depth(-1); - set_lines_left(1); - break; - } else if (command == "next") { - - set_depth(0); - set_lines_left(1); - break; - - } else if (command == "continue") { - set_depth(-1); - set_lines_left(-1); - OS::get_singleton()->move_window_to_foreground(); - break; - } else if (command == "break") { - ERR_PRINT("Got break when already broke!"); - break; - } else if (command == "request_scene_tree") { - -#ifdef DEBUG_ENABLED - if (scene_tree) - scene_tree->_debugger_request_tree(); -#endif - } else if (command == "request_video_mem") { - - _send_video_memory(); - } else if (command == "inspect_object") { - - ObjectID id = cmd[1]; - _send_object_id(id); - } else if (command == "set_object_property") { - - _set_object_property(cmd[1], cmd[2], cmd[3]); - - } else if (command == "override_camera_2D:set") { - bool enforce = cmd[1]; - - if (scene_tree) { - scene_tree->get_root()->enable_canvas_transform_override(enforce); - } - } else if (command == "override_camera_2D:transform") { - Transform2D transform = cmd[1]; - - if (scene_tree) { - scene_tree->get_root()->set_canvas_transform_override(transform); - } - } else if (command == "override_camera_3D:set") { - bool enable = cmd[1]; - - if (scene_tree) { - scene_tree->get_root()->enable_camera_override(enable); - } - } else if (command == "override_camera_3D:transform") { - Transform transform = cmd[1]; - bool is_perspective = cmd[2]; - float size_or_fov = cmd[3]; - float near = cmd[4]; - float far = cmd[5]; - - if (scene_tree) { - if (is_perspective) { - scene_tree->get_root()->set_camera_override_perspective(size_or_fov, near, far); - } else { - scene_tree->get_root()->set_camera_override_orthogonal(size_or_fov, near, far); - } - scene_tree->get_root()->set_camera_override_transform(transform); - } - - } else if (command == "reload_scripts") { - reload_all_scripts = true; - } else if (command == "breakpoint") { - - bool set = cmd[3]; - if (set) - insert_breakpoint(cmd[2], cmd[1]); - else - remove_breakpoint(cmd[2], cmd[1]); - - } else if (command == "save_node") { - _save_node(cmd[1], cmd[2]); - } else if (command == "set_skip_breakpoints") { - skip_breakpoints = cmd[1]; - } else { - _parse_live_edit(cmd); - } - - } else { - OS::get_singleton()->delay_usec(10000); - OS::get_singleton()->process_and_drop_events(); - } - - // This is for the camera override to stay live even when the game is paused from the editor - loop_time_sec = (OS::get_singleton()->get_ticks_usec() - loop_begin_usec) / 1000000.0f; - VisualServer::get_singleton()->sync(); - if (VisualServer::get_singleton()->has_changed()) { - VisualServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale()); - } - } - - packet_peer_stream->put_var("debug_exit"); - packet_peer_stream->put_var(0); - - if (mouse_mode != Input::MOUSE_MODE_VISIBLE) - Input::get_singleton()->set_mouse_mode(mouse_mode); -} - -void ScriptDebuggerRemote::_get_output() { - - mutex->lock(); - if (output_strings.size()) { - - locking = true; - packet_peer_stream->put_var("output"); - packet_peer_stream->put_var(output_strings.size()); - - while (output_strings.size()) { - - packet_peer_stream->put_var(output_strings.front()->get()); - output_strings.pop_front(); - } - locking = false; - } - - if (n_messages_dropped > 0) { - Message msg; - msg.message = "Too many messages! " + String::num_int64(n_messages_dropped) + " messages were dropped."; - messages.push_back(msg); - n_messages_dropped = 0; - } - - while (messages.size()) { - locking = true; - packet_peer_stream->put_var("message:" + messages.front()->get().message); - packet_peer_stream->put_var(messages.front()->get().data.size()); - for (int i = 0; i < messages.front()->get().data.size(); i++) { - packet_peer_stream->put_var(messages.front()->get().data[i]); - } - messages.pop_front(); - locking = false; - } - - if (n_errors_dropped == 1) { - // Only print one message about dropping per second - OutputError oe; - oe.error = "TOO_MANY_ERRORS"; - oe.error_descr = "Too many errors! Ignoring errors for up to 1 second."; - oe.warning = false; - uint64_t time = OS::get_singleton()->get_ticks_msec(); - oe.hr = time / 3600000; - oe.min = (time / 60000) % 60; - oe.sec = (time / 1000) % 60; - oe.msec = time % 1000; - errors.push_back(oe); - } - - if (n_warnings_dropped == 1) { - // Only print one message about dropping per second - OutputError oe; - oe.error = "TOO_MANY_WARNINGS"; - oe.error_descr = "Too many warnings! Ignoring warnings for up to 1 second."; - oe.warning = true; - uint64_t time = OS::get_singleton()->get_ticks_msec(); - oe.hr = time / 3600000; - oe.min = (time / 60000) % 60; - oe.sec = (time / 1000) % 60; - oe.msec = time % 1000; - errors.push_back(oe); - } - - while (errors.size()) { - locking = true; - packet_peer_stream->put_var("error"); - OutputError oe = errors.front()->get(); - - packet_peer_stream->put_var(oe.callstack.size() + 2); - - Array error_data; - - error_data.push_back(oe.hr); - error_data.push_back(oe.min); - error_data.push_back(oe.sec); - error_data.push_back(oe.msec); - error_data.push_back(oe.source_func); - error_data.push_back(oe.source_file); - error_data.push_back(oe.source_line); - error_data.push_back(oe.error); - error_data.push_back(oe.error_descr); - error_data.push_back(oe.warning); - packet_peer_stream->put_var(error_data); - packet_peer_stream->put_var(oe.callstack.size()); - for (int i = 0; i < oe.callstack.size(); i++) { - packet_peer_stream->put_var(oe.callstack[i]); - } - - errors.pop_front(); - locking = false; - } - mutex->unlock(); -} - -void ScriptDebuggerRemote::line_poll() { - - //the purpose of this is just processing events every now and then when the script might get too busy - //otherwise bugs like infinite loops can't be caught - if (poll_every % 2048 == 0) - _poll_events(); - poll_every++; -} - -void ScriptDebuggerRemote::_err_handler(void *ud, const char *p_func, const char *p_file, int p_line, const char *p_err, const char *p_descr, ErrorHandlerType p_type) { - - if (p_type == ERR_HANDLER_SCRIPT) - return; //ignore script errors, those go through debugger - - Vector<ScriptLanguage::StackInfo> si; - - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - si = ScriptServer::get_language(i)->debug_get_current_stack_info(); - if (si.size()) - break; - } - - ScriptDebuggerRemote *sdr = (ScriptDebuggerRemote *)ud; - sdr->send_error(p_func, p_file, p_line, p_err, p_descr, p_type, si); -} - -bool ScriptDebuggerRemote::_parse_live_edit(const Array &p_command) { - -#ifdef DEBUG_ENABLED - - String cmdstr = p_command[0]; - if (!scene_tree || !cmdstr.begins_with("live_")) - return false; - - if (cmdstr == "live_set_root") { - - scene_tree->_live_edit_root_func(p_command[1], p_command[2]); - - } else if (cmdstr == "live_node_path") { - - scene_tree->_live_edit_node_path_func(p_command[1], p_command[2]); - - } else if (cmdstr == "live_res_path") { - - scene_tree->_live_edit_res_path_func(p_command[1], p_command[2]); - - } else if (cmdstr == "live_node_prop_res") { - - scene_tree->_live_edit_node_set_res_func(p_command[1], p_command[2], p_command[3]); - - } else if (cmdstr == "live_node_prop") { - - scene_tree->_live_edit_node_set_func(p_command[1], p_command[2], p_command[3]); - - } else if (cmdstr == "live_res_prop_res") { - - scene_tree->_live_edit_res_set_res_func(p_command[1], p_command[2], p_command[3]); - - } else if (cmdstr == "live_res_prop") { - - scene_tree->_live_edit_res_set_func(p_command[1], p_command[2], p_command[3]); - - } else if (cmdstr == "live_node_call") { - - scene_tree->_live_edit_node_call_func(p_command[1], p_command[2], p_command[3], p_command[4], p_command[5], p_command[6], p_command[7]); - - } else if (cmdstr == "live_res_call") { - - scene_tree->_live_edit_res_call_func(p_command[1], p_command[2], p_command[3], p_command[4], p_command[5], p_command[6], p_command[7]); - - } else if (cmdstr == "live_create_node") { - - scene_tree->_live_edit_create_node_func(p_command[1], p_command[2], p_command[3]); - - } else if (cmdstr == "live_instance_node") { - - scene_tree->_live_edit_instance_node_func(p_command[1], p_command[2], p_command[3]); - - } else if (cmdstr == "live_remove_node") { - - scene_tree->_live_edit_remove_node_func(p_command[1]); - - } else if (cmdstr == "live_remove_and_keep_node") { - - scene_tree->_live_edit_remove_and_keep_node_func(p_command[1], p_command[2]); - - } else if (cmdstr == "live_restore_node") { - - scene_tree->_live_edit_restore_node_func(p_command[1], p_command[2], p_command[3]); - - } else if (cmdstr == "live_duplicate_node") { - - scene_tree->_live_edit_duplicate_node_func(p_command[1], p_command[2]); - - } else if (cmdstr == "live_reparent_node") { - - scene_tree->_live_edit_reparent_node_func(p_command[1], p_command[2], p_command[3], p_command[4]); - - } else { - - return false; - } - - return true; -#else - - return false; -#endif -} - -void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) { - - Object *obj = ObjectDB::get_instance(p_id); - if (!obj) - return; - - typedef Pair<PropertyInfo, Variant> PropertyDesc; - List<PropertyDesc> properties; - - if (ScriptInstance *si = obj->get_script_instance()) { - if (!si->get_script().is_null()) { - - typedef Map<const Script *, Set<StringName> > ScriptMemberMap; - typedef Map<const Script *, Map<StringName, Variant> > ScriptConstantsMap; - - ScriptMemberMap members; - members[si->get_script().ptr()] = Set<StringName>(); - si->get_script()->get_members(&(members[si->get_script().ptr()])); - - ScriptConstantsMap constants; - constants[si->get_script().ptr()] = Map<StringName, Variant>(); - si->get_script()->get_constants(&(constants[si->get_script().ptr()])); - - Ref<Script> base = si->get_script()->get_base_script(); - while (base.is_valid()) { - - members[base.ptr()] = Set<StringName>(); - base->get_members(&(members[base.ptr()])); - - constants[base.ptr()] = Map<StringName, Variant>(); - base->get_constants(&(constants[base.ptr()])); - - base = base->get_base_script(); - } - - for (ScriptMemberMap::Element *sm = members.front(); sm; sm = sm->next()) { - for (Set<StringName>::Element *E = sm->get().front(); E; E = E->next()) { - Variant m; - if (si->get(E->get(), m)) { - String script_path = sm->key() == si->get_script().ptr() ? "" : sm->key()->get_path().get_file() + "/"; - PropertyInfo pi(m.get_type(), "Members/" + script_path + E->get()); - properties.push_back(PropertyDesc(pi, m)); - } - } - } - - for (ScriptConstantsMap::Element *sc = constants.front(); sc; sc = sc->next()) { - for (Map<StringName, Variant>::Element *E = sc->get().front(); E; E = E->next()) { - String script_path = sc->key() == si->get_script().ptr() ? "" : sc->key()->get_path().get_file() + "/"; - if (E->value().get_type() == Variant::OBJECT) { - Variant id = ((Object *)E->value())->get_instance_id(); - PropertyInfo pi(id.get_type(), "Constants/" + E->key(), PROPERTY_HINT_OBJECT_ID, "Object"); - properties.push_back(PropertyDesc(pi, id)); - } else { - PropertyInfo pi(E->value().get_type(), "Constants/" + script_path + E->key()); - properties.push_back(PropertyDesc(pi, E->value())); - } - } - } - } - } - - if (Node *node = Object::cast_to<Node>(obj)) { - // in some cases node will not be in tree here - // for instance where it created as variable and not yet added to tree - // in such cases we can't ask for it's path - if (node->is_inside_tree()) { - PropertyInfo pi(Variant::NODE_PATH, String("Node/path")); - properties.push_front(PropertyDesc(pi, node->get_path())); - } else { - PropertyInfo pi(Variant::STRING, String("Node/path")); - properties.push_front(PropertyDesc(pi, "[Orphan]")); - } - - } else if (Resource *res = Object::cast_to<Resource>(obj)) { - if (Script *s = Object::cast_to<Script>(res)) { - Map<StringName, Variant> constants; - s->get_constants(&constants); - for (Map<StringName, Variant>::Element *E = constants.front(); E; E = E->next()) { - if (E->value().get_type() == Variant::OBJECT) { - Variant id = ((Object *)E->value())->get_instance_id(); - PropertyInfo pi(id.get_type(), "Constants/" + E->key(), PROPERTY_HINT_OBJECT_ID, "Object"); - properties.push_front(PropertyDesc(pi, E->value())); - } else { - PropertyInfo pi(E->value().get_type(), String("Constants/") + E->key()); - properties.push_front(PropertyDesc(pi, E->value())); - } - } - } - } - - List<PropertyInfo> pinfo; - obj->get_property_list(&pinfo, true); - for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) { - if (E->get().usage & (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CATEGORY)) { - properties.push_back(PropertyDesc(E->get(), obj->get(E->get().name))); - } - } - - Array send_props; - for (int i = 0; i < properties.size(); i++) { - const PropertyInfo &pi = properties[i].first; - Variant &var = properties[i].second; - - WeakRef *ref = Object::cast_to<WeakRef>(var); - if (ref) { - var = ref->get_ref(); - } - - RES res = var; - - Array prop; - prop.push_back(pi.name); - prop.push_back(pi.type); - - //only send information that can be sent.. - int len = 0; //test how big is this to encode - encode_variant(var, NULL, len); - if (len > packet_peer_stream->get_output_buffer_max_size()) { //limit to max size - prop.push_back(PROPERTY_HINT_OBJECT_TOO_BIG); - prop.push_back(""); - prop.push_back(pi.usage); - prop.push_back(Variant()); - } else { - prop.push_back(pi.hint); - prop.push_back(pi.hint_string); - prop.push_back(pi.usage); - - if (!res.is_null()) { - var = res->get_path(); - } - - prop.push_back(var); - } - send_props.push_back(prop); - } - - packet_peer_stream->put_var("message:inspect_object"); - packet_peer_stream->put_var(3); - packet_peer_stream->put_var(p_id); - packet_peer_stream->put_var(obj->get_class()); - packet_peer_stream->put_var(send_props); -} - -void ScriptDebuggerRemote::_set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value) { - - Object *obj = ObjectDB::get_instance(p_id); - if (!obj) - return; - - String prop_name = p_property; - if (p_property.begins_with("Members/")) { - Vector<String> ss = p_property.split("/"); - prop_name = ss[ss.size() - 1]; - } - - obj->set(prop_name, p_value); -} - -void ScriptDebuggerRemote::_poll_events() { - - //this si called from ::idle_poll, happens only when running the game, - //does not get called while on debug break - - while (packet_peer_stream->get_available_packet_count() > 0) { - - _get_output(); - - //send over output_strings - - Variant var; - Error err = packet_peer_stream->get_var(var); - - ERR_CONTINUE(err != OK); - ERR_CONTINUE(var.get_type() != Variant::ARRAY); - - Array cmd = var; - - ERR_CONTINUE(cmd.size() == 0); - ERR_CONTINUE(cmd[0].get_type() != Variant::STRING); - - String command = cmd[0]; - //cmd.remove(0); - - if (command == "break") { - - if (get_break_language()) - debug(get_break_language()); - } else if (command == "request_scene_tree") { - -#ifdef DEBUG_ENABLED - if (scene_tree) - scene_tree->_debugger_request_tree(); -#endif - } else if (command == "request_video_mem") { - - _send_video_memory(); - } else if (command == "inspect_object") { - - ObjectID id = cmd[1]; - _send_object_id(id); - } else if (command == "set_object_property") { - - _set_object_property(cmd[1], cmd[2], cmd[3]); - - } else if (command == "start_profiling") { - - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - ScriptServer::get_language(i)->profiling_start(); - } - - max_frame_functions = cmd[1]; - profiler_function_signature_map.clear(); - profiling = true; - frame_time = 0; - idle_time = 0; - physics_time = 0; - physics_frame_time = 0; - - print_line("PROFILING ALRIGHT!"); - - } else if (command == "stop_profiling") { - - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - ScriptServer::get_language(i)->profiling_stop(); - } - profiling = false; - _send_profiling_data(false); - print_line("PROFILING END!"); - } else if (command == "start_visual_profiling") { - - visual_profiling = true; - VS::get_singleton()->set_frame_profiling_enabled(true); - } else if (command == "stop_visual_profiling") { - - visual_profiling = false; - VS::get_singleton()->set_frame_profiling_enabled(false); - } else if (command == "start_network_profiling") { - - network_profiling = true; - multiplayer->profiling_start(); - } else if (command == "stop_network_profiling") { - - network_profiling = false; - multiplayer->profiling_end(); - } else if (command == "override_camera_2D:set") { - bool enforce = cmd[1]; - - if (scene_tree) { - scene_tree->get_root()->enable_canvas_transform_override(enforce); - } - } else if (command == "override_camera_2D:transform") { - Transform2D transform = cmd[1]; - - if (scene_tree) { - scene_tree->get_root()->set_canvas_transform_override(transform); - } - } else if (command == "override_camera_3D:set") { - bool enable = cmd[1]; - - if (scene_tree) { - scene_tree->get_root()->enable_camera_override(enable); - } - } else if (command == "override_camera_3D:transform") { - Transform transform = cmd[1]; - bool is_perspective = cmd[2]; - float size_or_fov = cmd[3]; - float near = cmd[4]; - float far = cmd[5]; - - if (scene_tree) { - if (is_perspective) { - scene_tree->get_root()->set_camera_override_perspective(size_or_fov, near, far); - } else { - scene_tree->get_root()->set_camera_override_orthogonal(size_or_fov, near, far); - } - scene_tree->get_root()->set_camera_override_transform(transform); - } - - } else if (command == "reload_scripts") { - reload_all_scripts = true; - } else if (command == "breakpoint") { - - bool set = cmd[3]; - if (set) - insert_breakpoint(cmd[2], cmd[1]); - else - remove_breakpoint(cmd[2], cmd[1]); - } else if (command == "set_skip_breakpoints") { - skip_breakpoints = cmd[1]; - } else { - _parse_live_edit(cmd); - } - } -} - -void ScriptDebuggerRemote::_send_profiling_data(bool p_for_frame) { - - int ofs = 0; - - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - if (p_for_frame) - ofs += ScriptServer::get_language(i)->profiling_get_frame_data(&profile_info.write[ofs], profile_info.size() - ofs); - else - ofs += ScriptServer::get_language(i)->profiling_get_accumulated_data(&profile_info.write[ofs], profile_info.size() - ofs); - } - - for (int i = 0; i < ofs; i++) { - profile_info_ptrs.write[i] = &profile_info.write[i]; - } - - SortArray<ScriptLanguage::ProfilingInfo *, ProfileInfoSort> sa; - sa.sort(profile_info_ptrs.ptrw(), ofs); - - int to_send = MIN(ofs, max_frame_functions); - - //check signatures first - uint64_t total_script_time = 0; - - for (int i = 0; i < to_send; i++) { - - if (!profiler_function_signature_map.has(profile_info_ptrs[i]->signature)) { - - int idx = profiler_function_signature_map.size(); - packet_peer_stream->put_var("profile_sig"); - packet_peer_stream->put_var(2); - packet_peer_stream->put_var(profile_info_ptrs[i]->signature); - packet_peer_stream->put_var(idx); - - profiler_function_signature_map[profile_info_ptrs[i]->signature] = idx; - } - - total_script_time += profile_info_ptrs[i]->self_time; - } - - //send frames then - - if (p_for_frame) { - packet_peer_stream->put_var("profile_frame"); - packet_peer_stream->put_var(8 + profile_frame_data.size() * 2 + to_send * 4); - } else { - packet_peer_stream->put_var("profile_total"); - packet_peer_stream->put_var(8 + to_send * 4); - } - - packet_peer_stream->put_var(Engine::get_singleton()->get_frames_drawn()); //total frame time - packet_peer_stream->put_var(frame_time); //total frame time - packet_peer_stream->put_var(idle_time); //idle frame time - packet_peer_stream->put_var(physics_time); //fixed frame time - packet_peer_stream->put_var(physics_frame_time); //fixed frame time - - packet_peer_stream->put_var(USEC_TO_SEC(total_script_time)); //total script execution time - - if (p_for_frame) { - - packet_peer_stream->put_var(profile_frame_data.size()); //how many profile framedatas to send - packet_peer_stream->put_var(to_send); //how many script functions to send - for (int i = 0; i < profile_frame_data.size(); i++) { - - packet_peer_stream->put_var(profile_frame_data[i].name); - packet_peer_stream->put_var(profile_frame_data[i].data); - } - } else { - packet_peer_stream->put_var(0); //how many script functions to send - packet_peer_stream->put_var(to_send); //how many script functions to send - } - - for (int i = 0; i < to_send; i++) { - - int sig_id = -1; - - if (profiler_function_signature_map.has(profile_info_ptrs[i]->signature)) { - sig_id = profiler_function_signature_map[profile_info_ptrs[i]->signature]; - } - - packet_peer_stream->put_var(sig_id); - packet_peer_stream->put_var(profile_info_ptrs[i]->call_count); - packet_peer_stream->put_var(profile_info_ptrs[i]->total_time / 1000000.0); - packet_peer_stream->put_var(profile_info_ptrs[i]->self_time / 1000000.0); - } - - if (p_for_frame) { - profile_frame_data.clear(); - } -} - -void ScriptDebuggerRemote::idle_poll() { - - // this function is called every frame, except when there is a debugger break (::debug() in this class) - // execution stops and remains in the ::debug function - - _get_output(); - - if (requested_quit) { - - packet_peer_stream->put_var("kill_me"); - packet_peer_stream->put_var(0); - requested_quit = false; - } - - if (performance) { - - uint64_t pt = OS::get_singleton()->get_ticks_msec(); - if (pt - last_perf_time > 1000) { - - last_perf_time = pt; - int max = performance->get("MONITOR_MAX"); - Array arr; - arr.resize(max); - for (int i = 0; i < max; i++) { - arr[i] = performance->call("get_monitor", i); - } - packet_peer_stream->put_var("performance"); - packet_peer_stream->put_var(1); - packet_peer_stream->put_var(arr); - } - } - if (visual_profiling) { - Vector<VS::FrameProfileArea> profile_areas = VS::get_singleton()->get_frame_profile(); - if (profile_areas.size()) { - Vector<String> area_names; - Vector<real_t> area_times; - area_names.resize(profile_areas.size()); - area_times.resize(profile_areas.size() * 2); - { - String *area_namesw = area_names.ptrw(); - real_t *area_timesw = area_times.ptrw(); - - for (int i = 0; i < profile_areas.size(); i++) { - area_namesw[i] = profile_areas[i].name; - area_timesw[i * 2 + 0] = profile_areas[i].cpu_msec; - area_timesw[i * 2 + 1] = profile_areas[i].gpu_msec; - } - } - packet_peer_stream->put_var("visual_profile"); - packet_peer_stream->put_var(3); - packet_peer_stream->put_var(VS::get_singleton()->get_frame_profile_frame()); - packet_peer_stream->put_var(area_names); - packet_peer_stream->put_var(area_times); - } - } - - if (profiling) { - - if (skip_profile_frame) { - skip_profile_frame = false; - } else { - //send profiling info normally - _send_profiling_data(true); - } - } - - if (network_profiling) { - uint64_t pt = OS::get_singleton()->get_ticks_msec(); - if (pt - last_net_bandwidth_time > 200) { - last_net_bandwidth_time = pt; - _send_network_bandwidth_usage(); - } - if (pt - last_net_prof_time > 100) { - last_net_prof_time = pt; - _send_network_profiling_data(); - } - } - - if (reload_all_scripts) { - - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - ScriptServer::get_language(i)->reload_all_scripts(); - } - reload_all_scripts = false; - } - - _poll_events(); -} - -void ScriptDebuggerRemote::_send_network_profiling_data() { - ERR_FAIL_COND(multiplayer.is_null()); - - int n_nodes = multiplayer->get_profiling_frame(&network_profile_info.write[0]); - - packet_peer_stream->put_var("network_profile"); - packet_peer_stream->put_var(n_nodes * 6); - for (int i = 0; i < n_nodes; ++i) { - packet_peer_stream->put_var(network_profile_info[i].node); - packet_peer_stream->put_var(network_profile_info[i].node_path); - packet_peer_stream->put_var(network_profile_info[i].incoming_rpc); - packet_peer_stream->put_var(network_profile_info[i].incoming_rset); - packet_peer_stream->put_var(network_profile_info[i].outgoing_rpc); - packet_peer_stream->put_var(network_profile_info[i].outgoing_rset); - } -} - -void ScriptDebuggerRemote::_send_network_bandwidth_usage() { - ERR_FAIL_COND(multiplayer.is_null()); - - int incoming_bandwidth = multiplayer->get_incoming_bandwidth_usage(); - int outgoing_bandwidth = multiplayer->get_outgoing_bandwidth_usage(); - - packet_peer_stream->put_var("network_bandwidth"); - packet_peer_stream->put_var(2); - packet_peer_stream->put_var(incoming_bandwidth); - packet_peer_stream->put_var(outgoing_bandwidth); -} - -void ScriptDebuggerRemote::send_message(const String &p_message, const Array &p_args) { - - mutex->lock(); - if (!locking && tcp_client->is_connected_to_host()) { - - if (messages.size() >= max_messages_per_frame) { - n_messages_dropped++; - } else { - Message msg; - msg.message = p_message; - msg.data = p_args; - messages.push_back(msg); - } - } - mutex->unlock(); -} - -void ScriptDebuggerRemote::send_error(const String &p_func, const String &p_file, int p_line, const String &p_err, const String &p_descr, ErrorHandlerType p_type, const Vector<ScriptLanguage::StackInfo> &p_stack_info) { - - OutputError oe; - oe.error = p_err; - oe.error_descr = p_descr; - oe.source_file = p_file; - oe.source_line = p_line; - oe.source_func = p_func; - oe.warning = p_type == ERR_HANDLER_WARNING; - uint64_t time = OS::get_singleton()->get_ticks_msec(); - oe.hr = time / 3600000; - oe.min = (time / 60000) % 60; - oe.sec = (time / 1000) % 60; - oe.msec = time % 1000; - Array cstack; - - uint64_t ticks = OS::get_singleton()->get_ticks_usec() / 1000; - msec_count += ticks - last_msec; - last_msec = ticks; - - if (msec_count > 1000) { - msec_count = 0; - - err_count = 0; - n_errors_dropped = 0; - warn_count = 0; - n_warnings_dropped = 0; - } - - cstack.resize(p_stack_info.size() * 3); - for (int i = 0; i < p_stack_info.size(); i++) { - cstack[i * 3 + 0] = p_stack_info[i].file; - cstack[i * 3 + 1] = p_stack_info[i].func; - cstack[i * 3 + 2] = p_stack_info[i].line; - } - - oe.callstack = cstack; - if (oe.warning) { - warn_count++; - } else { - err_count++; - } - - mutex->lock(); - - if (!locking && tcp_client->is_connected_to_host()) { - - if (oe.warning) { - if (warn_count > max_warnings_per_second) { - n_warnings_dropped++; - } else { - errors.push_back(oe); - } - } else { - if (err_count > max_errors_per_second) { - n_errors_dropped++; - } else { - errors.push_back(oe); - } - } - } - - mutex->unlock(); -} - -void ScriptDebuggerRemote::_print_handler(void *p_this, const String &p_string, bool p_error) { - - ScriptDebuggerRemote *sdr = (ScriptDebuggerRemote *)p_this; - - uint64_t ticks = OS::get_singleton()->get_ticks_usec() / 1000; - sdr->msec_count += ticks - sdr->last_msec; - sdr->last_msec = ticks; - - if (sdr->msec_count > 1000) { - sdr->char_count = 0; - sdr->msec_count = 0; - } - - String s = p_string; - int allowed_chars = MIN(MAX(sdr->max_cps - sdr->char_count, 0), s.length()); - - if (allowed_chars == 0) - return; - - if (allowed_chars < s.length()) { - s = s.substr(0, allowed_chars); - } - - sdr->char_count += allowed_chars; - bool overflowed = sdr->char_count >= sdr->max_cps; - - sdr->mutex->lock(); - if (!sdr->locking && sdr->tcp_client->is_connected_to_host()) { - - if (overflowed) - s += "[...]"; - - sdr->output_strings.push_back(s); - - if (overflowed) { - sdr->output_strings.push_back("[output overflow, print less text!]"); - } - } - sdr->mutex->unlock(); -} - -void ScriptDebuggerRemote::request_quit() { - - requested_quit = true; -} - -void ScriptDebuggerRemote::set_multiplayer(Ref<MultiplayerAPI> p_multiplayer) { - multiplayer = p_multiplayer; -} - -bool ScriptDebuggerRemote::is_profiling() const { - - return profiling; -} -void ScriptDebuggerRemote::add_profiling_frame_data(const StringName &p_name, const Array &p_data) { - - int idx = -1; - for (int i = 0; i < profile_frame_data.size(); i++) { - if (profile_frame_data[i].name == p_name) { - idx = i; - break; - } - } - - FrameData fd; - fd.name = p_name; - fd.data = p_data; - - if (idx == -1) { - profile_frame_data.push_back(fd); - } else { - profile_frame_data.write[idx] = fd; - } -} - -void ScriptDebuggerRemote::profiling_start() { - //ignores this, uses it via connection -} - -void ScriptDebuggerRemote::profiling_end() { - //ignores this, uses it via connection -} - -void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time) { - - frame_time = p_frame_time; - idle_time = p_idle_time; - physics_time = p_physics_time; - physics_frame_time = p_physics_frame_time; -} - -void ScriptDebuggerRemote::set_skip_breakpoints(bool p_skip_breakpoints) { - skip_breakpoints = p_skip_breakpoints; -} - -ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL; - -ScriptDebuggerRemote::ScriptDebuggerRemote() : - profiling(false), - visual_profiling(false), - network_profiling(false), - max_frame_functions(16), - skip_profile_frame(false), - reload_all_scripts(false), - tcp_client(Ref<StreamPeerTCP>(memnew(StreamPeerTCP))), - packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))), - last_perf_time(0), - last_net_prof_time(0), - last_net_bandwidth_time(0), - performance(Engine::get_singleton()->get_singleton_object("Performance")), - requested_quit(false), - mutex(Mutex::create()), - max_messages_per_frame(GLOBAL_GET("network/limits/debugger_stdout/max_messages_per_frame")), - n_messages_dropped(0), - max_errors_per_second(GLOBAL_GET("network/limits/debugger_stdout/max_errors_per_second")), - max_warnings_per_second(GLOBAL_GET("network/limits/debugger_stdout/max_warnings_per_second")), - n_errors_dropped(0), - max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), - char_count(0), - err_count(0), - warn_count(0), - last_msec(0), - msec_count(0), - locking(false), - poll_every(0), - scene_tree(NULL) { - - packet_peer_stream->set_stream_peer(tcp_client); - packet_peer_stream->set_output_buffer_max_size((1024 * 1024 * 8) - 4); // 8 MiB should be way more than enough, minus 4 bytes for separator. - - phl.printfunc = _print_handler; - phl.userdata = this; - add_print_handler(&phl); - - eh.errfunc = _err_handler; - eh.userdata = this; - add_error_handler(&eh); - - profile_info.resize(GLOBAL_GET("debug/settings/profiler/max_functions")); - network_profile_info.resize(GLOBAL_GET("debug/settings/profiler/max_functions")); - profile_info_ptrs.resize(profile_info.size()); -} - -ScriptDebuggerRemote::~ScriptDebuggerRemote() { - - remove_print_handler(&phl); - remove_error_handler(&eh); - memdelete(mutex); -} diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 04ff11f20c..784d298bff 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -106,7 +106,7 @@ void Button::_notification(int p_what) { break; } - FALLTHROUGH; + [[fallthrough]]; } case DRAW_PRESSED: { diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 6ed16a2b75..cb71128424 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -615,9 +615,9 @@ void ColorPicker::_screen_pick_pressed() { screen->set_as_toplevel(true); screen->set_anchors_and_margins_preset(Control::PRESET_WIDE); screen->set_default_cursor_shape(CURSOR_POINTING_HAND); - screen->connect("gui_input", this, "_screen_input"); + screen->connect_compat("gui_input", this, "_screen_input"); // It immediately toggles off in the first press otherwise. - screen->call_deferred("connect", "hide", btn_pick, "set_pressed", varray(false)); + screen->call_deferred("connect", "hide", Callable(btn_pick, "set_pressed"), varray(false)); } screen->raise(); screen->show_modal(); @@ -742,20 +742,20 @@ ColorPicker::ColorPicker() : uv_edit = memnew(Control); hb_edit->add_child(uv_edit); - uv_edit->connect("gui_input", this, "_uv_input"); + uv_edit->connect_compat("gui_input", this, "_uv_input"); uv_edit->set_mouse_filter(MOUSE_FILTER_PASS); uv_edit->set_h_size_flags(SIZE_EXPAND_FILL); uv_edit->set_v_size_flags(SIZE_EXPAND_FILL); uv_edit->set_custom_minimum_size(Size2(get_constant("sv_width"), get_constant("sv_height"))); - uv_edit->connect("draw", this, "_hsv_draw", make_binds(0, uv_edit)); + uv_edit->connect_compat("draw", this, "_hsv_draw", make_binds(0, uv_edit)); w_edit = memnew(Control); hb_edit->add_child(w_edit); w_edit->set_custom_minimum_size(Size2(get_constant("h_width"), 0)); w_edit->set_h_size_flags(SIZE_FILL); w_edit->set_v_size_flags(SIZE_EXPAND_FILL); - w_edit->connect("gui_input", this, "_w_input"); - w_edit->connect("draw", this, "_hsv_draw", make_binds(1, w_edit)); + w_edit->connect_compat("gui_input", this, "_w_input"); + w_edit->connect_compat("draw", this, "_hsv_draw", make_binds(1, w_edit)); HBoxContainer *hb_smpl = memnew(HBoxContainer); add_child(hb_smpl); @@ -763,13 +763,13 @@ ColorPicker::ColorPicker() : sample = memnew(TextureRect); hb_smpl->add_child(sample); sample->set_h_size_flags(SIZE_EXPAND_FILL); - sample->connect("draw", this, "_sample_draw"); + sample->connect_compat("draw", this, "_sample_draw"); btn_pick = memnew(ToolButton); hb_smpl->add_child(btn_pick); btn_pick->set_toggle_mode(true); btn_pick->set_tooltip(TTR("Pick a color from the editor window.")); - btn_pick->connect("pressed", this, "_screen_pick_pressed"); + btn_pick->connect_compat("pressed", this, "_screen_pick_pressed"); VBoxContainer *vbl = memnew(VBoxContainer); add_child(vbl); @@ -797,14 +797,14 @@ ColorPicker::ColorPicker() : values[i] = memnew(SpinBox); scroll[i]->share(values[i]); hbc->add_child(values[i]); - values[i]->get_line_edit()->connect("focus_entered", this, "_focus_enter"); - values[i]->get_line_edit()->connect("focus_exited", this, "_focus_exit"); + values[i]->get_line_edit()->connect_compat("focus_entered", this, "_focus_enter"); + values[i]->get_line_edit()->connect_compat("focus_exited", this, "_focus_exit"); scroll[i]->set_min(0); scroll[i]->set_page(0); scroll[i]->set_h_size_flags(SIZE_EXPAND_FILL); - scroll[i]->connect("value_changed", this, "_value_changed"); + scroll[i]->connect_compat("value_changed", this, "_value_changed"); vbr->add_child(hbc); } @@ -816,12 +816,12 @@ ColorPicker::ColorPicker() : btn_hsv = memnew(CheckButton); hhb->add_child(btn_hsv); btn_hsv->set_text(TTR("HSV")); - btn_hsv->connect("toggled", this, "set_hsv_mode"); + btn_hsv->connect_compat("toggled", this, "set_hsv_mode"); btn_raw = memnew(CheckButton); hhb->add_child(btn_raw); btn_raw->set_text(TTR("Raw")); - btn_raw->connect("toggled", this, "set_raw_mode"); + btn_raw->connect_compat("toggled", this, "set_raw_mode"); text_type = memnew(Button); hhb->add_child(text_type); @@ -832,7 +832,7 @@ ColorPicker::ColorPicker() : #ifdef TOOLS_ENABLED text_type->set_custom_minimum_size(Size2(28 * EDSCALE, 0)); // Adjust for the width of the "Script" icon. #endif - text_type->connect("pressed", this, "_text_type_toggled"); + text_type->connect_compat("pressed", this, "_text_type_toggled"); } else { text_type->set_flat(true); @@ -842,9 +842,9 @@ ColorPicker::ColorPicker() : c_text = memnew(LineEdit); hhb->add_child(c_text); c_text->set_h_size_flags(SIZE_EXPAND_FILL); - c_text->connect("text_entered", this, "_html_entered"); - c_text->connect("focus_entered", this, "_focus_enter"); - c_text->connect("focus_exited", this, "_html_focus_exit"); + c_text->connect_compat("text_entered", this, "_html_entered"); + c_text->connect_compat("focus_entered", this, "_focus_enter"); + c_text->connect_compat("focus_exited", this, "_html_focus_exit"); _update_controls(); updating = false; @@ -860,8 +860,8 @@ ColorPicker::ColorPicker() : preset = memnew(TextureRect); preset_container->add_child(preset); - preset->connect("gui_input", this, "_preset_input"); - preset->connect("draw", this, "_update_presets"); + preset->connect_compat("gui_input", this, "_preset_input"); + preset->connect_compat("draw", this, "_update_presets"); preset_container2 = memnew(HBoxContainer); preset_container2->set_h_size_flags(SIZE_EXPAND_FILL); @@ -869,7 +869,7 @@ ColorPicker::ColorPicker() : bt_add_preset = memnew(Button); preset_container2->add_child(bt_add_preset); bt_add_preset->set_tooltip(TTR("Add current color as a preset.")); - bt_add_preset->connect("pressed", this, "_add_preset_pressed"); + bt_add_preset->connect_compat("pressed", this, "_add_preset_pressed"); } ///////////////// @@ -969,10 +969,10 @@ void ColorPickerButton::_update_picker() { picker = memnew(ColorPicker); popup->add_child(picker); add_child(popup); - picker->connect("color_changed", this, "_color_changed"); - popup->connect("modal_closed", this, "_modal_closed"); - popup->connect("about_to_show", this, "set_pressed", varray(true)); - popup->connect("popup_hide", this, "set_pressed", varray(false)); + picker->connect_compat("color_changed", this, "_color_changed"); + popup->connect_compat("modal_closed", this, "_modal_closed"); + popup->connect_compat("about_to_show", this, "set_pressed", varray(true)); + popup->connect_compat("popup_hide", this, "set_pressed", varray(false)); picker->set_pick_color(color); picker->set_edit_alpha(edit_alpha); emit_signal("picker_created"); diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index b411f563b8..f6ce0c9a60 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -48,9 +48,9 @@ void Container::add_child_notify(Node *p_child) { if (!control) return; - control->connect("size_flags_changed", this, "queue_sort"); - control->connect("minimum_size_changed", this, "_child_minsize_changed"); - control->connect("visibility_changed", this, "_child_minsize_changed"); + control->connect_compat("size_flags_changed", this, "queue_sort"); + control->connect_compat("minimum_size_changed", this, "_child_minsize_changed"); + control->connect_compat("visibility_changed", this, "_child_minsize_changed"); minimum_size_changed(); queue_sort(); @@ -75,9 +75,9 @@ void Container::remove_child_notify(Node *p_child) { if (!control) return; - control->disconnect("size_flags_changed", this, "queue_sort"); - control->disconnect("minimum_size_changed", this, "_child_minsize_changed"); - control->disconnect("visibility_changed", this, "_child_minsize_changed"); + control->disconnect_compat("size_flags_changed", this, "queue_sort"); + control->disconnect_compat("minimum_size_changed", this, "_child_minsize_changed"); + control->disconnect_compat("visibility_changed", this, "_child_minsize_changed"); minimum_size_changed(); queue_sort(); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index b7bc2f9c9e..d3027b606d 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -221,28 +221,28 @@ bool Control::_set(const StringName &p_name, const Variant &p_value) { if (name.begins_with("custom_icons/")) { String dname = name.get_slicec('/', 1); if (data.icon_override.has(dname)) { - data.icon_override[dname]->disconnect("changed", this, "_override_changed"); + data.icon_override[dname]->disconnect_compat("changed", this, "_override_changed"); } data.icon_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); } else if (name.begins_with("custom_shaders/")) { String dname = name.get_slicec('/', 1); if (data.shader_override.has(dname)) { - data.shader_override[dname]->disconnect("changed", this, "_override_changed"); + data.shader_override[dname]->disconnect_compat("changed", this, "_override_changed"); } data.shader_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); } else if (name.begins_with("custom_styles/")) { String dname = name.get_slicec('/', 1); if (data.style_override.has(dname)) { - data.style_override[dname]->disconnect("changed", this, "_override_changed"); + data.style_override[dname]->disconnect_compat("changed", this, "_override_changed"); } data.style_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); } else if (name.begins_with("custom_fonts/")) { String dname = name.get_slicec('/', 1); if (data.font_override.has(dname)) { - data.font_override[dname]->disconnect("changed", this, "_override_changed"); + data.font_override[dname]->disconnect_compat("changed", this, "_override_changed"); } data.font_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); @@ -542,10 +542,10 @@ void Control::_notification(int p_notification) { if (data.parent_canvas_item) { - data.parent_canvas_item->connect("item_rect_changed", this, "_size_changed"); + data.parent_canvas_item->connect_compat("item_rect_changed", this, "_size_changed"); } else { //connect viewport - get_viewport()->connect("size_changed", this, "_size_changed"); + get_viewport()->connect_compat("size_changed", this, "_size_changed"); } } @@ -561,11 +561,11 @@ void Control::_notification(int p_notification) { if (data.parent_canvas_item) { - data.parent_canvas_item->disconnect("item_rect_changed", this, "_size_changed"); + data.parent_canvas_item->disconnect_compat("item_rect_changed", this, "_size_changed"); data.parent_canvas_item = NULL; } else if (!is_set_as_toplevel()) { //disconnect viewport - get_viewport()->disconnect("size_changed", this, "_size_changed"); + get_viewport()->disconnect_compat("size_changed", this, "_size_changed"); } if (data.MI) { @@ -687,9 +687,9 @@ bool Control::has_point(const Point2 &p_point) const { if (get_script_instance()) { Variant v = p_point; const Variant *p = &v; - Variant::CallError ce; + Callable::CallError ce; Variant ret = get_script_instance()->call(SceneStringNames::get_singleton()->has_point, &p, 1, ce); - if (ce.error == Variant::CallError::CALL_OK) { + if (ce.error == Callable::CallError::CALL_OK) { return ret; } } @@ -721,9 +721,9 @@ Variant Control::get_drag_data(const Point2 &p_point) { if (get_script_instance()) { Variant v = p_point; const Variant *p = &v; - Variant::CallError ce; + Callable::CallError ce; Variant ret = get_script_instance()->call(SceneStringNames::get_singleton()->get_drag_data, &p, 1, ce); - if (ce.error == Variant::CallError::CALL_OK) + if (ce.error == Callable::CallError::CALL_OK) return ret; } @@ -743,9 +743,9 @@ bool Control::can_drop_data(const Point2 &p_point, const Variant &p_data) const if (get_script_instance()) { Variant v = p_point; const Variant *p[2] = { &v, &p_data }; - Variant::CallError ce; + Callable::CallError ce; Variant ret = get_script_instance()->call(SceneStringNames::get_singleton()->can_drop_data, p, 2, ce); - if (ce.error == Variant::CallError::CALL_OK) + if (ce.error == Callable::CallError::CALL_OK) return ret; } @@ -765,9 +765,9 @@ void Control::drop_data(const Point2 &p_point, const Variant &p_data) { if (get_script_instance()) { Variant v = p_point; const Variant *p[2] = { &v, &p_data }; - Variant::CallError ce; + Callable::CallError ce; Variant ret = get_script_instance()->call(SceneStringNames::get_singleton()->drop_data, p, 2, ce); - if (ce.error == Variant::CallError::CALL_OK) + if (ce.error == Callable::CallError::CALL_OK) return; } } @@ -805,9 +805,9 @@ Size2 Control::get_minimum_size() const { ScriptInstance *si = const_cast<Control *>(this)->get_script_instance(); if (si) { - Variant::CallError ce; + Callable::CallError ce; Variant s = si->call(SceneStringNames::get_singleton()->_get_minimum_size, NULL, 0, ce); - if (ce.error == Variant::CallError::CALL_OK) + if (ce.error == Callable::CallError::CALL_OK) return s; } return Size2(); @@ -1883,7 +1883,7 @@ Rect2 Control::get_anchorable_rect() const { void Control::add_icon_override(const StringName &p_name, const Ref<Texture2D> &p_icon) { if (data.icon_override.has(p_name)) { - data.icon_override[p_name]->disconnect("changed", this, "_override_changed"); + data.icon_override[p_name]->disconnect_compat("changed", this, "_override_changed"); } // clear if "null" is passed instead of a icon @@ -1892,7 +1892,7 @@ void Control::add_icon_override(const StringName &p_name, const Ref<Texture2D> & } else { data.icon_override[p_name] = p_icon; if (data.icon_override[p_name].is_valid()) { - data.icon_override[p_name]->connect("changed", this, "_override_changed", Vector<Variant>(), CONNECT_REFERENCE_COUNTED); + data.icon_override[p_name]->connect_compat("changed", this, "_override_changed", Vector<Variant>(), CONNECT_REFERENCE_COUNTED); } } notification(NOTIFICATION_THEME_CHANGED); @@ -1901,7 +1901,7 @@ void Control::add_icon_override(const StringName &p_name, const Ref<Texture2D> & void Control::add_shader_override(const StringName &p_name, const Ref<Shader> &p_shader) { if (data.shader_override.has(p_name)) { - data.shader_override[p_name]->disconnect("changed", this, "_override_changed"); + data.shader_override[p_name]->disconnect_compat("changed", this, "_override_changed"); } // clear if "null" is passed instead of a shader @@ -1910,7 +1910,7 @@ void Control::add_shader_override(const StringName &p_name, const Ref<Shader> &p } else { data.shader_override[p_name] = p_shader; if (data.shader_override[p_name].is_valid()) { - data.shader_override[p_name]->connect("changed", this, "_override_changed", Vector<Variant>(), CONNECT_REFERENCE_COUNTED); + data.shader_override[p_name]->connect_compat("changed", this, "_override_changed", Vector<Variant>(), CONNECT_REFERENCE_COUNTED); } } notification(NOTIFICATION_THEME_CHANGED); @@ -1918,7 +1918,7 @@ void Control::add_shader_override(const StringName &p_name, const Ref<Shader> &p void Control::add_style_override(const StringName &p_name, const Ref<StyleBox> &p_style) { if (data.style_override.has(p_name)) { - data.style_override[p_name]->disconnect("changed", this, "_override_changed"); + data.style_override[p_name]->disconnect_compat("changed", this, "_override_changed"); } // clear if "null" is passed instead of a style @@ -1927,7 +1927,7 @@ void Control::add_style_override(const StringName &p_name, const Ref<StyleBox> & } else { data.style_override[p_name] = p_style; if (data.style_override[p_name].is_valid()) { - data.style_override[p_name]->connect("changed", this, "_override_changed", Vector<Variant>(), CONNECT_REFERENCE_COUNTED); + data.style_override[p_name]->connect_compat("changed", this, "_override_changed", Vector<Variant>(), CONNECT_REFERENCE_COUNTED); } } notification(NOTIFICATION_THEME_CHANGED); @@ -1936,7 +1936,7 @@ void Control::add_style_override(const StringName &p_name, const Ref<StyleBox> & void Control::add_font_override(const StringName &p_name, const Ref<Font> &p_font) { if (data.font_override.has(p_name)) { - data.font_override[p_name]->disconnect("changed", this, "_override_changed"); + data.font_override[p_name]->disconnect_compat("changed", this, "_override_changed"); } // clear if "null" is passed instead of a font @@ -1945,7 +1945,7 @@ void Control::add_font_override(const StringName &p_name, const Ref<Font> &p_fon } else { data.font_override[p_name] = p_font; if (data.font_override[p_name].is_valid()) { - data.font_override[p_name]->connect("changed", this, "_override_changed", Vector<Variant>(), CONNECT_REFERENCE_COUNTED); + data.font_override[p_name]->connect_compat("changed", this, "_override_changed", Vector<Variant>(), CONNECT_REFERENCE_COUNTED); } } notification(NOTIFICATION_THEME_CHANGED); @@ -2262,7 +2262,7 @@ void Control::set_theme(const Ref<Theme> &p_theme) { return; if (data.theme.is_valid()) { - data.theme->disconnect("changed", this, "_theme_changed"); + data.theme->disconnect_compat("changed", this, "_theme_changed"); } data.theme = p_theme; @@ -2282,7 +2282,7 @@ void Control::set_theme(const Ref<Theme> &p_theme) { } if (data.theme.is_valid()) { - data.theme->connect("changed", this, "_theme_changed", varray(), CONNECT_DEFERRED); + data.theme->connect_compat("changed", this, "_theme_changed", varray(), CONNECT_DEFERRED); } } @@ -2625,9 +2625,9 @@ bool Control::is_text_field() const { if (get_script_instance()) { Variant v=p_point; const Variant *p[2]={&v,&p_data}; - Variant::CallError ce; + Callable::CallError ce; Variant ret = get_script_instance()->call("is_text_field",p,2,ce); - if (ce.error==Variant::CallError::CALL_OK) + if (ce.error==Callable::CallError::CALL_OK) return ret; } */ @@ -2959,10 +2959,10 @@ void Control::_bind_methods() { BIND_VMETHOD(MethodInfo(Variant::BOOL, "_clips_input")); ADD_GROUP("Anchor", "anchor_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_left", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_LEFT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_top", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_TOP); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_right", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_RIGHT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_bottom", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_BOTTOM); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anchor_left", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_LEFT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anchor_top", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_TOP); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anchor_right", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_RIGHT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anchor_bottom", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_BOTTOM); ADD_GROUP("Margin", "margin_"); ADD_PROPERTYI(PropertyInfo(Variant::INT, "margin_left", PROPERTY_HINT_RANGE, "-4096,4096"), "set_margin", "get_margin", MARGIN_LEFT); @@ -2979,7 +2979,7 @@ void Control::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_global_position", PROPERTY_HINT_NONE, "", 0), "_set_global_position", "get_global_position"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_size", "get_size"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_min_size"), "set_custom_minimum_size", "get_custom_minimum_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rect_rotation", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater"), "set_rotation_degrees", "get_rotation_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rect_rotation", PROPERTY_HINT_RANGE, "-360,360,0.1,or_lesser,or_greater"), "set_rotation_degrees", "get_rotation_degrees"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_scale"), "set_scale", "get_scale"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "rect_pivot_offset"), "set_pivot_offset", "get_pivot_offset"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rect_clip_content"), "set_clip_contents", "is_clipping_contents"); @@ -3003,7 +3003,7 @@ void Control::_bind_methods() { ADD_GROUP("Size Flags", "size_flags_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_h_size_flags", "get_h_size_flags"); ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_v_size_flags", "get_v_size_flags"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "0,128,0.01"), "set_stretch_ratio", "get_stretch_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "0,128,0.01"), "set_stretch_ratio", "get_stretch_ratio"); ADD_GROUP("Theme", ""); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), "set_theme", "get_theme"); ADD_GROUP("", ""); diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index e0e88e1577..152738420a 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -347,7 +347,7 @@ WindowDialog::WindowDialog() { resizable = false; close_button = memnew(TextureButton); add_child(close_button); - close_button->connect("pressed", this, "_closed"); + close_button->connect_compat("pressed", this, "_closed"); #ifdef TOOLS_ENABLED was_editor_dimmed = false; @@ -446,7 +446,7 @@ void AcceptDialog::register_text_enter(Node *p_line_edit) { ERR_FAIL_NULL(p_line_edit); LineEdit *line_edit = Object::cast_to<LineEdit>(p_line_edit); if (line_edit) - line_edit->connect("text_entered", this, "_builtin_text_entered"); + line_edit->connect_compat("text_entered", this, "_builtin_text_entered"); } void AcceptDialog::_update_child_rects() { @@ -531,7 +531,7 @@ Button *AcceptDialog::add_button(const String &p_text, bool p_right, const Strin } if (p_action != "") { - button->connect("pressed", this, "_custom_action", varray(p_action)); + button->connect_compat("pressed", this, "_custom_action", varray(p_action)); } return button; @@ -543,7 +543,7 @@ Button *AcceptDialog::add_cancel(const String &p_cancel) { if (p_cancel == "") c = RTR("Cancel"); Button *b = swap_ok_cancel ? add_button(c, true) : add_button(c); - b->connect("pressed", this, "_closed"); + b->connect_compat("pressed", this, "_closed"); return b; } @@ -565,7 +565,7 @@ void AcceptDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("has_autowrap"), &AcceptDialog::has_autowrap); ADD_SIGNAL(MethodInfo("confirmed")); - ADD_SIGNAL(MethodInfo("custom_action", PropertyInfo(Variant::STRING, "action"))); + ADD_SIGNAL(MethodInfo("custom_action", PropertyInfo(Variant::STRING_NAME, "action"))); ADD_GROUP("Dialog", "dialog"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "dialog_text", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_DEFAULT_INTL), "set_text", "get_text"); @@ -600,7 +600,7 @@ AcceptDialog::AcceptDialog() { hbc->add_child(ok); hbc->add_spacer(); - ok->connect("pressed", this, "_ok"); + ok->connect_compat("pressed", this, "_ok"); set_as_toplevel(true); hide_on_ok = true; diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 931fb4f13e..e27e7d1490 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -900,11 +900,11 @@ FileDialog::FileDialog() { dir_up = memnew(ToolButton); dir_up->set_tooltip(RTR("Go to parent folder.")); hbc->add_child(dir_up); - dir_up->connect("pressed", this, "_go_up"); + dir_up->connect_compat("pressed", this, "_go_up"); drives = memnew(OptionButton); hbc->add_child(drives); - drives->connect("item_selected", this, "_select_drive"); + drives->connect_compat("item_selected", this, "_select_drive"); hbc->add_child(memnew(Label(RTR("Path:")))); dir = memnew(LineEdit); @@ -913,19 +913,19 @@ FileDialog::FileDialog() { refresh = memnew(ToolButton); refresh->set_tooltip(RTR("Refresh files.")); - refresh->connect("pressed", this, "_update_file_list"); + refresh->connect_compat("pressed", this, "_update_file_list"); hbc->add_child(refresh); show_hidden = memnew(ToolButton); show_hidden->set_toggle_mode(true); show_hidden->set_pressed(is_showing_hidden_files()); show_hidden->set_tooltip(RTR("Toggle the visibility of hidden files.")); - show_hidden->connect("toggled", this, "set_show_hidden_files"); + show_hidden->connect_compat("toggled", this, "set_show_hidden_files"); hbc->add_child(show_hidden); makedir = memnew(Button); makedir->set_text(RTR("Create Folder")); - makedir->connect("pressed", this, "_make_dir"); + makedir->connect_compat("pressed", this, "_make_dir"); hbc->add_child(makedir); vbc->add_child(hbc); @@ -950,20 +950,20 @@ FileDialog::FileDialog() { access = ACCESS_RESOURCES; _update_drives(); - connect("confirmed", this, "_action_pressed"); - tree->connect("multi_selected", this, "_tree_multi_selected", varray(), CONNECT_DEFERRED); - tree->connect("cell_selected", this, "_tree_selected", varray(), CONNECT_DEFERRED); - tree->connect("item_activated", this, "_tree_item_activated", varray()); - tree->connect("nothing_selected", this, "deselect_items"); - dir->connect("text_entered", this, "_dir_entered"); - file->connect("text_entered", this, "_file_entered"); - filter->connect("item_selected", this, "_filter_selected"); + connect_compat("confirmed", this, "_action_pressed"); + tree->connect_compat("multi_selected", this, "_tree_multi_selected", varray(), CONNECT_DEFERRED); + tree->connect_compat("cell_selected", this, "_tree_selected", varray(), CONNECT_DEFERRED); + tree->connect_compat("item_activated", this, "_tree_item_activated", varray()); + tree->connect_compat("nothing_selected", this, "deselect_items"); + dir->connect_compat("text_entered", this, "_dir_entered"); + file->connect_compat("text_entered", this, "_file_entered"); + filter->connect_compat("item_selected", this, "_filter_selected"); confirm_save = memnew(ConfirmationDialog); confirm_save->set_as_toplevel(true); add_child(confirm_save); - confirm_save->connect("confirmed", this, "_save_confirm_pressed"); + confirm_save->connect_compat("confirmed", this, "_save_confirm_pressed"); makedialog = memnew(ConfirmationDialog); makedialog->set_title(RTR("Create Folder")); @@ -974,7 +974,7 @@ FileDialog::FileDialog() { makevb->add_margin_child(RTR("Name:"), makedirname); add_child(makedialog); makedialog->register_text_enter(makedirname); - makedialog->connect("confirmed", this, "_make_dir_confirm"); + makedialog->connect_compat("confirmed", this, "_make_dir_confirm"); mkdirerr = memnew(AcceptDialog); mkdirerr->set_text(RTR("Could not create folder.")); add_child(mkdirerr); @@ -1029,10 +1029,10 @@ LineEditFileChooser::LineEditFileChooser() { button = memnew(Button); button->set_text(" .. "); add_child(button); - button->connect("pressed", this, "_browse"); + button->connect_compat("pressed", this, "_browse"); dialog = memnew(FileDialog); add_child(dialog); - dialog->connect("file_selected", this, "_chosen"); - dialog->connect("dir_selected", this, "_chosen"); - dialog->connect("files_selected", this, "_chosen"); + dialog->connect_compat("file_selected", this, "_chosen"); + dialog->connect_compat("dir_selected", this, "_chosen"); + dialog->connect_compat("files_selected", this, "_chosen"); } diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp index 80431cefe0..98c2d3a0e9 100644 --- a/scene/gui/gradient_edit.cpp +++ b/scene/gui/gradient_edit.cpp @@ -302,8 +302,8 @@ void GradientEdit::_gui_input(const Ref<InputEvent> &p_event) { void GradientEdit::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - if (!picker->is_connected("color_changed", this, "_color_changed")) { - picker->connect("color_changed", this, "_color_changed"); + if (!picker->is_connected_compat("color_changed", this, "_color_changed")) { + picker->connect_compat("color_changed", this, "_color_changed"); } } if (p_what == NOTIFICATION_DRAW) { diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index c6a5e21ff8..a9bdede852 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -257,9 +257,9 @@ void GraphEdit::add_child_notify(Node *p_child) { GraphNode *gn = Object::cast_to<GraphNode>(p_child); if (gn) { gn->set_scale(Vector2(zoom, zoom)); - gn->connect("offset_changed", this, "_graph_node_moved", varray(gn)); - gn->connect("raise_request", this, "_graph_node_raised", varray(gn)); - gn->connect("item_rect_changed", connections_layer, "update"); + gn->connect_compat("offset_changed", this, "_graph_node_moved", varray(gn)); + gn->connect_compat("raise_request", this, "_graph_node_raised", varray(gn)); + gn->connect_compat("item_rect_changed", connections_layer, "update"); _graph_node_moved(gn); gn->set_mouse_filter(MOUSE_FILTER_PASS); } @@ -273,8 +273,8 @@ void GraphEdit::remove_child_notify(Node *p_child) { } GraphNode *gn = Object::cast_to<GraphNode>(p_child); if (gn) { - gn->disconnect("offset_changed", this, "_graph_node_moved"); - gn->disconnect("raise_request", this, "_graph_node_raised"); + gn->disconnect_compat("offset_changed", this, "_graph_node_moved"); + gn->disconnect_compat("raise_request", this, "_graph_node_raised"); } } @@ -1315,17 +1315,17 @@ void GraphEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "scroll_offset"), "set_scroll_ofs", "get_scroll_ofs"); ADD_PROPERTY(PropertyInfo(Variant::INT, "snap_distance"), "set_snap", "get_snap"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_snap"), "set_use_snap", "is_using_snap"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "zoom"), "set_zoom", "get_zoom"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "zoom"), "set_zoom", "get_zoom"); - ADD_SIGNAL(MethodInfo("connection_request", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"))); - ADD_SIGNAL(MethodInfo("disconnection_request", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"))); + ADD_SIGNAL(MethodInfo("connection_request", PropertyInfo(Variant::STRING_NAME, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::STRING_NAME, "to"), PropertyInfo(Variant::INT, "to_slot"))); + ADD_SIGNAL(MethodInfo("disconnection_request", PropertyInfo(Variant::STRING_NAME, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::STRING_NAME, "to"), PropertyInfo(Variant::INT, "to_slot"))); ADD_SIGNAL(MethodInfo("popup_request", PropertyInfo(Variant::VECTOR2, "position"))); ADD_SIGNAL(MethodInfo("duplicate_nodes_request")); ADD_SIGNAL(MethodInfo("copy_nodes_request")); ADD_SIGNAL(MethodInfo("paste_nodes_request")); ADD_SIGNAL(MethodInfo("node_selected", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node"))); - ADD_SIGNAL(MethodInfo("connection_to_empty", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); - ADD_SIGNAL(MethodInfo("connection_from_empty", PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); + ADD_SIGNAL(MethodInfo("connection_to_empty", PropertyInfo(Variant::STRING_NAME, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); + ADD_SIGNAL(MethodInfo("connection_from_empty", PropertyInfo(Variant::STRING_NAME, "to"), PropertyInfo(Variant::INT, "to_slot"), PropertyInfo(Variant::VECTOR2, "release_position"))); ADD_SIGNAL(MethodInfo("delete_nodes_request")); ADD_SIGNAL(MethodInfo("_begin_node_move")); ADD_SIGNAL(MethodInfo("_end_node_move")); @@ -1341,12 +1341,12 @@ GraphEdit::GraphEdit() { add_child(top_layer); top_layer->set_mouse_filter(MOUSE_FILTER_PASS); top_layer->set_anchors_and_margins_preset(Control::PRESET_WIDE); - top_layer->connect("draw", this, "_top_layer_draw"); - top_layer->connect("gui_input", this, "_top_layer_input"); + top_layer->connect_compat("draw", this, "_top_layer_draw"); + top_layer->connect_compat("gui_input", this, "_top_layer_input"); connections_layer = memnew(Control); add_child(connections_layer); - connections_layer->connect("draw", this, "_connections_layer_draw"); + connections_layer->connect_compat("draw", this, "_connections_layer_draw"); connections_layer->set_name("CLAYER"); connections_layer->set_disable_visibility_clip(true); // so it can draw freely and be offset connections_layer->set_mouse_filter(MOUSE_FILTER_IGNORE); @@ -1373,8 +1373,8 @@ GraphEdit::GraphEdit() { v_scroll->set_min(-10000); v_scroll->set_max(10000); - h_scroll->connect("value_changed", this, "_scroll_moved"); - v_scroll->connect("value_changed", this, "_scroll_moved"); + h_scroll->connect_compat("value_changed", this, "_scroll_moved"); + v_scroll->connect_compat("value_changed", this, "_scroll_moved"); zoom = 1; @@ -1385,25 +1385,25 @@ GraphEdit::GraphEdit() { zoom_minus = memnew(ToolButton); zoom_hb->add_child(zoom_minus); zoom_minus->set_tooltip(RTR("Zoom Out")); - zoom_minus->connect("pressed", this, "_zoom_minus"); + zoom_minus->connect_compat("pressed", this, "_zoom_minus"); zoom_minus->set_focus_mode(FOCUS_NONE); zoom_reset = memnew(ToolButton); zoom_hb->add_child(zoom_reset); zoom_reset->set_tooltip(RTR("Zoom Reset")); - zoom_reset->connect("pressed", this, "_zoom_reset"); + zoom_reset->connect_compat("pressed", this, "_zoom_reset"); zoom_reset->set_focus_mode(FOCUS_NONE); zoom_plus = memnew(ToolButton); zoom_hb->add_child(zoom_plus); zoom_plus->set_tooltip(RTR("Zoom In")); - zoom_plus->connect("pressed", this, "_zoom_plus"); + zoom_plus->connect_compat("pressed", this, "_zoom_plus"); zoom_plus->set_focus_mode(FOCUS_NONE); snap_button = memnew(ToolButton); snap_button->set_toggle_mode(true); snap_button->set_tooltip(RTR("Enable snap and show grid.")); - snap_button->connect("pressed", this, "_snap_toggled"); + snap_button->connect_compat("pressed", this, "_snap_toggled"); snap_button->set_pressed(true); snap_button->set_focus_mode(FOCUS_NONE); zoom_hb->add_child(snap_button); @@ -1413,7 +1413,7 @@ GraphEdit::GraphEdit() { snap_amount->set_max(100); snap_amount->set_step(1); snap_amount->set_value(20); - snap_amount->connect("value_changed", this, "_snap_value_changed"); + snap_amount->connect_compat("value_changed", this, "_snap_value_changed"); zoom_hb->add_child(snap_amount); setting_scroll_ofs = false; diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index cf798f36e4..174dc65e8a 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1561,7 +1561,7 @@ void ItemList::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_column_width", PROPERTY_HINT_RANGE, "0,100,1,or_greater"), "set_fixed_column_width", "get_fixed_column_width"); ADD_GROUP("Icon", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "icon_mode", PROPERTY_HINT_ENUM, "Top,Left"), "set_icon_mode", "get_icon_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "icon_scale"), "set_icon_scale", "get_icon_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "icon_scale"), "set_icon_scale", "get_icon_scale"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "fixed_icon_size"), "set_fixed_icon_size", "get_fixed_icon_size"); BIND_ENUM_CONSTANT(ICON_MODE_TOP); @@ -1599,7 +1599,7 @@ ItemList::ItemList() { add_child(scroll_bar); shape_changed = true; - scroll_bar->connect("value_changed", this, "_scroll_changed"); + scroll_bar->connect_compat("value_changed", this, "_scroll_changed"); set_focus_mode(FOCUS_ALL); current_columns = 1; diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 9b542cb179..c900b35d65 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -687,7 +687,7 @@ void Label::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clip_text"), "set_clip_text", "is_clipping_text"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "uppercase"), "set_uppercase", "is_uppercase"); ADD_PROPERTY(PropertyInfo(Variant::INT, "visible_characters", PROPERTY_HINT_RANGE, "-1,128000,1", PROPERTY_USAGE_EDITOR), "set_visible_characters", "get_visible_characters"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "percent_visible", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_percent_visible", "get_percent_visible"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "percent_visible", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_percent_visible", "get_percent_visible"); ADD_PROPERTY(PropertyInfo(Variant::INT, "lines_skipped", PROPERTY_HINT_RANGE, "0,999,1"), "set_lines_skipped", "get_lines_skipped"); ADD_PROPERTY(PropertyInfo(Variant::INT, "max_lines_visible", PROPERTY_HINT_RANGE, "-1,999,1"), "set_max_lines_visible", "get_max_lines_visible"); } diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 3f4fd37c08..fb8396e4ff 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -355,14 +355,23 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_LEFT: { - #ifndef APPLE_STYLE_KEYS - if (!k->get_alt()) + if (!k->get_alt()) { #endif + if (selection.enabled && !k->get_shift()) { + set_cursor_position(selection.begin); + deselect(); + handled = true; + break; + } + shift_selection_check_pre(k->get_shift()); +#ifndef APPLE_STYLE_KEYS + } +#endif #ifdef APPLE_STYLE_KEYS if (k->get_command()) { @@ -402,11 +411,23 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_RIGHT: { +#ifndef APPLE_STYLE_KEYS + if (!k->get_alt()) { +#endif + if (selection.enabled && !k->get_shift()) { + set_cursor_position(selection.end); + deselect(); + handled = true; + break; + } - shift_selection_check_pre(k->get_shift()); + shift_selection_check_pre(k->get_shift()); +#ifndef APPLE_STYLE_KEYS + } +#endif #ifdef APPLE_STYLE_KEYS if (k->get_command()) { @@ -509,7 +530,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_HOME: { @@ -522,7 +543,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_END: { @@ -648,8 +669,8 @@ void LineEdit::_notification(int p_what) { cursor_set_blink_enabled(EDITOR_DEF("text_editor/cursor/caret_blink", false)); cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65)); - if (!EditorSettings::get_singleton()->is_connected("settings_changed", this, "_editor_settings_changed")) { - EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); + if (!EditorSettings::get_singleton()->is_connected_compat("settings_changed", this, "_editor_settings_changed")) { + EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_editor_settings_changed"); } } } break; @@ -1832,10 +1853,10 @@ void LineEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "right_icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_right_icon", "get_right_icon"); ADD_GROUP("Placeholder", "placeholder_"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "placeholder_text"), "set_placeholder", "get_placeholder"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "placeholder_alpha", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_placeholder_alpha", "get_placeholder_alpha"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "placeholder_alpha", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_placeholder_alpha", "get_placeholder_alpha"); ADD_GROUP("Caret", "caret_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), "cursor_set_blink_enabled", "cursor_get_blink_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "caret_blink_speed", PROPERTY_HINT_RANGE, "0.1,10,0.01"), "cursor_set_blink_speed", "cursor_get_blink_speed"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "caret_blink_speed", PROPERTY_HINT_RANGE, "0.1,10,0.01"), "cursor_set_blink_speed", "cursor_get_blink_speed"); ADD_PROPERTY(PropertyInfo(Variant::INT, "caret_position"), "set_cursor_position", "get_cursor_position"); } @@ -1870,7 +1891,7 @@ LineEdit::LineEdit() { caret_blink_timer = memnew(Timer); add_child(caret_blink_timer); caret_blink_timer->set_wait_time(0.65); - caret_blink_timer->connect("timeout", this, "_toggle_draw_caret"); + caret_blink_timer->connect_compat("timeout", this, "_toggle_draw_caret"); cursor_set_blink_enabled(false); context_menu_enabled = true; @@ -1878,7 +1899,7 @@ LineEdit::LineEdit() { add_child(menu); editable = false; // Initialise to opposite first, so we get past the early-out in set_editable. set_editable(true); - menu->connect("id_pressed", this, "menu_option"); + menu->connect_compat("id_pressed", this, "menu_option"); expand_to_text_length = false; } diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index 6e348054e2..a211ee02ed 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -137,8 +137,8 @@ MenuButton::MenuButton() { popup->hide(); add_child(popup); popup->set_pass_on_modal_close_click(false); - popup->connect("about_to_show", this, "set_pressed", varray(true)); // For when switching from another MenuButton. - popup->connect("popup_hide", this, "set_pressed", varray(false)); + popup->connect_compat("about_to_show", this, "set_pressed", varray(true)); // For when switching from another MenuButton. + popup->connect_compat("popup_hide", this, "set_pressed", varray(false)); } MenuButton::~MenuButton() { diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 6f656025e6..6488d6ce0a 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -363,9 +363,9 @@ OptionButton::OptionButton() { popup->set_pass_on_modal_close_click(false); popup->set_notify_transform(true); popup->set_allow_search(true); - popup->connect("index_pressed", this, "_selected"); - popup->connect("id_focused", this, "_focused"); - popup->connect("popup_hide", this, "set_pressed", varray(false)); + popup->connect_compat("index_pressed", this, "_selected"); + popup->connect_compat("id_focused", this, "_focused"); + popup->connect_compat("popup_hide", this, "set_pressed", varray(false)); } OptionButton::~OptionButton() { diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index b494506c6c..659d8041a2 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -1233,7 +1233,7 @@ void PopupMenu::_ref_shortcut(Ref<ShortCut> p_sc) { if (!shortcut_refcount.has(p_sc)) { shortcut_refcount[p_sc] = 1; - p_sc->connect("changed", this, "update"); + p_sc->connect_compat("changed", this, "update"); } else { shortcut_refcount[p_sc] += 1; } @@ -1244,7 +1244,7 @@ void PopupMenu::_unref_shortcut(Ref<ShortCut> p_sc) { ERR_FAIL_COND(!shortcut_refcount.has(p_sc)); shortcut_refcount[p_sc]--; if (shortcut_refcount[p_sc] == 0) { - p_sc->disconnect("changed", this, "update"); + p_sc->disconnect_compat("changed", this, "update"); shortcut_refcount.erase(p_sc); } } @@ -1477,7 +1477,7 @@ void PopupMenu::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hide_on_item_selection"), "set_hide_on_item_selection", "is_hide_on_item_selection"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hide_on_checkable_item_selection"), "set_hide_on_checkable_item_selection", "is_hide_on_checkable_item_selection"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hide_on_state_item_selection"), "set_hide_on_state_item_selection", "is_hide_on_state_item_selection"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "submenu_popup_delay"), "set_submenu_popup_delay", "get_submenu_popup_delay"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "submenu_popup_delay"), "set_submenu_popup_delay", "get_submenu_popup_delay"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_search"), "set_allow_search", "get_allow_search"); ADD_SIGNAL(MethodInfo("id_pressed", PropertyInfo(Variant::INT, "id"))); @@ -1514,7 +1514,7 @@ PopupMenu::PopupMenu() { submenu_timer = memnew(Timer); submenu_timer->set_wait_time(0.3); submenu_timer->set_one_shot(true); - submenu_timer->connect("timeout", this, "_submenu_timeout"); + submenu_timer->connect_compat("timeout", this, "_submenu_timeout"); add_child(submenu_timer); } diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index 6b6f5bca93..adc5f81465 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -267,15 +267,15 @@ void Range::_bind_methods() { ClassDB::bind_method(D_METHOD("share", "with"), &Range::_share); ClassDB::bind_method(D_METHOD("unshare"), &Range::unshare); - ADD_SIGNAL(MethodInfo("value_changed", PropertyInfo(Variant::REAL, "value"))); + ADD_SIGNAL(MethodInfo("value_changed", PropertyInfo(Variant::FLOAT, "value"))); ADD_SIGNAL(MethodInfo("changed")); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "min_value"), "set_min", "get_min"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_value"), "set_max", "get_max"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "step"), "set_step", "get_step"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "page"), "set_page", "get_page"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "value"), "set_value", "get_value"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ratio", PROPERTY_HINT_RANGE, "0,1,0.01", 0), "set_as_ratio", "get_as_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "min_value"), "set_min", "get_min"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_value"), "set_max", "get_max"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step"), "set_step", "get_step"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "page"), "set_page", "get_page"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "value"), "set_value", "get_value"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ratio", PROPERTY_HINT_RANGE, "0,1,0.01", 0), "set_as_ratio", "get_as_ratio"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "exp_edit"), "set_exp_ratio", "is_ratio_exp"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rounded"), "set_use_rounded_values", "is_using_rounded_values"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_greater"), "set_allow_greater", "is_greater_allowed"); diff --git a/scene/gui/rich_text_effect.cpp b/scene/gui/rich_text_effect.cpp index c5b1685ff9..0f5926ea1c 100644 --- a/scene/gui/rich_text_effect.cpp +++ b/scene/gui/rich_text_effect.cpp @@ -91,7 +91,7 @@ void CharFXTransform::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "relative_index"), "set_relative_index", "get_relative_index"); ADD_PROPERTY(PropertyInfo(Variant::INT, "absolute_index"), "set_absolute_index", "get_absolute_index"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "elapsed_time"), "set_elapsed_time", "get_elapsed_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "elapsed_time"), "set_elapsed_time", "get_elapsed_time"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "visible"), "set_visibility", "is_visible"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index b39a1aff70..6282b26a5a 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2781,7 +2781,7 @@ void RichTextLabel::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "bbcode_text", PROPERTY_HINT_MULTILINE_TEXT), "set_bbcode", "get_bbcode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "visible_characters", PROPERTY_HINT_RANGE, "-1,128000,1"), "set_visible_characters", "get_visible_characters"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "percent_visible", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_percent_visible", "get_percent_visible"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "percent_visible", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_percent_visible", "get_percent_visible"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "meta_underlined"), "set_meta_underline", "is_meta_underlined"); ADD_PROPERTY(PropertyInfo(Variant::INT, "tab_size", PROPERTY_HINT_RANGE, "0,24,1"), "set_tab_size", "get_tab_size"); @@ -2963,7 +2963,7 @@ RichTextLabel::RichTextLabel() { vscroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 0); vscroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0); vscroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0); - vscroll->connect("value_changed", this, "_scroll_changed"); + vscroll->connect_compat("value_changed", this, "_scroll_changed"); vscroll->set_step(1); vscroll->hide(); current_idx = 1; diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 8e6d0843a7..3d7b6b05ae 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -296,15 +296,15 @@ void ScrollBar::_notification(int p_what) { } if (drag_node) { - drag_node->connect("gui_input", this, "_drag_node_input"); - drag_node->connect("tree_exiting", this, "_drag_node_exit", varray(), CONNECT_ONESHOT); + drag_node->connect_compat("gui_input", this, "_drag_node_input"); + drag_node->connect_compat("tree_exiting", this, "_drag_node_exit", varray(), CONNECT_ONESHOT); } } if (p_what == NOTIFICATION_EXIT_TREE) { if (drag_node) { - drag_node->disconnect("gui_input", this, "_drag_node_input"); - drag_node->disconnect("tree_exiting", this, "_drag_node_exit"); + drag_node->disconnect_compat("gui_input", this, "_drag_node_input"); + drag_node->disconnect_compat("tree_exiting", this, "_drag_node_exit"); } drag_node = NULL; @@ -539,7 +539,7 @@ float ScrollBar::get_custom_step() const { void ScrollBar::_drag_node_exit() { if (drag_node) { - drag_node->disconnect("gui_input", this, "_drag_node_input"); + drag_node->disconnect_compat("gui_input", this, "_drag_node_input"); } drag_node = NULL; } @@ -611,8 +611,8 @@ void ScrollBar::set_drag_node(const NodePath &p_path) { if (is_inside_tree()) { if (drag_node) { - drag_node->disconnect("gui_input", this, "_drag_node_input"); - drag_node->disconnect("tree_exiting", this, "_drag_node_exit"); + drag_node->disconnect_compat("gui_input", this, "_drag_node_input"); + drag_node->disconnect_compat("tree_exiting", this, "_drag_node_exit"); } } @@ -627,8 +627,8 @@ void ScrollBar::set_drag_node(const NodePath &p_path) { } if (drag_node) { - drag_node->connect("gui_input", this, "_drag_node_input"); - drag_node->connect("tree_exiting", this, "_drag_node_exit", varray(), CONNECT_ONESHOT); + drag_node->connect_compat("gui_input", this, "_drag_node_input"); + drag_node->connect_compat("tree_exiting", this, "_drag_node_exit", varray(), CONNECT_ONESHOT); } } } @@ -656,7 +656,7 @@ void ScrollBar::_bind_methods() { ADD_SIGNAL(MethodInfo("scrolling")); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "custom_step", PROPERTY_HINT_RANGE, "-1,4096"), "set_custom_step", "get_custom_step"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "custom_step", PROPERTY_HINT_RANGE, "-1,4096"), "set_custom_step", "get_custom_step"); } ScrollBar::ScrollBar(Orientation p_orientation) { diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 509e6d19f6..5829a86a42 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -267,7 +267,7 @@ void ScrollContainer::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { - get_viewport()->connect("gui_focus_changed", this, "_ensure_focused_visible"); + get_viewport()->connect_compat("gui_focus_changed", this, "_ensure_focused_visible"); } if (p_what == NOTIFICATION_SORT_CHILDREN) { @@ -610,12 +610,12 @@ ScrollContainer::ScrollContainer() { h_scroll = memnew(HScrollBar); h_scroll->set_name("_h_scroll"); add_child(h_scroll); - h_scroll->connect("value_changed", this, "_scroll_moved"); + h_scroll->connect_compat("value_changed", this, "_scroll_moved"); v_scroll = memnew(VScrollBar); v_scroll->set_name("_v_scroll"); add_child(v_scroll); - v_scroll->connect("value_changed", this, "_scroll_moved"); + v_scroll->connect_compat("value_changed", this, "_scroll_moved"); drag_speed = Vector2(); drag_touching = false; diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index c49d7f3d12..1200877127 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -297,12 +297,12 @@ SpinBox::SpinBox() { line_edit->set_anchors_and_margins_preset(Control::PRESET_WIDE); line_edit->set_mouse_filter(MOUSE_FILTER_PASS); //connect("value_changed",this,"_value_changed"); - line_edit->connect("text_entered", this, "_text_entered", Vector<Variant>(), CONNECT_DEFERRED); - line_edit->connect("focus_exited", this, "_line_edit_focus_exit", Vector<Variant>(), CONNECT_DEFERRED); - line_edit->connect("gui_input", this, "_line_edit_input"); + line_edit->connect_compat("text_entered", this, "_text_entered", Vector<Variant>(), CONNECT_DEFERRED); + line_edit->connect_compat("focus_exited", this, "_line_edit_focus_exit", Vector<Variant>(), CONNECT_DEFERRED); + line_edit->connect_compat("gui_input", this, "_line_edit_input"); drag.enabled = false; range_click_timer = memnew(Timer); - range_click_timer->connect("timeout", this, "_range_click_timeout"); + range_click_timer->connect_compat("timeout", this, "_range_click_timeout"); add_child(range_click_timer); } diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 402623e53d..66ecbea378 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -537,7 +537,7 @@ void TabContainer::add_child_notify(Node *p_child) { c->set_margin(Margin(MARGIN_BOTTOM), c->get_margin(Margin(MARGIN_BOTTOM)) - sb->get_margin(Margin(MARGIN_BOTTOM))); update(); - p_child->connect("renamed", this, "_child_renamed_callback"); + p_child->connect_compat("renamed", this, "_child_renamed_callback"); if (first) emit_signal("tab_changed", current); } @@ -620,7 +620,7 @@ void TabContainer::remove_child_notify(Node *p_child) { call_deferred("_update_current_tab"); - p_child->disconnect("renamed", this, "_child_renamed_callback"); + p_child->disconnect_compat("renamed", this, "_child_renamed_callback"); update(); } @@ -1048,5 +1048,5 @@ TabContainer::TabContainer() { tabs_rearrange_group = -1; use_hidden_tabs_for_min_size = false; - connect("mouse_exited", this, "_on_mouse_exited"); + connect_compat("mouse_exited", this, "_on_mouse_exited"); } diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 4aa7ea8cb1..ea1e6546e9 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -1034,5 +1034,5 @@ Tabs::Tabs() { drag_to_rearrange_enabled = false; tabs_rearrange_group = -1; - connect("mouse_exited", this, "_on_mouse_exited"); + connect_compat("mouse_exited", this, "_on_mouse_exited"); } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ae169e3dcd..2fd1ba5535 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1844,6 +1844,42 @@ void TextEdit::_consume_pair_symbol(CharType ch) { } } + String line = text[cursor.line]; + + bool in_single_quote = false; + bool in_double_quote = false; + + int c = 0; + while (c < line.length()) { + if (line[c] == '\\') { + c++; // Skip quoted anything. + + if (cursor.column == c) { + break; + } + } else { + if (line[c] == '\'' && !in_double_quote) { + in_single_quote = !in_single_quote; + } else if (line[c] == '"' && !in_single_quote) { + in_double_quote = !in_double_quote; + } + } + + c++; + + if (cursor.column == c) { + break; + } + } + + // Disallow inserting duplicated quotes while already in string + if ((in_single_quote || in_double_quote) && (ch == '"' || ch == '\'')) { + insert_text_at_cursor(ch_single); + cursor_set_column(cursor_position_to_move); + + return; + } + insert_text_at_cursor(ch_pair); cursor_set_column(cursor_position_to_move); } @@ -3068,7 +3104,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { scancode_handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_LEFT: { @@ -3144,7 +3180,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { scancode_handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_RIGHT: { @@ -3205,7 +3241,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { scancode_handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_UP: { @@ -3258,7 +3294,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { scancode_handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_DOWN: { @@ -3381,7 +3417,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { scancode_handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_HOME: { #ifdef APPLE_STYLE_KEYS @@ -3442,7 +3478,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { scancode_handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_END: { #ifdef APPLE_STYLE_KEYS @@ -3489,7 +3525,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { scancode_handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_PAGEUP: { @@ -3512,7 +3548,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { scancode_handled = false; break; } - FALLTHROUGH; + [[fallthrough]]; } case KEY_PAGEDOWN: { @@ -7147,10 +7183,10 @@ void TextEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_keys_enabled"), "set_shortcut_keys_enabled", "is_shortcut_keys_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selecting_enabled"), "set_selecting_enabled", "is_selecting_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_scrolling"), "set_smooth_scroll_enable", "is_smooth_scroll_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_scroll_speed"), "set_v_scroll_speed", "get_v_scroll_speed"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "v_scroll_speed"), "set_v_scroll_speed", "get_v_scroll_speed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hiding_enabled"), "set_hiding_enabled", "is_hiding_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "wrap_enabled"), "set_wrap_enabled", "is_wrap_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "scroll_vertical"), "set_v_scroll", "get_v_scroll"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "scroll_vertical"), "set_v_scroll", "get_v_scroll"); ADD_PROPERTY(PropertyInfo(Variant::INT, "scroll_horizontal"), "set_h_scroll", "get_h_scroll"); ADD_GROUP("Minimap", "minimap_"); @@ -7160,7 +7196,7 @@ void TextEdit::_bind_methods() { ADD_GROUP("Caret", "caret_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_block_mode"), "cursor_set_block_mode", "cursor_is_block_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), "cursor_set_blink_enabled", "cursor_get_blink_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "caret_blink_speed", PROPERTY_HINT_RANGE, "0.1,10,0.01"), "cursor_set_blink_speed", "cursor_get_blink_speed"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "caret_blink_speed", PROPERTY_HINT_RANGE, "0.1,10,0.01"), "cursor_set_blink_speed", "cursor_get_blink_speed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_moving_by_right_click"), "set_right_click_moves_caret", "is_right_click_moving_caret"); ADD_SIGNAL(MethodInfo("cursor_changed")); @@ -7180,7 +7216,7 @@ void TextEdit::_bind_methods() { BIND_ENUM_CONSTANT(MENU_MAX); GLOBAL_DEF("gui/timers/text_edit_idle_detect_sec", 3); - ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/text_edit_idle_detect_sec", PropertyInfo(Variant::REAL, "gui/timers/text_edit_idle_detect_sec", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater")); // No negative numbers. + ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/text_edit_idle_detect_sec", PropertyInfo(Variant::FLOAT, "gui/timers/text_edit_idle_detect_sec", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater")); // No negative numbers. } TextEdit::TextEdit() { @@ -7223,10 +7259,10 @@ TextEdit::TextEdit() { updating_scrolls = false; selection.active = false; - h_scroll->connect("value_changed", this, "_scroll_moved"); - v_scroll->connect("value_changed", this, "_scroll_moved"); + h_scroll->connect_compat("value_changed", this, "_scroll_moved"); + v_scroll->connect_compat("value_changed", this, "_scroll_moved"); - v_scroll->connect("scrolling", this, "_v_scroll_input"); + v_scroll->connect_compat("scrolling", this, "_v_scroll_input"); cursor_changed_dirty = false; text_changed_dirty = false; @@ -7243,7 +7279,7 @@ TextEdit::TextEdit() { caret_blink_timer = memnew(Timer); add_child(caret_blink_timer); caret_blink_timer->set_wait_time(0.65); - caret_blink_timer->connect("timeout", this, "_toggle_draw_caret"); + caret_blink_timer->connect_compat("timeout", this, "_toggle_draw_caret"); cursor_set_blink_enabled(false); right_click_moves_caret = true; @@ -7251,12 +7287,12 @@ TextEdit::TextEdit() { add_child(idle_detect); idle_detect->set_one_shot(true); idle_detect->set_wait_time(GLOBAL_GET("gui/timers/text_edit_idle_detect_sec")); - idle_detect->connect("timeout", this, "_push_current_op"); + idle_detect->connect_compat("timeout", this, "_push_current_op"); click_select_held = memnew(Timer); add_child(click_select_held); click_select_held->set_wait_time(0.05); - click_select_held->connect("timeout", this, "_click_selection_held"); + click_select_held->connect_compat("timeout", this, "_click_selection_held"); current_op.type = TextOperation::TYPE_NONE; undo_enabled = true; @@ -7314,7 +7350,7 @@ TextEdit::TextEdit() { add_child(menu); readonly = true; // Initialise to opposite first, so we get past the early-out in set_readonly. set_readonly(false); - menu->connect("id_pressed", this, "menu_option"); + menu->connect_compat("id_pressed", this, "menu_option"); first_draw = true; executing_line = -1; diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index c5650b1795..abf6b2ed49 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -510,8 +510,8 @@ void TextureProgress::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::COLOR, "tint_over"), "set_tint_over", "get_tint_over"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "tint_progress"), "set_tint_progress", "get_tint_progress"); ADD_GROUP("Radial Fill", "radial_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radial_initial_angle", PROPERTY_HINT_RANGE, "0.0,360.0,0.1,slider"), "set_radial_initial_angle", "get_radial_initial_angle"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radial_fill_degrees", PROPERTY_HINT_RANGE, "0.0,360.0,0.1,slider"), "set_fill_degrees", "get_fill_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radial_initial_angle", PROPERTY_HINT_RANGE, "0.0,360.0,0.1,slider"), "set_radial_initial_angle", "get_radial_initial_angle"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radial_fill_degrees", PROPERTY_HINT_RANGE, "0.0,360.0,0.1,slider"), "set_fill_degrees", "get_fill_degrees"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "radial_center_offset"), "set_radial_center_offset", "get_radial_center_offset"); ADD_GROUP("Stretch", "stretch_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "nine_patch_stretch"), "set_nine_patch_stretch", "get_nine_patch_stretch"); diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp index 64693e2531..87442f32e8 100644 --- a/scene/gui/texture_rect.cpp +++ b/scene/gui/texture_rect.cpp @@ -160,13 +160,13 @@ void TextureRect::set_texture(const Ref<Texture2D> &p_tex) { } if (texture.is_valid()) { - texture->disconnect(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); + texture->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); } texture = p_tex; if (texture.is_valid()) { - texture->connect(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); + texture->connect_compat(CoreStringNames::get_singleton()->changed, this, "_texture_changed"); } update(); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 08835be9fd..940692ebd7 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -729,18 +729,18 @@ bool TreeItem::is_folding_disabled() const { return disable_folding; } -Variant TreeItem::_call_recursive_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant TreeItem::_call_recursive_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 0; return Variant(); } - if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + if (p_args[0]->get_type() != Variant::STRING && p_args[0]->get_type() != Variant::STRING_NAME) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::STRING; + r_error.expected = Variant::STRING_NAME; return Variant(); } @@ -750,7 +750,7 @@ Variant TreeItem::_call_recursive_bind(const Variant **p_args, int p_argcount, V return Variant(); } -void recursive_call_aux(TreeItem *p_item, const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +void recursive_call_aux(TreeItem *p_item, const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (!p_item) { return; } @@ -762,7 +762,7 @@ void recursive_call_aux(TreeItem *p_item, const StringName &p_method, const Vari } } -void TreeItem::call_recursive(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +void TreeItem::call_recursive(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { recursive_call_aux(this, p_method, p_args, p_argcount, r_error); } @@ -861,7 +861,7 @@ void TreeItem::_bind_methods() { { MethodInfo mi; mi.name = "call_recursive"; - mi.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_recursive", &TreeItem::_call_recursive_bind, mi); } @@ -1020,7 +1020,7 @@ int Tree::compute_item_height(TreeItem *p_item) const { int check_icon_h = cache.checked->get_height(); if (height < check_icon_h) height = check_icon_h; - FALLTHROUGH; + [[fallthrough]]; } case TreeItem::CELL_MODE_STRING: case TreeItem::CELL_MODE_CUSTOM: @@ -4043,15 +4043,15 @@ Tree::Tree() { add_child(v_scroll); range_click_timer = memnew(Timer); - range_click_timer->connect("timeout", this, "_range_click_timeout"); + range_click_timer->connect_compat("timeout", this, "_range_click_timeout"); add_child(range_click_timer); - h_scroll->connect("value_changed", this, "_scroll_moved"); - v_scroll->connect("value_changed", this, "_scroll_moved"); - text_editor->connect("text_entered", this, "_text_editor_enter"); - text_editor->connect("modal_closed", this, "_text_editor_modal_close"); - popup_menu->connect("id_pressed", this, "_popup_select"); - value_editor->connect("value_changed", this, "_value_editor_changed"); + h_scroll->connect_compat("value_changed", this, "_scroll_moved"); + v_scroll->connect_compat("value_changed", this, "_scroll_moved"); + text_editor->connect_compat("text_entered", this, "_text_editor_enter"); + text_editor->connect_compat("modal_closed", this, "_text_editor_modal_close"); + popup_menu->connect_compat("id_pressed", this, "_popup_select"); + value_editor->connect_compat("value_changed", this, "_value_editor_changed"); value_editor->set_as_toplevel(true); text_editor->set_as_toplevel(true); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index b58f937c57..b179c5bcba 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -172,7 +172,7 @@ protected: remove_child(Object::cast_to<TreeItem>(p_child)); } - Variant _call_recursive_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _call_recursive_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); public: /* cell mode */ @@ -282,7 +282,7 @@ public: void set_disable_folding(bool p_disable); bool is_folding_disabled() const; - void call_recursive(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error); + void call_recursive(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); ~TreeItem(); }; diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 3d8112b986..ac1e4a5629 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -473,15 +473,15 @@ void VideoPlayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "audio_track", PROPERTY_HINT_RANGE, "0,128,1"), "set_audio_track", "get_audio_track"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "VideoStream"), "set_stream", "get_stream"); //ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), "set_loop", "has_loop") ; - ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_volume_db", "get_volume_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume", PROPERTY_HINT_EXP_RANGE, "0,15,0.01", 0), "set_volume", "get_volume"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume_db", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_volume_db", "get_volume_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume", PROPERTY_HINT_EXP_RANGE, "0,15,0.01", 0), "set_volume", "get_volume"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "has_autoplay"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused"), "set_paused", "is_paused"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "expand"), "set_expand", "has_expand"); ADD_PROPERTY(PropertyInfo(Variant::INT, "buffering_msec", PROPERTY_HINT_RANGE, "10,1000"), "set_buffering_msec", "get_buffering_msec"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "stream_position", PROPERTY_HINT_RANGE, "0,1280000,0.1", 0), "set_stream_position", "get_stream_position"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "stream_position", PROPERTY_HINT_RANGE, "0,1280000,0.1", 0), "set_stream_position", "get_stream_position"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); } VideoPlayer::VideoPlayer() { diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index 04cf5c6338..2085fa3a60 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -307,15 +307,15 @@ void CanvasLayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "layer", PROPERTY_HINT_RANGE, "-128,128,1"), "set_layer", "get_layer"); ADD_GROUP("Transform", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rotation_degrees", PROPERTY_HINT_RANGE, "-1080,1080,0.1,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation_degrees", PROPERTY_HINT_RANGE, "-1080,1080,0.1,or_lesser,or_greater", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_rotation", "get_rotation"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "scale"), "set_scale", "get_scale"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform"), "set_transform", "get_transform"); ADD_GROUP("", ""); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", 0), "set_custom_viewport", "get_custom_viewport"); ADD_GROUP("Follow Viewport", "follow_viewport"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "follow_viewport_enable"), "set_follow_viewport", "is_following_viewport"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "follow_viewport_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001,or_greater,or_lesser"), "set_follow_viewport_scale", "get_follow_viewport_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "follow_viewport_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001,or_greater,or_lesser"), "set_follow_viewport_scale", "get_follow_viewport_scale"); } CanvasLayer::CanvasLayer() { diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index c4fb3335dc..85bde92851 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -589,7 +589,7 @@ HTTPRequest::HTTPRequest() { timer = memnew(Timer); timer->set_one_shot(true); - timer->connect("timeout", this, "_timeout"); + timer->connect_compat("timeout", this, "_timeout"); add_child(timer); timeout = 0; } diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 8ceac74bb8..a0159c3858 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -37,6 +37,7 @@ #include "core/message_queue.h" #include "core/print_string.h" #include "instance_placeholder.h" +#include "scene/debugger/scene_debugger.h" #include "scene/resources/packed_scene.h" #include "scene/scene_string_names.h" #include "viewport.h" @@ -244,11 +245,7 @@ void Node::_propagate_enter_tree() { data.blocked--; #ifdef DEBUG_ENABLED - - if (ScriptDebugger::get_singleton() && data.filename != String()) { - //used for live edit - data.tree->live_scene_edit_cache[data.filename].insert(this); - } + SceneDebugger::add_to_cache(data.filename, this); #endif // enter groups } @@ -268,26 +265,7 @@ void Node::_propagate_exit_tree() { //block while removing children #ifdef DEBUG_ENABLED - - if (ScriptDebugger::get_singleton() && data.filename != String()) { - //used for live edit - Map<String, Set<Node *> >::Element *E = data.tree->live_scene_edit_cache.find(data.filename); - if (E) { - E->get().erase(this); - if (E->get().size() == 0) { - data.tree->live_scene_edit_cache.erase(E); - } - } - - Map<Node *, Map<ObjectID, Node *> >::Element *F = data.tree->live_edit_remove_list.find(this); - if (F) { - for (Map<ObjectID, Node *>::Element *G = F->get().front(); G; G = G->next()) { - - memdelete(G->get()); - } - data.tree->live_edit_remove_list.erase(F); - } - } + SceneDebugger::remove_from_cache(data.filename, this); #endif data.blocked++; @@ -592,16 +570,16 @@ void Node::rpc_unreliable_id(int p_peer_id, const StringName &p_method, VARIANT_ rpcp(p_peer_id, true, p_method, argptr, argc); } -Variant Node::_rpc_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant Node::_rpc_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; return Variant(); } if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; return Variant(); @@ -611,27 +589,27 @@ Variant Node::_rpc_bind(const Variant **p_args, int p_argcount, Variant::CallErr rpcp(0, false, method, &p_args[1], p_argcount - 1); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; return Variant(); } -Variant Node::_rpc_id_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant Node::_rpc_id_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 2) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 2; return Variant(); } if (p_args[0]->get_type() != Variant::INT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::INT; return Variant(); } if (p_args[1]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::STRING; return Variant(); @@ -642,20 +620,20 @@ Variant Node::_rpc_id_bind(const Variant **p_args, int p_argcount, Variant::Call rpcp(peer_id, false, method, &p_args[2], p_argcount - 2); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; return Variant(); } -Variant Node::_rpc_unreliable_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant Node::_rpc_unreliable_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; return Variant(); } if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING; return Variant(); @@ -665,27 +643,27 @@ Variant Node::_rpc_unreliable_bind(const Variant **p_args, int p_argcount, Varia rpcp(0, true, method, &p_args[1], p_argcount - 1); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; return Variant(); } -Variant Node::_rpc_unreliable_id_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant Node::_rpc_unreliable_id_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 2) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 2; return Variant(); } if (p_args[0]->get_type() != Variant::INT) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::INT; return Variant(); } if (p_args[1]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::STRING; return Variant(); @@ -696,7 +674,7 @@ Variant Node::_rpc_unreliable_id_bind(const Variant **p_args, int p_argcount, Va rpcp(peer_id, true, method, &p_args[2], p_argcount - 2); - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; return Variant(); } @@ -2360,7 +2338,7 @@ void Node::_duplicate_signals(const Node *p_original, Node *p_copy) const { NodePath p = p_original->get_path_to(this); Node *copy = p_copy->get_node(p); - Node *target = Object::cast_to<Node>(E->get().target); + Node *target = Object::cast_to<Node>(E->get().callable.get_object()); if (!target) { continue; } @@ -2375,8 +2353,8 @@ void Node::_duplicate_signals(const Node *p_original, Node *p_copy) const { if (p_copy->has_node(ptarget)) copytarget = p_copy->get_node(ptarget); - if (copy && copytarget && !copy->is_connected(E->get().signal, copytarget, E->get().method)) { - copy->connect(E->get().signal, copytarget, E->get().method, E->get().binds, E->get().flags); + if (copy && copytarget && !copy->is_connected_compat(E->get().signal.get_name(), copytarget, E->get().callable.get_method())) { + copy->connect_compat(E->get().signal.get_name(), copytarget, E->get().callable.get_method(), E->get().binds, E->get().flags); } } } @@ -2531,10 +2509,10 @@ void Node::_replace_connections_target(Node *p_new_target) { Connection &c = E->get(); if (c.flags & CONNECT_PERSIST) { - c.source->disconnect(c.signal, this, c.method); - bool valid = p_new_target->has_method(c.method) || Ref<Script>(p_new_target->get_script()).is_null() || Ref<Script>(p_new_target->get_script())->has_method(c.method); - ERR_CONTINUE_MSG(!valid, "Attempt to connect signal '" + c.source->get_class() + "." + c.signal + "' to nonexistent method '" + c.target->get_class() + "." + c.method + "'."); - c.source->connect(c.signal, p_new_target, c.method, c.binds, c.flags); + c.signal.get_object()->disconnect_compat(c.signal.get_name(), this, c.callable.get_method()); + bool valid = p_new_target->has_method(c.callable.get_method()) || Ref<Script>(p_new_target->get_script()).is_null() || Ref<Script>(p_new_target->get_script())->has_method(c.callable.get_method()); + ERR_CONTINUE_MSG(!valid, "Attempt to connect signal '" + c.signal.get_object()->get_class() + "." + c.signal.get_name() + "' to nonexistent method '" + c.callable.get_object()->get_class() + "." + c.callable.get_method() + "'."); + c.signal.get_object()->connect_compat(c.signal.get_name(), p_new_target, c.callable.get_method(), c.binds, c.flags); } } } @@ -2822,7 +2800,7 @@ void Node::_bind_methods() { GLOBAL_DEF("node/name_casing", NAME_CASING_PASCAL_CASE); ProjectSettings::get_singleton()->set_custom_property_info("node/name_casing", PropertyInfo(Variant::INT, "node/name_casing", PROPERTY_HINT_ENUM, "PascalCase,camelCase,snake_case")); - ClassDB::bind_method(D_METHOD("add_child_below_node", "node", "child_node", "legible_unique_name"), &Node::add_child_below_node, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("add_child_below_node", "preceding_node", "node", "legible_unique_name"), &Node::add_child_below_node, DEFVAL(false)); ClassDB::bind_method(D_METHOD("set_name", "name"), &Node::set_name); ClassDB::bind_method(D_METHOD("get_name"), &Node::get_name); @@ -2926,7 +2904,7 @@ void Node::_bind_methods() { { MethodInfo mi; - mi.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); mi.name = "rpc"; ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "rpc", &Node::_rpc_bind, mi); @@ -2998,15 +2976,15 @@ void Node::_bind_methods() { ADD_GROUP("Pause", "pause_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "pause_mode", PROPERTY_HINT_ENUM, "Inherit,Stop,Process"), "set_pause_mode", "get_pause_mode"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "name", PROPERTY_HINT_NONE, "", 0), "set_name", "get_name"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "name", PROPERTY_HINT_NONE, "", 0), "set_name", "get_name"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "filename", PROPERTY_HINT_NONE, "", 0), "set_filename", "get_filename"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_owner", "get_owner"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "", "get_multiplayer"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_custom_multiplayer", "get_custom_multiplayer"); ADD_PROPERTY(PropertyInfo(Variant::INT, "process_priority"), "set_process_priority", "get_process_priority"); - BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta"))); - BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::REAL, "delta"))); + BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::FLOAT, "delta"))); + BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::FLOAT, "delta"))); BIND_VMETHOD(MethodInfo("_enter_tree")); BIND_VMETHOD(MethodInfo("_exit_tree")); BIND_VMETHOD(MethodInfo("_ready")); diff --git a/scene/main/node.h b/scene/main/node.h index 02c828e8ff..d1f75b71ec 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -185,10 +185,10 @@ private: Array _get_children() const; Array _get_groups() const; - Variant _rpc_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error); - Variant _rpc_unreliable_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error); - Variant _rpc_id_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error); - Variant _rpc_unreliable_id_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _rpc_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); + Variant _rpc_unreliable_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); + Variant _rpc_id_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); + Variant _rpc_unreliable_id_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); friend class SceneTree; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 2a0825252d..ed89b70d65 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -38,9 +38,10 @@ #include "core/os/os.h" #include "core/print_string.h" #include "core/project_settings.h" +#include "core/script_debugger_remote.h" #include "main/input_default.h" #include "node.h" -#include "scene/debugger/script_debugger_remote.h" +#include "scene/debugger/scene_debugger.h" #include "scene/resources/dynamic_font.h" #include "scene/resources/material.h" #include "scene/resources/mesh.h" @@ -58,7 +59,7 @@ void SceneTreeTimer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_time_left", "time"), &SceneTreeTimer::set_time_left); ClassDB::bind_method(D_METHOD("get_time_left"), &SceneTreeTimer::get_time_left); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_left"), "set_time_left", "get_time_left"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_left"), "set_time_left", "get_time_left"); ADD_SIGNAL(MethodInfo("timeout")); } @@ -87,7 +88,7 @@ void SceneTreeTimer::release_connections() { for (List<Connection>::Element *E = connections.front(); E; E = E->next()) { Connection const &connection = E->get(); - disconnect(connection.signal, connection.target, connection.method); + disconnect_compat(connection.signal.get_name(), connection.callable.get_object(), connection.callable.get_method()); } } @@ -1004,14 +1005,14 @@ void SceneMainLoop::_update_listener_2d() { } */ -Variant SceneTree::_call_group_flags(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant SceneTree::_call_group_flags(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; ERR_FAIL_COND_V(p_argcount < 3, Variant()); ERR_FAIL_COND_V(!p_args[0]->is_num(), Variant()); - ERR_FAIL_COND_V(p_args[1]->get_type() != Variant::STRING, Variant()); - ERR_FAIL_COND_V(p_args[2]->get_type() != Variant::STRING, Variant()); + ERR_FAIL_COND_V(p_args[1]->get_type() != Variant::STRING_NAME && p_args[1]->get_type() != Variant::STRING, Variant()); + ERR_FAIL_COND_V(p_args[2]->get_type() != Variant::STRING_NAME && p_args[2]->get_type() != Variant::STRING, Variant()); int flags = *p_args[0]; StringName group = *p_args[1]; @@ -1027,13 +1028,13 @@ Variant SceneTree::_call_group_flags(const Variant **p_args, int p_argcount, Var return Variant(); } -Variant SceneTree::_call_group(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant SceneTree::_call_group(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - r_error.error = Variant::CallError::CALL_OK; + r_error.error = Callable::CallError::CALL_OK; ERR_FAIL_COND_V(p_argcount < 2, Variant()); - ERR_FAIL_COND_V(p_args[0]->get_type() != Variant::STRING, Variant()); - ERR_FAIL_COND_V(p_args[1]->get_type() != Variant::STRING, Variant()); + ERR_FAIL_COND_V(p_args[0]->get_type() != Variant::STRING_NAME && p_args[0]->get_type() != Variant::STRING, Variant()); + ERR_FAIL_COND_V(p_args[1]->get_type() != Variant::STRING_NAME && p_args[1]->get_type() != Variant::STRING, Variant()); StringName group = *p_args[0]; StringName method = *p_args[1]; @@ -1329,380 +1330,6 @@ void SceneTree::add_current_scene(Node *p_current) { root->add_child(p_current); } -#ifdef DEBUG_ENABLED - -static void _fill_array(Node *p_node, Array &array, int p_level) { - - array.push_back(p_node->get_child_count()); - array.push_back(p_node->get_name()); - array.push_back(p_node->get_class()); - array.push_back(p_node->get_instance_id()); - for (int i = 0; i < p_node->get_child_count(); i++) { - - _fill_array(p_node->get_child(i), array, p_level + 1); - } -} - -void SceneTree::_debugger_request_tree() { - - Array arr; - _fill_array(root, arr, 0); - ScriptDebugger::get_singleton()->send_message("scene_tree", arr); -} - -void SceneTree::_live_edit_node_path_func(const NodePath &p_path, int p_id) { - - live_edit_node_path_cache[p_id] = p_path; -} - -void SceneTree::_live_edit_res_path_func(const String &p_path, int p_id) { - - live_edit_resource_cache[p_id] = p_path; -} - -void SceneTree::_live_edit_node_set_func(int p_id, const StringName &p_prop, const Variant &p_value) { - - if (!live_edit_node_path_cache.has(p_id)) - return; - - NodePath np = live_edit_node_path_cache[p_id]; - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(np)) - continue; - Node *n2 = n->get_node(np); - - n2->set(p_prop, p_value); - } -} - -void SceneTree::_live_edit_node_set_res_func(int p_id, const StringName &p_prop, const String &p_value) { - - RES r = ResourceLoader::load(p_value); - if (!r.is_valid()) - return; - _live_edit_node_set_func(p_id, p_prop, r); -} -void SceneTree::_live_edit_node_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE) { - - if (!live_edit_node_path_cache.has(p_id)) - return; - - NodePath np = live_edit_node_path_cache[p_id]; - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(np)) - continue; - Node *n2 = n->get_node(np); - - n2->call(p_method, VARIANT_ARG_PASS); - } -} -void SceneTree::_live_edit_res_set_func(int p_id, const StringName &p_prop, const Variant &p_value) { - - if (!live_edit_resource_cache.has(p_id)) - return; - - String resp = live_edit_resource_cache[p_id]; - - if (!ResourceCache::has(resp)) - return; - - RES r = ResourceCache::get(resp); - if (!r.is_valid()) - return; - - r->set(p_prop, p_value); -} -void SceneTree::_live_edit_res_set_res_func(int p_id, const StringName &p_prop, const String &p_value) { - - RES r = ResourceLoader::load(p_value); - if (!r.is_valid()) - return; - _live_edit_res_set_func(p_id, p_prop, r); -} -void SceneTree::_live_edit_res_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE) { - - if (!live_edit_resource_cache.has(p_id)) - return; - - String resp = live_edit_resource_cache[p_id]; - - if (!ResourceCache::has(resp)) - return; - - RES r = ResourceCache::get(resp); - if (!r.is_valid()) - return; - - r->call(p_method, VARIANT_ARG_PASS); -} - -void SceneTree::_live_edit_root_func(const NodePath &p_scene_path, const String &p_scene_from) { - - live_edit_root = p_scene_path; - live_edit_scene = p_scene_from; -} - -void SceneTree::_live_edit_create_node_func(const NodePath &p_parent, const String &p_type, const String &p_name) { - - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(p_parent)) - continue; - Node *n2 = n->get_node(p_parent); - - Node *no = Object::cast_to<Node>(ClassDB::instance(p_type)); - if (!no) { - continue; - } - - no->set_name(p_name); - n2->add_child(no); - } -} -void SceneTree::_live_edit_instance_node_func(const NodePath &p_parent, const String &p_path, const String &p_name) { - - Ref<PackedScene> ps = ResourceLoader::load(p_path); - - if (!ps.is_valid()) - return; - - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(p_parent)) - continue; - Node *n2 = n->get_node(p_parent); - - Node *no = ps->instance(); - if (!no) { - continue; - } - - no->set_name(p_name); - n2->add_child(no); - } -} -void SceneTree::_live_edit_remove_node_func(const NodePath &p_at) { - - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F;) { - - Set<Node *>::Element *N = F->next(); - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(p_at)) - continue; - Node *n2 = n->get_node(p_at); - - memdelete(n2); - - F = N; - } -} -void SceneTree::_live_edit_remove_and_keep_node_func(const NodePath &p_at, ObjectID p_keep_id) { - - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F;) { - - Set<Node *>::Element *N = F->next(); - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(p_at)) - continue; - - Node *n2 = n->get_node(p_at); - - n2->get_parent()->remove_child(n2); - - live_edit_remove_list[n][p_keep_id] = n2; - - F = N; - } -} -void SceneTree::_live_edit_restore_node_func(ObjectID p_id, const NodePath &p_at, int p_at_pos) { - - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F;) { - - Set<Node *>::Element *N = F->next(); - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(p_at)) - continue; - Node *n2 = n->get_node(p_at); - - Map<Node *, Map<ObjectID, Node *> >::Element *EN = live_edit_remove_list.find(n); - - if (!EN) - continue; - - Map<ObjectID, Node *>::Element *FN = EN->get().find(p_id); - - if (!FN) - continue; - n2->add_child(FN->get()); - - EN->get().erase(FN); - - if (EN->get().size() == 0) { - live_edit_remove_list.erase(EN); - } - - F = N; - } -} -void SceneTree::_live_edit_duplicate_node_func(const NodePath &p_at, const String &p_new_name) { - - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(p_at)) - continue; - Node *n2 = n->get_node(p_at); - - Node *dup = n2->duplicate(Node::DUPLICATE_SIGNALS | Node::DUPLICATE_GROUPS | Node::DUPLICATE_SCRIPTS); - - if (!dup) - continue; - - dup->set_name(p_new_name); - n2->get_parent()->add_child(dup); - } -} -void SceneTree::_live_edit_reparent_node_func(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) { - - Node *base = NULL; - if (root->has_node(live_edit_root)) - base = root->get_node(live_edit_root); - - Map<String, Set<Node *> >::Element *E = live_scene_edit_cache.find(live_edit_scene); - if (!E) - return; //scene not editable - - for (Set<Node *>::Element *F = E->get().front(); F; F = F->next()) { - - Node *n = F->get(); - - if (base && !base->is_a_parent_of(n)) - continue; - - if (!n->has_node(p_at)) - continue; - Node *nfrom = n->get_node(p_at); - - if (!n->has_node(p_new_place)) - continue; - Node *nto = n->get_node(p_new_place); - - nfrom->get_parent()->remove_child(nfrom); - nfrom->set_name(p_new_name); - - nto->add_child(nfrom); - if (p_at_pos >= 0) - nto->move_child(nfrom, p_at_pos); - } -} - -#endif - void SceneTree::drop_files(const Vector<String> &p_files, int p_from_screen) { emit_signal("files_dropped", p_files, p_from_screen); @@ -1766,21 +1393,21 @@ void SceneTree::set_multiplayer(Ref<MultiplayerAPI> p_multiplayer) { ERR_FAIL_COND(!p_multiplayer.is_valid()); if (multiplayer.is_valid()) { - multiplayer->disconnect("network_peer_connected", this, "_network_peer_connected"); - multiplayer->disconnect("network_peer_disconnected", this, "_network_peer_disconnected"); - multiplayer->disconnect("connected_to_server", this, "_connected_to_server"); - multiplayer->disconnect("connection_failed", this, "_connection_failed"); - multiplayer->disconnect("server_disconnected", this, "_server_disconnected"); + multiplayer->disconnect_compat("network_peer_connected", this, "_network_peer_connected"); + multiplayer->disconnect_compat("network_peer_disconnected", this, "_network_peer_disconnected"); + multiplayer->disconnect_compat("connected_to_server", this, "_connected_to_server"); + multiplayer->disconnect_compat("connection_failed", this, "_connection_failed"); + multiplayer->disconnect_compat("server_disconnected", this, "_server_disconnected"); } multiplayer = p_multiplayer; multiplayer->set_root_node(root); - multiplayer->connect("network_peer_connected", this, "_network_peer_connected"); - multiplayer->connect("network_peer_disconnected", this, "_network_peer_disconnected"); - multiplayer->connect("connected_to_server", this, "_connected_to_server"); - multiplayer->connect("connection_failed", this, "_connection_failed"); - multiplayer->connect("server_disconnected", this, "_server_disconnected"); + multiplayer->connect_compat("network_peer_connected", this, "_network_peer_connected"); + multiplayer->connect_compat("network_peer_disconnected", this, "_network_peer_disconnected"); + multiplayer->connect_compat("connected_to_server", this, "_connected_to_server"); + multiplayer->connect_compat("connection_failed", this, "_connection_failed"); + multiplayer->connect_compat("server_disconnected", this, "_server_disconnected"); } void SceneTree::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_network_peer) { @@ -1858,8 +1485,8 @@ void SceneTree::_bind_methods() { MethodInfo mi; mi.name = "call_group_flags"; mi.arguments.push_back(PropertyInfo(Variant::INT, "flags")); - mi.arguments.push_back(PropertyInfo(Variant::STRING, "group")); - mi.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "group")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_group_flags", &SceneTree::_call_group_flags, mi); @@ -1868,8 +1495,8 @@ void SceneTree::_bind_methods() { MethodInfo mi2; mi2.name = "call_group"; - mi2.arguments.push_back(PropertyInfo(Variant::STRING, "group")); - mi2.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi2.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "group")); + mi2.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_group", &SceneTree::_call_group, mi2); @@ -2116,11 +1743,6 @@ SceneTree::SceneTree() { _update_root_rect(); if (ScriptDebugger::get_singleton()) { - if (ScriptDebugger::get_singleton()->is_remote()) { - ScriptDebuggerRemote *remote_debugger = static_cast<ScriptDebuggerRemote *>(ScriptDebugger::get_singleton()); - - remote_debugger->set_scene_tree(this); - } ScriptDebugger::get_singleton()->set_multiplayer(multiplayer); } @@ -2129,12 +1751,6 @@ SceneTree::SceneTree() { #ifdef TOOLS_ENABLED edited_scene_root = NULL; #endif - -#ifdef DEBUG_ENABLED - - live_edit_root = NodePath("/root"); - -#endif } SceneTree::~SceneTree() { diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 565c58fac1..1bef0d3131 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -44,6 +44,7 @@ class Node; class Viewport; class Material; class Mesh; +class SceneDebugger; class SceneTreeTimer : public Reference { GDCLASS(SceneTreeTimer, Reference); @@ -208,8 +209,8 @@ private: void _notify_group_pause(const StringName &p_group, int p_notification); void _call_input_pause(const StringName &p_group, const StringName &p_method, const Ref<InputEvent> &p_input); - Variant _call_group_flags(const Variant **p_args, int p_argcount, Variant::CallError &r_error); - Variant _call_group(const Variant **p_args, int p_argcount, Variant::CallError &r_error); + Variant _call_group_flags(const Variant **p_args, int p_argcount, Callable::CallError &r_error); + Variant _call_group(const Variant **p_args, int p_argcount, Callable::CallError &r_error); void _flush_delete_queue(); //optimization @@ -219,39 +220,8 @@ private: SelfList<Node>::List xform_change_list; - friend class ScriptDebuggerRemote; -#ifdef DEBUG_ENABLED - - Map<int, NodePath> live_edit_node_path_cache; - Map<int, String> live_edit_resource_cache; - - NodePath live_edit_root; - String live_edit_scene; - - Map<String, Set<Node *> > live_scene_edit_cache; - Map<Node *, Map<ObjectID, Node *> > live_edit_remove_list; - - void _debugger_request_tree(); - - void _live_edit_node_path_func(const NodePath &p_path, int p_id); - void _live_edit_res_path_func(const String &p_path, int p_id); - - void _live_edit_node_set_func(int p_id, const StringName &p_prop, const Variant &p_value); - void _live_edit_node_set_res_func(int p_id, const StringName &p_prop, const String &p_value); - void _live_edit_node_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE); - void _live_edit_res_set_func(int p_id, const StringName &p_prop, const Variant &p_value); - void _live_edit_res_set_res_func(int p_id, const StringName &p_prop, const String &p_value); - void _live_edit_res_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE); - void _live_edit_root_func(const NodePath &p_scene_path, const String &p_scene_from); - - void _live_edit_create_node_func(const NodePath &p_parent, const String &p_type, const String &p_name); - void _live_edit_instance_node_func(const NodePath &p_parent, const String &p_path, const String &p_name); - void _live_edit_remove_node_func(const NodePath &p_at); - void _live_edit_remove_and_keep_node_func(const NodePath &p_at, ObjectID p_keep_id); - void _live_edit_restore_node_func(ObjectID p_id, const NodePath &p_at, int p_at_pos); - void _live_edit_duplicate_node_func(const NodePath &p_at, const String &p_new_name); - void _live_edit_reparent_node_func(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos); - +#ifdef DEBUG_ENABLED // No live editor in release build. + friend class LiveEditor; #endif enum { diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index cb213be731..7c847095e1 100755 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -206,11 +206,11 @@ void Timer::_bind_methods() { ADD_SIGNAL(MethodInfo("timeout")); ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_timer_process_mode", "get_timer_process_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.001,4096,0.001,or_greater"), "set_wait_time", "get_wait_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.001,4096,0.001,or_greater"), "set_wait_time", "get_wait_time"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "is_one_shot"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autostart"), "set_autostart", "has_autostart"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused", PROPERTY_HINT_NONE, "", 0), "set_paused", "is_paused"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_left", PROPERTY_HINT_NONE, "", 0), "", "get_time_left"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_left", PROPERTY_HINT_NONE, "", 0), "", "get_time_left"); BIND_ENUM_CONSTANT(TIMER_PROCESS_PHYSICS); BIND_ENUM_CONSTANT(TIMER_PROCESS_IDLE); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 748a713110..2f9c9f8a37 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1124,7 +1124,7 @@ void Viewport::set_world(const Ref<World> &p_world) { _propagate_exit_world(this); if (own_world.is_valid() && world.is_valid()) { - world->disconnect(CoreStringNames::get_singleton()->changed, this, "_own_world_changed"); + world->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_own_world_changed"); } world = p_world; @@ -1132,7 +1132,7 @@ void Viewport::set_world(const Ref<World> &p_world) { if (own_world.is_valid()) { if (world.is_valid()) { own_world = world->duplicate(); - world->connect(CoreStringNames::get_singleton()->changed, this, "_own_world_changed"); + world->connect_compat(CoreStringNames::get_singleton()->changed, this, "_own_world_changed"); } else { own_world = Ref<World>(memnew(World)); } @@ -2473,7 +2473,7 @@ List<Control *>::Element *Viewport::_gui_add_root_control(Control *p_control) { List<Control *>::Element *Viewport::_gui_add_subwindow_control(Control *p_control) { - p_control->connect("visibility_changed", this, "_subwindow_visibility_changed"); + p_control->connect_compat("visibility_changed", this, "_subwindow_visibility_changed"); if (p_control->is_visible_in_tree()) { gui.subwindow_order_dirty = true; @@ -2568,7 +2568,7 @@ void Viewport::_gui_remove_subwindow_control(List<Control *>::Element *SI) { Control *control = SI->get(); - control->disconnect("visibility_changed", this, "_subwindow_visibility_changed"); + control->disconnect_compat("visibility_changed", this, "_subwindow_visibility_changed"); List<Control *>::Element *E = gui.subwindows.find(control); if (E) @@ -2850,12 +2850,12 @@ void Viewport::set_use_own_world(bool p_world) { if (!p_world) { own_world = Ref<World>(); if (world.is_valid()) { - world->disconnect(CoreStringNames::get_singleton()->changed, this, "_own_world_changed"); + world->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_own_world_changed"); } } else { if (world.is_valid()) { own_world = world->duplicate(); - world->connect(CoreStringNames::get_singleton()->changed, this, "_own_world_changed"); + world->connect_compat(CoreStringNames::get_singleton()->changed, this, "_own_world_changed"); } else { own_world = Ref<World>(memnew(World)); } @@ -3285,7 +3285,7 @@ void Viewport::_bind_methods() { BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS); - BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS); + BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); @@ -3360,7 +3360,7 @@ Viewport::Viewport() { //gui.tooltip_timer->force_parent_owned(); gui.tooltip_delay = GLOBAL_DEF("gui/timers/tooltip_delay_sec", 0.5); - ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/tooltip_delay_sec", PropertyInfo(Variant::REAL, "gui/timers/tooltip_delay_sec", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); // No negative numbers + ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/tooltip_delay_sec", PropertyInfo(Variant::FLOAT, "gui/timers/tooltip_delay_sec", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); // No negative numbers gui.tooltip = NULL; gui.tooltip_label = NULL; diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 44d4c89ed1..30c872b6ed 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -153,7 +153,7 @@ public: DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST, DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR, DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, - DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS, + DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX }; diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 40f24ece87..6288598ce2 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -76,6 +76,7 @@ #include "scene/animation/root_motion_view.h" #include "scene/animation/tween.h" #include "scene/audio/audio_stream_player.h" +#include "scene/debugger/scene_debugger.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/center_container.h" @@ -487,17 +488,20 @@ void register_scene_types() { ClassDB::register_class<VisualShaderNodeInput>(); ClassDB::register_virtual_class<VisualShaderNodeOutput>(); ClassDB::register_class<VisualShaderNodeGroupBase>(); - ClassDB::register_class<VisualShaderNodeScalarConstant>(); + ClassDB::register_class<VisualShaderNodeFloatConstant>(); + ClassDB::register_class<VisualShaderNodeIntConstant>(); ClassDB::register_class<VisualShaderNodeBooleanConstant>(); ClassDB::register_class<VisualShaderNodeColorConstant>(); ClassDB::register_class<VisualShaderNodeVec3Constant>(); ClassDB::register_class<VisualShaderNodeTransformConstant>(); - ClassDB::register_class<VisualShaderNodeScalarOp>(); + ClassDB::register_class<VisualShaderNodeFloatOp>(); + ClassDB::register_class<VisualShaderNodeIntOp>(); ClassDB::register_class<VisualShaderNodeVectorOp>(); ClassDB::register_class<VisualShaderNodeColorOp>(); ClassDB::register_class<VisualShaderNodeTransformMult>(); ClassDB::register_class<VisualShaderNodeTransformVecMult>(); - ClassDB::register_class<VisualShaderNodeScalarFunc>(); + ClassDB::register_class<VisualShaderNodeFloatFunc>(); + ClassDB::register_class<VisualShaderNodeIntFunc>(); ClassDB::register_class<VisualShaderNodeVectorFunc>(); ClassDB::register_class<VisualShaderNodeColorFunc>(); ClassDB::register_class<VisualShaderNodeTransformFunc>(); @@ -526,7 +530,8 @@ void register_scene_types() { ClassDB::register_class<VisualShaderNodeTexture>(); ClassDB::register_class<VisualShaderNodeCubemap>(); ClassDB::register_virtual_class<VisualShaderNodeUniform>(); - ClassDB::register_class<VisualShaderNodeScalarUniform>(); + ClassDB::register_class<VisualShaderNodeFloatUniform>(); + ClassDB::register_class<VisualShaderNodeIntUniform>(); ClassDB::register_class<VisualShaderNodeBooleanUniform>(); ClassDB::register_class<VisualShaderNodeColorUniform>(); ClassDB::register_class<VisualShaderNodeVec3Uniform>(); @@ -737,6 +742,10 @@ void register_scene_types() { ClassDB::add_compatibility_class("SpatialMaterial", "StandardMaterial3D"); ClassDB::add_compatibility_class("Mesh", "ArrayMesh"); ClassDB::add_compatibility_class("AnimationTreePlayer", "AnimationTree"); + ClassDB::add_compatibility_class("VisualShaderNodeScalarConstant", "VisualShaderNodeFloatConstant"); + ClassDB::add_compatibility_class("VisualShaderNodeScalarUniform", "VisualShaderNodeFloatUniform"); + ClassDB::add_compatibility_class("VisualShaderNodeScalarOp", "VisualShaderNodeFloatOp"); + ClassDB::add_compatibility_class("VisualShaderNodeScalarFunc", "VisualShaderNodeFloatFunc"); #endif OS::get_singleton()->yield(); //may take time to init @@ -777,10 +786,12 @@ void register_scene_types() { ERR_PRINT("Error loading custom theme '" + theme_path + "'"); } } + SceneDebugger::initialize(); } void unregister_scene_types() { + SceneDebugger::deinitialize(); clear_default_theme(); ResourceLoader::remove_resource_format_loader(resource_loader_dynamic_font); diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 6177356e9a..ba1f738115 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -221,7 +221,7 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) { ERR_FAIL_COND_V(!d.has("points"), false); Vector<float> times = d["times"]; - PackedRealArray values = d["points"]; + PackedFloat32Array values = d["points"]; ERR_FAIL_COND_V(times.size() * 5 != values.size(), false); @@ -373,7 +373,7 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { if (track_get_type(track) == TYPE_TRANSFORM) { - Vector<real_t> keys; + Vector<float> keys; int kk = track_get_key_count(track); keys.resize(kk * 12); @@ -1048,7 +1048,7 @@ void Animation::track_insert_key(int p_track, float p_time, const Variant &p_key ERR_FAIL_COND(p_key.get_type() != Variant::DICTIONARY); Dictionary d = p_key; - ERR_FAIL_COND(!d.has("method") || d["method"].get_type() != Variant::STRING); + ERR_FAIL_COND(!d.has("method") || (d["method"].get_type() != Variant::STRING_NAME && d["method"].get_type() != Variant::STRING)); ERR_FAIL_COND(!d.has("args") || !d["args"].is_array()); MethodKey k; @@ -1620,7 +1620,7 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a vformat |= 1 << type_pa; vformat |= 1 << type_pb; - if (vformat == ((1 << Variant::INT) | (1 << Variant::REAL)) || vformat == (1 << Variant::REAL)) { + if (vformat == ((1 << Variant::INT) | (1 << Variant::FLOAT)) || vformat == (1 << Variant::FLOAT)) { //mix of real and int real_t p0 = p_pre_a; @@ -2810,9 +2810,9 @@ void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("clear"), &Animation::clear); ClassDB::bind_method(D_METHOD("copy_track", "track_idx", "to_animation"), &Animation::copy_track); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "length", PROPERTY_HINT_RANGE, "0.001,99999,0.001"), "set_length", "get_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length", PROPERTY_HINT_RANGE, "0.001,99999,0.001"), "set_length", "get_length"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "step", PROPERTY_HINT_RANGE, "0,4096,0.001"), "set_step", "get_step"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step", PROPERTY_HINT_RANGE, "0,4096,0.001"), "set_step", "get_step"); ADD_SIGNAL(MethodInfo("tracks_changed")); diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp index 933129936a..dddbd7fef3 100644 --- a/scene/resources/capsule_shape.cpp +++ b/scene/resources/capsule_shape.cpp @@ -38,7 +38,7 @@ Vector<Vector3> CapsuleShape::get_debug_mesh_lines() { Vector<Vector3> points; - Vector3 d(0, 0, height * 0.5); + Vector3 d(0, height * 0.5, 0); for (int i = 0; i < 360; i++) { float ra = Math::deg2rad((float)i); @@ -46,24 +46,24 @@ Vector<Vector3> CapsuleShape::get_debug_mesh_lines() { Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * radius; Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * radius; - points.push_back(Vector3(a.x, a.y, 0) + d); - points.push_back(Vector3(b.x, b.y, 0) + d); + points.push_back(Vector3(a.x, 0, a.y) + d); + points.push_back(Vector3(b.x, 0, b.y) + d); - points.push_back(Vector3(a.x, a.y, 0) - d); - points.push_back(Vector3(b.x, b.y, 0) - d); + points.push_back(Vector3(a.x, 0, a.y) - d); + points.push_back(Vector3(b.x, 0, b.y) - d); if (i % 90 == 0) { - points.push_back(Vector3(a.x, a.y, 0) + d); - points.push_back(Vector3(a.x, a.y, 0) - d); + points.push_back(Vector3(a.x, 0, a.y) + d); + points.push_back(Vector3(a.x, 0, a.y) - d); } Vector3 dud = i < 180 ? d : -d; - points.push_back(Vector3(0, a.y, a.x) + dud); - points.push_back(Vector3(0, b.y, b.x) + dud); - points.push_back(Vector3(a.y, 0, a.x) + dud); - points.push_back(Vector3(b.y, 0, b.x) + dud); + points.push_back(Vector3(0, a.x, a.y) + dud); + points.push_back(Vector3(0, b.x, b.y) + dud); + points.push_back(Vector3(a.y, a.x, 0) + dud); + points.push_back(Vector3(b.y, b.x, 0) + dud); } return points; @@ -115,8 +115,8 @@ void CapsuleShape::_bind_methods() { ClassDB::bind_method(D_METHOD("set_height", "height"), &CapsuleShape::set_height); ClassDB::bind_method(D_METHOD("get_height"), &CapsuleShape::get_height); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_height", "get_height"); } CapsuleShape::CapsuleShape() : diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 5658395cee..9b8083de97 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -109,8 +109,8 @@ void CapsuleShape2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_height", "height"), &CapsuleShape2D::set_height); ClassDB::bind_method(D_METHOD("get_height"), &CapsuleShape2D::get_height); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "height"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height"), "set_height", "get_height"); } CapsuleShape2D::CapsuleShape2D() : diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index 10f8ab8a8a..37874e17ef 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -60,7 +60,7 @@ void CircleShape2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_radius", "radius"), &CircleShape2D::set_radius); ClassDB::bind_method(D_METHOD("get_radius"), &CircleShape2D::get_radius); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.01,16384,0.5"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.01,16384,0.5"), "set_radius", "get_radius"); } Rect2 CircleShape2D::get_rect() const { diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 00c52e8a03..a68eb77378 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -392,7 +392,7 @@ void Curve::set_data(Array input) { for (int i = 0; i < input.size(); i += ELEMS) { ERR_FAIL_COND(input[i].get_type() != Variant::VECTOR2); ERR_FAIL_COND(!input[i + 1].is_num()); - ERR_FAIL_COND(input[i + 2].get_type() != Variant::REAL); + ERR_FAIL_COND(input[i + 2].get_type() != Variant::FLOAT); ERR_FAIL_COND(input[i + 3].get_type() != Variant::INT); int left_mode = input[i + 3]; @@ -524,8 +524,8 @@ void Curve::_bind_methods() { ClassDB::bind_method(D_METHOD("_get_data"), &Curve::get_data); ClassDB::bind_method(D_METHOD("_set_data", "data"), &Curve::set_data); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "min_value", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_min_value", "get_min_value"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_value", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_max_value", "get_max_value"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "min_value", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_min_value", "get_min_value"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_value", PROPERTY_HINT_RANGE, "-1024,1024,0.01"), "set_max_value", "get_max_value"); ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_resolution", PROPERTY_HINT_RANGE, "1,1000,1"), "set_bake_resolution", "get_bake_resolution"); ADD_PROPERTY(PropertyInfo(Variant::INT, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_data", "_get_data"); @@ -1001,7 +1001,7 @@ void Curve2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_get_data"), &Curve2D::_get_data); ClassDB::bind_method(D_METHOD("_set_data"), &Curve2D::_set_data); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_interval", PROPERTY_HINT_RANGE, "0.01,512,0.01"), "set_bake_interval", "get_bake_interval"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_interval", PROPERTY_HINT_RANGE, "0.01,512,0.01"), "set_bake_interval", "get_bake_interval"); ADD_PROPERTY(PropertyInfo(Variant::INT, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_data", "_get_data"); } @@ -1445,7 +1445,7 @@ PackedVector3Array Curve3D::get_baked_points() const { return baked_point_cache; } -PackedRealArray Curve3D::get_baked_tilts() const { +PackedFloat32Array Curve3D::get_baked_tilts() const { if (baked_cache_dirty) _bake(); @@ -1567,7 +1567,7 @@ Dictionary Curve3D::_get_data() const { PackedVector3Array d; d.resize(points.size() * 3); Vector3 *w = d.ptrw(); - PackedRealArray t; + PackedFloat32Array t; t.resize(points.size()); real_t *wt = t.ptrw(); @@ -1594,7 +1594,7 @@ void Curve3D::_set_data(const Dictionary &p_data) { ERR_FAIL_COND(pc % 3 != 0); points.resize(pc / 3); const Vector3 *r = rp.ptr(); - PackedRealArray rtl = p_data["tilts"]; + PackedFloat32Array rtl = p_data["tilts"]; const real_t *rt = rtl.ptr(); for (int i = 0; i < points.size(); i++) { @@ -1682,7 +1682,7 @@ void Curve3D::_bind_methods() { ClassDB::bind_method(D_METHOD("_get_data"), &Curve3D::_get_data); ClassDB::bind_method(D_METHOD("_set_data"), &Curve3D::_set_data); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_interval", PROPERTY_HINT_RANGE, "0.01,512,0.01"), "set_bake_interval", "get_bake_interval"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bake_interval", PROPERTY_HINT_RANGE, "0.01,512,0.01"), "set_bake_interval", "get_bake_interval"); ADD_PROPERTY(PropertyInfo(Variant::INT, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_data", "_get_data"); ADD_GROUP("Up Vector", "up_vector_"); diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 91b744f302..7dcbf1ceff 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -235,7 +235,7 @@ class Curve3D : public Resource { mutable bool baked_cache_dirty; mutable PackedVector3Array baked_point_cache; - mutable PackedRealArray baked_tilt_cache; + mutable PackedFloat32Array baked_tilt_cache; mutable PackedVector3Array baked_up_vector_cache; mutable float baked_max_ofs; @@ -278,7 +278,7 @@ public: float interpolate_baked_tilt(float p_offset) const; Vector3 interpolate_baked_up_vector(float p_offset, bool p_apply_tilt = false) const; PackedVector3Array get_baked_points() const; //useful for going through - PackedRealArray get_baked_tilts() const; //useful for going through + PackedFloat32Array get_baked_tilts() const; //useful for going through PackedVector3Array get_baked_up_vectors() const; Vector3 get_closest_point(const Vector3 &p_to_point) const; float get_closest_offset(const Vector3 &p_to_point) const; diff --git a/scene/resources/cylinder_shape.cpp b/scene/resources/cylinder_shape.cpp index b9b0d77a1b..53d368d32a 100644 --- a/scene/resources/cylinder_shape.cpp +++ b/scene/resources/cylinder_shape.cpp @@ -108,8 +108,8 @@ void CylinderShape::_bind_methods() { ClassDB::bind_method(D_METHOD("set_height", "height"), &CylinderShape::set_height); ClassDB::bind_method(D_METHOD("get_height"), &CylinderShape::get_height); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_RANGE, "0.01,4096,0.01"), "set_height", "get_height"); } CylinderShape::CylinderShape() : diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 5a6a8dc286..04bc95ade6 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -706,9 +706,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("font_color_disabled", "TabContainer", control_font_color_disabled); theme->set_constant("side_margin", "TabContainer", 8 * scale); - theme->set_constant("top_margin", "TabContainer", 24 * scale); - theme->set_constant("label_valign_fg", "TabContainer", 0 * scale); - theme->set_constant("label_valign_bg", "TabContainer", 2 * scale); theme->set_constant("hseparation", "TabContainer", 4 * scale); // Tabs @@ -732,9 +729,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("font_color_bg", "Tabs", control_font_color_low); theme->set_color("font_color_disabled", "Tabs", control_font_color_disabled); - theme->set_constant("top_margin", "Tabs", 24 * scale); - theme->set_constant("label_valign_fg", "Tabs", 0 * scale); - theme->set_constant("label_valign_bg", "Tabs", 2 * scale); theme->set_constant("hseparation", "Tabs", 4 * scale); // Separators diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 12b2bf4bc9..d407dd3722 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -870,16 +870,16 @@ void Environment::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "background_canvas_max_layer", PROPERTY_HINT_RANGE, "-1000,1000,1"), "set_canvas_max_layer", "get_canvas_max_layer"); ADD_PROPERTY(PropertyInfo(Variant::INT, "background_camera_feed_id", PROPERTY_HINT_RANGE, "1,10,1"), "set_camera_feed_id", "get_camera_feed_id"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "background_color"), "set_bg_color", "get_bg_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_bg_energy", "get_bg_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "background_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_bg_energy", "get_bg_energy"); ADD_GROUP("Sky", "sky_"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "sky", PROPERTY_HINT_RESOURCE_TYPE, "Sky"), "set_sky", "get_sky"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sky_custom_fov", PROPERTY_HINT_RANGE, "0,180,0.1"), "set_sky_custom_fov", "get_sky_custom_fov"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sky_custom_fov", PROPERTY_HINT_RANGE, "0,180,0.1"), "set_sky_custom_fov", "get_sky_custom_fov"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "sky_rotation"), "set_sky_rotation", "get_sky_rotation"); ADD_GROUP("Ambient Light", "ambient_light_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "ambient_light_source", PROPERTY_HINT_ENUM, "Background,Disabled,Color,Sky"), "set_ambient_source", "get_ambient_source"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ambient_light_color"), "set_ambient_light_color", "get_ambient_light_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ambient_light_sky_contribution", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ambient_light_sky_contribution", "get_ambient_light_sky_contribution"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ambient_light_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_ambient_light_energy", "get_ambient_light_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ambient_light_sky_contribution", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ambient_light_sky_contribution", "get_ambient_light_sky_contribution"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ambient_light_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_ambient_light_energy", "get_ambient_light_energy"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ambient_light_occlusion_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_ao_color", "get_ao_color"); ADD_GROUP("Reflected Light", "reflected_light_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "reflected_light_source", PROPERTY_HINT_ENUM, "Background,Disabled,Sky"), "set_reflection_source", "get_reflection_source"); @@ -930,17 +930,17 @@ void Environment::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_enabled"), "set_fog_enabled", "is_fog_enabled"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "fog_color"), "set_fog_color", "get_fog_color"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "fog_sun_color"), "set_fog_sun_color", "get_fog_sun_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_sun_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_fog_sun_amount", "get_fog_sun_amount"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_sun_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_fog_sun_amount", "get_fog_sun_amount"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_depth_enabled"), "set_fog_depth_enabled", "is_fog_depth_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_depth_begin", PROPERTY_HINT_RANGE, "0,4000,0.1"), "set_fog_depth_begin", "get_fog_depth_begin"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_depth_end", PROPERTY_HINT_RANGE, "0,4000,0.1,or_greater"), "set_fog_depth_end", "get_fog_depth_end"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_depth_curve", PROPERTY_HINT_EXP_EASING), "set_fog_depth_curve", "get_fog_depth_curve"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_depth_begin", PROPERTY_HINT_RANGE, "0,4000,0.1"), "set_fog_depth_begin", "get_fog_depth_begin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_depth_end", PROPERTY_HINT_RANGE, "0,4000,0.1,or_greater"), "set_fog_depth_end", "get_fog_depth_end"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_depth_curve", PROPERTY_HINT_EXP_EASING), "set_fog_depth_curve", "get_fog_depth_curve"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_transmit_enabled"), "set_fog_transmit_enabled", "is_fog_transmit_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_transmit_curve", PROPERTY_HINT_EXP_EASING), "set_fog_transmit_curve", "get_fog_transmit_curve"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_transmit_curve", PROPERTY_HINT_EXP_EASING), "set_fog_transmit_curve", "get_fog_transmit_curve"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_height_enabled"), "set_fog_height_enabled", "is_fog_height_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_min", PROPERTY_HINT_RANGE, "-4000,4000,0.1,or_lesser,or_greater"), "set_fog_height_min", "get_fog_height_min"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_max", PROPERTY_HINT_RANGE, "-4000,4000,0.1,or_lesser,or_greater"), "set_fog_height_max", "get_fog_height_max"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fog_height_curve", PROPERTY_HINT_EXP_EASING), "set_fog_height_curve", "get_fog_height_curve"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_height_min", PROPERTY_HINT_RANGE, "-4000,4000,0.1,or_lesser,or_greater"), "set_fog_height_min", "get_fog_height_min"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_height_max", PROPERTY_HINT_RANGE, "-4000,4000,0.1,or_lesser,or_greater"), "set_fog_height_max", "get_fog_height_max"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_height_curve", PROPERTY_HINT_EXP_EASING), "set_fog_height_curve", "get_fog_height_curve"); ClassDB::bind_method(D_METHOD("set_tonemapper", "mode"), &Environment::set_tonemapper); ClassDB::bind_method(D_METHOD("get_tonemapper"), &Environment::get_tonemapper); @@ -968,14 +968,14 @@ void Environment::_bind_methods() { ADD_GROUP("Tonemap", "tonemap_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "tonemap_mode", PROPERTY_HINT_ENUM, "Linear,Reinhard,Filmic,Aces"), "set_tonemapper", "get_tonemapper"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tonemap_exposure", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_tonemap_exposure", "get_tonemap_exposure"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tonemap_white", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_tonemap_white", "get_tonemap_white"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tonemap_exposure", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_tonemap_exposure", "get_tonemap_exposure"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tonemap_white", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_tonemap_white", "get_tonemap_white"); ADD_GROUP("Auto Exposure", "auto_exposure_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "auto_exposure_enabled"), "set_tonemap_auto_exposure", "get_tonemap_auto_exposure"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "auto_exposure_scale", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_tonemap_auto_exposure_grey", "get_tonemap_auto_exposure_grey"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "auto_exposure_min_luma", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_tonemap_auto_exposure_min", "get_tonemap_auto_exposure_min"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "auto_exposure_max_luma", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_tonemap_auto_exposure_max", "get_tonemap_auto_exposure_max"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "auto_exposure_speed", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_tonemap_auto_exposure_speed", "get_tonemap_auto_exposure_speed"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "auto_exposure_scale", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_tonemap_auto_exposure_grey", "get_tonemap_auto_exposure_grey"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "auto_exposure_min_luma", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_tonemap_auto_exposure_min", "get_tonemap_auto_exposure_min"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "auto_exposure_max_luma", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_tonemap_auto_exposure_max", "get_tonemap_auto_exposure_max"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "auto_exposure_speed", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_tonemap_auto_exposure_speed", "get_tonemap_auto_exposure_speed"); ClassDB::bind_method(D_METHOD("set_ssr_enabled", "enabled"), &Environment::set_ssr_enabled); ClassDB::bind_method(D_METHOD("is_ssr_enabled"), &Environment::is_ssr_enabled); @@ -998,9 +998,9 @@ void Environment::_bind_methods() { ADD_GROUP("SS Reflections", "ss_reflections_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ss_reflections_enabled"), "set_ssr_enabled", "is_ssr_enabled"); ADD_PROPERTY(PropertyInfo(Variant::INT, "ss_reflections_max_steps", PROPERTY_HINT_RANGE, "1,512,1"), "set_ssr_max_steps", "get_ssr_max_steps"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ss_reflections_fade_in", PROPERTY_HINT_EXP_EASING), "set_ssr_fade_in", "get_ssr_fade_in"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ss_reflections_fade_out", PROPERTY_HINT_EXP_EASING), "set_ssr_fade_out", "get_ssr_fade_out"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ss_reflections_depth_tolerance", PROPERTY_HINT_RANGE, "0.1,128,0.1"), "set_ssr_depth_tolerance", "get_ssr_depth_tolerance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ss_reflections_fade_in", PROPERTY_HINT_EXP_EASING), "set_ssr_fade_in", "get_ssr_fade_in"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ss_reflections_fade_out", PROPERTY_HINT_EXP_EASING), "set_ssr_fade_out", "get_ssr_fade_out"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ss_reflections_depth_tolerance", PROPERTY_HINT_RANGE, "0.1,128,0.1"), "set_ssr_depth_tolerance", "get_ssr_depth_tolerance"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ss_reflections_roughness"), "set_ssr_rough", "is_ssr_rough"); ClassDB::bind_method(D_METHOD("set_ssao_enabled", "enabled"), &Environment::set_ssao_enabled); @@ -1029,13 +1029,13 @@ void Environment::_bind_methods() { ADD_GROUP("SSAO", "ssao_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ssao_enabled"), "set_ssao_enabled", "is_ssao_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ssao_radius", PROPERTY_HINT_RANGE, "0.1,128,0.1"), "set_ssao_radius", "get_ssao_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ssao_intensity", PROPERTY_HINT_RANGE, "0.0,128,0.1"), "set_ssao_intensity", "get_ssao_intensity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ssao_bias", PROPERTY_HINT_RANGE, "0.001,8,0.001"), "set_ssao_bias", "get_ssao_bias"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ssao_light_affect", PROPERTY_HINT_RANGE, "0.00,1,0.01"), "set_ssao_direct_light_affect", "get_ssao_direct_light_affect"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ssao_ao_channel_affect", PROPERTY_HINT_RANGE, "0.00,1,0.01"), "set_ssao_ao_channel_affect", "get_ssao_ao_channel_affect"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_radius", PROPERTY_HINT_RANGE, "0.1,128,0.1"), "set_ssao_radius", "get_ssao_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_intensity", PROPERTY_HINT_RANGE, "0.0,128,0.1"), "set_ssao_intensity", "get_ssao_intensity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_bias", PROPERTY_HINT_RANGE, "0.001,8,0.001"), "set_ssao_bias", "get_ssao_bias"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_light_affect", PROPERTY_HINT_RANGE, "0.00,1,0.01"), "set_ssao_direct_light_affect", "get_ssao_direct_light_affect"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_ao_channel_affect", PROPERTY_HINT_RANGE, "0.00,1,0.01"), "set_ssao_ao_channel_affect", "get_ssao_ao_channel_affect"); ADD_PROPERTY(PropertyInfo(Variant::INT, "ssao_blur", PROPERTY_HINT_ENUM, "Disabled,1x1,2x2,3x3"), "set_ssao_blur", "get_ssao_blur"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ssao_edge_sharpness", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_ssao_edge_sharpness", "get_ssao_edge_sharpness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_edge_sharpness", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_ssao_edge_sharpness", "get_ssao_edge_sharpness"); ClassDB::bind_method(D_METHOD("set_glow_enabled", "enabled"), &Environment::set_glow_enabled); ClassDB::bind_method(D_METHOD("is_glow_enabled"), &Environment::is_glow_enabled); @@ -1080,14 +1080,14 @@ void Environment::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "glow_levels/6"), "set_glow_level", "is_glow_level_enabled", 5); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "glow_levels/7"), "set_glow_level", "is_glow_level_enabled", 6); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_intensity", PROPERTY_HINT_RANGE, "0.0,8.0,0.01"), "set_glow_intensity", "get_glow_intensity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_mix", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_glow_mix", "get_glow_mix"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_strength", PROPERTY_HINT_RANGE, "0.0,2.0,0.01"), "set_glow_strength", "get_glow_strength"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_bloom", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_glow_bloom", "get_glow_bloom"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_intensity", PROPERTY_HINT_RANGE, "0.0,8.0,0.01"), "set_glow_intensity", "get_glow_intensity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_mix", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_glow_mix", "get_glow_mix"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_strength", PROPERTY_HINT_RANGE, "0.0,2.0,0.01"), "set_glow_strength", "get_glow_strength"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_bloom", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_glow_bloom", "get_glow_bloom"); ADD_PROPERTY(PropertyInfo(Variant::INT, "glow_blend_mode", PROPERTY_HINT_ENUM, "Additive,Screen,Softlight,Replace,Mix"), "set_glow_blend_mode", "get_glow_blend_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_hdr_threshold", PROPERTY_HINT_RANGE, "0.0,4.0,0.01"), "set_glow_hdr_bleed_threshold", "get_glow_hdr_bleed_threshold"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_hdr_luminance_cap", PROPERTY_HINT_RANGE, "0.0,256.0,0.01"), "set_glow_hdr_luminance_cap", "get_glow_hdr_luminance_cap"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_hdr_scale", PROPERTY_HINT_RANGE, "0.0,4.0,0.01"), "set_glow_hdr_bleed_scale", "get_glow_hdr_bleed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_hdr_threshold", PROPERTY_HINT_RANGE, "0.0,4.0,0.01"), "set_glow_hdr_bleed_threshold", "get_glow_hdr_bleed_threshold"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_hdr_luminance_cap", PROPERTY_HINT_RANGE, "0.0,256.0,0.01"), "set_glow_hdr_luminance_cap", "get_glow_hdr_luminance_cap"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_hdr_scale", PROPERTY_HINT_RANGE, "0.0,4.0,0.01"), "set_glow_hdr_bleed_scale", "get_glow_hdr_bleed_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "glow_bicubic_upscale"), "set_glow_bicubic_upscale", "is_glow_bicubic_upscale_enabled"); ClassDB::bind_method(D_METHOD("set_adjustment_enable", "enabled"), &Environment::set_adjustment_enable); @@ -1107,9 +1107,9 @@ void Environment::_bind_methods() { ADD_GROUP("Adjustments", "adjustment_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "adjustment_enabled"), "set_adjustment_enable", "is_adjustment_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "adjustment_brightness", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_brightness", "get_adjustment_brightness"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "adjustment_contrast", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_contrast", "get_adjustment_contrast"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "adjustment_saturation", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_saturation", "get_adjustment_saturation"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "adjustment_brightness", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_brightness", "get_adjustment_brightness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "adjustment_contrast", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_contrast", "get_adjustment_contrast"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "adjustment_saturation", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_saturation", "get_adjustment_saturation"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "adjustment_color_correction", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_adjustment_color_correction", "get_adjustment_color_correction"); BIND_ENUM_CONSTANT(BG_CLEAR_COLOR); @@ -1369,15 +1369,15 @@ void CameraEffects::_bind_methods() { ADD_GROUP("DOF Blur", "dof_blur_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dof_blur_far_enabled"), "set_dof_blur_far_enabled", "is_dof_blur_far_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "dof_blur_far_distance", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01"), "set_dof_blur_far_distance", "get_dof_blur_far_distance"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "dof_blur_far_transition", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01"), "set_dof_blur_far_transition", "get_dof_blur_far_transition"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_far_distance", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01"), "set_dof_blur_far_distance", "get_dof_blur_far_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_far_transition", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01"), "set_dof_blur_far_transition", "get_dof_blur_far_transition"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dof_blur_near_enabled"), "set_dof_blur_near_enabled", "is_dof_blur_near_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "dof_blur_near_distance", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01"), "set_dof_blur_near_distance", "get_dof_blur_near_distance"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "dof_blur_near_transition", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01"), "set_dof_blur_near_transition", "get_dof_blur_near_transition"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "dof_blur_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dof_blur_amount", "get_dof_blur_amount"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_near_distance", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01"), "set_dof_blur_near_distance", "get_dof_blur_near_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_near_transition", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01"), "set_dof_blur_near_transition", "get_dof_blur_near_transition"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dof_blur_amount", "get_dof_blur_amount"); ADD_GROUP("Override Exposure", "override_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "override_exposure_enable"), "set_override_exposure_enabled", "is_override_exposure_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "override_exposure", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_override_exposure", "get_override_exposure"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "override_exposure", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_override_exposure", "get_override_exposure"); } CameraEffects::CameraEffects() { diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index e890ff13a6..316d6f04d7 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -625,11 +625,11 @@ void BitmapFont::_bind_methods() { ClassDB::bind_method(D_METHOD("get_fallback"), &BitmapFont::get_fallback); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "textures", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_textures", "_get_textures"); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT_ARRAY, "chars", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_chars", "_get_chars"); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT_ARRAY, "kernings", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_kernings", "_get_kernings"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT32_ARRAY, "chars", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_chars", "_get_chars"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT32_ARRAY, "kernings", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_kernings", "_get_kernings"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "1,1024,1"), "set_height", "get_height"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ascent", PROPERTY_HINT_RANGE, "0,1024,1"), "set_ascent", "get_ascent"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_RANGE, "1,1024,1"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ascent", PROPERTY_HINT_RANGE, "0,1024,1"), "set_ascent", "get_ascent"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "distance_field"), "set_distance_field_hint", "is_distance_field_hint"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "fallback", PROPERTY_HINT_RESOURCE_TYPE, "BitmapFont"), "set_fallback", "get_fallback"); } diff --git a/scene/resources/gradient.cpp b/scene/resources/gradient.cpp index bfa3d05d2d..7bce04beaf 100644 --- a/scene/resources/gradient.cpp +++ b/scene/resources/gradient.cpp @@ -72,7 +72,7 @@ void Gradient::_bind_methods() { ClassDB::bind_method(D_METHOD(COLOR_RAMP_SET_COLORS, "colors"), &Gradient::set_colors); ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_COLORS), &Gradient::get_colors); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_REAL_ARRAY, "offsets"), COLOR_RAMP_SET_OFFSETS, COLOR_RAMP_GET_OFFSETS); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_FLOAT32_ARRAY, "offsets"), COLOR_RAMP_SET_OFFSETS, COLOR_RAMP_GET_OFFSETS); ADD_PROPERTY(PropertyInfo(Variant::PACKED_COLOR_ARRAY, "colors"), COLOR_RAMP_SET_COLORS, COLOR_RAMP_GET_COLORS); } diff --git a/scene/resources/height_map_shape.cpp b/scene/resources/height_map_shape.cpp index 1d8483dfb4..fa45ddcabb 100644 --- a/scene/resources/height_map_shape.cpp +++ b/scene/resources/height_map_shape.cpp @@ -144,7 +144,7 @@ int HeightMapShape::get_map_depth() const { return map_depth; } -void HeightMapShape::set_map_data(PackedRealArray p_new) { +void HeightMapShape::set_map_data(PackedFloat32Array p_new) { int size = (map_width * map_depth); if (p_new.size() != size) { // fail @@ -174,7 +174,7 @@ void HeightMapShape::set_map_data(PackedRealArray p_new) { _change_notify("map_data"); } -PackedRealArray HeightMapShape::get_map_data() const { +PackedFloat32Array HeightMapShape::get_map_data() const { return map_data; } @@ -188,7 +188,7 @@ void HeightMapShape::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "map_width", PROPERTY_HINT_RANGE, "1,4096,1"), "set_map_width", "get_map_width"); ADD_PROPERTY(PropertyInfo(Variant::INT, "map_depth", PROPERTY_HINT_RANGE, "1,4096,1"), "set_map_depth", "get_map_depth"); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_REAL_ARRAY, "map_data"), "set_map_data", "get_map_data"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_FLOAT32_ARRAY, "map_data"), "set_map_data", "get_map_data"); } HeightMapShape::HeightMapShape() : diff --git a/scene/resources/height_map_shape.h b/scene/resources/height_map_shape.h index 7b17f9ee7b..b8204f6c98 100644 --- a/scene/resources/height_map_shape.h +++ b/scene/resources/height_map_shape.h @@ -38,7 +38,7 @@ class HeightMapShape : public Shape { int map_width; int map_depth; - PackedRealArray map_data; + PackedFloat32Array map_data; float min_height; float max_height; @@ -51,8 +51,8 @@ public: int get_map_width() const; void set_map_depth(int p_new); int get_map_depth() const; - void set_map_data(PackedRealArray p_new); - PackedRealArray get_map_data() const; + void set_map_data(PackedFloat32Array p_new); + PackedFloat32Array get_map_data() const; virtual Vector<Vector3> get_debug_mesh_lines(); virtual real_t get_enclosing_radius() const; diff --git a/scene/resources/line_shape_2d.cpp b/scene/resources/line_shape_2d.cpp index d1bb61820b..3b30b4528a 100644 --- a/scene/resources/line_shape_2d.cpp +++ b/scene/resources/line_shape_2d.cpp @@ -113,7 +113,7 @@ void LineShape2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_d"), &LineShape2D::get_d); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "normal"), "set_normal", "get_normal"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "d"), "set_d", "get_d"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "d"), "set_d", "get_d"); } LineShape2D::LineShape2D() : diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 6e2fe01834..ff51cab0a4 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -197,7 +197,7 @@ void ShaderMaterial::set_shader(const Ref<Shader> &p_shader) { // This can be a slow operation, and `_change_notify()` (which is called by `_shader_changed()`) // does nothing in non-editor builds anyway. See GH-34741 for details. if (shader.is_valid() && Engine::get_singleton()->is_editor_hint()) { - shader->disconnect("changed", this, "_shader_changed"); + shader->disconnect_compat("changed", this, "_shader_changed"); } shader = p_shader; @@ -207,7 +207,7 @@ void ShaderMaterial::set_shader(const Ref<Shader> &p_shader) { rid = shader->get_rid(); if (Engine::get_singleton()->is_editor_hint()) { - shader->connect("changed", this, "_shader_changed"); + shader->connect_compat("changed", this, "_shader_changed"); } } @@ -419,9 +419,9 @@ void BaseMaterial3D::_update_shader() { switch (texture_filter) { case TEXTURE_FILTER_NEAREST: texfilter_str = "filter_nearest"; break; case TEXTURE_FILTER_LINEAR: texfilter_str = "filter_linear"; break; - case TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS: texfilter_str = "filter_nearest_mipmap"; break; + case TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: texfilter_str = "filter_nearest_mipmap"; break; case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: texfilter_str = "filter_linear_mipmap"; break; - case TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC: texfilter_str = "filter_nearest_mipmap_aniso"; break; + case TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC: texfilter_str = "filter_nearest_mipmap_aniso"; break; case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: texfilter_str = "filter_linear_mipmap_aniso"; break; case TEXTURE_FILTER_MAX: break; // Internal value, skip. } @@ -2223,7 +2223,7 @@ void BaseMaterial3D::_bind_methods() { ADD_GROUP("Transparency", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "transparency", PROPERTY_HINT_ENUM, "Disabled,Alpha,AlphaScissor,DepthPrePass"), "set_transparency", "get_transparency"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "alpha_scissor_threshold", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_alpha_scissor_threshold", "get_alpha_scissor_threshold"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "alpha_scissor_threshold", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_alpha_scissor_threshold", "get_alpha_scissor_threshold"); ADD_PROPERTY(PropertyInfo(Variant::INT, "blend_mode", PROPERTY_HINT_ENUM, "Mix,Add,Sub,Mul"), "set_blend_mode", "get_blend_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "cull_mode", PROPERTY_HINT_ENUM, "Back,Front,Disabled"), "set_cull_mode", "get_cull_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "depth_draw_mode", PROPERTY_HINT_ENUM, "Opaque Only,Always,Never"), "set_depth_draw_mode", "get_depth_draw_mode"); @@ -2248,56 +2248,56 @@ void BaseMaterial3D::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "orm_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_ORM); ADD_GROUP("Metallic", "metallic_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "metallic", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_metallic", "get_metallic"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "metallic_specular", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_specular", "get_specular"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "metallic", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_metallic", "get_metallic"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "metallic_specular", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_specular", "get_specular"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "metallic_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_METALLIC); ADD_PROPERTY(PropertyInfo(Variant::INT, "metallic_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_metallic_texture_channel", "get_metallic_texture_channel"); ADD_GROUP("Roughness", "roughness_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "roughness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_roughness", "get_roughness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "roughness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_roughness", "get_roughness"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "roughness_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_ROUGHNESS); ADD_PROPERTY(PropertyInfo(Variant::INT, "roughness_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_roughness_texture_channel", "get_roughness_texture_channel"); ADD_GROUP("Emission", "emission_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "emission_enabled"), "set_feature", "get_feature", FEATURE_EMISSION); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "emission", PROPERTY_HINT_COLOR_NO_ALPHA), "set_emission", "get_emission"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_emission_energy", "get_emission_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_emission_energy", "get_emission_energy"); ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_operator", PROPERTY_HINT_ENUM, "Add,Multiply"), "set_emission_operator", "get_emission_operator"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "emission_on_uv2"), "set_flag", "get_flag", FLAG_EMISSION_ON_UV2); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "emission_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_EMISSION); ADD_GROUP("NormalMap", "normal_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "normal_enabled"), "set_feature", "get_feature", FEATURE_NORMAL_MAPPING); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "normal_scale", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_normal_scale", "get_normal_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "normal_scale", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_normal_scale", "get_normal_scale"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "normal_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_NORMAL); ADD_GROUP("Rim", "rim_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "rim_enabled"), "set_feature", "get_feature", FEATURE_RIM); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rim", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_rim", "get_rim"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rim_tint", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_rim_tint", "get_rim_tint"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rim", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_rim", "get_rim"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rim_tint", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_rim_tint", "get_rim_tint"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "rim_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_RIM); ADD_GROUP("Clearcoat", "clearcoat_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "clearcoat_enabled"), "set_feature", "get_feature", FEATURE_CLEARCOAT); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "clearcoat", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_clearcoat", "get_clearcoat"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "clearcoat_gloss", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_clearcoat_gloss", "get_clearcoat_gloss"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "clearcoat", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_clearcoat", "get_clearcoat"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "clearcoat_gloss", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_clearcoat_gloss", "get_clearcoat_gloss"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "clearcoat_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_CLEARCOAT); ADD_GROUP("Anisotropy", "anisotropy_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "anisotropy_enabled"), "set_feature", "get_feature", FEATURE_ANISOTROPY); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "anisotropy", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_anisotropy", "get_anisotropy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "anisotropy", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_anisotropy", "get_anisotropy"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anisotropy_flowmap", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_FLOWMAP); ADD_GROUP("Ambient Occlusion", "ao_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "ao_enabled"), "set_feature", "get_feature", FEATURE_AMBIENT_OCCLUSION); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ao_light_affect", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_light_affect", "get_ao_light_affect"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ao_light_affect", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_light_affect", "get_ao_light_affect"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "ao_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_AMBIENT_OCCLUSION); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "ao_on_uv2"), "set_flag", "get_flag", FLAG_AO_ON_UV2); ADD_PROPERTY(PropertyInfo(Variant::INT, "ao_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_ao_texture_channel", "get_ao_texture_channel"); ADD_GROUP("Height", "heightmap_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "heightmap_enabled"), "set_feature", "get_feature", FEATURE_HEIGHT_MAPPING); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "heightmap_scale", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_heightmap_scale", "get_heightmap_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "heightmap_scale", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_heightmap_scale", "get_heightmap_scale"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "heightmap_deep_parallax"), "set_heightmap_deep_parallax", "is_heightmap_deep_parallax_enabled"); ADD_PROPERTY(PropertyInfo(Variant::INT, "heightmap_min_layers", PROPERTY_HINT_RANGE, "1,32,1"), "set_heightmap_deep_parallax_min_layers", "get_heightmap_deep_parallax_min_layers"); ADD_PROPERTY(PropertyInfo(Variant::INT, "heightmap_max_layers", PROPERTY_HINT_RANGE, "1,32,1"), "set_heightmap_deep_parallax_max_layers", "get_heightmap_deep_parallax_max_layers"); @@ -2308,7 +2308,7 @@ void BaseMaterial3D::_bind_methods() { ADD_GROUP("Subsurf Scatter", "subsurf_scatter_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "subsurf_scatter_enabled"), "set_feature", "get_feature", FEATURE_SUBSURACE_SCATTERING); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "subsurf_scatter_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_subsurface_scattering_strength", "get_subsurface_scattering_strength"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "subsurf_scatter_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_subsurface_scattering_strength", "get_subsurface_scattering_strength"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "subsurf_scatter_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_SUBSURFACE_SCATTERING); ADD_GROUP("Transmission", "transmission_"); @@ -2318,7 +2318,7 @@ void BaseMaterial3D::_bind_methods() { ADD_GROUP("Refraction", "refraction_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "refraction_enabled"), "set_feature", "get_feature", FEATURE_REFRACTION); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "refraction_scale", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_refraction", "get_refraction"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "refraction_scale", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_refraction", "get_refraction"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "refraction_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_REFRACTION); ADD_PROPERTY(PropertyInfo(Variant::INT, "refraction_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_refraction_texture_channel", "get_refraction_texture_channel"); @@ -2334,14 +2334,14 @@ void BaseMaterial3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "uv1_scale"), "set_uv1_scale", "get_uv1_scale"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "uv1_offset"), "set_uv1_offset", "get_uv1_offset"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "uv1_triplanar"), "set_flag", "get_flag", FLAG_UV1_USE_TRIPLANAR); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "uv1_triplanar_sharpness", PROPERTY_HINT_EXP_EASING), "set_uv1_triplanar_blend_sharpness", "get_uv1_triplanar_blend_sharpness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "uv1_triplanar_sharpness", PROPERTY_HINT_EXP_EASING), "set_uv1_triplanar_blend_sharpness", "get_uv1_triplanar_blend_sharpness"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "uv1_world_triplanar"), "set_flag", "get_flag", FLAG_UV1_USE_WORLD_TRIPLANAR); ADD_GROUP("UV2", "uv2_"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "uv2_scale"), "set_uv2_scale", "get_uv2_scale"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "uv2_offset"), "set_uv2_offset", "get_uv2_offset"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "uv2_triplanar"), "set_flag", "get_flag", FLAG_UV2_USE_TRIPLANAR); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "uv2_triplanar_sharpness", PROPERTY_HINT_EXP_EASING), "set_uv2_triplanar_blend_sharpness", "get_uv2_triplanar_blend_sharpness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "uv2_triplanar_sharpness", PROPERTY_HINT_EXP_EASING), "set_uv2_triplanar_blend_sharpness", "get_uv2_triplanar_blend_sharpness"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "uv2_world_triplanar"), "set_flag", "get_flag", FLAG_UV2_USE_WORLD_TRIPLANAR); ADD_GROUP("Sampling", "texture_"); @@ -2363,18 +2363,18 @@ void BaseMaterial3D::_bind_methods() { ADD_GROUP("Grow", "grow_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "grow"), "set_grow_enabled", "is_grow_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "grow_amount", PROPERTY_HINT_RANGE, "-16,16,0.001"), "set_grow", "get_grow"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "grow_amount", PROPERTY_HINT_RANGE, "-16,16,0.001"), "set_grow", "get_grow"); ADD_GROUP("Transform", ""); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "fixed_size"), "set_flag", "get_flag", FLAG_FIXED_SIZE); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "use_point_size"), "set_flag", "get_flag", FLAG_USE_POINT_SIZE); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "point_size", PROPERTY_HINT_RANGE, "0.1,128,0.1"), "set_point_size", "get_point_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "point_size", PROPERTY_HINT_RANGE, "0.1,128,0.1"), "set_point_size", "get_point_size"); ADD_GROUP("Proximity Fade", "proximity_fade_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "proximity_fade_enable"), "set_proximity_fade", "is_proximity_fade_enabled"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "proximity_fade_distance", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_proximity_fade_distance", "get_proximity_fade_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "proximity_fade_distance", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_proximity_fade_distance", "get_proximity_fade_distance"); ADD_GROUP("Distance Fade", "distance_fade_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "distance_fade_mode", PROPERTY_HINT_ENUM, "Disabled,PixelAlpha,PixelDither,ObjectDither"), "set_distance_fade", "get_distance_fade"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "distance_fade_min_distance", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_distance_fade_min_distance", "get_distance_fade_min_distance"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "distance_fade_max_distance", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_distance_fade_max_distance", "get_distance_fade_max_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "distance_fade_min_distance", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_distance_fade_min_distance", "get_distance_fade_min_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "distance_fade_max_distance", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_distance_fade_max_distance", "get_distance_fade_max_distance"); BIND_ENUM_CONSTANT(TEXTURE_ALBEDO); BIND_ENUM_CONSTANT(TEXTURE_METALLIC); @@ -2397,9 +2397,9 @@ void BaseMaterial3D::_bind_methods() { BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST); BIND_ENUM_CONSTANT(TEXTURE_FILTER_LINEAR); - BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS); + BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST_WITH_MIPMAPS); BIND_ENUM_CONSTANT(TEXTURE_FILTER_LINEAR_WITH_MIPMAPS); - BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC); + BIND_ENUM_CONSTANT(TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC); BIND_ENUM_CONSTANT(TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC); BIND_ENUM_CONSTANT(TEXTURE_FILTER_MAX); diff --git a/scene/resources/material.h b/scene/resources/material.h index 8c5a648058..927334c74d 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -138,9 +138,9 @@ public: enum TextureFilter { TEXTURE_FILTER_NEAREST, TEXTURE_FILTER_LINEAR, - TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS, + TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, - TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC, + TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, TEXTURE_FILTER_MAX }; diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 85eab335de..aa8be326f5 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -350,7 +350,7 @@ void MultiMesh::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "instance_count", PROPERTY_HINT_RANGE, "0,16384,1,or_greater"), "set_instance_count", "get_instance_count"); ADD_PROPERTY(PropertyInfo(Variant::INT, "visible_instance_count", PROPERTY_HINT_RANGE, "-1,16384,1,or_greater"), "set_visible_instance_count", "get_visible_instance_count"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh"), "set_mesh", "get_mesh"); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_REAL_ARRAY, "buffer", PROPERTY_HINT_NONE), "set_buffer", "get_buffer"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_FLOAT32_ARRAY, "buffer", PROPERTY_HINT_NONE), "set_buffer", "get_buffer"); #ifndef DISABLE_DEPRECATED // Kept for compatibility from 3.x to 4.0. diff --git a/scene/resources/navigation_mesh.cpp b/scene/resources/navigation_mesh.cpp index 809513c5ae..e0aff2182e 100644 --- a/scene/resources/navigation_mesh.cpp +++ b/scene/resources/navigation_mesh.cpp @@ -487,19 +487,19 @@ void NavigationMesh::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "geometry/source_geometry_mode", PROPERTY_HINT_ENUM, "Navmesh Children, Group With Children, Group Explicit"), "set_source_geometry_mode", "get_source_geometry_mode"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "geometry/source_group_name"), "set_source_group_name", "get_source_group_name"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell/size", PROPERTY_HINT_RANGE, "0.1,1.0,0.01,or_greater"), "set_cell_size", "get_cell_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell/height", PROPERTY_HINT_RANGE, "0.1,1.0,0.01,or_greater"), "set_cell_height", "get_cell_height"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/height", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_height", "get_agent_height"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/radius", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_radius", "get_agent_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/max_climb", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_max_climb", "get_agent_max_climb"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/max_slope", PROPERTY_HINT_RANGE, "0.0,90.0,0.1"), "set_agent_max_slope", "get_agent_max_slope"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "region/min_size", PROPERTY_HINT_RANGE, "0.0,150.0,0.01,or_greater"), "set_region_min_size", "get_region_min_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "region/merge_size", PROPERTY_HINT_RANGE, "0.0,150.0,0.01,or_greater"), "set_region_merge_size", "get_region_merge_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "edge/max_length", PROPERTY_HINT_RANGE, "0.0,50.0,0.01,or_greater"), "set_edge_max_length", "get_edge_max_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "edge/max_error", PROPERTY_HINT_RANGE, "0.1,3.0,0.01,or_greater"), "set_edge_max_error", "get_edge_max_error"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "polygon/verts_per_poly", PROPERTY_HINT_RANGE, "3.0,12.0,1.0,or_greater"), "set_verts_per_poly", "get_verts_per_poly"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "detail/sample_distance", PROPERTY_HINT_RANGE, "0.0,16.0,0.01,or_greater"), "set_detail_sample_distance", "get_detail_sample_distance"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "detail/sample_max_error", PROPERTY_HINT_RANGE, "0.0,16.0,0.01,or_greater"), "set_detail_sample_max_error", "get_detail_sample_max_error"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell/size", PROPERTY_HINT_RANGE, "0.1,1.0,0.01,or_greater"), "set_cell_size", "get_cell_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cell/height", PROPERTY_HINT_RANGE, "0.1,1.0,0.01,or_greater"), "set_cell_height", "get_cell_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "agent/height", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_height", "get_agent_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "agent/radius", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_radius", "get_agent_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "agent/max_climb", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_max_climb", "get_agent_max_climb"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "agent/max_slope", PROPERTY_HINT_RANGE, "0.0,90.0,0.1"), "set_agent_max_slope", "get_agent_max_slope"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "region/min_size", PROPERTY_HINT_RANGE, "0.0,150.0,0.01,or_greater"), "set_region_min_size", "get_region_min_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "region/merge_size", PROPERTY_HINT_RANGE, "0.0,150.0,0.01,or_greater"), "set_region_merge_size", "get_region_merge_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "edge/max_length", PROPERTY_HINT_RANGE, "0.0,50.0,0.01,or_greater"), "set_edge_max_length", "get_edge_max_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "edge/max_error", PROPERTY_HINT_RANGE, "0.1,3.0,0.01,or_greater"), "set_edge_max_error", "get_edge_max_error"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "polygon/verts_per_poly", PROPERTY_HINT_RANGE, "3.0,12.0,1.0,or_greater"), "set_verts_per_poly", "get_verts_per_poly"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "detail/sample_distance", PROPERTY_HINT_RANGE, "0.0,16.0,0.01,or_greater"), "set_detail_sample_distance", "get_detail_sample_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "detail/sample_max_error", PROPERTY_HINT_RANGE, "0.0,16.0,0.01,or_greater"), "set_detail_sample_max_error", "get_detail_sample_max_error"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "filter/low_hanging_obstacles"), "set_filter_low_hanging_obstacles", "get_filter_low_hanging_obstacles"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "filter/ledge_spans"), "set_filter_ledge_spans", "get_filter_ledge_spans"); diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index c018ab2029..00910095c7 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -331,7 +331,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { binds.write[j] = props[c.binds[j]]; } - cfrom->connect(snames[c.signal], cto, snames[c.method], binds, CONNECT_PERSIST | c.flags); + cfrom->connect_compat(snames[c.signal], cto, snames[c.method], binds, CONNECT_PERSIST | c.flags); } //Node *s = ret_nodes[0]; @@ -532,7 +532,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map if (exists) { //check if already exists and did not change - if (value.get_type() == Variant::REAL && original.get_type() == Variant::REAL) { + if (value.get_type() == Variant::FLOAT && original.get_type() == Variant::FLOAT) { //this must be done because, as some scenes save as text, there might be a tiny difference in floats due to numerical error float a = value; float b = original; @@ -702,7 +702,7 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName // only connections that originate or end into main saved scene are saved // everything else is discarded - Node *target = Object::cast_to<Node>(c.target); + Node *target = Object::cast_to<Node>(c.callable.get_object()); if (!target) { continue; @@ -734,7 +734,7 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName NodePath signal_from = common_parent->get_path_to(p_node); NodePath signal_to = common_parent->get_path_to(target); - if (ps->has_connection(signal_from, c.signal, signal_to, c.method)) { + if (ps->has_connection(signal_from, c.signal.get_name(), signal_to, c.callable.get_method())) { exists = true; break; } @@ -766,7 +766,7 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName if (from_node >= 0 && to_node >= 0) { //this one has state for this node, save - if (state->is_connection(from_node, c.signal, to_node, c.method)) { + if (state->is_connection(from_node, c.signal.get_name(), to_node, c.callable.get_method())) { exists2 = true; break; } @@ -784,7 +784,7 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName if (from_node >= 0 && to_node >= 0) { //this one has state for this node, save - if (state->is_connection(from_node, c.signal, to_node, c.method)) { + if (state->is_connection(from_node, c.signal.get_name(), to_node, c.callable.get_method())) { exists2 = true; break; } @@ -831,8 +831,8 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName ConnectionData cd; cd.from = src_id; cd.to = target_id; - cd.method = _nm_get_string(c.method, name_map); - cd.signal = _nm_get_string(c.signal, name_map); + cd.method = _nm_get_string(c.callable.get_method(), name_map); + cd.signal = _nm_get_string(c.signal.get_name(), name_map); cd.flags = c.flags; for (int i = 0; i < c.binds.size(); i++) { diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp index d852dca7fa..e820aec2ed 100644 --- a/scene/resources/particles_material.cpp +++ b/scene/resources/particles_material.cpp @@ -189,7 +189,7 @@ void ParticlesMaterial::_update_shader() { } break; case EMISSION_SHAPE_DIRECTED_POINTS: { code += "uniform sampler2D emission_texture_normal : hint_black;\n"; - FALLTHROUGH; + [[fallthrough]]; } case EMISSION_SHAPE_POINTS: { code += "uniform sampler2D emission_texture_points : hint_black;\n"; @@ -1153,14 +1153,14 @@ void ParticlesMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &ParticlesMaterial::get_lifetime_randomness); ADD_GROUP("Time", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_GROUP("Trail", "trail_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "trail_divisor", PROPERTY_HINT_RANGE, "1,1000000,1"), "set_trail_divisor", "get_trail_divisor"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "trail_size_modifier", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_trail_size_modifier", "get_trail_size_modifier"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "trail_color_modifier", PROPERTY_HINT_RESOURCE_TYPE, "GradientTexture"), "set_trail_color_modifier", "get_trail_color_modifier"); ADD_GROUP("Emission Shape", "emission_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_shape", PROPERTY_HINT_ENUM, "Point,Sphere,Box,Points,Directed Points"), "set_emission_shape", "get_emission_shape"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01,or_greater"), "set_emission_sphere_radius", "get_emission_sphere_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01,or_greater"), "set_emission_sphere_radius", "get_emission_sphere_radius"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "emission_box_extents"), "set_emission_box_extents", "get_emission_box_extents"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "emission_point_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_emission_point_texture", "get_emission_point_texture"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "emission_normal_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_emission_normal_texture", "get_emission_normal_texture"); @@ -1172,59 +1172,59 @@ void ParticlesMaterial::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_disable_z"), "set_flag", "get_flag", FLAG_DISABLE_Z); ADD_GROUP("Direction", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "direction"), "set_direction", "get_direction"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "flatness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_flatness", "get_flatness"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spread", PROPERTY_HINT_RANGE, "0,180,0.01"), "set_spread", "get_spread"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "flatness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_flatness", "get_flatness"); ADD_GROUP("Gravity", ""); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "gravity"), "set_gravity", "get_gravity"); ADD_GROUP("Initial Velocity", "initial_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity", PROPERTY_HINT_RANGE, "0,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_INITIAL_LINEAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "initial_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_INITIAL_LINEAR_VELOCITY); ADD_GROUP("Angular Velocity", "angular_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity", PROPERTY_HINT_RANGE, "-720,720,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGULAR_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGULAR_VELOCITY); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angular_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANGULAR_VELOCITY); ADD_GROUP("Orbit Velocity", "orbit_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity", PROPERTY_HINT_RANGE, "-1000,1000,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_ORBIT_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "orbit_velocity_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ORBIT_VELOCITY); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "orbit_velocity_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ORBIT_VELOCITY); ADD_GROUP("Linear Accel", "linear_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_LINEAR_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "linear_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_LINEAR_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "linear_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_LINEAR_ACCEL); ADD_GROUP("Radial Accel", "radial_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_RADIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "radial_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_RADIAL_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "radial_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_RADIAL_ACCEL); ADD_GROUP("Tangential Accel", "tangential_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel", PROPERTY_HINT_RANGE, "-100,100,0.01,or_lesser,or_greater"), "set_param", "get_param", PARAM_TANGENTIAL_ACCEL); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_TANGENTIAL_ACCEL); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "tangential_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_TANGENTIAL_ACCEL); ADD_GROUP("Damping", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_RANGE, "0,100,0.01,or_greater"), "set_param", "get_param", PARAM_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping", PROPERTY_HINT_RANGE, "0,100,0.01,or_greater"), "set_param", "get_param", PARAM_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_DAMPING); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "damping_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_DAMPING); ADD_GROUP("Angle", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle", PROPERTY_HINT_RANGE, "-720,720,0.1,or_lesser,or_greater"), "set_param", "get_param", PARAM_ANGLE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANGLE); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "angle_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANGLE); ADD_GROUP("Scale", ""); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "scale_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale", PROPERTY_HINT_RANGE, "0,1000,0.01,or_greater"), "set_param", "get_param", PARAM_SCALE); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "scale_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_SCALE); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "scale_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_SCALE); ADD_GROUP("Color", ""); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "color_ramp", PROPERTY_HINT_RESOURCE_TYPE, "GradientTexture"), "set_color_ramp", "get_color_ramp"); ADD_GROUP("Hue Variation", "hue_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_param", "get_param", PARAM_HUE_VARIATION); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "hue_variation_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_HUE_VARIATION); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "hue_variation_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_HUE_VARIATION); ADD_GROUP("Animation", "anim_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed", PROPERTY_HINT_RANGE, "0,128,0.01,or_greater"), "set_param", "get_param", PARAM_ANIM_SPEED); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_speed_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_SPEED); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_speed_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANIM_SPEED); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANIM_OFFSET); BIND_ENUM_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY); diff --git a/scene/resources/physics_material.cpp b/scene/resources/physics_material.cpp index 0db115ecc0..8ac0191452 100644 --- a/scene/resources/physics_material.cpp +++ b/scene/resources/physics_material.cpp @@ -44,9 +44,9 @@ void PhysicsMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_absorbent", "absorbent"), &PhysicsMaterial::set_absorbent); ClassDB::bind_method(D_METHOD("is_absorbent"), &PhysicsMaterial::is_absorbent); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "friction"), "set_friction", "get_friction"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "friction"), "set_friction", "get_friction"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rough"), "set_rough", "is_rough"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bounce"), "set_bounce", "get_bounce"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bounce"), "set_bounce", "get_bounce"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "absorbent"), "set_absorbent", "is_absorbent"); } diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index ea775ba028..00fc016ca1 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -303,19 +303,19 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const { v /= (rings + 1); w = sin(0.5 * Math_PI * v); - z = radius * cos(0.5 * Math_PI * v); + y = radius * cos(0.5 * Math_PI * v); for (i = 0; i <= radial_segments; i++) { u = i; u /= radial_segments; - x = sin(u * (Math_PI * 2.0)); - y = -cos(u * (Math_PI * 2.0)); + x = -sin(u * (Math_PI * 2.0)); + z = cos(u * (Math_PI * 2.0)); - Vector3 p = Vector3(x * radius * w, y * radius * w, z); - points.push_back(p + Vector3(0.0, 0.0, 0.5 * mid_height)); + Vector3 p = Vector3(x * radius * w, y, -z * radius * w); + points.push_back(p + Vector3(0.0, 0.5 * mid_height, 0.0)); normals.push_back(p.normalized()); - ADD_TANGENT(-y, x, 0.0, 1.0) + ADD_TANGENT(z, 0.0, x, 1.0) uvs.push_back(Vector2(u, v * onethird)); point++; @@ -341,20 +341,20 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const { v = j; v /= (rings + 1); - z = mid_height * v; - z = (mid_height * 0.5) - z; + y = mid_height * v; + y = (mid_height * 0.5) - y; for (i = 0; i <= radial_segments; i++) { u = i; u /= radial_segments; - x = sin(u * (Math_PI * 2.0)); - y = -cos(u * (Math_PI * 2.0)); + x = -sin(u * (Math_PI * 2.0)); + z = cos(u * (Math_PI * 2.0)); - Vector3 p = Vector3(x * radius, y * radius, z); + Vector3 p = Vector3(x * radius, y, -z * radius); points.push_back(p); - normals.push_back(Vector3(x, y, 0.0)); - ADD_TANGENT(-y, x, 0.0, 1.0) + normals.push_back(Vector3(x, 0.0, -z)); + ADD_TANGENT(z, 0.0, x, 1.0) uvs.push_back(Vector2(u, onethird + (v * onethird))); point++; @@ -382,19 +382,19 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const { v /= (rings + 1); v += 1.0; w = sin(0.5 * Math_PI * v); - z = radius * cos(0.5 * Math_PI * v); + y = radius * cos(0.5 * Math_PI * v); for (i = 0; i <= radial_segments; i++) { float u2 = i; u2 /= radial_segments; - x = sin(u2 * (Math_PI * 2.0)); - y = -cos(u2 * (Math_PI * 2.0)); + x = -sin(u2 * (Math_PI * 2.0)); + z = cos(u2 * (Math_PI * 2.0)); - Vector3 p = Vector3(x * radius * w, y * radius * w, z); - points.push_back(p + Vector3(0.0, 0.0, -0.5 * mid_height)); + Vector3 p = Vector3(x * radius * w, y, -z * radius * w); + points.push_back(p + Vector3(0.0, -0.5 * mid_height, 0.0)); normals.push_back(p.normalized()); - ADD_TANGENT(-y, x, 0.0, 1.0) + ADD_TANGENT(z, 0.0, x, 1.0) uvs.push_back(Vector2(u2, twothirds + ((v - 1.0) * onethird))); point++; @@ -431,8 +431,8 @@ void CapsuleMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_rings", "rings"), &CapsuleMesh::set_rings); ClassDB::bind_method(D_METHOD("get_rings"), &CapsuleMesh::get_rings); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "mid_height", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_mid_height", "get_mid_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mid_height", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_mid_height", "get_mid_height"); ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_radial_segments", "get_radial_segments"); ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_rings", "get_rings"); } @@ -891,9 +891,9 @@ void CylinderMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_rings", "rings"), &CylinderMesh::set_rings); ClassDB::bind_method(D_METHOD("get_rings"), &CylinderMesh::get_rings); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "top_radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_top_radius", "get_top_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "bottom_radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_bottom_radius", "get_bottom_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "top_radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_top_radius", "get_top_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bottom_radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_bottom_radius", "get_bottom_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_radial_segments", "get_radial_segments"); ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_rings", "get_rings"); } @@ -1291,7 +1291,7 @@ void PrismMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_subdivide_depth", "segments"), &PrismMesh::set_subdivide_depth); ClassDB::bind_method(D_METHOD("get_subdivide_depth"), &PrismMesh::get_subdivide_depth); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "left_to_right", PROPERTY_HINT_RANGE, "-2.0,2.0,0.1"), "set_left_to_right", "get_left_to_right"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "left_to_right", PROPERTY_HINT_RANGE, "-2.0,2.0,0.1"), "set_left_to_right", "get_left_to_right"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "size"), "set_size", "get_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_width", PROPERTY_HINT_RANGE, "0,100,1,or_greater"), "set_subdivide_width", "get_subdivide_width"); ADD_PROPERTY(PropertyInfo(Variant::INT, "subdivide_height", PROPERTY_HINT_RANGE, "0,100,1,or_greater"), "set_subdivide_height", "get_subdivide_height"); @@ -1515,8 +1515,8 @@ void SphereMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_is_hemisphere", "is_hemisphere"), &SphereMesh::set_is_hemisphere); ClassDB::bind_method(D_METHOD("get_is_hemisphere"), &SphereMesh::get_is_hemisphere); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_radius", "get_radius"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_radial_segments", "get_radial_segments"); ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_rings", "get_rings"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "is_hemisphere"), "set_is_hemisphere", "get_is_hemisphere"); diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index 1a9b7e6dd2..906abaf60c 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -87,7 +87,7 @@ void RayShape::_bind_methods() { ClassDB::bind_method(D_METHOD("set_slips_on_slope", "active"), &RayShape::set_slips_on_slope); ClassDB::bind_method(D_METHOD("get_slips_on_slope"), &RayShape::get_slips_on_slope); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "length", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_length", "get_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_length", "get_length"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "slips_on_slope"), "set_slips_on_slope", "get_slips_on_slope"); } diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 3094d0f9bd..2e78a4fccf 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -154,7 +154,7 @@ void RayShape2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_slips_on_slope", "active"), &RayShape2D::set_slips_on_slope); ClassDB::bind_method(D_METHOD("get_slips_on_slope"), &RayShape2D::get_slips_on_slope); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "length"), "set_length", "get_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length"), "set_length", "get_length"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "slips_on_slope"), "set_slips_on_slope", "get_slips_on_slope"); } diff --git a/scene/resources/shape.cpp b/scene/resources/shape.cpp index 988ff0d4f0..4a6da18f2b 100644 --- a/scene/resources/shape.cpp +++ b/scene/resources/shape.cpp @@ -106,7 +106,7 @@ void Shape::_bind_methods() { ClassDB::bind_method(D_METHOD("set_margin", "margin"), &Shape::set_margin); ClassDB::bind_method(D_METHOD("get_margin"), &Shape::get_margin); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "margin", PROPERTY_HINT_RANGE, "0.001,10,0.001"), "set_margin", "get_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0.001,10,0.001"), "set_margin", "get_margin"); } Shape::Shape() : diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 9e97c65a3c..64930c3117 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -105,7 +105,7 @@ void Shape2D::_bind_methods() { ClassDB::bind_method(D_METHOD("collide_and_get_contacts", "local_xform", "with_shape", "shape_xform"), &Shape2D::collide_and_get_contacts); ClassDB::bind_method(D_METHOD("collide_with_motion_and_get_contacts", "local_xform", "local_motion", "with_shape", "shape_xform", "shape_motion"), &Shape2D::collide_with_motion_and_get_contacts); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "custom_solver_bias", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_custom_solver_bias", "get_custom_solver_bias"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "custom_solver_bias", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_custom_solver_bias", "get_custom_solver_bias"); } Shape2D::Shape2D(const RID &p_rid) { diff --git a/scene/resources/skin.cpp b/scene/resources/skin.cpp index 9c8710a59c..df0620b6c4 100644 --- a/scene/resources/skin.cpp +++ b/scene/resources/skin.cpp @@ -45,6 +45,24 @@ void Skin::add_bind(int p_bone, const Transform &p_pose) { set_bind_pose(index, p_pose); } +void Skin::add_named_bind(const String &p_name, const Transform &p_pose) { + + uint32_t index = bind_count; + set_bind_count(bind_count + 1); + set_bind_name(index, p_name); + set_bind_pose(index, p_pose); +} + +void Skin::set_bind_name(int p_index, const StringName &p_name) { + ERR_FAIL_INDEX(p_index, bind_count); + bool notify_change = (binds_ptr[p_index].name != StringName()) != (p_name != StringName()); + binds_ptr[p_index].name = p_name; + emit_changed(); + if (notify_change) { + _change_notify(); + } +} + void Skin::set_bind_bone(int p_index, int p_bone) { ERR_FAIL_INDEX(p_index, bind_count); binds_ptr[p_index].bone = p_bone; @@ -75,6 +93,9 @@ bool Skin::_set(const StringName &p_name, const Variant &p_value) { if (what == "bone") { set_bind_bone(index, p_value); return true; + } else if (what == "name") { + set_bind_name(index, p_value); + return true; } else if (what == "pose") { set_bind_pose(index, p_value); return true; @@ -95,6 +116,9 @@ bool Skin::_get(const StringName &p_name, Variant &r_ret) const { if (what == "bone") { r_ret = get_bind_bone(index); return true; + } else if (what == "name") { + r_ret = get_bind_name(index); + return true; } else if (what == "pose") { r_ret = get_bind_pose(index); return true; @@ -105,7 +129,8 @@ bool Skin::_get(const StringName &p_name, Variant &r_ret) const { void Skin::_get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::INT, "bind_count", PROPERTY_HINT_RANGE, "0,16384,1,or_greater")); for (int i = 0; i < get_bind_count(); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "bind/" + itos(i) + "/bone", PROPERTY_HINT_RANGE, "0,16384,1,or_greater")); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "bind/" + itos(i) + "/name")); + p_list->push_back(PropertyInfo(Variant::INT, "bind/" + itos(i) + "/bone", PROPERTY_HINT_RANGE, "0,16384,1,or_greater", get_bind_name(i) != StringName() ? PROPERTY_USAGE_NOEDITOR : PROPERTY_USAGE_DEFAULT)); p_list->push_back(PropertyInfo(Variant::TRANSFORM, "bind/" + itos(i) + "/pose")); } } @@ -120,6 +145,9 @@ void Skin::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bind_pose", "bind_index", "pose"), &Skin::set_bind_pose); ClassDB::bind_method(D_METHOD("get_bind_pose", "bind_index"), &Skin::get_bind_pose); + ClassDB::bind_method(D_METHOD("set_bind_name", "bind_index", "name"), &Skin::set_bind_name); + ClassDB::bind_method(D_METHOD("get_bind_name", "bind_index"), &Skin::get_bind_name); + ClassDB::bind_method(D_METHOD("set_bind_bone", "bind_index", "bone"), &Skin::set_bind_bone); ClassDB::bind_method(D_METHOD("get_bind_bone", "bind_index"), &Skin::get_bind_bone); diff --git a/scene/resources/skin.h b/scene/resources/skin.h index ddc7c655f5..57aaf1afd4 100644 --- a/scene/resources/skin.h +++ b/scene/resources/skin.h @@ -37,7 +37,8 @@ class Skin : public Resource { GDCLASS(Skin, Resource) struct Bind { - int bone; + int bone = -1; + StringName name; Transform pose; }; @@ -58,9 +59,11 @@ public: inline int get_bind_count() const { return bind_count; } void add_bind(int p_bone, const Transform &p_pose); + void add_named_bind(const String &p_name, const Transform &p_pose); void set_bind_bone(int p_index, int p_bone); void set_bind_pose(int p_index, const Transform &p_pose); + void set_bind_name(int p_index, const StringName &p_name); inline int get_bind_bone(int p_index) const { #ifdef DEBUG_ENABLED @@ -69,6 +72,13 @@ public: return binds_ptr[p_index].bone; } + inline StringName get_bind_name(int p_index) const { +#ifdef DEBUG_ENABLED + ERR_FAIL_INDEX_V(p_index, bind_count, StringName()); +#endif + return binds_ptr[p_index].name; + } + inline Transform get_bind_pose(int p_index) const { #ifdef DEBUG_ENABLED ERR_FAIL_INDEX_V(p_index, bind_count, Transform()); diff --git a/scene/resources/sky.cpp b/scene/resources/sky.cpp index 7a54828639..54648e8af7 100644 --- a/scene/resources/sky.cpp +++ b/scene/resources/sky.cpp @@ -509,23 +509,23 @@ void ProceduralSky::_bind_methods() { ADD_GROUP("Sky", "sky_"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_top_color"), "set_sky_top_color", "get_sky_top_color"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_horizon_color"), "set_sky_horizon_color", "get_sky_horizon_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sky_curve", PROPERTY_HINT_EXP_EASING), "set_sky_curve", "get_sky_curve"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sky_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_sky_energy", "get_sky_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sky_curve", PROPERTY_HINT_EXP_EASING), "set_sky_curve", "get_sky_curve"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sky_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_sky_energy", "get_sky_energy"); ADD_GROUP("Ground", "ground_"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_bottom_color"), "set_ground_bottom_color", "get_ground_bottom_color"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_horizon_color"), "set_ground_horizon_color", "get_ground_horizon_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ground_curve", PROPERTY_HINT_EXP_EASING), "set_ground_curve", "get_ground_curve"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ground_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_ground_energy", "get_ground_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ground_curve", PROPERTY_HINT_EXP_EASING), "set_ground_curve", "get_ground_curve"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ground_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_ground_energy", "get_ground_energy"); ADD_GROUP("Sun", "sun_"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sun_color"), "set_sun_color", "get_sun_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_latitude", PROPERTY_HINT_RANGE, "-180,180,0.01"), "set_sun_latitude", "get_sun_latitude"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_longitude", PROPERTY_HINT_RANGE, "-180,180,0.01"), "set_sun_longitude", "get_sun_longitude"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_angle_min", PROPERTY_HINT_RANGE, "0,360,0.01"), "set_sun_angle_min", "get_sun_angle_min"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_angle_max", PROPERTY_HINT_RANGE, "0,360,0.01"), "set_sun_angle_max", "get_sun_angle_max"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_curve", PROPERTY_HINT_EXP_EASING), "set_sun_curve", "get_sun_curve"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "sun_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_sun_energy", "get_sun_energy"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sun_latitude", PROPERTY_HINT_RANGE, "-180,180,0.01"), "set_sun_latitude", "get_sun_latitude"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sun_longitude", PROPERTY_HINT_RANGE, "-180,180,0.01"), "set_sun_longitude", "get_sun_longitude"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sun_angle_min", PROPERTY_HINT_RANGE, "0,360,0.01"), "set_sun_angle_min", "get_sun_angle_min"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sun_angle_max", PROPERTY_HINT_RANGE, "0,360,0.01"), "set_sun_angle_max", "get_sun_angle_max"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sun_curve", PROPERTY_HINT_EXP_EASING), "set_sun_curve", "get_sun_curve"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sun_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_sun_energy", "get_sun_energy"); ADD_GROUP("Texture2D", "texture_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_size", PROPERTY_HINT_ENUM, "256,512,1024,2048,4096"), "set_texture_size", "get_texture_size"); diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp index 56121b6941..825708d1e2 100644 --- a/scene/resources/sphere_shape.cpp +++ b/scene/resources/sphere_shape.cpp @@ -83,7 +83,7 @@ void SphereShape::_bind_methods() { ClassDB::bind_method(D_METHOD("set_radius", "radius"), &SphereShape::set_radius); ClassDB::bind_method(D_METHOD("get_radius"), &SphereShape::get_radius); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "radius", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_radius", "get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_radius", "get_radius"); } SphereShape::SphereShape() : diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 1766b531d5..119cbcd098 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -104,10 +104,10 @@ void StyleBox::_bind_methods() { ClassDB::bind_method(D_METHOD("draw", "canvas_item", "rect"), &StyleBox::draw); ADD_GROUP("Content Margin", "content_margin_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "content_margin_left", PROPERTY_HINT_RANGE, "-1,2048,1"), "set_default_margin", "get_default_margin", MARGIN_LEFT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "content_margin_right", PROPERTY_HINT_RANGE, "-1,2048,1"), "set_default_margin", "get_default_margin", MARGIN_RIGHT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "content_margin_top", PROPERTY_HINT_RANGE, "-1,2048,1"), "set_default_margin", "get_default_margin", MARGIN_TOP); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "content_margin_bottom", PROPERTY_HINT_RANGE, "-1,2048,1"), "set_default_margin", "get_default_margin", MARGIN_BOTTOM); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "content_margin_left", PROPERTY_HINT_RANGE, "-1,2048,1"), "set_default_margin", "get_default_margin", MARGIN_LEFT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "content_margin_right", PROPERTY_HINT_RANGE, "-1,2048,1"), "set_default_margin", "get_default_margin", MARGIN_RIGHT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "content_margin_top", PROPERTY_HINT_RANGE, "-1,2048,1"), "set_default_margin", "get_default_margin", MARGIN_TOP); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "content_margin_bottom", PROPERTY_HINT_RANGE, "-1,2048,1"), "set_default_margin", "get_default_margin", MARGIN_BOTTOM); } StyleBox::StyleBox() { @@ -339,15 +339,15 @@ void StyleBoxTexture::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_normal_map", "get_normal_map"); ADD_PROPERTY(PropertyInfo(Variant::RECT2, "region_rect"), "set_region_rect", "get_region_rect"); ADD_GROUP("Margin", "margin_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "margin_left", PROPERTY_HINT_RANGE, "0,2048,1"), "set_margin_size", "get_margin_size", MARGIN_LEFT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "margin_right", PROPERTY_HINT_RANGE, "0,2048,1"), "set_margin_size", "get_margin_size", MARGIN_RIGHT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "margin_top", PROPERTY_HINT_RANGE, "0,2048,1"), "set_margin_size", "get_margin_size", MARGIN_TOP); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "margin_bottom", PROPERTY_HINT_RANGE, "0,2048,1"), "set_margin_size", "get_margin_size", MARGIN_BOTTOM); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "margin_left", PROPERTY_HINT_RANGE, "0,2048,1"), "set_margin_size", "get_margin_size", MARGIN_LEFT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "margin_right", PROPERTY_HINT_RANGE, "0,2048,1"), "set_margin_size", "get_margin_size", MARGIN_RIGHT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "margin_top", PROPERTY_HINT_RANGE, "0,2048,1"), "set_margin_size", "get_margin_size", MARGIN_TOP); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "margin_bottom", PROPERTY_HINT_RANGE, "0,2048,1"), "set_margin_size", "get_margin_size", MARGIN_BOTTOM); ADD_GROUP("Expand Margin", "expand_margin_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_left", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin_size", "get_expand_margin_size", MARGIN_LEFT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_right", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin_size", "get_expand_margin_size", MARGIN_RIGHT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_top", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin_size", "get_expand_margin_size", MARGIN_TOP); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_bottom", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin_size", "get_expand_margin_size", MARGIN_BOTTOM); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "expand_margin_left", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin_size", "get_expand_margin_size", MARGIN_LEFT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "expand_margin_right", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin_size", "get_expand_margin_size", MARGIN_RIGHT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "expand_margin_top", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin_size", "get_expand_margin_size", MARGIN_TOP); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "expand_margin_bottom", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin_size", "get_expand_margin_size", MARGIN_BOTTOM); ADD_GROUP("Axis Stretch", "axis_stretch_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "axis_stretch_horizontal", PROPERTY_HINT_ENUM, "Stretch,Tile,Tile Fit"), "set_h_axis_stretch_mode", "get_h_axis_stretch_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "axis_stretch_vertical", PROPERTY_HINT_ENUM, "Stretch,Tile,Tile Fit"), "set_v_axis_stretch_mode", "get_v_axis_stretch_mode"); @@ -933,10 +933,10 @@ void StyleBoxFlat::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "corner_detail", PROPERTY_HINT_RANGE, "1,20,1"), "set_corner_detail", "get_corner_detail"); ADD_GROUP("Expand Margin", "expand_margin_"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_left", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_LEFT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_right", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_RIGHT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_top", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_TOP); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_bottom", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_BOTTOM); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "expand_margin_left", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_LEFT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "expand_margin_right", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_RIGHT); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "expand_margin_top", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_TOP); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "expand_margin_bottom", PROPERTY_HINT_RANGE, "0,2048,1"), "set_expand_margin", "get_expand_margin", MARGIN_BOTTOM); ADD_GROUP("Shadow", "shadow_"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color"), "set_shadow_color", "get_shadow_color"); @@ -1035,8 +1035,8 @@ void StyleBoxLine::_bind_methods() { ClassDB::bind_method(D_METHOD("is_vertical"), &StyleBoxLine::is_vertical); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "grow_begin", PROPERTY_HINT_RANGE, "-300,300,1"), "set_grow_begin", "get_grow_begin"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "grow_end", PROPERTY_HINT_RANGE, "-300,300,1"), "set_grow_end", "get_grow_end"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "grow_begin", PROPERTY_HINT_RANGE, "-300,300,1"), "set_grow_begin", "get_grow_begin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "grow_end", PROPERTY_HINT_RANGE, "-300,300,1"), "set_grow_end", "get_grow_end"); ADD_PROPERTY(PropertyInfo(Variant::INT, "thickness", PROPERTY_HINT_RANGE, "0,10"), "set_thickness", "get_thickness"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vertical"), "set_vertical", "is_vertical"); } diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 60a9ca8f0f..64de19c197 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -405,7 +405,6 @@ Ref<Image> StreamTexture::load_image_from_file(FileAccess *f, int p_size_limit) } if (img.is_null() || img->empty()) { - memdelete(f); ERR_FAIL_COND_V(img.is_null() || img->empty(), Ref<Image>()); } @@ -1410,11 +1409,11 @@ void CurveTexture::ensure_default_setup(float p_min, float p_max) { void CurveTexture::set_curve(Ref<Curve> p_curve) { if (_curve != p_curve) { if (_curve.is_valid()) { - _curve->disconnect(CoreStringNames::get_singleton()->changed, this, "_update"); + _curve->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_update"); } _curve = p_curve; if (_curve.is_valid()) { - _curve->connect(CoreStringNames::get_singleton()->changed, this, "_update"); + _curve->connect_compat(CoreStringNames::get_singleton()->changed, this, "_update"); } _update(); } @@ -1515,11 +1514,11 @@ void GradientTexture::set_gradient(Ref<Gradient> p_gradient) { if (p_gradient == gradient) return; if (gradient.is_valid()) { - gradient->disconnect(CoreStringNames::get_singleton()->changed, this, "_update"); + gradient->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_update"); } gradient = p_gradient; if (gradient.is_valid()) { - gradient->connect(CoreStringNames::get_singleton()->changed, this, "_update"); + gradient->connect_compat(CoreStringNames::get_singleton()->changed, this, "_update"); } _update(); emit_changed(); @@ -1847,11 +1846,11 @@ void AnimatedTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_proxy"), &AnimatedTexture::_update_proxy); ADD_PROPERTY(PropertyInfo(Variant::INT, "frames", PROPERTY_HINT_RANGE, "1," + itos(MAX_FRAMES), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "set_frames", "get_frames"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "fps", PROPERTY_HINT_RANGE, "0,1024,0.1"), "set_fps", "get_fps"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fps", PROPERTY_HINT_RANGE, "0,1024,0.1"), "set_fps", "get_fps"); for (int i = 0; i < MAX_FRAMES; i++) { ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "frame_" + itos(i) + "/texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_frame_texture", "get_frame_texture", i); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "frame_" + itos(i) + "/delay_sec", PROPERTY_HINT_RANGE, "0.0,16.0,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_frame_delay", "get_frame_delay", i); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "frame_" + itos(i) + "/delay_sec", PROPERTY_HINT_RANGE, "0.0,16.0,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_frame_delay", "get_frame_delay", i); } BIND_CONSTANT(MAX_FRAMES); @@ -1868,7 +1867,7 @@ AnimatedTexture::AnimatedTexture() { fps = 4; prev_ticks = 0; current_frame = 0; - VisualServer::get_singleton()->connect("frame_pre_draw", this, "_update_proxy"); + VisualServer::get_singleton()->connect_compat("frame_pre_draw", this, "_update_proxy"); #ifndef NO_THREADS rw_lock = RWLock::create(); diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index aa05e41b16..5db521bc20 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -302,13 +302,13 @@ void Theme::set_default_theme_font(const Ref<Font> &p_default_font) { return; if (default_theme_font.is_valid()) { - default_theme_font->disconnect("changed", this, "_emit_theme_changed"); + default_theme_font->disconnect_compat("changed", this, "_emit_theme_changed"); } default_theme_font = p_default_font; if (default_theme_font.is_valid()) { - default_theme_font->connect("changed", this, "_emit_theme_changed", varray(), CONNECT_REFERENCE_COUNTED); + default_theme_font->connect_compat("changed", this, "_emit_theme_changed", varray(), CONNECT_REFERENCE_COUNTED); } _change_notify(); @@ -366,13 +366,13 @@ void Theme::set_icon(const StringName &p_name, const StringName &p_type, const R bool new_value = !icon_map.has(p_type) || !icon_map[p_type].has(p_name); if (icon_map[p_type].has(p_name) && icon_map[p_type][p_name].is_valid()) { - icon_map[p_type][p_name]->disconnect("changed", this, "_emit_theme_changed"); + icon_map[p_type][p_name]->disconnect_compat("changed", this, "_emit_theme_changed"); } icon_map[p_type][p_name] = p_icon; if (p_icon.is_valid()) { - icon_map[p_type][p_name]->connect("changed", this, "_emit_theme_changed", varray(), CONNECT_REFERENCE_COUNTED); + icon_map[p_type][p_name]->connect_compat("changed", this, "_emit_theme_changed", varray(), CONNECT_REFERENCE_COUNTED); } if (new_value) { @@ -401,7 +401,7 @@ void Theme::clear_icon(const StringName &p_name, const StringName &p_type) { ERR_FAIL_COND(!icon_map[p_type].has(p_name)); if (icon_map[p_type][p_name].is_valid()) { - icon_map[p_type][p_name]->disconnect("changed", this, "_emit_theme_changed"); + icon_map[p_type][p_name]->disconnect_compat("changed", this, "_emit_theme_changed"); } icon_map[p_type].erase(p_name); @@ -479,13 +479,13 @@ void Theme::set_stylebox(const StringName &p_name, const StringName &p_type, con bool new_value = !style_map.has(p_type) || !style_map[p_type].has(p_name); if (style_map[p_type].has(p_name) && style_map[p_type][p_name].is_valid()) { - style_map[p_type][p_name]->disconnect("changed", this, "_emit_theme_changed"); + style_map[p_type][p_name]->disconnect_compat("changed", this, "_emit_theme_changed"); } style_map[p_type][p_name] = p_style; if (p_style.is_valid()) { - style_map[p_type][p_name]->connect("changed", this, "_emit_theme_changed", varray(), CONNECT_REFERENCE_COUNTED); + style_map[p_type][p_name]->connect_compat("changed", this, "_emit_theme_changed", varray(), CONNECT_REFERENCE_COUNTED); } if (new_value) @@ -514,7 +514,7 @@ void Theme::clear_stylebox(const StringName &p_name, const StringName &p_type) { ERR_FAIL_COND(!style_map[p_type].has(p_name)); if (style_map[p_type][p_name].is_valid()) { - style_map[p_type][p_name]->disconnect("changed", this, "_emit_theme_changed"); + style_map[p_type][p_name]->disconnect_compat("changed", this, "_emit_theme_changed"); } style_map[p_type].erase(p_name); @@ -554,13 +554,13 @@ void Theme::set_font(const StringName &p_name, const StringName &p_type, const R bool new_value = !font_map.has(p_type) || !font_map[p_type].has(p_name); if (font_map[p_type][p_name].is_valid()) { - font_map[p_type][p_name]->disconnect("changed", this, "_emit_theme_changed"); + font_map[p_type][p_name]->disconnect_compat("changed", this, "_emit_theme_changed"); } font_map[p_type][p_name] = p_font; if (p_font.is_valid()) { - font_map[p_type][p_name]->connect("changed", this, "_emit_theme_changed", varray(), CONNECT_REFERENCE_COUNTED); + font_map[p_type][p_name]->connect_compat("changed", this, "_emit_theme_changed", varray(), CONNECT_REFERENCE_COUNTED); } if (new_value) { @@ -589,7 +589,7 @@ void Theme::clear_font(const StringName &p_name, const StringName &p_type) { ERR_FAIL_COND(!font_map[p_type].has(p_name)); if (font_map[p_type][p_name].is_valid()) { - font_map[p_type][p_name]->disconnect("changed", this, "_emit_theme_changed"); + font_map[p_type][p_name]->disconnect_compat("changed", this, "_emit_theme_changed"); } font_map[p_type].erase(p_name); @@ -722,7 +722,7 @@ void Theme::clear() { while ((L = icon_map[*K].next(L))) { Ref<Texture2D> icon = icon_map[*K][*L]; if (icon.is_valid()) { - icon->disconnect("changed", this, "_emit_theme_changed"); + icon->disconnect_compat("changed", this, "_emit_theme_changed"); } } } @@ -735,7 +735,7 @@ void Theme::clear() { while ((L = style_map[*K].next(L))) { Ref<StyleBox> style = style_map[*K][*L]; if (style.is_valid()) { - style->disconnect("changed", this, "_emit_theme_changed"); + style->disconnect_compat("changed", this, "_emit_theme_changed"); } } } @@ -748,7 +748,7 @@ void Theme::clear() { while ((L = font_map[*K].next(L))) { Ref<Font> font = font_map[*K][*L]; if (font.is_valid()) { - font->disconnect("changed", this, "_emit_theme_changed"); + font->disconnect_compat("changed", this, "_emit_theme_changed"); } } } diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 7383e18473..f42b56bc83 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -360,7 +360,7 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::BOOL, pre + "shape_one_way", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); - p_list->push_back(PropertyInfo(Variant::REAL, pre + "shape_one_way_margin", PROPERTY_HINT_RANGE, "0,128,0.01", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::FLOAT, pre + "shape_one_way_margin", PROPERTY_HINT_RANGE, "0,128,0.01", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "shapes", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::INT, pre + "z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1", PROPERTY_USAGE_NOEDITOR)); } diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 38b7c5cda0..556d299198 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -32,6 +32,7 @@ #include "core/vmap.h" #include "servers/visual/shader_types.h" +#include "visual_shader_nodes.h" bool VisualShaderNode::is_simple_decl() const { return simple_decl; @@ -127,6 +128,7 @@ void VisualShaderNode::_bind_methods() { ADD_SIGNAL(MethodInfo("editor_refresh_request")); BIND_ENUM_CONSTANT(PORT_TYPE_SCALAR); + BIND_ENUM_CONSTANT(PORT_TYPE_SCALAR_INT); BIND_ENUM_CONSTANT(PORT_TYPE_VECTOR); BIND_ENUM_CONSTANT(PORT_TYPE_BOOLEAN); BIND_ENUM_CONSTANT(PORT_TYPE_TRANSFORM); @@ -266,14 +268,13 @@ void VisualShaderNodeCustom::_bind_methods() { BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_name")); BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_description")); BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_category")); - BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_subcategory")); BIND_VMETHOD(MethodInfo(Variant::INT, "_get_return_icon_type")); BIND_VMETHOD(MethodInfo(Variant::INT, "_get_input_port_count")); BIND_VMETHOD(MethodInfo(Variant::INT, "_get_input_port_type", PropertyInfo(Variant::INT, "port"))); - BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_input_port_name", PropertyInfo(Variant::INT, "port"))); + BIND_VMETHOD(MethodInfo(Variant::STRING_NAME, "_get_input_port_name", PropertyInfo(Variant::INT, "port"))); BIND_VMETHOD(MethodInfo(Variant::INT, "_get_output_port_count")); BIND_VMETHOD(MethodInfo(Variant::INT, "_get_output_port_type", PropertyInfo(Variant::INT, "port"))); - BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_output_port_name", PropertyInfo(Variant::INT, "port"))); + BIND_VMETHOD(MethodInfo(Variant::STRING_NAME, "_get_output_port_name", PropertyInfo(Variant::INT, "port"))); BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_code", PropertyInfo(Variant::ARRAY, "input_vars"), PropertyInfo(Variant::ARRAY, "output_vars"), PropertyInfo(Variant::INT, "mode"), PropertyInfo(Variant::INT, "type"))); BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_global_code", PropertyInfo(Variant::INT, "mode"))); BIND_VMETHOD(MethodInfo(Variant::BOOL, "_is_highend")); @@ -285,6 +286,49 @@ VisualShaderNodeCustom::VisualShaderNodeCustom() { ///////////////////////////////////////////////////////// +void VisualShader::set_version(const String &p_version) { + version = p_version; +} + +String VisualShader::get_version() const { + return version; +} + +void VisualShader::update_version(const String &p_new_version) { + if (version == "") { + for (int i = 0; i < TYPE_MAX; i++) { + for (Map<int, Node>::Element *E = graph[i].nodes.front(); E; E = E->next()) { + Ref<VisualShaderNodeExpression> expression = Object::cast_to<VisualShaderNodeExpression>(E->get().node.ptr()); + if (expression.is_valid()) { + for (int j = 0; j < expression->get_input_port_count(); j++) { + int type = expression->get_input_port_type(j); + if (type > 0) { // + PORT_TYPE_SCALAR_INT + type += 1; + } + expression->set_input_port_type(j, type); + } + for (int j = 0; j < expression->get_output_port_count(); j++) { + int type = expression->get_output_port_type(j); + if (type > 0) { // + PORT_TYPE_SCALAR_INT + type += 1; + } + expression->set_output_port_type(j, type); + } + } + Ref<VisualShaderNodeCompare> compare = Object::cast_to<VisualShaderNodeCompare>(E->get().node.ptr()); + if (compare.is_valid()) { + int ctype = int(compare->get_comparison_type()); + if (int(ctype) > 0) { // + PORT_TYPE_SCALAR_INT + ctype += 1; + } + compare->set_comparison_type(VisualShaderNodeCompare::ComparisonType(ctype)); + } + } + } + } + set_version(p_new_version); +} + void VisualShader::add_node(Type p_type, const Ref<VisualShaderNode> &p_node, const Vector2 &p_position, int p_id) { ERR_FAIL_COND(p_node.is_null()); ERR_FAIL_COND(p_id < 2); @@ -305,10 +349,10 @@ void VisualShader::add_node(Type p_type, const Ref<VisualShaderNode> &p_node, co if (input.is_valid()) { input->shader_mode = shader_mode; input->shader_type = p_type; - input->connect("input_type_changed", this, "_input_type_changed", varray(p_type, p_id)); + input->connect_compat("input_type_changed", this, "_input_type_changed", varray(p_type, p_id)); } - n.node->connect("changed", this, "_queue_update"); + n.node->connect_compat("changed", this, "_queue_update"); Ref<VisualShaderNodeCustom> custom = n.node; if (custom.is_valid()) { @@ -375,10 +419,10 @@ void VisualShader::remove_node(Type p_type, int p_id) { Ref<VisualShaderNodeInput> input = g->nodes[p_id].node; if (input.is_valid()) { - input->disconnect("input_type_changed", this, "_input_type_changed"); + input->disconnect_compat("input_type_changed", this, "_input_type_changed"); } - g->nodes[p_id].node->disconnect("changed", this, "_queue_update"); + g->nodes[p_id].node->disconnect_compat("changed", this, "_queue_update"); g->nodes.erase(p_id); @@ -470,7 +514,7 @@ bool VisualShader::can_connect_nodes(Type p_type, int p_from_node, int p_from_po } bool VisualShader::is_port_types_compatible(int p_a, int p_b) const { - return MAX(0, p_a - 2) == (MAX(0, p_b - 2)); + return MAX(0, p_a - 3) == (MAX(0, p_b - 3)); } void VisualShader::connect_nodes_forced(Type p_type, int p_from_node, int p_from_port, int p_to_node, int p_to_port) { @@ -698,9 +742,11 @@ String VisualShader::generate_preview_shader(Type p_type, int p_node, int p_port ERR_FAIL_COND_V(err != OK, String()); if (node->get_output_port_type(p_port) == VisualShaderNode::PORT_TYPE_SCALAR) { - code += "\tCOLOR.rgb = vec3( n_out" + itos(p_node) + "p" + itos(p_port) + " );\n"; + code += "\tCOLOR.rgb = vec3(n_out" + itos(p_node) + "p" + itos(p_port) + " );\n"; + } else if (node->get_output_port_type(p_port) == VisualShaderNode::PORT_TYPE_SCALAR_INT) { + code += "\tCOLOR.rgb = vec3(float(n_out" + itos(p_node) + "p" + itos(p_port) + "));\n"; } else if (node->get_output_port_type(p_port) == VisualShaderNode::PORT_TYPE_BOOLEAN) { - code += "\tCOLOR.rgb = vec3( n_out" + itos(p_node) + "p" + itos(p_port) + " ? 1.0 : 0.0 );\n"; + code += "\tCOLOR.rgb = vec3(n_out" + itos(p_node) + "p" + itos(p_port) + " ? 1.0 : 0.0);\n"; } else { code += "\tCOLOR.rgb = n_out" + itos(p_node) + "p" + itos(p_port) + ";\n"; } @@ -985,8 +1031,8 @@ bool VisualShader::_get(const StringName &p_name, Variant &r_ret) const { } return false; } -void VisualShader::_get_property_list(List<PropertyInfo> *p_list) const { +void VisualShader::_get_property_list(List<PropertyInfo> *p_list) const { //mode p_list->push_back(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Spatial,CanvasItem,Particles")); //render modes @@ -995,7 +1041,6 @@ void VisualShader::_get_property_list(List<PropertyInfo> *p_list) const { Set<String> toggles; for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode)).size(); i++) { - String mode = ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode))[i]; int idx = 0; bool in_enum = false; @@ -1020,7 +1065,6 @@ void VisualShader::_get_property_list(List<PropertyInfo> *p_list) const { } for (Map<String, String>::Element *E = blend_mode_enums.front(); E; E = E->next()) { - p_list->push_back(PropertyInfo(Variant::INT, "modes/" + E->key(), PROPERTY_HINT_ENUM, E->get())); } @@ -1050,7 +1094,7 @@ void VisualShader::_get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::STRING, prop_name + "/expression", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); } } - p_list->push_back(PropertyInfo(Variant::PACKED_INT_ARRAY, "nodes/" + String(type_string[i]) + "/connections", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "nodes/" + String(type_string[i]) + "/connections", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); } } @@ -1113,24 +1157,40 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui inputs[i] = src_var; } else if (in_type == VisualShaderNode::PORT_TYPE_SCALAR && out_type == VisualShaderNode::PORT_TYPE_VECTOR) { inputs[i] = "dot(" + src_var + ", vec3(0.333333, 0.333333, 0.333333))"; + } else if (in_type == VisualShaderNode::PORT_TYPE_SCALAR_INT && out_type == VisualShaderNode::PORT_TYPE_VECTOR) { + inputs[i] = "dot(float(" + src_var + "), vec3(0.333333, 0.333333, 0.333333))"; } else if (in_type == VisualShaderNode::PORT_TYPE_VECTOR && out_type == VisualShaderNode::PORT_TYPE_SCALAR) { inputs[i] = "vec3(" + src_var + ")"; + } else if (in_type == VisualShaderNode::PORT_TYPE_VECTOR && out_type == VisualShaderNode::PORT_TYPE_SCALAR_INT) { + inputs[i] = "vec3(float(" + src_var + "))"; } else if (in_type == VisualShaderNode::PORT_TYPE_BOOLEAN && out_type == VisualShaderNode::PORT_TYPE_VECTOR) { inputs[i] = "all(bvec3(" + src_var + "))"; } else if (in_type == VisualShaderNode::PORT_TYPE_BOOLEAN && out_type == VisualShaderNode::PORT_TYPE_SCALAR) { inputs[i] = src_var + " > 0.0 ? true : false"; + } else if (in_type == VisualShaderNode::PORT_TYPE_BOOLEAN && out_type == VisualShaderNode::PORT_TYPE_SCALAR_INT) { + inputs[i] = src_var + " > 0 ? true : false"; } else if (in_type == VisualShaderNode::PORT_TYPE_SCALAR && out_type == VisualShaderNode::PORT_TYPE_BOOLEAN) { inputs[i] = src_var + " ? 1.0 : 0.0"; + } else if (in_type == VisualShaderNode::PORT_TYPE_SCALAR_INT && out_type == VisualShaderNode::PORT_TYPE_BOOLEAN) { + inputs[i] = src_var + " ? 1 : 0"; } else if (in_type == VisualShaderNode::PORT_TYPE_VECTOR && out_type == VisualShaderNode::PORT_TYPE_BOOLEAN) { inputs[i] = "vec3(" + src_var + " ? 1.0 : 0.0)"; + } else if (in_type == VisualShaderNode::PORT_TYPE_SCALAR && out_type == VisualShaderNode::PORT_TYPE_SCALAR_INT) { + inputs[i] = "float(" + src_var + ")"; + } else if (in_type == VisualShaderNode::PORT_TYPE_SCALAR_INT && out_type == VisualShaderNode::PORT_TYPE_SCALAR) { + inputs[i] = "int(" + src_var + ")"; } } else { Variant defval = vsnode->get_input_port_default_value(i); - if (defval.get_type() == Variant::REAL || defval.get_type() == Variant::INT) { + if (defval.get_type() == Variant::FLOAT) { float val = defval; inputs[i] = "n_in" + itos(node) + "p" + itos(i); code += "\tfloat " + inputs[i] + " = " + vformat("%.5f", val) + ";\n"; + } else if (defval.get_type() == Variant::INT) { + int val = defval; + inputs[i] = "n_in" + itos(node) + "p" + itos(i); + code += "\tint " + inputs[i] + " = " + itos(val) + ";\n"; } else if (defval.get_type() == Variant::BOOL) { bool val = defval; inputs[i] = "n_in" + itos(node) + "p" + itos(i); @@ -1170,6 +1230,7 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui String var_name = "n_out" + itos(node) + "p" + itos(i); switch (vsnode->get_output_port_type(i)) { case VisualShaderNode::PORT_TYPE_SCALAR: outputs[i] = "float " + var_name; break; + case VisualShaderNode::PORT_TYPE_SCALAR_INT: outputs[i] = "int " + var_name; break; case VisualShaderNode::PORT_TYPE_VECTOR: outputs[i] = "vec3 " + var_name; break; case VisualShaderNode::PORT_TYPE_BOOLEAN: outputs[i] = "bool " + var_name; break; case VisualShaderNode::PORT_TYPE_TRANSFORM: outputs[i] = "mat4 " + var_name; break; @@ -1183,6 +1244,7 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui outputs[i] = "n_out" + itos(node) + "p" + itos(i); switch (vsnode->get_output_port_type(i)) { case VisualShaderNode::PORT_TYPE_SCALAR: code += String() + "\tfloat " + outputs[i] + ";\n"; break; + case VisualShaderNode::PORT_TYPE_SCALAR_INT: code += String() + "\tint " + outputs[i] + ";\n"; break; case VisualShaderNode::PORT_TYPE_VECTOR: code += String() + "\tvec3 " + outputs[i] + ";\n"; break; case VisualShaderNode::PORT_TYPE_BOOLEAN: code += String() + "\tbool " + outputs[i] + ";\n"; break; case VisualShaderNode::PORT_TYPE_TRANSFORM: code += String() + "\tmat4 " + outputs[i] + ";\n"; break; @@ -1412,6 +1474,9 @@ void VisualShader::_bind_methods() { ClassDB::bind_method(D_METHOD("get_node_connections", "type"), &VisualShader::_get_node_connections); + ClassDB::bind_method(D_METHOD("set_version", "version"), &VisualShader::set_version); + ClassDB::bind_method(D_METHOD("get_version"), &VisualShader::get_version); + ClassDB::bind_method(D_METHOD("set_graph_offset", "offset"), &VisualShader::set_graph_offset); ClassDB::bind_method(D_METHOD("get_graph_offset"), &VisualShader::get_graph_offset); @@ -1421,6 +1486,7 @@ void VisualShader::_bind_methods() { ClassDB::bind_method(D_METHOD("_input_type_changed"), &VisualShader::_input_type_changed); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "graph_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_graph_offset", "get_graph_offset"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "version", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_version", "get_version"); BIND_ENUM_CONSTANT(TYPE_VERTEX); BIND_ENUM_CONSTANT(TYPE_FRAGMENT); @@ -1576,7 +1642,7 @@ const VisualShaderNodeInput::Port VisualShaderNodeInput::ports[] = { { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_SCALAR, "delta", "DELTA" }, { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_SCALAR, "lifetime", "LIFETIME" }, - { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_SCALAR, "index", "float(INDEX)" }, + { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_SCALAR_INT, "index", "INDEX" }, { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_TRANSFORM, "emission_transform", "EMISSION_TRANSFORM" }, { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_SCALAR, "time", "TIME" }, @@ -1684,17 +1750,20 @@ String VisualShaderNodeInput::generate_code(Shader::Mode p_mode, VisualShader::T switch (get_output_port_type(0)) { case PORT_TYPE_SCALAR: { code = "\t" + p_output_vars[0] + " = 0.0;\n"; - } break; //default (none found) is scalar + } break; + case PORT_TYPE_SCALAR_INT: { + code = "\t" + p_output_vars[0] + " = 0;\n"; + } break; case PORT_TYPE_VECTOR: { code = "\t" + p_output_vars[0] + " = vec3(0.0);\n"; - } break; //default (none found) is scalar + } break; case PORT_TYPE_TRANSFORM: { code = "\t" + p_output_vars[0] + " = mat4( vec4(1.0,0.0,0.0,0.0), vec4(0.0,1.0,0.0,0.0), vec4(0.0,0.0,1.0,0.0), vec4(0.0,0.0,0.0,1.0) );\n"; - } break; //default (none found) is scalar + } break; case PORT_TYPE_BOOLEAN: { code = "\t" + p_output_vars[0] + " = false;\n"; } break; - default: + default: //default (none found) is scalar break; } } @@ -1847,7 +1916,7 @@ void VisualShaderNodeInput::_bind_methods() { ClassDB::bind_method(D_METHOD("get_input_name"), &VisualShaderNodeInput::get_input_name); ClassDB::bind_method(D_METHOD("get_input_real_name"), &VisualShaderNodeInput::get_input_real_name); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "input_name", PROPERTY_HINT_ENUM, ""), "set_input_name", "get_input_name"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "input_name", PROPERTY_HINT_ENUM, ""), "set_input_name", "get_input_name"); ADD_SIGNAL(MethodInfo("input_type_changed")); } VisualShaderNodeInput::VisualShaderNodeInput() { @@ -2047,7 +2116,7 @@ void VisualShaderNodeUniform::_bind_methods() { ClassDB::bind_method(D_METHOD("set_uniform_name", "name"), &VisualShaderNodeUniform::set_uniform_name); ClassDB::bind_method(D_METHOD("get_uniform_name"), &VisualShaderNodeUniform::get_uniform_name); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "uniform_name"), "set_uniform_name", "get_uniform_name"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "uniform_name"), "set_uniform_name", "get_uniform_name"); } VisualShaderNodeUniform::VisualShaderNodeUniform() { @@ -2626,6 +2695,9 @@ String VisualShaderNodeExpression::generate_code(Shader::Mode p_mode, VisualShad case PORT_TYPE_SCALAR: tk = "0.0"; break; + case PORT_TYPE_SCALAR_INT: + tk = "0"; + break; case PORT_TYPE_VECTOR: tk = "vec3(0.0, 0.0, 0.0)"; break; diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index 1ee75a4cb7..450dcfa081 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -41,6 +41,10 @@ class VisualShaderNode; class VisualShader : public Shader { GDCLASS(VisualShader, Shader); + friend class VisualShaderNodeVersionChecker; + + String version = ""; + public: enum Type { TYPE_VERTEX, @@ -118,6 +122,11 @@ protected: void _get_property_list(List<PropertyInfo> *p_list) const; public: + void set_version(const String &p_version); + String get_version() const; + + void update_version(const String &p_new_version); + enum { NODE_ID_INVALID = -1, NODE_ID_OUTPUT = 0, @@ -182,6 +191,7 @@ protected: public: enum PortType { PORT_TYPE_SCALAR, + PORT_TYPE_SCALAR_INT, PORT_TYPE_VECTOR, PORT_TYPE_BOOLEAN, PORT_TYPE_TRANSFORM, diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp index 95a8155c31..2064ca10f3 100644 --- a/scene/resources/visual_shader_nodes.cpp +++ b/scene/resources/visual_shader_nodes.cpp @@ -30,66 +30,127 @@ #include "visual_shader_nodes.h" -////////////// Scalar +////////////// Scalar(Float) -String VisualShaderNodeScalarConstant::get_caption() const { - return "Scalar"; +String VisualShaderNodeFloatConstant::get_caption() const { + return "ScalarFloat"; } -int VisualShaderNodeScalarConstant::get_input_port_count() const { +int VisualShaderNodeFloatConstant::get_input_port_count() const { return 0; } -VisualShaderNodeScalarConstant::PortType VisualShaderNodeScalarConstant::get_input_port_type(int p_port) const { +VisualShaderNodeFloatConstant::PortType VisualShaderNodeFloatConstant::get_input_port_type(int p_port) const { return PORT_TYPE_SCALAR; } -String VisualShaderNodeScalarConstant::get_input_port_name(int p_port) const { +String VisualShaderNodeFloatConstant::get_input_port_name(int p_port) const { return String(); } -int VisualShaderNodeScalarConstant::get_output_port_count() const { +int VisualShaderNodeFloatConstant::get_output_port_count() const { return 1; } -VisualShaderNodeScalarConstant::PortType VisualShaderNodeScalarConstant::get_output_port_type(int p_port) const { +VisualShaderNodeFloatConstant::PortType VisualShaderNodeFloatConstant::get_output_port_type(int p_port) const { return PORT_TYPE_SCALAR; } -String VisualShaderNodeScalarConstant::get_output_port_name(int p_port) const { +String VisualShaderNodeFloatConstant::get_output_port_name(int p_port) const { return ""; //no output port means the editor will be used as port } -String VisualShaderNodeScalarConstant::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { +String VisualShaderNodeFloatConstant::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { return "\t" + p_output_vars[0] + " = " + vformat("%.6f", constant) + ";\n"; } -void VisualShaderNodeScalarConstant::set_constant(float p_value) { +void VisualShaderNodeFloatConstant::set_constant(float p_value) { constant = p_value; emit_changed(); } -float VisualShaderNodeScalarConstant::get_constant() const { +float VisualShaderNodeFloatConstant::get_constant() const { return constant; } -Vector<StringName> VisualShaderNodeScalarConstant::get_editable_properties() const { +Vector<StringName> VisualShaderNodeFloatConstant::get_editable_properties() const { Vector<StringName> props; props.push_back("constant"); return props; } -void VisualShaderNodeScalarConstant::_bind_methods() { +void VisualShaderNodeFloatConstant::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_constant", "value"), &VisualShaderNodeScalarConstant::set_constant); - ClassDB::bind_method(D_METHOD("get_constant"), &VisualShaderNodeScalarConstant::get_constant); + ClassDB::bind_method(D_METHOD("set_constant", "value"), &VisualShaderNodeFloatConstant::set_constant); + ClassDB::bind_method(D_METHOD("get_constant"), &VisualShaderNodeFloatConstant::get_constant); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "constant"), "set_constant", "get_constant"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "constant"), "set_constant", "get_constant"); } -VisualShaderNodeScalarConstant::VisualShaderNodeScalarConstant() { +VisualShaderNodeFloatConstant::VisualShaderNodeFloatConstant() { + constant = 0.0; +} + +////////////// Scalar(Int) + +String VisualShaderNodeIntConstant::get_caption() const { + return "ScalarInt"; +} + +int VisualShaderNodeIntConstant::get_input_port_count() const { + return 0; +} + +VisualShaderNodeIntConstant::PortType VisualShaderNodeIntConstant::get_input_port_type(int p_port) const { + return PORT_TYPE_SCALAR_INT; +} + +String VisualShaderNodeIntConstant::get_input_port_name(int p_port) const { + return String(); +} + +int VisualShaderNodeIntConstant::get_output_port_count() const { + return 1; +} + +VisualShaderNodeIntConstant::PortType VisualShaderNodeIntConstant::get_output_port_type(int p_port) const { + return PORT_TYPE_SCALAR_INT; +} + +String VisualShaderNodeIntConstant::get_output_port_name(int p_port) const { + return ""; //no output port means the editor will be used as port +} + +String VisualShaderNodeIntConstant::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { + return "\t" + p_output_vars[0] + " = " + itos(constant) + ";\n"; +} + +void VisualShaderNodeIntConstant::set_constant(int p_value) { + constant = p_value; + emit_changed(); +} + +int VisualShaderNodeIntConstant::get_constant() const { + return constant; +} + +Vector<StringName> VisualShaderNodeIntConstant::get_editable_properties() const { + Vector<StringName> props; + props.push_back("constant"); + return props; +} + +void VisualShaderNodeIntConstant::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_constant", "value"), &VisualShaderNodeIntConstant::set_constant); + ClassDB::bind_method(D_METHOD("get_constant"), &VisualShaderNodeIntConstant::get_constant); + + ADD_PROPERTY(PropertyInfo(Variant::INT, "constant"), "set_constant", "get_constant"); +} + +VisualShaderNodeIntConstant::VisualShaderNodeIntConstant() { constant = 0; } @@ -936,37 +997,37 @@ VisualShaderNodeCubemap::VisualShaderNodeCubemap() { simple_decl = false; } -////////////// Scalar Op +////////////// Float Op -String VisualShaderNodeScalarOp::get_caption() const { - return "ScalarOp"; +String VisualShaderNodeFloatOp::get_caption() const { + return "FloatOp"; } -int VisualShaderNodeScalarOp::get_input_port_count() const { +int VisualShaderNodeFloatOp::get_input_port_count() const { return 2; } -VisualShaderNodeScalarOp::PortType VisualShaderNodeScalarOp::get_input_port_type(int p_port) const { +VisualShaderNodeFloatOp::PortType VisualShaderNodeFloatOp::get_input_port_type(int p_port) const { return PORT_TYPE_SCALAR; } -String VisualShaderNodeScalarOp::get_input_port_name(int p_port) const { +String VisualShaderNodeFloatOp::get_input_port_name(int p_port) const { return p_port == 0 ? "a" : "b"; } -int VisualShaderNodeScalarOp::get_output_port_count() const { +int VisualShaderNodeFloatOp::get_output_port_count() const { return 1; } -VisualShaderNodeScalarOp::PortType VisualShaderNodeScalarOp::get_output_port_type(int p_port) const { +VisualShaderNodeFloatOp::PortType VisualShaderNodeFloatOp::get_output_port_type(int p_port) const { return PORT_TYPE_SCALAR; } -String VisualShaderNodeScalarOp::get_output_port_name(int p_port) const { +String VisualShaderNodeFloatOp::get_output_port_name(int p_port) const { return "op"; //no output port means the editor will be used as port } -String VisualShaderNodeScalarOp::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { +String VisualShaderNodeFloatOp::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { String code = "\t" + p_output_vars[0] + " = "; switch (op) { @@ -986,27 +1047,27 @@ String VisualShaderNodeScalarOp::generate_code(Shader::Mode p_mode, VisualShader return code; } -void VisualShaderNodeScalarOp::set_operator(Operator p_op) { +void VisualShaderNodeFloatOp::set_operator(Operator p_op) { op = p_op; emit_changed(); } -VisualShaderNodeScalarOp::Operator VisualShaderNodeScalarOp::get_operator() const { +VisualShaderNodeFloatOp::Operator VisualShaderNodeFloatOp::get_operator() const { return op; } -Vector<StringName> VisualShaderNodeScalarOp::get_editable_properties() const { +Vector<StringName> VisualShaderNodeFloatOp::get_editable_properties() const { Vector<StringName> props; props.push_back("operator"); return props; } -void VisualShaderNodeScalarOp::_bind_methods() { +void VisualShaderNodeFloatOp::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_operator", "op"), &VisualShaderNodeScalarOp::set_operator); - ClassDB::bind_method(D_METHOD("get_operator"), &VisualShaderNodeScalarOp::get_operator); + ClassDB::bind_method(D_METHOD("set_operator", "op"), &VisualShaderNodeFloatOp::set_operator); + ClassDB::bind_method(D_METHOD("get_operator"), &VisualShaderNodeFloatOp::get_operator); ADD_PROPERTY(PropertyInfo(Variant::INT, "operator", PROPERTY_HINT_ENUM, "Add,Sub,Multiply,Divide,Remainder,Power,Max,Min,Atan2,Step"), "set_operator", "get_operator"); @@ -1022,12 +1083,97 @@ void VisualShaderNodeScalarOp::_bind_methods() { BIND_ENUM_CONSTANT(OP_STEP); } -VisualShaderNodeScalarOp::VisualShaderNodeScalarOp() { +VisualShaderNodeFloatOp::VisualShaderNodeFloatOp() { op = OP_ADD; set_input_port_default_value(0, 0.0); set_input_port_default_value(1, 0.0); } +////////////// Integer Op + +String VisualShaderNodeIntOp::get_caption() const { + return "IntOp"; +} + +int VisualShaderNodeIntOp::get_input_port_count() const { + return 2; +} + +VisualShaderNodeIntOp::PortType VisualShaderNodeIntOp::get_input_port_type(int p_port) const { + return PORT_TYPE_SCALAR_INT; +} + +String VisualShaderNodeIntOp::get_input_port_name(int p_port) const { + return p_port == 0 ? "a" : "b"; +} + +int VisualShaderNodeIntOp::get_output_port_count() const { + return 1; +} + +VisualShaderNodeIntOp::PortType VisualShaderNodeIntOp::get_output_port_type(int p_port) const { + return PORT_TYPE_SCALAR_INT; +} + +String VisualShaderNodeIntOp::get_output_port_name(int p_port) const { + return "op"; //no output port means the editor will be used as port +} + +String VisualShaderNodeIntOp::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { + + String code = "\t" + p_output_vars[0] + " = "; + switch (op) { + + case OP_ADD: code += p_input_vars[0] + " + " + p_input_vars[1] + ";\n"; break; + case OP_SUB: code += p_input_vars[0] + " - " + p_input_vars[1] + ";\n"; break; + case OP_MUL: code += p_input_vars[0] + " * " + p_input_vars[1] + ";\n"; break; + case OP_DIV: code += p_input_vars[0] + " / " + p_input_vars[1] + ";\n"; break; + case OP_MOD: code += p_input_vars[0] + " % " + p_input_vars[1] + ";\n"; break; + case OP_MAX: code += "max(" + p_input_vars[0] + ", " + p_input_vars[1] + ");\n"; break; + case OP_MIN: code += "min(" + p_input_vars[0] + ", " + p_input_vars[1] + ");\n"; break; + } + + return code; +} + +void VisualShaderNodeIntOp::set_operator(Operator p_op) { + + op = p_op; + emit_changed(); +} + +VisualShaderNodeIntOp::Operator VisualShaderNodeIntOp::get_operator() const { + return op; +} + +Vector<StringName> VisualShaderNodeIntOp::get_editable_properties() const { + Vector<StringName> props; + props.push_back("operator"); + return props; +} + +void VisualShaderNodeIntOp::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_operator", "op"), &VisualShaderNodeIntOp::set_operator); + ClassDB::bind_method(D_METHOD("get_operator"), &VisualShaderNodeIntOp::get_operator); + + ADD_PROPERTY(PropertyInfo(Variant::INT, "operator", PROPERTY_HINT_ENUM, "Add,Sub,Multiply,Divide,Remainder,Max,Min"), "set_operator", "get_operator"); + + BIND_ENUM_CONSTANT(OP_ADD); + BIND_ENUM_CONSTANT(OP_SUB); + BIND_ENUM_CONSTANT(OP_MUL); + BIND_ENUM_CONSTANT(OP_DIV); + BIND_ENUM_CONSTANT(OP_MOD); + BIND_ENUM_CONSTANT(OP_MAX); + BIND_ENUM_CONSTANT(OP_MIN); +} + +VisualShaderNodeIntOp::VisualShaderNodeIntOp() { + op = OP_ADD; + set_input_port_default_value(0, 0); + set_input_port_default_value(1, 0); +} + ////////////// Vector Op String VisualShaderNodeVectorOp::get_caption() const { @@ -1462,37 +1608,37 @@ VisualShaderNodeTransformVecMult::VisualShaderNodeTransformVecMult() { set_input_port_default_value(1, Vector3()); } -////////////// Scalar Func +////////////// Float Func -String VisualShaderNodeScalarFunc::get_caption() const { - return "ScalarFunc"; +String VisualShaderNodeFloatFunc::get_caption() const { + return "FloatFunc"; } -int VisualShaderNodeScalarFunc::get_input_port_count() const { +int VisualShaderNodeFloatFunc::get_input_port_count() const { return 1; } -VisualShaderNodeScalarFunc::PortType VisualShaderNodeScalarFunc::get_input_port_type(int p_port) const { +VisualShaderNodeFloatFunc::PortType VisualShaderNodeFloatFunc::get_input_port_type(int p_port) const { return PORT_TYPE_SCALAR; } -String VisualShaderNodeScalarFunc::get_input_port_name(int p_port) const { +String VisualShaderNodeFloatFunc::get_input_port_name(int p_port) const { return ""; } -int VisualShaderNodeScalarFunc::get_output_port_count() const { +int VisualShaderNodeFloatFunc::get_output_port_count() const { return 1; } -VisualShaderNodeScalarFunc::PortType VisualShaderNodeScalarFunc::get_output_port_type(int p_port) const { +VisualShaderNodeFloatFunc::PortType VisualShaderNodeFloatFunc::get_output_port_type(int p_port) const { return PORT_TYPE_SCALAR; } -String VisualShaderNodeScalarFunc::get_output_port_name(int p_port) const { +String VisualShaderNodeFloatFunc::get_output_port_name(int p_port) const { return ""; //no output port means the editor will be used as port } -String VisualShaderNodeScalarFunc::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { +String VisualShaderNodeFloatFunc::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { static const char *scalar_func_id[FUNC_ONEMINUS + 1] = { "sin($)", @@ -1532,27 +1678,27 @@ String VisualShaderNodeScalarFunc::generate_code(Shader::Mode p_mode, VisualShad return "\t" + p_output_vars[0] + " = " + String(scalar_func_id[func]).replace("$", p_input_vars[0]) + ";\n"; } -void VisualShaderNodeScalarFunc::set_function(Function p_func) { +void VisualShaderNodeFloatFunc::set_function(Function p_func) { func = p_func; emit_changed(); } -VisualShaderNodeScalarFunc::Function VisualShaderNodeScalarFunc::get_function() const { +VisualShaderNodeFloatFunc::Function VisualShaderNodeFloatFunc::get_function() const { return func; } -Vector<StringName> VisualShaderNodeScalarFunc::get_editable_properties() const { +Vector<StringName> VisualShaderNodeFloatFunc::get_editable_properties() const { Vector<StringName> props; props.push_back("function"); return props; } -void VisualShaderNodeScalarFunc::_bind_methods() { +void VisualShaderNodeFloatFunc::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_function", "func"), &VisualShaderNodeScalarFunc::set_function); - ClassDB::bind_method(D_METHOD("get_function"), &VisualShaderNodeScalarFunc::get_function); + ClassDB::bind_method(D_METHOD("set_function", "func"), &VisualShaderNodeFloatFunc::set_function); + ClassDB::bind_method(D_METHOD("get_function"), &VisualShaderNodeFloatFunc::get_function); ADD_PROPERTY(PropertyInfo(Variant::INT, "function", PROPERTY_HINT_ENUM, "Sin,Cos,Tan,ASin,ACos,ATan,SinH,CosH,TanH,Log,Exp,Sqrt,Abs,Sign,Floor,Round,Ceil,Frac,Saturate,Negate,ACosH,ASinH,ATanH,Degrees,Exp2,InverseSqrt,Log2,Radians,Reciprocal,RoundEven,Trunc,OneMinus"), "set_function", "get_function"); @@ -1590,11 +1736,108 @@ void VisualShaderNodeScalarFunc::_bind_methods() { BIND_ENUM_CONSTANT(FUNC_ONEMINUS); } -VisualShaderNodeScalarFunc::VisualShaderNodeScalarFunc() { +VisualShaderNodeFloatFunc::VisualShaderNodeFloatFunc() { func = FUNC_SIGN; set_input_port_default_value(0, 0.0); } +////////////// Int Func + +String VisualShaderNodeIntFunc::get_caption() const { + return "IntFunc"; +} + +int VisualShaderNodeIntFunc::get_input_port_count() const { + if (func == FUNC_CLAMP) { + return 3; + } + return 1; +} + +VisualShaderNodeIntFunc::PortType VisualShaderNodeIntFunc::get_input_port_type(int p_port) const { + return PORT_TYPE_SCALAR_INT; +} + +String VisualShaderNodeIntFunc::get_input_port_name(int p_port) const { + if (func == FUNC_CLAMP) { + if (p_port == 0) { + return ""; + } else if (p_port == 1) { + return "min"; + } else if (p_port == 2) { + return "max"; + } + } + return ""; +} + +int VisualShaderNodeIntFunc::get_output_port_count() const { + return 1; +} + +VisualShaderNodeIntFunc::PortType VisualShaderNodeIntFunc::get_output_port_type(int p_port) const { + return PORT_TYPE_SCALAR_INT; +} + +String VisualShaderNodeIntFunc::get_output_port_name(int p_port) const { + return ""; //no output port means the editor will be used as port +} + +String VisualShaderNodeIntFunc::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { + if (func == FUNC_CLAMP) { + return "\t" + p_output_vars[0] + " = clamp(" + p_input_vars[0] + ", " + p_input_vars[1] + ", " + p_input_vars[2] + ");\n"; + } + + static const char *int_func_id[FUNC_SIGN + 1] = { + "abs($)", + "", + "-($)", + "sign($)" + }; + + return "\t" + p_output_vars[0] + " = " + String(int_func_id[func]).replace("$", p_input_vars[0]) + ";\n"; +} + +void VisualShaderNodeIntFunc::set_function(Function p_func) { + if (func != p_func) { + if (p_func == FUNC_CLAMP) { + set_input_port_default_value(1, 0); + set_input_port_default_value(2, 0); + } + } + func = p_func; + emit_changed(); +} + +VisualShaderNodeIntFunc::Function VisualShaderNodeIntFunc::get_function() const { + + return func; +} + +Vector<StringName> VisualShaderNodeIntFunc::get_editable_properties() const { + Vector<StringName> props; + props.push_back("function"); + return props; +} + +void VisualShaderNodeIntFunc::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_function", "func"), &VisualShaderNodeIntFunc::set_function); + ClassDB::bind_method(D_METHOD("get_function"), &VisualShaderNodeIntFunc::get_function); + + ADD_PROPERTY(PropertyInfo(Variant::INT, "function", PROPERTY_HINT_ENUM, "Abs,Clamp,Negate,Sign"), "set_function", "get_function"); + + BIND_ENUM_CONSTANT(FUNC_ABS); + BIND_ENUM_CONSTANT(FUNC_CLAMP); + BIND_ENUM_CONSTANT(FUNC_NEGATE); + BIND_ENUM_CONSTANT(FUNC_SIGN); +} + +VisualShaderNodeIntFunc::VisualShaderNodeIntFunc() { + func = FUNC_SIGN; + set_input_port_default_value(0, 0); +} + ////////////// Vector Func String VisualShaderNodeVectorFunc::get_caption() const { @@ -3008,37 +3251,37 @@ VisualShaderNodeTransformDecompose::VisualShaderNodeTransformDecompose() { set_input_port_default_value(0, Transform()); } -////////////// Scalar Uniform +////////////// Float Uniform -String VisualShaderNodeScalarUniform::get_caption() const { - return "ScalarUniform"; +String VisualShaderNodeFloatUniform::get_caption() const { + return "FloatUniform"; } -int VisualShaderNodeScalarUniform::get_input_port_count() const { +int VisualShaderNodeFloatUniform::get_input_port_count() const { return 0; } -VisualShaderNodeScalarUniform::PortType VisualShaderNodeScalarUniform::get_input_port_type(int p_port) const { +VisualShaderNodeFloatUniform::PortType VisualShaderNodeFloatUniform::get_input_port_type(int p_port) const { return PORT_TYPE_SCALAR; } -String VisualShaderNodeScalarUniform::get_input_port_name(int p_port) const { +String VisualShaderNodeFloatUniform::get_input_port_name(int p_port) const { return String(); } -int VisualShaderNodeScalarUniform::get_output_port_count() const { +int VisualShaderNodeFloatUniform::get_output_port_count() const { return 1; } -VisualShaderNodeScalarUniform::PortType VisualShaderNodeScalarUniform::get_output_port_type(int p_port) const { +VisualShaderNodeFloatUniform::PortType VisualShaderNodeFloatUniform::get_output_port_type(int p_port) const { return PORT_TYPE_SCALAR; } -String VisualShaderNodeScalarUniform::get_output_port_name(int p_port) const { +String VisualShaderNodeFloatUniform::get_output_port_name(int p_port) const { return ""; //no output port means the editor will be used as port } -String VisualShaderNodeScalarUniform::generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { +String VisualShaderNodeFloatUniform::generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { if (hint == HINT_RANGE) { return "uniform float " + get_uniform_name() + " : hint_range(" + rtos(hint_range_min) + ", " + rtos(hint_range_max) + ");\n"; } else if (hint == HINT_RANGE_STEP) { @@ -3047,70 +3290,70 @@ String VisualShaderNodeScalarUniform::generate_global(Shader::Mode p_mode, Visua return "uniform float " + get_uniform_name() + ";\n"; } -String VisualShaderNodeScalarUniform::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { +String VisualShaderNodeFloatUniform::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { return "\t" + p_output_vars[0] + " = " + get_uniform_name() + ";\n"; } -void VisualShaderNodeScalarUniform::set_hint(Hint p_hint) { +void VisualShaderNodeFloatUniform::set_hint(Hint p_hint) { hint = p_hint; emit_changed(); } -VisualShaderNodeScalarUniform::Hint VisualShaderNodeScalarUniform::get_hint() const { +VisualShaderNodeFloatUniform::Hint VisualShaderNodeFloatUniform::get_hint() const { return hint; } -void VisualShaderNodeScalarUniform::set_min(float p_value) { +void VisualShaderNodeFloatUniform::set_min(float p_value) { hint_range_min = p_value; emit_changed(); } -float VisualShaderNodeScalarUniform::get_min() const { +float VisualShaderNodeFloatUniform::get_min() const { return hint_range_min; } -void VisualShaderNodeScalarUniform::set_max(float p_value) { +void VisualShaderNodeFloatUniform::set_max(float p_value) { hint_range_max = p_value; emit_changed(); } -float VisualShaderNodeScalarUniform::get_max() const { +float VisualShaderNodeFloatUniform::get_max() const { return hint_range_max; } -void VisualShaderNodeScalarUniform::set_step(float p_value) { +void VisualShaderNodeFloatUniform::set_step(float p_value) { hint_range_step = p_value; emit_changed(); } -float VisualShaderNodeScalarUniform::get_step() const { +float VisualShaderNodeFloatUniform::get_step() const { return hint_range_step; } -void VisualShaderNodeScalarUniform::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_hint", "hint"), &VisualShaderNodeScalarUniform::set_hint); - ClassDB::bind_method(D_METHOD("get_hint"), &VisualShaderNodeScalarUniform::get_hint); +void VisualShaderNodeFloatUniform::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_hint", "hint"), &VisualShaderNodeFloatUniform::set_hint); + ClassDB::bind_method(D_METHOD("get_hint"), &VisualShaderNodeFloatUniform::get_hint); - ClassDB::bind_method(D_METHOD("set_min", "value"), &VisualShaderNodeScalarUniform::set_min); - ClassDB::bind_method(D_METHOD("get_min"), &VisualShaderNodeScalarUniform::get_min); + ClassDB::bind_method(D_METHOD("set_min", "value"), &VisualShaderNodeFloatUniform::set_min); + ClassDB::bind_method(D_METHOD("get_min"), &VisualShaderNodeFloatUniform::get_min); - ClassDB::bind_method(D_METHOD("set_max", "value"), &VisualShaderNodeScalarUniform::set_max); - ClassDB::bind_method(D_METHOD("get_max"), &VisualShaderNodeScalarUniform::get_max); + ClassDB::bind_method(D_METHOD("set_max", "value"), &VisualShaderNodeFloatUniform::set_max); + ClassDB::bind_method(D_METHOD("get_max"), &VisualShaderNodeFloatUniform::get_max); - ClassDB::bind_method(D_METHOD("set_step", "value"), &VisualShaderNodeScalarUniform::set_step); - ClassDB::bind_method(D_METHOD("get_step"), &VisualShaderNodeScalarUniform::get_step); + ClassDB::bind_method(D_METHOD("set_step", "value"), &VisualShaderNodeFloatUniform::set_step); + ClassDB::bind_method(D_METHOD("get_step"), &VisualShaderNodeFloatUniform::get_step); ADD_PROPERTY(PropertyInfo(Variant::INT, "hint", PROPERTY_HINT_ENUM, "None,Range,Range+Step"), "set_hint", "get_hint"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "min"), "set_min", "get_min"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "max"), "set_max", "get_max"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "step"), "set_step", "get_step"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "min"), "set_min", "get_min"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max"), "set_max", "get_max"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step"), "set_step", "get_step"); BIND_ENUM_CONSTANT(HINT_NONE); BIND_ENUM_CONSTANT(HINT_RANGE); BIND_ENUM_CONSTANT(HINT_RANGE_STEP); } -Vector<StringName> VisualShaderNodeScalarUniform::get_editable_properties() const { +Vector<StringName> VisualShaderNodeFloatUniform::get_editable_properties() const { Vector<StringName> props; props.push_back("hint"); if (hint == HINT_RANGE || hint == HINT_RANGE_STEP) { @@ -3123,13 +3366,135 @@ Vector<StringName> VisualShaderNodeScalarUniform::get_editable_properties() cons return props; } -VisualShaderNodeScalarUniform::VisualShaderNodeScalarUniform() { +VisualShaderNodeFloatUniform::VisualShaderNodeFloatUniform() { hint = HINT_NONE; hint_range_min = 0.0; hint_range_max = 1.0; hint_range_step = 0.1; } +////////////// Integer Uniform + +String VisualShaderNodeIntUniform::get_caption() const { + return "IntUniform"; +} + +int VisualShaderNodeIntUniform::get_input_port_count() const { + return 0; +} + +VisualShaderNodeIntUniform::PortType VisualShaderNodeIntUniform::get_input_port_type(int p_port) const { + return PORT_TYPE_SCALAR_INT; +} + +String VisualShaderNodeIntUniform::get_input_port_name(int p_port) const { + return String(); +} + +int VisualShaderNodeIntUniform::get_output_port_count() const { + return 1; +} + +VisualShaderNodeIntUniform::PortType VisualShaderNodeIntUniform::get_output_port_type(int p_port) const { + return PORT_TYPE_SCALAR_INT; +} + +String VisualShaderNodeIntUniform::get_output_port_name(int p_port) const { + return ""; //no output port means the editor will be used as port +} + +String VisualShaderNodeIntUniform::generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + if (hint == HINT_RANGE) { + return "uniform int " + get_uniform_name() + " : hint_range(" + rtos(hint_range_min) + ", " + rtos(hint_range_max) + ");\n"; + } else if (hint == HINT_RANGE_STEP) { + return "uniform int " + get_uniform_name() + " : hint_range(" + rtos(hint_range_min) + ", " + rtos(hint_range_max) + ", " + rtos(hint_range_step) + ");\n"; + } + return "uniform int " + get_uniform_name() + ";\n"; +} + +String VisualShaderNodeIntUniform::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { + return "\t" + p_output_vars[0] + " = " + get_uniform_name() + ";\n"; +} + +void VisualShaderNodeIntUniform::set_hint(Hint p_hint) { + hint = p_hint; + emit_changed(); +} + +VisualShaderNodeIntUniform::Hint VisualShaderNodeIntUniform::get_hint() const { + return hint; +} + +void VisualShaderNodeIntUniform::set_min(int p_value) { + hint_range_min = p_value; + emit_changed(); +} + +int VisualShaderNodeIntUniform::get_min() const { + return hint_range_min; +} + +void VisualShaderNodeIntUniform::set_max(int p_value) { + hint_range_max = p_value; + emit_changed(); +} + +int VisualShaderNodeIntUniform::get_max() const { + return hint_range_max; +} + +void VisualShaderNodeIntUniform::set_step(int p_value) { + hint_range_step = p_value; + emit_changed(); +} + +int VisualShaderNodeIntUniform::get_step() const { + return hint_range_step; +} + +void VisualShaderNodeIntUniform::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_hint", "hint"), &VisualShaderNodeIntUniform::set_hint); + ClassDB::bind_method(D_METHOD("get_hint"), &VisualShaderNodeIntUniform::get_hint); + + ClassDB::bind_method(D_METHOD("set_min", "value"), &VisualShaderNodeIntUniform::set_min); + ClassDB::bind_method(D_METHOD("get_min"), &VisualShaderNodeIntUniform::get_min); + + ClassDB::bind_method(D_METHOD("set_max", "value"), &VisualShaderNodeIntUniform::set_max); + ClassDB::bind_method(D_METHOD("get_max"), &VisualShaderNodeIntUniform::get_max); + + ClassDB::bind_method(D_METHOD("set_step", "value"), &VisualShaderNodeIntUniform::set_step); + ClassDB::bind_method(D_METHOD("get_step"), &VisualShaderNodeIntUniform::get_step); + + ADD_PROPERTY(PropertyInfo(Variant::INT, "hint", PROPERTY_HINT_ENUM, "None,Range,Range+Step"), "set_hint", "get_hint"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "min"), "set_min", "get_min"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "max"), "set_max", "get_max"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "step"), "set_step", "get_step"); + + BIND_ENUM_CONSTANT(HINT_NONE); + BIND_ENUM_CONSTANT(HINT_RANGE); + BIND_ENUM_CONSTANT(HINT_RANGE_STEP); +} + +Vector<StringName> VisualShaderNodeIntUniform::get_editable_properties() const { + Vector<StringName> props; + props.push_back("hint"); + if (hint == HINT_RANGE || hint == HINT_RANGE_STEP) { + props.push_back("min"); + props.push_back("max"); + } + if (hint == HINT_RANGE_STEP) { + props.push_back("step"); + } + return props; +} + +VisualShaderNodeIntUniform::VisualShaderNodeIntUniform() { + hint = HINT_NONE; + hint_range_min = 0; + hint_range_max = 100; + hint_range_step = 1; +} + ////////////// Boolean Uniform String VisualShaderNodeBooleanUniform::get_caption() const { @@ -3968,6 +4333,8 @@ VisualShaderNodeCompare::PortType VisualShaderNodeCompare::get_input_port_type(i switch (ctype) { case CTYPE_SCALAR: return PORT_TYPE_SCALAR; + case CTYPE_SCALAR_INT: + return PORT_TYPE_SCALAR_INT; case CTYPE_VECTOR: return PORT_TYPE_VECTOR; case CTYPE_BOOLEAN: @@ -4046,10 +4413,14 @@ String VisualShaderNodeCompare::generate_code(Shader::Mode p_mode, VisualShader: } else if (func == FUNC_NOT_EQUAL) { code += "\t" + p_output_vars[0] + " = !(abs(" + p_input_vars[0] + " - " + p_input_vars[1] + ") < " + p_input_vars[2] + ");"; } else { - code += "\t" + p_output_vars[0] + " = " + (p_input_vars[0] + "$" + p_input_vars[1]).replace("$", ops[func]) + ";\n"; + code += "\t" + p_output_vars[0] + " = " + (p_input_vars[0] + " $ " + p_input_vars[1]).replace("$", ops[func]) + ";\n"; } break; + case CTYPE_SCALAR_INT: + code += "\t" + p_output_vars[0] + " = " + (p_input_vars[0] + " $ " + p_input_vars[1]).replace("$", ops[func]) + ";\n"; + break; + case CTYPE_VECTOR: code += "\t{\n"; code += "\t\tbvec3 _bv = " + String(funcs[func]).replace("$", p_input_vars[0] + ", " + p_input_vars[1]) + ";\n"; @@ -4085,6 +4456,11 @@ void VisualShaderNodeCompare::set_comparison_type(ComparisonType p_type) { set_input_port_default_value(1, 0.0); simple_decl = true; break; + case CTYPE_SCALAR_INT: + set_input_port_default_value(0, 0); + set_input_port_default_value(1, 0); + simple_decl = true; + break; case CTYPE_VECTOR: set_input_port_default_value(0, Vector3(0.0, 0.0, 0.0)); set_input_port_default_value(1, Vector3(0.0, 0.0, 0.0)); @@ -4151,11 +4527,12 @@ void VisualShaderNodeCompare::_bind_methods() { ClassDB::bind_method(D_METHOD("set_condition", "condition"), &VisualShaderNodeCompare::set_condition); ClassDB::bind_method(D_METHOD("get_condition"), &VisualShaderNodeCompare::get_condition); - ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, "Scalar,Vector,Boolean,Transform"), "set_comparison_type", "get_comparison_type"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, "Float,Int,Vector,Boolean,Transform"), "set_comparison_type", "get_comparison_type"); ADD_PROPERTY(PropertyInfo(Variant::INT, "function", PROPERTY_HINT_ENUM, "a == b,a != b,a > b,a >= b,a < b,a <= b"), "set_function", "get_function"); ADD_PROPERTY(PropertyInfo(Variant::INT, "condition", PROPERTY_HINT_ENUM, "All,Any"), "set_condition", "get_condition"); BIND_ENUM_CONSTANT(CTYPE_SCALAR); + BIND_ENUM_CONSTANT(CTYPE_SCALAR_INT); BIND_ENUM_CONSTANT(CTYPE_VECTOR); BIND_ENUM_CONSTANT(CTYPE_BOOLEAN); BIND_ENUM_CONSTANT(CTYPE_TRANSFORM); diff --git a/scene/resources/visual_shader_nodes.h b/scene/resources/visual_shader_nodes.h index 85782bc509..035e39230c 100644 --- a/scene/resources/visual_shader_nodes.h +++ b/scene/resources/visual_shader_nodes.h @@ -37,8 +37,8 @@ /// CONSTANTS /////////////////////////////////////// -class VisualShaderNodeScalarConstant : public VisualShaderNode { - GDCLASS(VisualShaderNodeScalarConstant, VisualShaderNode); +class VisualShaderNodeFloatConstant : public VisualShaderNode { + GDCLASS(VisualShaderNodeFloatConstant, VisualShaderNode); float constant; protected: @@ -62,7 +62,37 @@ public: virtual Vector<StringName> get_editable_properties() const; - VisualShaderNodeScalarConstant(); + VisualShaderNodeFloatConstant(); +}; + +/////////////////////////////////////// + +class VisualShaderNodeIntConstant : public VisualShaderNode { + GDCLASS(VisualShaderNodeIntConstant, VisualShaderNode); + int constant; + +protected: + static void _bind_methods(); + +public: + virtual String get_caption() const; + + virtual int get_input_port_count() const; + virtual PortType get_input_port_type(int p_port) const; + virtual String get_input_port_name(int p_port) const; + + virtual int get_output_port_count() const; + virtual PortType get_output_port_type(int p_port) const; + virtual String get_output_port_name(int p_port) const; + + virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty + + void set_constant(int p_value); + int get_constant() const; + + virtual Vector<StringName> get_editable_properties() const; + + VisualShaderNodeIntConstant(); }; /////////////////////////////////////// @@ -314,8 +344,8 @@ VARIANT_ENUM_CAST(VisualShaderNodeCubemap::Source) /// OPS /////////////////////////////////////// -class VisualShaderNodeScalarOp : public VisualShaderNode { - GDCLASS(VisualShaderNodeScalarOp, VisualShaderNode); +class VisualShaderNodeFloatOp : public VisualShaderNode { + GDCLASS(VisualShaderNodeFloatOp, VisualShaderNode); public: enum Operator { @@ -354,10 +384,52 @@ public: virtual Vector<StringName> get_editable_properties() const; - VisualShaderNodeScalarOp(); + VisualShaderNodeFloatOp(); }; -VARIANT_ENUM_CAST(VisualShaderNodeScalarOp::Operator) +VARIANT_ENUM_CAST(VisualShaderNodeFloatOp::Operator) + +class VisualShaderNodeIntOp : public VisualShaderNode { + GDCLASS(VisualShaderNodeIntOp, VisualShaderNode); + +public: + enum Operator { + OP_ADD, + OP_SUB, + OP_MUL, + OP_DIV, + OP_MOD, + OP_MAX, + OP_MIN, + }; + +protected: + Operator op; + + static void _bind_methods(); + +public: + virtual String get_caption() const; + + virtual int get_input_port_count() const; + virtual PortType get_input_port_type(int p_port) const; + virtual String get_input_port_name(int p_port) const; + + virtual int get_output_port_count() const; + virtual PortType get_output_port_type(int p_port) const; + virtual String get_output_port_name(int p_port) const; + + virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty + + void set_operator(Operator p_op); + Operator get_operator() const; + + virtual Vector<StringName> get_editable_properties() const; + + VisualShaderNodeIntOp(); +}; + +VARIANT_ENUM_CAST(VisualShaderNodeIntOp::Operator) class VisualShaderNodeVectorOp : public VisualShaderNode { GDCLASS(VisualShaderNodeVectorOp, VisualShaderNode); @@ -539,11 +611,11 @@ public: VARIANT_ENUM_CAST(VisualShaderNodeTransformVecMult::Operator) /////////////////////////////////////// -/// SCALAR FUNC +/// FLOAT FUNC /////////////////////////////////////// -class VisualShaderNodeScalarFunc : public VisualShaderNode { - GDCLASS(VisualShaderNodeScalarFunc, VisualShaderNode); +class VisualShaderNodeFloatFunc : public VisualShaderNode { + GDCLASS(VisualShaderNodeFloatFunc, VisualShaderNode); public: enum Function { @@ -604,10 +676,53 @@ public: virtual Vector<StringName> get_editable_properties() const; - VisualShaderNodeScalarFunc(); + VisualShaderNodeFloatFunc(); +}; + +VARIANT_ENUM_CAST(VisualShaderNodeFloatFunc::Function) + +/////////////////////////////////////// +/// INT FUNC +/////////////////////////////////////// + +class VisualShaderNodeIntFunc : public VisualShaderNode { + GDCLASS(VisualShaderNodeIntFunc, VisualShaderNode); + +public: + enum Function { + FUNC_ABS, + FUNC_CLAMP, + FUNC_NEGATE, + FUNC_SIGN, + }; + +protected: + Function func; + + static void _bind_methods(); + +public: + virtual String get_caption() const; + + virtual int get_input_port_count() const; + virtual PortType get_input_port_type(int p_port) const; + virtual String get_input_port_name(int p_port) const; + + virtual int get_output_port_count() const; + virtual PortType get_output_port_type(int p_port) const; + virtual String get_output_port_name(int p_port) const; + + virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty + + void set_function(Function p_func); + Function get_function() const; + + virtual Vector<StringName> get_editable_properties() const; + + VisualShaderNodeIntFunc(); }; -VARIANT_ENUM_CAST(VisualShaderNodeScalarFunc::Function) +VARIANT_ENUM_CAST(VisualShaderNodeIntFunc::Function) /////////////////////////////////////// /// VECTOR FUNC @@ -1297,8 +1412,8 @@ public: /// UNIFORMS /////////////////////////////////////// -class VisualShaderNodeScalarUniform : public VisualShaderNodeUniform { - GDCLASS(VisualShaderNodeScalarUniform, VisualShaderNodeUniform); +class VisualShaderNodeFloatUniform : public VisualShaderNodeUniform { + GDCLASS(VisualShaderNodeFloatUniform, VisualShaderNodeUniform); public: enum Hint { @@ -1344,10 +1459,62 @@ public: virtual Vector<StringName> get_editable_properties() const; - VisualShaderNodeScalarUniform(); + VisualShaderNodeFloatUniform(); +}; + +VARIANT_ENUM_CAST(VisualShaderNodeFloatUniform::Hint) + +class VisualShaderNodeIntUniform : public VisualShaderNodeUniform { + GDCLASS(VisualShaderNodeIntUniform, VisualShaderNodeUniform); + +public: + enum Hint { + HINT_NONE, + HINT_RANGE, + HINT_RANGE_STEP, + }; + +private: + Hint hint; + int hint_range_min; + int hint_range_max; + int hint_range_step; + +protected: + static void _bind_methods(); + +public: + virtual String get_caption() const; + + virtual int get_input_port_count() const; + virtual PortType get_input_port_type(int p_port) const; + virtual String get_input_port_name(int p_port) const; + + virtual int get_output_port_count() const; + virtual PortType get_output_port_type(int p_port) const; + virtual String get_output_port_name(int p_port) const; + + virtual String generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty + + void set_hint(Hint p_hint); + Hint get_hint() const; + + void set_min(int p_value); + int get_min() const; + + void set_max(int p_value); + int get_max() const; + + void set_step(int p_value); + int get_step() const; + + virtual Vector<StringName> get_editable_properties() const; + + VisualShaderNodeIntUniform(); }; -VARIANT_ENUM_CAST(VisualShaderNodeScalarUniform::Hint) +VARIANT_ENUM_CAST(VisualShaderNodeIntUniform::Hint) /////////////////////////////////////// @@ -1669,9 +1836,10 @@ class VisualShaderNodeCompare : public VisualShaderNode { public: enum ComparisonType { CTYPE_SCALAR, + CTYPE_SCALAR_INT, CTYPE_VECTOR, CTYPE_BOOLEAN, - CTYPE_TRANSFORM + CTYPE_TRANSFORM, }; enum Function { diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp index 78c08080b5..a7e519479f 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world.cpp @@ -360,9 +360,9 @@ World::World() { PhysicsServer::get_singleton()->area_set_param(space, PhysicsServer::AREA_PARAM_GRAVITY, GLOBAL_DEF("physics/3d/default_gravity", 9.8)); PhysicsServer::get_singleton()->area_set_param(space, PhysicsServer::AREA_PARAM_GRAVITY_VECTOR, GLOBAL_DEF("physics/3d/default_gravity_vector", Vector3(0, -1, 0))); PhysicsServer::get_singleton()->area_set_param(space, PhysicsServer::AREA_PARAM_LINEAR_DAMP, GLOBAL_DEF("physics/3d/default_linear_damp", 0.1)); - ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/default_linear_damp", PropertyInfo(Variant::REAL, "physics/3d/default_linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater")); + ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/default_linear_damp", PropertyInfo(Variant::FLOAT, "physics/3d/default_linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater")); PhysicsServer::get_singleton()->area_set_param(space, PhysicsServer::AREA_PARAM_ANGULAR_DAMP, GLOBAL_DEF("physics/3d/default_angular_damp", 0.1)); - ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/default_angular_damp", PropertyInfo(Variant::REAL, "physics/3d/default_angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater")); + ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/default_angular_damp", PropertyInfo(Variant::FLOAT, "physics/3d/default_angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater")); #ifdef _3D_DISABLED indexer = NULL; diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index 5cc809d8e3..6bdc4cf6f0 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -394,9 +394,9 @@ World2D::World2D() { Physics2DServer::get_singleton()->area_set_param(space, Physics2DServer::AREA_PARAM_GRAVITY, GLOBAL_DEF("physics/2d/default_gravity", 98)); Physics2DServer::get_singleton()->area_set_param(space, Physics2DServer::AREA_PARAM_GRAVITY_VECTOR, GLOBAL_DEF("physics/2d/default_gravity_vector", Vector2(0, 1))); Physics2DServer::get_singleton()->area_set_param(space, Physics2DServer::AREA_PARAM_LINEAR_DAMP, GLOBAL_DEF("physics/2d/default_linear_damp", 0.1)); - ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/default_linear_damp", PropertyInfo(Variant::REAL, "physics/2d/default_linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater")); + ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/default_linear_damp", PropertyInfo(Variant::FLOAT, "physics/2d/default_linear_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater")); Physics2DServer::get_singleton()->area_set_param(space, Physics2DServer::AREA_PARAM_ANGULAR_DAMP, GLOBAL_DEF("physics/2d/default_angular_damp", 1.0)); - ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/default_angular_damp", PropertyInfo(Variant::REAL, "physics/2d/default_angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater")); + ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/default_angular_damp", PropertyInfo(Variant::FLOAT, "physics/2d/default_angular_damp", PROPERTY_HINT_RANGE, "-1,100,0.001,or_greater")); indexer = memnew(SpatialIndexer2D); } diff --git a/servers/arvr/arvr_positional_tracker.cpp b/servers/arvr/arvr_positional_tracker.cpp index 4438475d44..9acc36a139 100644 --- a/servers/arvr/arvr_positional_tracker.cpp +++ b/servers/arvr/arvr_positional_tracker.cpp @@ -58,7 +58,7 @@ void ARVRPositionalTracker::_bind_methods() { ClassDB::bind_method(D_METHOD("get_rumble"), &ARVRPositionalTracker::get_rumble); ClassDB::bind_method(D_METHOD("set_rumble", "rumble"), &ARVRPositionalTracker::set_rumble); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rumble"), "set_rumble", "get_rumble"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rumble"), "set_rumble", "get_rumble"); }; void ARVRPositionalTracker::set_type(ARVRServer::TrackerType p_type) { diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp index a5bb9f794d..4b3417db6c 100644 --- a/servers/arvr_server.cpp +++ b/servers/arvr_server.cpp @@ -46,7 +46,7 @@ void ARVRServer::_bind_methods() { ClassDB::bind_method(D_METHOD("center_on_hmd", "rotation_mode", "keep_height"), &ARVRServer::center_on_hmd); ClassDB::bind_method(D_METHOD("get_hmd_transform"), &ARVRServer::get_hmd_transform); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "world_scale"), "set_world_scale", "get_world_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "world_scale"), "set_world_scale", "get_world_scale"); ClassDB::bind_method(D_METHOD("get_interface_count"), &ARVRServer::get_interface_count); ClassDB::bind_method(D_METHOD("get_interface", "idx"), &ARVRServer::get_interface); @@ -75,11 +75,11 @@ void ARVRServer::_bind_methods() { BIND_ENUM_CONSTANT(RESET_BUT_KEEP_TILT); BIND_ENUM_CONSTANT(DONT_RESET_ROTATION); - ADD_SIGNAL(MethodInfo("interface_added", PropertyInfo(Variant::STRING, "interface_name"))); - ADD_SIGNAL(MethodInfo("interface_removed", PropertyInfo(Variant::STRING, "interface_name"))); + ADD_SIGNAL(MethodInfo("interface_added", PropertyInfo(Variant::STRING_NAME, "interface_name"))); + ADD_SIGNAL(MethodInfo("interface_removed", PropertyInfo(Variant::STRING_NAME, "interface_name"))); - ADD_SIGNAL(MethodInfo("tracker_added", PropertyInfo(Variant::STRING, "tracker_name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); - ADD_SIGNAL(MethodInfo("tracker_removed", PropertyInfo(Variant::STRING, "tracker_name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("tracker_added", PropertyInfo(Variant::STRING_NAME, "tracker_name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("tracker_removed", PropertyInfo(Variant::STRING_NAME, "tracker_name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); }; real_t ARVRServer::get_world_scale() const { diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index 259c5487e9..46e674fd9b 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -300,7 +300,7 @@ void AudioStreamRandomPitch::_bind_methods() { ClassDB::bind_method(D_METHOD("get_random_pitch"), &AudioStreamRandomPitch::get_random_pitch); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "audio_stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_audio_stream", "get_audio_stream"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "random_pitch", PROPERTY_HINT_RANGE, "1,16,0.01"), "set_random_pitch", "get_random_pitch"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "random_pitch", PROPERTY_HINT_RANGE, "1,16,0.01"), "set_random_pitch", "get_random_pitch"); } AudioStreamRandomPitch::AudioStreamRandomPitch() { diff --git a/servers/audio/effects/audio_effect_amplify.cpp b/servers/audio/effects/audio_effect_amplify.cpp index 938d29f764..8ad2ecc5ce 100644 --- a/servers/audio/effects/audio_effect_amplify.cpp +++ b/servers/audio/effects/audio_effect_amplify.cpp @@ -67,7 +67,7 @@ void AudioEffectAmplify::_bind_methods() { ClassDB::bind_method(D_METHOD("set_volume_db", "volume"), &AudioEffectAmplify::set_volume_db); ClassDB::bind_method(D_METHOD("get_volume_db"), &AudioEffectAmplify::get_volume_db); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_volume_db", "get_volume_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volume_db", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_volume_db", "get_volume_db"); } AudioEffectAmplify::AudioEffectAmplify() { diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp index 58943582c9..34c03dca8d 100644 --- a/servers/audio/effects/audio_effect_chorus.cpp +++ b/servers/audio/effects/audio_effect_chorus.cpp @@ -326,36 +326,36 @@ void AudioEffectChorus::_bind_methods() { ClassDB::bind_method(D_METHOD("get_dry"), &AudioEffectChorus::get_dry); ADD_PROPERTY(PropertyInfo(Variant::INT, "voice_count", PROPERTY_HINT_RANGE, "1,4,1"), "set_voice_count", "get_voice_count"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "dry", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dry", "get_dry"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wet", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_wet", "get_wet"); - - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 0); - - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 1); - - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 2); - - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 3); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dry", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dry", "get_dry"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wet", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_wet", "get_wet"); + + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/1/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 0); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/1/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 0); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/1/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 0); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/1/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 0); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/1/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 0); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/1/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 0); + + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/2/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 1); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/2/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 1); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/2/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 1); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/2/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 1); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/2/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 1); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/2/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 1); + + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/3/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 2); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/3/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 2); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/3/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 2); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/3/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 2); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/3/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 2); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/3/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 2); + + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/4/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 3); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/4/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 3); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/4/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 3); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/4/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 3); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/4/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 3); + ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "voice/4/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 3); } AudioEffectChorus::AudioEffectChorus() { diff --git a/servers/audio/effects/audio_effect_compressor.cpp b/servers/audio/effects/audio_effect_compressor.cpp index 1ef3bb9b10..8d54bd8e36 100644 --- a/servers/audio/effects/audio_effect_compressor.cpp +++ b/servers/audio/effects/audio_effect_compressor.cpp @@ -230,13 +230,13 @@ void AudioEffectCompressor::_bind_methods() { ClassDB::bind_method(D_METHOD("set_sidechain", "sidechain"), &AudioEffectCompressor::set_sidechain); ClassDB::bind_method(D_METHOD("get_sidechain"), &AudioEffectCompressor::get_sidechain); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "threshold", PROPERTY_HINT_RANGE, "-60,0,0.1"), "set_threshold", "get_threshold"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ratio", PROPERTY_HINT_RANGE, "1,48,0.1"), "set_ratio", "get_ratio"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gain", PROPERTY_HINT_RANGE, "-20,20,0.1"), "set_gain", "get_gain"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "attack_us", PROPERTY_HINT_RANGE, "20,2000,1"), "set_attack_us", "get_attack_us"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "release_ms", PROPERTY_HINT_RANGE, "20,2000,1"), "set_release_ms", "get_release_ms"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "mix", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_mix", "get_mix"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "sidechain", PROPERTY_HINT_ENUM), "set_sidechain", "get_sidechain"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "threshold", PROPERTY_HINT_RANGE, "-60,0,0.1"), "set_threshold", "get_threshold"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ratio", PROPERTY_HINT_RANGE, "1,48,0.1"), "set_ratio", "get_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gain", PROPERTY_HINT_RANGE, "-20,20,0.1"), "set_gain", "get_gain"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "attack_us", PROPERTY_HINT_RANGE, "20,2000,1"), "set_attack_us", "get_attack_us"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "release_ms", PROPERTY_HINT_RANGE, "20,2000,1"), "set_release_ms", "get_release_ms"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mix", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_mix", "get_mix"); + ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "sidechain", PROPERTY_HINT_ENUM), "set_sidechain", "get_sidechain"); } AudioEffectCompressor::AudioEffectCompressor() { diff --git a/servers/audio/effects/audio_effect_delay.cpp b/servers/audio/effects/audio_effect_delay.cpp index 21d979a78c..fa57a94977 100644 --- a/servers/audio/effects/audio_effect_delay.cpp +++ b/servers/audio/effects/audio_effect_delay.cpp @@ -305,22 +305,22 @@ void AudioEffectDelay::_bind_methods() { ClassDB::bind_method(D_METHOD("set_feedback_lowpass", "amount"), &AudioEffectDelay::set_feedback_lowpass); ClassDB::bind_method(D_METHOD("get_feedback_lowpass"), &AudioEffectDelay::get_feedback_lowpass); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "dry", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dry", "get_dry"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dry", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dry", "get_dry"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "tap1/active"), "set_tap1_active", "is_tap1_active"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tap1/delay_ms", PROPERTY_HINT_RANGE, "0,1500,1"), "set_tap1_delay_ms", "get_tap1_delay_ms"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tap1/level_db", PROPERTY_HINT_RANGE, "-60,0,0.01"), "set_tap1_level_db", "get_tap1_level_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tap1/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_tap1_pan", "get_tap1_pan"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tap1/delay_ms", PROPERTY_HINT_RANGE, "0,1500,1"), "set_tap1_delay_ms", "get_tap1_delay_ms"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tap1/level_db", PROPERTY_HINT_RANGE, "-60,0,0.01"), "set_tap1_level_db", "get_tap1_level_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tap1/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_tap1_pan", "get_tap1_pan"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "tap2/active"), "set_tap2_active", "is_tap2_active"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tap2/delay_ms", PROPERTY_HINT_RANGE, "0,1500,1"), "set_tap2_delay_ms", "get_tap2_delay_ms"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tap2/level_db", PROPERTY_HINT_RANGE, "-60,0,0.01"), "set_tap2_level_db", "get_tap2_level_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tap2/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_tap2_pan", "get_tap2_pan"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tap2/delay_ms", PROPERTY_HINT_RANGE, "0,1500,1"), "set_tap2_delay_ms", "get_tap2_delay_ms"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tap2/level_db", PROPERTY_HINT_RANGE, "-60,0,0.01"), "set_tap2_level_db", "get_tap2_level_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tap2/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_tap2_pan", "get_tap2_pan"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "feedback/active"), "set_feedback_active", "is_feedback_active"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "feedback/delay_ms", PROPERTY_HINT_RANGE, "0,1500,1"), "set_feedback_delay_ms", "get_feedback_delay_ms"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "feedback/level_db", PROPERTY_HINT_RANGE, "-60,0,0.01"), "set_feedback_level_db", "get_feedback_level_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "feedback/lowpass", PROPERTY_HINT_RANGE, "1,16000,1"), "set_feedback_lowpass", "get_feedback_lowpass"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "feedback/delay_ms", PROPERTY_HINT_RANGE, "0,1500,1"), "set_feedback_delay_ms", "get_feedback_delay_ms"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "feedback/level_db", PROPERTY_HINT_RANGE, "-60,0,0.01"), "set_feedback_level_db", "get_feedback_level_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "feedback/lowpass", PROPERTY_HINT_RANGE, "1,16000,1"), "set_feedback_lowpass", "get_feedback_lowpass"); } AudioEffectDelay::AudioEffectDelay() { diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp index 8f2c0743ef..bc4fc7ecd6 100644 --- a/servers/audio/effects/audio_effect_distortion.cpp +++ b/servers/audio/effects/audio_effect_distortion.cpp @@ -172,10 +172,10 @@ void AudioEffectDistortion::_bind_methods() { ClassDB::bind_method(D_METHOD("get_post_gain"), &AudioEffectDistortion::get_post_gain); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Clip,ATan,LoFi,Overdrive,WaveShape"), "set_mode", "get_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pre_gain", PROPERTY_HINT_RANGE, "-60,60,0.01"), "set_pre_gain", "get_pre_gain"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "keep_hf_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_keep_hf_hz", "get_keep_hf_hz"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "drive", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drive", "get_drive"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "post_gain", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_post_gain", "get_post_gain"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pre_gain", PROPERTY_HINT_RANGE, "-60,60,0.01"), "set_pre_gain", "get_pre_gain"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "keep_hf_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_keep_hf_hz", "get_keep_hf_hz"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "drive", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drive", "get_drive"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "post_gain", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_post_gain", "get_post_gain"); BIND_ENUM_CONSTANT(MODE_CLIP); BIND_ENUM_CONSTANT(MODE_ATAN); diff --git a/servers/audio/effects/audio_effect_eq.cpp b/servers/audio/effects/audio_effect_eq.cpp index ecd5f04d5f..b315fdc3bb 100644 --- a/servers/audio/effects/audio_effect_eq.cpp +++ b/servers/audio/effects/audio_effect_eq.cpp @@ -117,7 +117,7 @@ void AudioEffectEQ::_get_property_list(List<PropertyInfo> *p_list) const { for (int i = 0; i < band_names.size(); i++) { - p_list->push_back(PropertyInfo(Variant::REAL, band_names[i], PROPERTY_HINT_RANGE, "-60,24,0.1")); + p_list->push_back(PropertyInfo(Variant::FLOAT, band_names[i], PROPERTY_HINT_RANGE, "-60,24,0.1")); } } diff --git a/servers/audio/effects/audio_effect_filter.cpp b/servers/audio/effects/audio_effect_filter.cpp index 9ba5ceb500..18047bc99e 100644 --- a/servers/audio/effects/audio_effect_filter.cpp +++ b/servers/audio/effects/audio_effect_filter.cpp @@ -156,9 +156,9 @@ void AudioEffectFilter::_bind_methods() { ClassDB::bind_method(D_METHOD("set_db", "amount"), &AudioEffectFilter::set_db); ClassDB::bind_method(D_METHOD("get_db"), &AudioEffectFilter::get_db); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_cutoff", "get_cutoff"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "resonance", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_resonance", "get_resonance"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "gain", PROPERTY_HINT_RANGE, "0,4,0.01"), "set_gain", "get_gain"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_cutoff", "get_cutoff"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "resonance", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_resonance", "get_resonance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gain", PROPERTY_HINT_RANGE, "0,4,0.01"), "set_gain", "get_gain"); ADD_PROPERTY(PropertyInfo(Variant::INT, "db", PROPERTY_HINT_ENUM, "6 dB,12 dB,18 dB,24 dB"), "set_db", "get_db"); BIND_ENUM_CONSTANT(FILTER_6DB); diff --git a/servers/audio/effects/audio_effect_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp index d495964719..40a4243168 100644 --- a/servers/audio/effects/audio_effect_limiter.cpp +++ b/servers/audio/effects/audio_effect_limiter.cpp @@ -128,10 +128,10 @@ void AudioEffectLimiter::_bind_methods() { ClassDB::bind_method(D_METHOD("set_soft_clip_ratio", "soft_clip"), &AudioEffectLimiter::set_soft_clip_ratio); ClassDB::bind_method(D_METHOD("get_soft_clip_ratio"), &AudioEffectLimiter::get_soft_clip_ratio); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "ceiling_db", PROPERTY_HINT_RANGE, "-20,-0.1,0.1"), "set_ceiling_db", "get_ceiling_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "threshold_db", PROPERTY_HINT_RANGE, "-30,0,0.1"), "set_threshold_db", "get_threshold_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "soft_clip_db", PROPERTY_HINT_RANGE, "0,6,0.1"), "set_soft_clip_db", "get_soft_clip_db"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "soft_clip_ratio", PROPERTY_HINT_RANGE, "3,20,0.1"), "set_soft_clip_ratio", "get_soft_clip_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ceiling_db", PROPERTY_HINT_RANGE, "-20,-0.1,0.1"), "set_ceiling_db", "get_ceiling_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "threshold_db", PROPERTY_HINT_RANGE, "-30,0,0.1"), "set_threshold_db", "get_threshold_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "soft_clip_db", PROPERTY_HINT_RANGE, "0,6,0.1"), "set_soft_clip_db", "get_soft_clip_db"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "soft_clip_ratio", PROPERTY_HINT_RANGE, "3,20,0.1"), "set_soft_clip_ratio", "get_soft_clip_ratio"); } AudioEffectLimiter::AudioEffectLimiter() { diff --git a/servers/audio/effects/audio_effect_panner.cpp b/servers/audio/effects/audio_effect_panner.cpp index b9e95f44df..10724175e5 100644 --- a/servers/audio/effects/audio_effect_panner.cpp +++ b/servers/audio/effects/audio_effect_panner.cpp @@ -63,7 +63,7 @@ void AudioEffectPanner::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pan", "cpanume"), &AudioEffectPanner::set_pan); ClassDB::bind_method(D_METHOD("get_pan"), &AudioEffectPanner::get_pan); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_pan", "get_pan"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_pan", "get_pan"); } AudioEffectPanner::AudioEffectPanner() { diff --git a/servers/audio/effects/audio_effect_phaser.cpp b/servers/audio/effects/audio_effect_phaser.cpp index d811522576..3709b69d45 100644 --- a/servers/audio/effects/audio_effect_phaser.cpp +++ b/servers/audio/effects/audio_effect_phaser.cpp @@ -154,11 +154,11 @@ void AudioEffectPhaser::_bind_methods() { ClassDB::bind_method(D_METHOD("set_depth", "depth"), &AudioEffectPhaser::set_depth); ClassDB::bind_method(D_METHOD("get_depth"), &AudioEffectPhaser::get_depth); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "range_min_hz", PROPERTY_HINT_RANGE, "10,10000"), "set_range_min_hz", "get_range_min_hz"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "range_max_hz", PROPERTY_HINT_RANGE, "10,10000"), "set_range_max_hz", "get_range_max_hz"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "rate_hz", PROPERTY_HINT_RANGE, "0.01,20"), "set_rate_hz", "get_rate_hz"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "feedback", PROPERTY_HINT_RANGE, "0.1,0.9,0.1"), "set_feedback", "get_feedback"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth", PROPERTY_HINT_RANGE, "0.1,4,0.1"), "set_depth", "get_depth"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "range_min_hz", PROPERTY_HINT_RANGE, "10,10000"), "set_range_min_hz", "get_range_min_hz"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "range_max_hz", PROPERTY_HINT_RANGE, "10,10000"), "set_range_max_hz", "get_range_max_hz"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rate_hz", PROPERTY_HINT_RANGE, "0.01,20"), "set_rate_hz", "get_rate_hz"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "feedback", PROPERTY_HINT_RANGE, "0.1,0.9,0.1"), "set_feedback", "get_feedback"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_RANGE, "0.1,4,0.1"), "set_depth", "get_depth"); } AudioEffectPhaser::AudioEffectPhaser() { diff --git a/servers/audio/effects/audio_effect_pitch_shift.cpp b/servers/audio/effects/audio_effect_pitch_shift.cpp index 28185e591f..56529e208e 100644 --- a/servers/audio/effects/audio_effect_pitch_shift.cpp +++ b/servers/audio/effects/audio_effect_pitch_shift.cpp @@ -347,8 +347,8 @@ void AudioEffectPitchShift::_bind_methods() { ClassDB::bind_method(D_METHOD("set_fft_size", "size"), &AudioEffectPitchShift::set_fft_size); ClassDB::bind_method(D_METHOD("get_fft_size"), &AudioEffectPitchShift::get_fft_size); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_pitch_scale", "get_pitch_scale"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "oversampling", PROPERTY_HINT_RANGE, "4,32,1"), "set_oversampling", "get_oversampling"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_pitch_scale", "get_pitch_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "oversampling", PROPERTY_HINT_RANGE, "4,32,1"), "set_oversampling", "get_oversampling"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fft_size", PROPERTY_HINT_ENUM, "256,512,1024,2048,4096"), "set_fft_size", "get_fft_size"); BIND_ENUM_CONSTANT(FFT_SIZE_256); diff --git a/servers/audio/effects/audio_effect_reverb.cpp b/servers/audio/effects/audio_effect_reverb.cpp index caa2d8ab26..6dccb2945b 100644 --- a/servers/audio/effects/audio_effect_reverb.cpp +++ b/servers/audio/effects/audio_effect_reverb.cpp @@ -184,15 +184,15 @@ void AudioEffectReverb::_bind_methods() { ClassDB::bind_method(D_METHOD("get_hpf"), &AudioEffectReverb::get_hpf); ADD_GROUP("Predelay", "predelay_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "predelay_msec", PROPERTY_HINT_RANGE, "20,500,1"), "set_predelay_msec", "get_predelay_msec"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "predelay_feedback", PROPERTY_HINT_RANGE, "0,0.98,0.01"), "set_predelay_feedback", "get_predelay_feedback"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "predelay_msec", PROPERTY_HINT_RANGE, "20,500,1"), "set_predelay_msec", "get_predelay_msec"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "predelay_feedback", PROPERTY_HINT_RANGE, "0,0.98,0.01"), "set_predelay_feedback", "get_predelay_feedback"); ADD_GROUP("", ""); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "room_size", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_room_size", "get_room_size"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_damping", "get_damping"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "spread", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_spread", "get_spread"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "hipass", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_hpf", "get_hpf"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "dry", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dry", "get_dry"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wet", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_wet", "get_wet"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "room_size", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_room_size", "get_room_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "damping", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_damping", "get_damping"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "spread", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_spread", "get_spread"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "hipass", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_hpf", "get_hpf"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dry", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dry", "get_dry"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wet", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_wet", "get_wet"); } AudioEffectReverb::AudioEffectReverb() { diff --git a/servers/audio/effects/audio_effect_spectrum_analyzer.cpp b/servers/audio/effects/audio_effect_spectrum_analyzer.cpp index d4bd3e2461..47aee02de2 100644 --- a/servers/audio/effects/audio_effect_spectrum_analyzer.cpp +++ b/servers/audio/effects/audio_effect_spectrum_analyzer.cpp @@ -268,8 +268,8 @@ void AudioEffectSpectrumAnalyzer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_fft_size", "size"), &AudioEffectSpectrumAnalyzer::set_fft_size); ClassDB::bind_method(D_METHOD("get_fft_size"), &AudioEffectSpectrumAnalyzer::get_fft_size); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "buffer_length", PROPERTY_HINT_RANGE, "0.1,4,0.1"), "set_buffer_length", "get_buffer_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "tap_back_pos", PROPERTY_HINT_RANGE, "0.1,4,0.1"), "set_tap_back_pos", "get_tap_back_pos"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "buffer_length", PROPERTY_HINT_RANGE, "0.1,4,0.1"), "set_buffer_length", "get_buffer_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "tap_back_pos", PROPERTY_HINT_RANGE, "0.1,4,0.1"), "set_tap_back_pos", "get_tap_back_pos"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fft_size", PROPERTY_HINT_ENUM, "256,512,1024,2048,4096"), "set_fft_size", "get_fft_size"); BIND_ENUM_CONSTANT(FFT_SIZE_256); diff --git a/servers/audio/effects/audio_effect_stereo_enhance.cpp b/servers/audio/effects/audio_effect_stereo_enhance.cpp index e8b8f47676..a10aca02b2 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.cpp +++ b/servers/audio/effects/audio_effect_stereo_enhance.cpp @@ -146,9 +146,9 @@ void AudioEffectStereoEnhance::_bind_methods() { ClassDB::bind_method(D_METHOD("set_surround", "amount"), &AudioEffectStereoEnhance::set_surround); ClassDB::bind_method(D_METHOD("get_surround"), &AudioEffectStereoEnhance::get_surround); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "pan_pullout", PROPERTY_HINT_RANGE, "0,4,0.01"), "set_pan_pullout", "get_pan_pullout"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_pullout_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_time_pullout", "get_time_pullout"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "surround", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_surround", "get_surround"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pan_pullout", PROPERTY_HINT_RANGE, "0,4,0.01"), "set_pan_pullout", "get_pan_pullout"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_pullout_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_time_pullout", "get_time_pullout"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "surround", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_surround", "get_surround"); } AudioEffectStereoEnhance::AudioEffectStereoEnhance() { diff --git a/servers/audio/effects/audio_stream_generator.cpp b/servers/audio/effects/audio_stream_generator.cpp index 101dcddae7..5f24cf3d6b 100644 --- a/servers/audio/effects/audio_stream_generator.cpp +++ b/servers/audio/effects/audio_stream_generator.cpp @@ -74,8 +74,8 @@ void AudioStreamGenerator::_bind_methods() { ClassDB::bind_method(D_METHOD("set_buffer_length", "seconds"), &AudioStreamGenerator::set_buffer_length); ClassDB::bind_method(D_METHOD("get_buffer_length"), &AudioStreamGenerator::get_buffer_length); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "mix_rate", PROPERTY_HINT_RANGE, "20,192000,1"), "set_mix_rate", "get_mix_rate"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "buffer_length", PROPERTY_HINT_RANGE, "0.01,10,0.01"), "set_buffer_length", "get_buffer_length"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mix_rate", PROPERTY_HINT_RANGE, "20,192000,1"), "set_mix_rate", "get_mix_rate"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "buffer_length", PROPERTY_HINT_RANGE, "0.01,10,0.01"), "set_buffer_length", "get_buffer_length"); } AudioStreamGenerator::AudioStreamGenerator() { diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 2a5a5040b6..abf351135a 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -971,7 +971,7 @@ void AudioServer::init() { channel_disable_threshold_db = GLOBAL_DEF_RST("audio/channel_disable_threshold_db", -60.0); channel_disable_frames = float(GLOBAL_DEF_RST("audio/channel_disable_time", 2.0)) * get_mix_rate(); - ProjectSettings::get_singleton()->set_custom_property_info("audio/channel_disable_time", PropertyInfo(Variant::REAL, "audio/channel_disable_time", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); + ProjectSettings::get_singleton()->set_custom_property_info("audio/channel_disable_time", PropertyInfo(Variant::FLOAT, "audio/channel_disable_time", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); buffer_size = 1024; //hardcoded for now init_channels_and_buffers(); @@ -1384,7 +1384,7 @@ void AudioServer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "bus_count"), "set_bus_count", "get_bus_count"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "device"), "set_device", "get_device"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rate_scale"), "set_global_rate_scale", "get_global_rate_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rate_scale"), "set_global_rate_scale", "get_global_rate_scale"); ADD_SIGNAL(MethodInfo("bus_layout_changed")); @@ -1531,8 +1531,8 @@ void AudioBusLayout::_get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::BOOL, "bus/" + itos(i) + "/solo", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); p_list->push_back(PropertyInfo(Variant::BOOL, "bus/" + itos(i) + "/mute", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); p_list->push_back(PropertyInfo(Variant::BOOL, "bus/" + itos(i) + "/bypass_fx", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::REAL, "bus/" + itos(i) + "/volume_db", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::REAL, "bus/" + itos(i) + "/send", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "bus/" + itos(i) + "/volume_db", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "bus/" + itos(i) + "/send", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); for (int j = 0; j < buses[i].effects.size(); j++) { p_list->push_back(PropertyInfo(Variant::OBJECT, "bus/" + itos(i) + "/effect/" + itos(j) + "/effect", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); diff --git a/servers/navigation_server.cpp b/servers/navigation_server.cpp index f31795fb35..f2b727ac47 100644 --- a/servers/navigation_server.cpp +++ b/servers/navigation_server.cpp @@ -75,7 +75,7 @@ void NavigationServer::_bind_methods() { ClassDB::bind_method(D_METHOD("free", "object"), &NavigationServer::free); ClassDB::bind_method(D_METHOD("set_active", "active"), &NavigationServer::set_active); - ClassDB::bind_method(D_METHOD("step", "delta_time"), &NavigationServer::step); + ClassDB::bind_method(D_METHOD("process", "delta_time"), &NavigationServer::process); } const NavigationServer *NavigationServer::get_singleton() { diff --git a/servers/navigation_server.h b/servers/navigation_server.h index d4d95d72d4..2587e53ab2 100644 --- a/servers/navigation_server.h +++ b/servers/navigation_server.h @@ -175,9 +175,11 @@ public: /// Control activation of this server. virtual void set_active(bool p_active) const = 0; - /// Step the server - /// NOTE: This function is not Threadsafe and MUST be called in single thread. - virtual void step(real_t delta_time) = 0; + /// Process the collision avoidance agents. + /// The result of this process is needed by the physics server, + /// so this must be called in the main thread. + /// Note: This function is not thread safe. + virtual void process(real_t delta_time) = 0; NavigationServer(); virtual ~NavigationServer(); diff --git a/servers/physics/area_sw.cpp b/servers/physics/area_sw.cpp index 1016afcaba..4b54a56253 100644 --- a/servers/physics/area_sw.cpp +++ b/servers/physics/area_sw.cpp @@ -200,7 +200,7 @@ void AreaSW::call_queries() { res[3] = E->key().body_shape; res[4] = E->key().area_shape; - Variant::CallError ce; + Callable::CallError ce; obj->call(monitor_callback_method, (const Variant **)resptr, 5, ce); } } @@ -232,7 +232,7 @@ void AreaSW::call_queries() { res[3] = E->key().body_shape; res[4] = E->key().area_shape; - Variant::CallError ce; + Callable::CallError ce; obj->call(area_monitor_callback_method, (const Variant **)resptr, 5, ce); } } diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index b71c9772df..8819941f04 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -713,7 +713,7 @@ void BodySW::call_queries() { } else { const Variant *vp[2] = { &v, &fi_callback->udata }; - Variant::CallError ce; + Callable::CallError ce; int argc = (fi_callback->udata.get_type() == Variant::NIL) ? 1 : 2; obj->call(fi_callback->method, vp, argc, ce); } diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index 03dca8b9ec..110520db5a 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -1220,7 +1220,7 @@ SpaceSW::SpaceSW() { body_linear_velocity_sleep_threshold = GLOBAL_DEF("physics/3d/sleep_threshold_linear", 0.1); body_angular_velocity_sleep_threshold = GLOBAL_DEF("physics/3d/sleep_threshold_angular", (8.0 / 180.0 * Math_PI)); body_time_to_sleep = GLOBAL_DEF("physics/3d/time_before_sleep", 0.5); - ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/time_before_sleep", PropertyInfo(Variant::REAL, "physics/3d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); + ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/time_before_sleep", PropertyInfo(Variant::FLOAT, "physics/3d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); body_angular_velocity_damp_ratio = 10; broadphase = BroadPhaseSW::create_func(); diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp index c67d870b2a..45666d9d09 100644 --- a/servers/physics_2d/area_2d_sw.cpp +++ b/servers/physics_2d/area_2d_sw.cpp @@ -200,7 +200,7 @@ void Area2DSW::call_queries() { res[3] = E->key().body_shape; res[4] = E->key().area_shape; - Variant::CallError ce; + Callable::CallError ce; obj->call(monitor_callback_method, (const Variant **)resptr, 5, ce); } } @@ -232,7 +232,7 @@ void Area2DSW::call_queries() { res[3] = E->key().body_shape; res[4] = E->key().area_shape; - Variant::CallError ce; + Callable::CallError ce; obj->call(area_monitor_callback_method, (const Variant **)resptr, 5, ce); } } diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 4de52cacbd..863b422996 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -612,7 +612,7 @@ void Body2DSW::call_queries() { set_force_integration_callback(ObjectID(), StringName()); } else { - Variant::CallError ce; + Callable::CallError ce; if (fi_callback->callback_udata.get_type() != Variant::NIL) { obj->call(fi_callback->method, vp, 2, ce); diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 86057e4078..5fefb9595f 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -639,7 +639,7 @@ real_t ConvexPolygonShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 void ConvexPolygonShape2DSW::set_data(const Variant &p_data) { - ERR_FAIL_COND(p_data.get_type() != Variant::PACKED_VECTOR2_ARRAY && p_data.get_type() != Variant::PACKED_REAL_ARRAY); + ERR_FAIL_COND(p_data.get_type() != Variant::PACKED_VECTOR2_ARRAY && p_data.get_type() != Variant::PACKED_FLOAT32_ARRAY); if (points) memdelete_arr(points); @@ -899,7 +899,7 @@ int ConcavePolygonShape2DSW::_generate_bvh(BVH *p_bvh, int p_len, int p_depth) { void ConcavePolygonShape2DSW::set_data(const Variant &p_data) { - ERR_FAIL_COND(p_data.get_type() != Variant::PACKED_VECTOR2_ARRAY && p_data.get_type() != Variant::PACKED_REAL_ARRAY); + ERR_FAIL_COND(p_data.get_type() != Variant::PACKED_VECTOR2_ARRAY && p_data.get_type() != Variant::PACKED_FLOAT32_ARRAY); Rect2 aabb; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 83bcae4607..2009cb823d 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -1346,7 +1346,7 @@ Space2DSW::Space2DSW() { body_linear_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threshold_linear", 2.0); body_angular_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threshold_angular", (8.0 / 180.0 * Math_PI)); body_time_to_sleep = GLOBAL_DEF("physics/2d/time_before_sleep", 0.5); - ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/time_before_sleep", PropertyInfo(Variant::REAL, "physics/2d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); + ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/time_before_sleep", PropertyInfo(Variant::FLOAT, "physics/2d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); broadphase = BroadPhase2DSW::create_func(); broadphase->set_pair_callback(_broadphase_pair, this); diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp index 925af52eeb..1f92d6e419 100644 --- a/servers/physics_2d_server.cpp +++ b/servers/physics_2d_server.cpp @@ -118,13 +118,13 @@ void Physics2DDirectBodyState::_bind_methods() { ClassDB::bind_method(D_METHOD("integrate_forces"), &Physics2DDirectBodyState::integrate_forces); ClassDB::bind_method(D_METHOD("get_space_state"), &Physics2DDirectBodyState::get_space_state); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "step"), "", "get_step"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "inverse_mass"), "", "get_inverse_mass"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "inverse_inertia"), "", "get_inverse_inertia"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "total_angular_damp"), "", "get_total_angular_damp"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "total_linear_damp"), "", "get_total_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step"), "", "get_step"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inverse_mass"), "", "get_inverse_mass"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inverse_inertia"), "", "get_inverse_inertia"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "total_angular_damp"), "", "get_total_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "total_linear_damp"), "", "get_total_linear_damp"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "total_gravity"), "", "get_total_gravity"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_velocity"), "set_angular_velocity", "get_angular_velocity"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "angular_velocity"), "set_angular_velocity", "get_angular_velocity"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "linear_velocity"), "set_linear_velocity", "get_linear_velocity"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sleeping"), "set_sleep_state", "is_sleeping"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform"), "set_transform", "get_transform"); @@ -249,7 +249,7 @@ void Physics2DShapeQueryParameters::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_layer", "get_collision_layer"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "exclude", PROPERTY_HINT_NONE, itos(Variant::_RID) + ":"), "set_exclude", "get_exclude"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "margin", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_margin", "get_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_margin", "get_margin"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "motion"), "set_motion", "get_motion"); //ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D"), "set_shape", ""); // FIXME: Lacks a getter ADD_PROPERTY(PropertyInfo(Variant::_RID, "shape_rid"), "set_shape_rid", "get_shape_rid"); diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp index 94bcf1f76e..57f3a7979e 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -120,10 +120,10 @@ void PhysicsDirectBodyState::_bind_methods() { ClassDB::bind_method(D_METHOD("integrate_forces"), &PhysicsDirectBodyState::integrate_forces); ClassDB::bind_method(D_METHOD("get_space_state"), &PhysicsDirectBodyState::get_space_state); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "step"), "", "get_step"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "inverse_mass"), "", "get_inverse_mass"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "total_angular_damp"), "", "get_total_angular_damp"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "total_linear_damp"), "", "get_total_linear_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step"), "", "get_step"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "inverse_mass"), "", "get_inverse_mass"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "total_angular_damp"), "", "get_total_angular_damp"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "total_linear_damp"), "", "get_total_linear_damp"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "inverse_inertia"), "", "get_inverse_inertia"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "total_gravity"), "", "get_total_gravity"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "center_of_mass"), "", "get_center_of_mass"); @@ -242,7 +242,7 @@ void PhysicsShapeQueryParameters::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "exclude", PROPERTY_HINT_NONE, itos(Variant::_RID) + ":"), "set_exclude", "get_exclude"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "margin", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_margin", "get_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_margin", "get_margin"); //ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D"), "set_shape", ""); // FIXME: Lacks a getter ADD_PROPERTY(PropertyInfo(Variant::_RID, "shape_rid"), "set_shape_rid", "get_shape_rid"); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "transform"), "set_transform", "get_transform"); diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 25d122604a..c9f5277a4d 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -56,6 +56,7 @@ #include "audio_server.h" #include "camera/camera_feed.h" #include "camera_server.h" +#include "core/script_debugger_remote.h" #include "navigation_2d_server.h" #include "navigation_server.h" #include "physics/physics_server_sw.h" @@ -63,18 +64,17 @@ #include "physics_2d/physics_2d_server_wrap_mt.h" #include "physics_2d_server.h" #include "physics_server.h" -#include "scene/debugger/script_debugger_remote.h" #include "visual/shader_types.h" #include "visual_server.h" -static void _debugger_get_resource_usage(List<ScriptDebuggerRemote::ResourceUsage> *r_usage) { +static void _debugger_get_resource_usage(ScriptDebuggerRemote::ResourceUsage *r_usage) { List<VS::TextureInfo> tinfo; VS::get_singleton()->texture_debug_usage(&tinfo); for (List<VS::TextureInfo>::Element *E = tinfo.front(); E; E = E->next()) { - ScriptDebuggerRemote::ResourceUsage usage; + ScriptDebuggerRemote::ResourceInfo usage; usage.path = E->get().path; usage.vram = E->get().bytes; usage.id = E->get().texture; @@ -84,7 +84,7 @@ static void _debugger_get_resource_usage(List<ScriptDebuggerRemote::ResourceUsag } else { usage.format = itos(E->get().width) + "x" + itos(E->get().height) + "x" + itos(E->get().depth) + " " + Image::get_format_name(E->get().format); } - r_usage->push_back(usage); + r_usage->infos.push_back(usage); } } diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 3274b15975..3a219ec7e3 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -1080,7 +1080,7 @@ public: const Item::CommandTransform *transform = static_cast<const Item::CommandTransform *>(c); xf = transform->xform; found_xform = true; - FALLTHROUGH; + [[fallthrough]]; } default: { c = c->next; diff --git a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp index c3e8ca5e90..54f330ecdd 100644 --- a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp +++ b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp @@ -2140,15 +2140,15 @@ void RasterizerCanvasRD::MaterialData::update_parameters(const Map<StringName, V RID *ids_ptr = u.ids.ptrw(); ids_ptr[0] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); ids_ptr[1] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - ids_ptr[2] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + ids_ptr[2] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); ids_ptr[3] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - ids_ptr[4] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + ids_ptr[4] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); ids_ptr[5] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); ids_ptr[6] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); ids_ptr[7] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); - ids_ptr[8] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); + ids_ptr[8] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); ids_ptr[9] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); - ids_ptr[10] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); + ids_ptr[10] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); ids_ptr[11] = canvas_singleton->storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); uniforms.push_back(u); } diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp index 608b7c1c68..dd6bece11d 100644 --- a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp +++ b/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp @@ -1894,8 +1894,16 @@ void RasterizerSceneHighEndRD::_render_scene(RID p_render_buffer, const Transfor if (draw_sky) { RENDER_TIMESTAMP("Render Sky"); + + CameraMatrix projection = p_cam_projection; + if (p_reflection_probe.is_valid()) { + CameraMatrix correction; + correction.set_depth_correction(true); + projection = correction * p_cam_projection; + } + RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(opaque_framebuffer, RD::INITIAL_ACTION_CONTINUE, can_continue ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_CONTINUE, can_continue ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ); - _draw_sky(draw_list, RD::get_singleton()->framebuffer_get_format(opaque_framebuffer), p_environment, p_cam_projection, p_cam_transform, 1.0); + _draw_sky(draw_list, RD::get_singleton()->framebuffer_get_format(opaque_framebuffer), p_environment, projection, p_cam_transform, 1.0); RD::get_singleton()->draw_list_end(); if (using_separate_specular && !can_continue) { @@ -2092,15 +2100,15 @@ void RasterizerSceneHighEndRD::_update_render_base_uniform_set() { RID *ids_ptr = u.ids.ptrw(); ids_ptr[0] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); ids_ptr[1] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - ids_ptr[2] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + ids_ptr[2] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); ids_ptr[3] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - ids_ptr[4] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + ids_ptr[4] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); ids_ptr[5] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); ids_ptr[6] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); ids_ptr[7] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); - ids_ptr[8] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); + ids_ptr[8] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); ids_ptr[9] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); - ids_ptr[10] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); + ids_ptr[10] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); ids_ptr[11] = storage->sampler_rd_get_default(VS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, VS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); uniforms.push_back(u); } diff --git a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp index 09767cb5a9..5d43876192 100644 --- a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp +++ b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp @@ -4623,7 +4623,7 @@ RasterizerStorageRD::RasterizerStorageRD() { sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR; sampler_state.max_lod = 0; } break; - case VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS: { + case VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: { sampler_state.mag_filter = RD::SAMPLER_FILTER_NEAREST; sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR; sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR; @@ -4634,7 +4634,7 @@ RasterizerStorageRD::RasterizerStorageRD() { sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR; } break; - case VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC: { + case VS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC: { sampler_state.mag_filter = RD::SAMPLER_FILTER_NEAREST; sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR; sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR; diff --git a/servers/visual/rasterizer_rd/shaders/scene_high_end_inc.glsl b/servers/visual/rasterizer_rd/shaders/scene_high_end_inc.glsl index 9b14499923..baef1e060f 100644 --- a/servers/visual/rasterizer_rd/shaders/scene_high_end_inc.glsl +++ b/servers/visual/rasterizer_rd/shaders/scene_high_end_inc.glsl @@ -11,15 +11,15 @@ draw_call; #define SAMPLER_NEAREST_CLAMP 0 #define SAMPLER_LINEAR_CLAMP 1 -#define SAMPLER_NEAREST_WITH_MIMPAMPS_CLAMP 2 +#define SAMPLER_NEAREST_WITH_MIPMAPS_CLAMP 2 #define SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP 3 -#define SAMPLER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC_CLAMP 4 +#define SAMPLER_NEAREST_WITH_MIPMAPS_ANISOTROPIC_CLAMP 4 #define SAMPLER_LINEAR_WITH_MIPMAPS_ANISOTROPIC_CLAMP 5 #define SAMPLER_NEAREST_REPEAT 6 #define SAMPLER_LINEAR_REPEAT 7 -#define SAMPLER_NEAREST_WITH_MIMPAMPS_REPEAT 8 +#define SAMPLER_NEAREST_WITH_MIPMAPS_REPEAT 8 #define SAMPLER_LINEAR_WITH_MIPMAPS_REPEAT 9 -#define SAMPLER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC_REPEAT 10 +#define SAMPLER_NEAREST_WITH_MIPMAPS_ANISOTROPIC_REPEAT 10 #define SAMPLER_LINEAR_WITH_MIPMAPS_ANISOTROPIC_REPEAT 11 layout(set = 0, binding = 1) uniform sampler material_samplers[12]; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 438ec2079c..97a18e6d86 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2657,10 +2657,10 @@ PropertyInfo ShaderLanguage::uniform_to_property_info(const ShaderNode::Uniform case ShaderLanguage::TYPE_UVEC3: case ShaderLanguage::TYPE_UVEC4: { - pi.type = Variant::PACKED_INT_ARRAY; + pi.type = Variant::PACKED_INT32_ARRAY; } break; case ShaderLanguage::TYPE_FLOAT: { - pi.type = Variant::REAL; + pi.type = Variant::FLOAT; if (p_uniform.hint == ShaderLanguage::ShaderNode::Uniform::HINT_RANGE) { pi.hint = PROPERTY_HINT_RANGE; pi.hint_string = rtos(p_uniform.hint_range[0]) + "," + rtos(p_uniform.hint_range[1]) + "," + rtos(p_uniform.hint_range[2]); diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index b27c01cccc..35ec52a5c0 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -120,10 +120,10 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) { Object *obj = ObjectDB::get_instance(frame_drawn_callbacks.front()->get().object); if (obj) { - Variant::CallError ce; + Callable::CallError ce; const Variant *v = &frame_drawn_callbacks.front()->get().param; obj->call(frame_drawn_callbacks.front()->get().method, &v, 1, ce); - if (ce.error != Variant::CallError::CALL_OK) { + if (ce.error != Callable::CallError::CALL_OK) { String err = Variant::get_call_error_text(obj, frame_drawn_callbacks.front()->get().method, &v, 1, ce); ERR_PRINT("Error calling frame drawn function: " + err); } diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 21885e93b5..d493c20e9a 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -445,7 +445,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_ case VS::ARRAY_TANGENT: { - ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_REAL_ARRAY, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_FLOAT32_ARRAY, ERR_INVALID_PARAMETER); Vector<real_t> array = p_arrays[ai]; @@ -571,7 +571,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_ } break; case VS::ARRAY_WEIGHTS: { - ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_REAL_ARRAY, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_FLOAT32_ARRAY, ERR_INVALID_PARAMETER); Vector<real_t> array = p_arrays[ai]; @@ -595,7 +595,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_ } break; case VS::ARRAY_BONES: { - ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_INT_ARRAY && p_arrays[ai].get_type() != Variant::PACKED_REAL_ARRAY, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_INT32_ARRAY && p_arrays[ai].get_type() != Variant::PACKED_FLOAT32_ARRAY, ERR_INVALID_PARAMETER); Vector<int> array = p_arrays[ai]; @@ -618,7 +618,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_ case VS::ARRAY_INDEX: { ERR_FAIL_COND_V(p_index_array_len <= 0, ERR_INVALID_DATA); - ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_INT_ARRAY, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_INT32_ARRAY, ERR_INVALID_PARAMETER); Vector<int> indices = p_arrays[ai]; ERR_FAIL_COND_V(indices.size() == 0, ERR_INVALID_PARAMETER); @@ -867,7 +867,7 @@ Error VisualServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surface_ ERR_FAIL_COND_V(array_len == 0, ERR_INVALID_DATA); } else if (i == VS::ARRAY_INDEX) { - index_array_len = PackedIntArray(p_arrays[i]).size(); + index_array_len = PackedInt32Array(p_arrays[i]).size(); } } @@ -2180,9 +2180,9 @@ void VisualServer::_bind_methods() { BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_DEFAULT); BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_NEAREST); BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_LINEAR); - BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS); + BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS); BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS); - BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC); + BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC); BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC); BIND_ENUM_CONSTANT(CANVAS_ITEM_TEXTURE_FILTER_MAX); @@ -2352,7 +2352,7 @@ VisualServer::VisualServer() { GLOBAL_DEF("rendering/quality/filters/screen_space_roughness_limiter", 0); ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/screen_space_roughness_limiter", PropertyInfo(Variant::INT, "rendering/quality/filters/screen_space_roughness_limiter", PROPERTY_HINT_ENUM, "Disabled,Enabled (Small Cost)")); GLOBAL_DEF("rendering/quality/filters/screen_space_roughness_limiter_curve", 1.0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/screen_space_roughness_limiter_curve", PropertyInfo(Variant::REAL, "rendering/quality/filters/screen_space_roughness_limiter_curve", PROPERTY_HINT_EXP_EASING, "0.01,8,0.01")); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/screen_space_roughness_limiter_curve", PropertyInfo(Variant::FLOAT, "rendering/quality/filters/screen_space_roughness_limiter_curve", PROPERTY_HINT_EXP_EASING, "0.01,8,0.01")); } VisualServer::~VisualServer() { diff --git a/servers/visual_server.h b/servers/visual_server.h index c29bc2a767..9129f940ee 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -916,9 +916,9 @@ public: CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, //uses canvas item setting for draw command, uses global setting for canvas item CANVAS_ITEM_TEXTURE_FILTER_NEAREST, CANVAS_ITEM_TEXTURE_FILTER_LINEAR, - CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS, + CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, - CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC, + CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, CANVAS_ITEM_TEXTURE_FILTER_MAX }; diff --git a/thirdparty/glslang/glslang/Include/revision.template b/thirdparty/glslang/glslang/Include/revision.template deleted file mode 100644 index 6c13630b27..0000000000 --- a/thirdparty/glslang/glslang/Include/revision.template +++ /dev/null @@ -1,13 +0,0 @@ -// The file revision.h should be updated to the latest version, somehow, on
-// check-in, if glslang has changed.
-//
-// revision.template is the source for revision.h when using SubWCRev as the
-// method of updating revision.h. You don't have to do it this way, the
-// requirement is only that revision.h gets updated.
-//
-// revision.h is under source control so that not all consumers of glslang
-// source have to figure out how to create revision.h just to get a build
-// going. However, if it is not updated, it can be a version behind.
-
-#define GLSLANG_REVISION "$WCREV$"
-#define GLSLANG_DATE "$WCDATE$"
|