diff options
Diffstat (limited to 'editor')
79 files changed, 383 insertions, 399 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index d195561a85..cc07d589c5 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -969,9 +969,9 @@ void ActionMapEditor::_notification(int p_what) { } void ActionMapEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &ActionMapEditor::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &ActionMapEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &ActionMapEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw"), &ActionMapEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &ActionMapEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &ActionMapEditor::drop_data_fw); ADD_SIGNAL(MethodInfo("action_added", PropertyInfo(Variant::STRING, "name"))); ADD_SIGNAL(MethodInfo("action_edited", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::DICTIONARY, "new_action"))); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 756eb4acb6..f1d8139511 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -236,8 +236,8 @@ public: AnimationTrackEdit(); }; -class AnimationTrackEditPlugin : public Reference { - GDCLASS(AnimationTrackEditPlugin, Reference); +class AnimationTrackEditPlugin : public RefCounted { + GDCLASS(AnimationTrackEditPlugin, RefCounted); public: virtual AnimationTrackEdit *create_value_track_edit(Object *p_object, Variant::Type p_type, const String &p_property, PropertyHint p_hint, const String &p_hint_string, int p_usage); diff --git a/editor/array_property_edit.h b/editor/array_property_edit.h index fa3dcbe038..d7e11936a3 100644 --- a/editor/array_property_edit.h +++ b/editor/array_property_edit.h @@ -33,8 +33,8 @@ #include "scene/main/node.h" -class ArrayPropertyEdit : public Reference { - GDCLASS(ArrayPropertyEdit, Reference); +class ArrayPropertyEdit : public RefCounted { + GDCLASS(ArrayPropertyEdit, RefCounted); int page; ObjectID obj; diff --git a/editor/audio_stream_preview.h b/editor/audio_stream_preview.h index accc7275c0..61567598ed 100644 --- a/editor/audio_stream_preview.h +++ b/editor/audio_stream_preview.h @@ -36,8 +36,8 @@ #include "scene/main/node.h" #include "servers/audio/audio_stream.h" -class AudioStreamPreview : public Reference { - GDCLASS(AudioStreamPreview, Reference); +class AudioStreamPreview : public RefCounted { + GDCLASS(AudioStreamPreview, RefCounted); friend class AudioStream; Vector<uint8_t> preview; float length; diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 1c0a55e4ec..968b24893c 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -643,9 +643,9 @@ void CreateDialog::_load_favorites_and_history() { void CreateDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("_save_and_update_favorite_list"), &CreateDialog::_save_and_update_favorite_list); - ClassDB::bind_method("get_drag_data_fw", &CreateDialog::get_drag_data_fw); - ClassDB::bind_method("can_drop_data_fw", &CreateDialog::can_drop_data_fw); - ClassDB::bind_method("drop_data_fw", &CreateDialog::drop_data_fw); + ClassDB::bind_method("_get_drag_data_fw", &CreateDialog::get_drag_data_fw); + ClassDB::bind_method("_can_drop_data_fw", &CreateDialog::can_drop_data_fw); + ClassDB::bind_method("_drop_data_fw", &CreateDialog::drop_data_fw); ADD_SIGNAL(MethodInfo("create")); ADD_SIGNAL(MethodInfo("favorites_updated")); diff --git a/editor/debugger/editor_debugger_server.h b/editor/debugger/editor_debugger_server.h index 6458421e7a..6216d0df3d 100644 --- a/editor/debugger/editor_debugger_server.h +++ b/editor/debugger/editor_debugger_server.h @@ -32,9 +32,9 @@ #define EDITOR_DEBUGGER_CONNECTION_H #include "core/debugger/remote_debugger_peer.h" -#include "core/object/reference.h" +#include "core/object/ref_counted.h" -class EditorDebuggerServer : public Reference { +class EditorDebuggerServer : public RefCounted { public: typedef EditorDebuggerServer *(*CreateServerFunc)(const String &p_uri); diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index c085205f63..7534b419fe 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -30,8 +30,8 @@ #include "dependency_editor.h" +#include "core/io/file_access.h" #include "core/io/resource_loader.h" -#include "core/os/file_access.h" #include "editor_node.h" #include "editor_scale.h" #include "scene/gui/margin_container.h" diff --git a/editor/dictionary_property_edit.h b/editor/dictionary_property_edit.h index e0fd945491..d1401c5e5f 100644 --- a/editor/dictionary_property_edit.h +++ b/editor/dictionary_property_edit.h @@ -33,8 +33,8 @@ #include "scene/main/node.h" -class DictionaryPropertyEdit : public Reference { - GDCLASS(DictionaryPropertyEdit, Reference); +class DictionaryPropertyEdit : public RefCounted { + GDCLASS(DictionaryPropertyEdit, RefCounted); ObjectID obj; StringName property; diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index e29c9593c3..d3df4d91a6 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -34,9 +34,9 @@ #include "core/config/project_settings.h" #include "core/core_constants.h" #include "core/io/compression.h" +#include "core/io/dir_access.h" #include "core/io/marshalls.h" #include "core/object/script_language.h" -#include "core/os/dir_access.h" #include "core/version.h" #include "scene/resources/theme.h" diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index e7937a8e3c..38f417a8ce 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -30,9 +30,9 @@ #include "editor_asset_installer.h" +#include "core/io/dir_access.h" +#include "core/io/file_access.h" #include "core/io/zip_io.h" -#include "core/os/dir_access.h" -#include "core/os/file_access.h" #include "editor_node.h" #include "progress_dialog.h" diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 4317760379..13296e2f23 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -757,9 +757,9 @@ void EditorAudioBus::_bind_methods() { ClassDB::bind_method("update_bus", &EditorAudioBus::update_bus); ClassDB::bind_method("update_send", &EditorAudioBus::update_send); ClassDB::bind_method("_gui_input", &EditorAudioBus::_gui_input); - ClassDB::bind_method("get_drag_data_fw", &EditorAudioBus::get_drag_data_fw); - ClassDB::bind_method("can_drop_data_fw", &EditorAudioBus::can_drop_data_fw); - ClassDB::bind_method("drop_data_fw", &EditorAudioBus::drop_data_fw); + ClassDB::bind_method("_get_drag_data_fw", &EditorAudioBus::get_drag_data_fw); + ClassDB::bind_method("_can_drop_data_fw", &EditorAudioBus::can_drop_data_fw); + ClassDB::bind_method("_drop_data_fw", &EditorAudioBus::drop_data_fw); ADD_SIGNAL(MethodInfo("duplicate_request")); ADD_SIGNAL(MethodInfo("delete_request")); diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index d46df05f6e..a39e693912 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -749,9 +749,9 @@ void EditorAutoloadSettings::autoload_remove(const String &p_name) { void EditorAutoloadSettings::_bind_methods() { ClassDB::bind_method("_autoload_open", &EditorAutoloadSettings::_autoload_open); - ClassDB::bind_method("get_drag_data_fw", &EditorAutoloadSettings::get_drag_data_fw); - ClassDB::bind_method("can_drop_data_fw", &EditorAutoloadSettings::can_drop_data_fw); - ClassDB::bind_method("drop_data_fw", &EditorAutoloadSettings::drop_data_fw); + ClassDB::bind_method("_get_drag_data_fw", &EditorAutoloadSettings::get_drag_data_fw); + ClassDB::bind_method("_can_drop_data_fw", &EditorAutoloadSettings::can_drop_data_fw); + ClassDB::bind_method("_drop_data_fw", &EditorAutoloadSettings::drop_data_fw); ClassDB::bind_method("update_autoload", &EditorAutoloadSettings::update_autoload); ClassDB::bind_method("autoload_add", &EditorAutoloadSettings::autoload_add); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 6405af3876..56c6a416af 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -31,9 +31,9 @@ #include "editor_data.h" #include "core/config/project_settings.h" +#include "core/io/dir_access.h" +#include "core/io/file_access.h" #include "core/io/resource_loader.h" -#include "core/os/dir_access.h" -#include "core/os/file_access.h" #include "editor_node.h" #include "editor_settings.h" #include "scene/resources/packed_scene.h" @@ -83,7 +83,7 @@ void EditorHistory::cleanup_history() { void EditorHistory::_add_object(ObjectID p_object, const String &p_property, int p_level_change, bool p_inspector_only) { Object *obj = ObjectDB::get_instance(p_object); ERR_FAIL_COND(!obj); - Reference *r = Object::cast_to<Reference>(obj); + RefCounted *r = Object::cast_to<RefCounted>(obj); Obj o; if (r) { o.ref = REF(r); diff --git a/editor/editor_dir_dialog.h b/editor/editor_dir_dialog.h index 05451b7bda..ef473b0779 100644 --- a/editor/editor_dir_dialog.h +++ b/editor/editor_dir_dialog.h @@ -31,7 +31,7 @@ #ifndef EDITOR_DIR_DIALOG_H #define EDITOR_DIR_DIALOG_H -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "editor/editor_file_system.h" #include "scene/gui/dialogs.h" #include "scene/gui/tree.h" diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index a988681e32..7c5a06107d 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -33,14 +33,14 @@ #include "core/config/project_settings.h" #include "core/crypto/crypto_core.h" #include "core/io/config_file.h" +#include "core/io/dir_access.h" +#include "core/io/file_access.h" #include "core/io/file_access_encrypted.h" #include "core/io/file_access_pack.h" // PACK_HEADER_MAGIC, PACK_FORMAT_VERSION #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/io/zip_io.h" #include "core/object/script_language.h" -#include "core/os/dir_access.h" -#include "core/os/file_access.h" #include "core/version.h" #include "editor/editor_file_system.h" #include "editor/plugins/script_editor_plugin.h" diff --git a/editor/editor_export.h b/editor/editor_export.h index c96c8fdbce..c9401df9c2 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -31,8 +31,8 @@ #ifndef EDITOR_EXPORT_H #define EDITOR_EXPORT_H +#include "core/io/dir_access.h" #include "core/io/resource.h" -#include "core/os/dir_access.h" #include "scene/main/node.h" #include "scene/main/timer.h" #include "scene/resources/texture.h" @@ -42,8 +42,8 @@ class EditorExportPlatform; class EditorFileSystemDirectory; struct EditorProgress; -class EditorExportPreset : public Reference { - GDCLASS(EditorExportPreset, Reference); +class EditorExportPreset : public RefCounted { + GDCLASS(EditorExportPreset, RefCounted); public: enum ExportFilter { @@ -161,8 +161,8 @@ struct SharedObject { SharedObject() {} }; -class EditorExportPlatform : public Reference { - GDCLASS(EditorExportPlatform, Reference); +class EditorExportPlatform : public RefCounted { + GDCLASS(EditorExportPlatform, RefCounted); public: typedef Error (*EditorExportSaveFunction)(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total, const Vector<String> &p_enc_in_filters, const Vector<String> &p_enc_ex_filters, const Vector<uint8_t> &p_key); @@ -284,8 +284,8 @@ public: EditorExportPlatform(); }; -class EditorExportPlugin : public Reference { - GDCLASS(EditorExportPlugin, Reference); +class EditorExportPlugin : public RefCounted { + GDCLASS(EditorExportPlugin, RefCounted); friend class EditorExportPlatform; diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index d232153206..51c6b473ad 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -30,8 +30,8 @@ #include "editor_feature_profile.h" +#include "core/io/dir_access.h" #include "core/io/json.h" -#include "core/os/dir_access.h" #include "editor/editor_settings.h" #include "editor_node.h" #include "editor_scale.h" diff --git a/editor/editor_feature_profile.h b/editor/editor_feature_profile.h index e118b5f287..d31498bfc6 100644 --- a/editor/editor_feature_profile.h +++ b/editor/editor_feature_profile.h @@ -31,8 +31,8 @@ #ifndef EDITOR_FEATURE_PROFILE_H #define EDITOR_FEATURE_PROFILE_H -#include "core/object/reference.h" -#include "core/os/file_access.h" +#include "core/io/file_access.h" +#include "core/object/ref_counted.h" #include "editor/editor_file_dialog.h" #include "editor_help.h" #include "scene/gui/dialogs.h" @@ -41,8 +41,8 @@ #include "scene/gui/split_container.h" #include "scene/gui/tree.h" -class EditorFeatureProfile : public Reference { - GDCLASS(EditorFeatureProfile, Reference); +class EditorFeatureProfile : public RefCounted { + GDCLASS(EditorFeatureProfile, RefCounted); public: enum Feature { diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 75815fa750..e7d536e08e 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -30,7 +30,7 @@ #include "editor_file_dialog.h" -#include "core/os/file_access.h" +#include "core/io/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/string/print_string.h" diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 5a5e3a8807..f7879838d4 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -31,7 +31,7 @@ #ifndef EDITORFILEDIALOG_H #define EDITORFILEDIALOG_H -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "scene/gui/box_container.h" #include "scene/gui/dialogs.h" #include "scene/gui/item_list.h" diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 69663b9ed9..050e55c624 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -31,10 +31,10 @@ #include "editor_file_system.h" #include "core/config/project_settings.h" +#include "core/io/file_access.h" #include "core/io/resource_importer.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/os/file_access.h" #include "core/os/os.h" #include "core/variant/variant_parser.h" #include "editor_node.h" diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index 855c320856..04879bad6d 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -31,7 +31,7 @@ #ifndef EDITOR_FILE_SYSTEM_H #define EDITOR_FILE_SYSTEM_H -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "core/os/thread.h" #include "core/os/thread_safe.h" #include "core/templates/safe_refcount.h" diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp index 97a2c67c26..4030aecbf5 100644 --- a/editor/editor_folding.cpp +++ b/editor/editor_folding.cpp @@ -30,7 +30,7 @@ #include "editor_folding.h" -#include "core/os/file_access.h" +#include "core/io/file_access.h" #include "editor_inspector.h" #include "editor_settings.h" diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 8a5142459c..2f5451fba3 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -31,7 +31,7 @@ #include "editor_fonts.h" #include "builtin_fonts.gen.h" -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "editor_scale.h" #include "editor_settings.h" #include "scene/resources/default_theme/default_theme.h" diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index 350a02315f..75da2d5aba 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -83,7 +83,7 @@ public: EditorHelpSearch(); }; -class EditorHelpSearch::Runner : public Reference { +class EditorHelpSearch::Runner : public RefCounted { enum Phase { PHASE_MATCH_CLASSES_INIT, PHASE_MATCH_CLASSES, diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 20abe72750..69709315ff 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -380,7 +380,7 @@ StringName EditorProperty::get_edited_property() { void EditorProperty::update_property() { if (get_script_instance()) { - get_script_instance()->call("update_property"); + get_script_instance()->call("_update_property"); } } @@ -753,7 +753,7 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) { call_deferred("emit_changed", property, object->get(property).operator int64_t() + 1, "", false); } - call_deferred("update_property"); + call_deferred("_update_property"); } } if (delete_rect.has_point(mpos)) { @@ -965,9 +965,7 @@ void EditorProperty::_bind_methods() { 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; - vm.name = "update_property"; - BIND_VMETHOD(vm); + BIND_VMETHOD(MethodInfo("_update_property")); } EditorProperty::EditorProperty() { @@ -1023,20 +1021,20 @@ void EditorInspectorPlugin::add_property_editor_for_multiple_properties(const St bool EditorInspectorPlugin::can_handle(Object *p_object) { if (get_script_instance()) { - return get_script_instance()->call("can_handle", p_object); + return get_script_instance()->call("_can_handle", p_object); } return false; } void EditorInspectorPlugin::parse_begin(Object *p_object) { if (get_script_instance()) { - get_script_instance()->call("parse_begin", p_object); + get_script_instance()->call("_parse_begin", p_object); } } void EditorInspectorPlugin::parse_category(Object *p_object, const String &p_parse_category) { if (get_script_instance()) { - get_script_instance()->call("parse_category", p_object, p_parse_category); + get_script_instance()->call("_parse_category", p_object, p_parse_category); } } @@ -1050,14 +1048,14 @@ bool EditorInspectorPlugin::parse_property(Object *p_object, Variant::Type p_typ }; Callable::CallError err; - return get_script_instance()->call("parse_property", (const Variant **)&argptr, 6, err); + return get_script_instance()->call("_parse_property", (const Variant **)&argptr, 6, err); } return false; } void EditorInspectorPlugin::parse_end() { if (get_script_instance()) { - get_script_instance()->call("parse_end"); + get_script_instance()->call("_parse_end"); } } @@ -1066,30 +1064,11 @@ void EditorInspectorPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("add_property_editor", "property", "editor"), &EditorInspectorPlugin::add_property_editor); ClassDB::bind_method(D_METHOD("add_property_editor_for_multiple_properties", "label", "properties", "editor"), &EditorInspectorPlugin::add_property_editor_for_multiple_properties); - MethodInfo vm; - vm.name = "can_handle"; - vm.return_val.type = Variant::BOOL; - vm.arguments.push_back(PropertyInfo(Variant::OBJECT, "object")); - BIND_VMETHOD(vm); - vm.name = "parse_begin"; - vm.return_val.type = Variant::NIL; - BIND_VMETHOD(vm); - vm.name = "parse_category"; - vm.arguments.push_back(PropertyInfo(Variant::STRING, "category")); - BIND_VMETHOD(vm); - vm.arguments.pop_back(); - vm.name = "parse_property"; - vm.return_val.type = Variant::BOOL; - vm.arguments.push_back(PropertyInfo(Variant::INT, "type")); - vm.arguments.push_back(PropertyInfo(Variant::STRING, "path")); - vm.arguments.push_back(PropertyInfo(Variant::INT, "hint")); - vm.arguments.push_back(PropertyInfo(Variant::STRING, "hint_text")); - vm.arguments.push_back(PropertyInfo(Variant::INT, "usage")); - BIND_VMETHOD(vm); - vm.arguments.clear(); - vm.name = "parse_end"; - vm.return_val.type = Variant::NIL; - BIND_VMETHOD(vm); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_can_handle", PropertyInfo(Variant::OBJECT, "object"))); + BIND_VMETHOD(MethodInfo(Variant::NIL, "_parse_begin")); + BIND_VMETHOD(MethodInfo(Variant::NIL, "_parse_category", PropertyInfo(Variant::STRING, "category"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_parse_property", PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::INT, "hint"), PropertyInfo(Variant::STRING, "hint_text"), PropertyInfo(Variant::INT, "usage"))); + BIND_VMETHOD(MethodInfo(Variant::NIL, "_parse_end")); } //////////////////////////////////////////////// @@ -1290,7 +1269,7 @@ void EditorInspectorSection::_notification(int p_what) { Control *editor_property = Object::cast_to<Control>(vbox->get_child(child_idx)); // Test can_drop_data and can_drop_data_fw, since can_drop_data only works if set up with forwarding or if script attached. - if (editor_property && (editor_property->can_drop_data(Point2(), dd) || editor_property->call("can_drop_data_fw", Point2(), dd, this))) { + if (editor_property && (editor_property->can_drop_data(Point2(), dd) || editor_property->call("_can_drop_data_fw", Point2(), dd, this))) { children_can_drop = true; break; } diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 348dea7086..e4bcab3e3f 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -175,8 +175,8 @@ public: EditorProperty(); }; -class EditorInspectorPlugin : public Reference { - GDCLASS(EditorInspectorPlugin, Reference); +class EditorInspectorPlugin : public RefCounted { + GDCLASS(EditorInspectorPlugin, RefCounted); friend class EditorInspector; struct AddedEditor { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index e65e776f94..d8c5a14d4f 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -34,15 +34,16 @@ #include "core/core_bind.h" #include "core/input/input.h" #include "core/io/config_file.h" +#include "core/io/file_access.h" #include "core/io/image_loader.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/io/stream_peer_ssl.h" #include "core/object/class_db.h" #include "core/object/message_queue.h" -#include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" +#include "core/os/time.h" #include "core/string/print_string.h" #include "core/string/translation.h" #include "core/version.h" @@ -2823,7 +2824,7 @@ void EditorNode::_request_screenshot() { } void EditorNode::_screenshot(bool p_use_utc) { - String name = "editor_screenshot_" + OS::get_singleton()->get_iso_date_time(p_use_utc).replace(":", "") + ".png"; + String name = "editor_screenshot_" + Time::get_singleton()->get_datetime_string_from_system(p_use_utc).replace(":", "") + ".png"; NodePath path = String("user://") + name; _save_screenshot(path); if (EditorSettings::get_singleton()->get("interface/editor/automatically_open_screenshots")) { diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp index 474da4fb96..ddba36c187 100644 --- a/editor/editor_paths.cpp +++ b/editor/editor_paths.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "editor_paths.h" -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "core/os/os.h" EditorPaths *EditorPaths::singleton = nullptr; diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index a12bf036bc..63de06d5e2 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -553,21 +553,21 @@ void EditorPlugin::notify_resource_saved(const Ref<Resource> &p_resource) { } bool EditorPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p_event) { - if (get_script_instance() && get_script_instance()->has_method("forward_canvas_gui_input")) { - return get_script_instance()->call("forward_canvas_gui_input", p_event); + if (get_script_instance() && get_script_instance()->has_method("_forward_canvas_gui_input")) { + return get_script_instance()->call("_forward_canvas_gui_input", p_event); } return false; } void EditorPlugin::forward_canvas_draw_over_viewport(Control *p_overlay) { - if (get_script_instance() && get_script_instance()->has_method("forward_canvas_draw_over_viewport")) { - get_script_instance()->call("forward_canvas_draw_over_viewport", p_overlay); + if (get_script_instance() && get_script_instance()->has_method("_forward_canvas_draw_over_viewport")) { + get_script_instance()->call("_forward_canvas_draw_over_viewport", p_overlay); } } void EditorPlugin::forward_canvas_force_draw_over_viewport(Control *p_overlay) { - if (get_script_instance() && get_script_instance()->has_method("forward_canvas_force_draw_over_viewport")) { - get_script_instance()->call("forward_canvas_force_draw_over_viewport", p_overlay); + if (get_script_instance() && get_script_instance()->has_method("_forward_canvas_force_draw_over_viewport")) { + get_script_instance()->call("_forward_canvas_force_draw_over_viewport", p_overlay); } } @@ -591,110 +591,110 @@ int EditorPlugin::update_overlays() const { } bool EditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { - if (get_script_instance() && get_script_instance()->has_method("forward_spatial_gui_input")) { - return get_script_instance()->call("forward_spatial_gui_input", p_camera, p_event); + if (get_script_instance() && get_script_instance()->has_method("_forward_spatial_gui_input")) { + return get_script_instance()->call("_forward_spatial_gui_input", p_camera, p_event); } return false; } void EditorPlugin::forward_spatial_draw_over_viewport(Control *p_overlay) { - if (get_script_instance() && get_script_instance()->has_method("forward_spatial_draw_over_viewport")) { - get_script_instance()->call("forward_spatial_draw_over_viewport", p_overlay); + if (get_script_instance() && get_script_instance()->has_method("_forward_spatial_draw_over_viewport")) { + get_script_instance()->call("_forward_spatial_draw_over_viewport", p_overlay); } } void EditorPlugin::forward_spatial_force_draw_over_viewport(Control *p_overlay) { - if (get_script_instance() && get_script_instance()->has_method("forward_spatial_force_draw_over_viewport")) { - get_script_instance()->call("forward_spatial_force_draw_over_viewport", p_overlay); + if (get_script_instance() && get_script_instance()->has_method("_forward_spatial_force_draw_over_viewport")) { + get_script_instance()->call("_forward_spatial_force_draw_over_viewport", p_overlay); } } String EditorPlugin::get_name() const { - if (get_script_instance() && get_script_instance()->has_method("get_plugin_name")) { - return get_script_instance()->call("get_plugin_name"); + if (get_script_instance() && get_script_instance()->has_method("_get_plugin_name")) { + return get_script_instance()->call("_get_plugin_name"); } return String(); } const Ref<Texture2D> EditorPlugin::get_icon() const { - if (get_script_instance() && get_script_instance()->has_method("get_plugin_icon")) { - return get_script_instance()->call("get_plugin_icon"); + if (get_script_instance() && get_script_instance()->has_method("_get_plugin_icon")) { + return get_script_instance()->call("_get_plugin_icon"); } return Ref<Texture2D>(); } bool EditorPlugin::has_main_screen() const { - if (get_script_instance() && get_script_instance()->has_method("has_main_screen")) { - return get_script_instance()->call("has_main_screen"); + if (get_script_instance() && get_script_instance()->has_method("_has_main_screen")) { + return get_script_instance()->call("_has_main_screen"); } return false; } void EditorPlugin::make_visible(bool p_visible) { - if (get_script_instance() && get_script_instance()->has_method("make_visible")) { - get_script_instance()->call("make_visible", p_visible); + if (get_script_instance() && get_script_instance()->has_method("_make_visible")) { + get_script_instance()->call("_make_visible", p_visible); } } void EditorPlugin::edit(Object *p_object) { - if (get_script_instance() && get_script_instance()->has_method("edit")) { + if (get_script_instance() && get_script_instance()->has_method("_edit")) { if (p_object->is_class("Resource")) { - get_script_instance()->call("edit", Ref<Resource>(Object::cast_to<Resource>(p_object))); + get_script_instance()->call("_edit", Ref<Resource>(Object::cast_to<Resource>(p_object))); } else { - get_script_instance()->call("edit", p_object); + get_script_instance()->call("_edit", p_object); } } } bool EditorPlugin::handles(Object *p_object) const { - if (get_script_instance() && get_script_instance()->has_method("handles")) { - return get_script_instance()->call("handles", p_object); + if (get_script_instance() && get_script_instance()->has_method("_handles")) { + return get_script_instance()->call("_handles", p_object); } return false; } Dictionary EditorPlugin::get_state() const { - if (get_script_instance() && get_script_instance()->has_method("get_state")) { - return get_script_instance()->call("get_state"); + if (get_script_instance() && get_script_instance()->has_method("_get_state")) { + return get_script_instance()->call("_get_state"); } return Dictionary(); } void EditorPlugin::set_state(const Dictionary &p_state) { - if (get_script_instance() && get_script_instance()->has_method("set_state")) { - get_script_instance()->call("set_state", p_state); + if (get_script_instance() && get_script_instance()->has_method("_set_state")) { + get_script_instance()->call("_set_state", p_state); } } void EditorPlugin::clear() { - if (get_script_instance() && get_script_instance()->has_method("clear")) { - get_script_instance()->call("clear"); + if (get_script_instance() && get_script_instance()->has_method("_clear")) { + get_script_instance()->call("_clear"); } } // if editor references external resources/scenes, save them void EditorPlugin::save_external_data() { - if (get_script_instance() && get_script_instance()->has_method("save_external_data")) { - get_script_instance()->call("save_external_data"); + if (get_script_instance() && get_script_instance()->has_method("_save_external_data")) { + get_script_instance()->call("_save_external_data"); } } // if changes are pending in editor, apply them void EditorPlugin::apply_changes() { - if (get_script_instance() && get_script_instance()->has_method("apply_changes")) { - get_script_instance()->call("apply_changes"); + if (get_script_instance() && get_script_instance()->has_method("_apply_changes")) { + get_script_instance()->call("_apply_changes"); } } void EditorPlugin::get_breakpoints(List<String> *p_breakpoints) { - if (get_script_instance() && get_script_instance()->has_method("get_breakpoints")) { - PackedStringArray arr = get_script_instance()->call("get_breakpoints"); + if (get_script_instance() && get_script_instance()->has_method("_get_breakpoints")) { + PackedStringArray arr = get_script_instance()->call("_get_breakpoints"); for (int i = 0; i < arr.size(); i++) { p_breakpoints->push_back(arr[i]); } @@ -717,52 +717,64 @@ void EditorPlugin::remove_undo_redo_inspector_hook_callback(Callable p_callable) } void EditorPlugin::add_translation_parser_plugin(const Ref<EditorTranslationParserPlugin> &p_parser) { + ERR_FAIL_COND(!p_parser.is_valid()); EditorTranslationParser::get_singleton()->add_parser(p_parser, EditorTranslationParser::CUSTOM); } void EditorPlugin::remove_translation_parser_plugin(const Ref<EditorTranslationParserPlugin> &p_parser) { + ERR_FAIL_COND(!p_parser.is_valid()); EditorTranslationParser::get_singleton()->remove_parser(p_parser, EditorTranslationParser::CUSTOM); } void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin> &p_importer) { + ERR_FAIL_COND(!p_importer.is_valid()); ResourceFormatImporter::get_singleton()->add_importer(p_importer); EditorFileSystem::get_singleton()->call_deferred("scan"); } void EditorPlugin::remove_import_plugin(const Ref<EditorImportPlugin> &p_importer) { + ERR_FAIL_COND(!p_importer.is_valid()); ResourceFormatImporter::get_singleton()->remove_importer(p_importer); EditorFileSystem::get_singleton()->call_deferred("scan"); } void EditorPlugin::add_export_plugin(const Ref<EditorExportPlugin> &p_exporter) { + ERR_FAIL_COND(!p_exporter.is_valid()); EditorExport::get_singleton()->add_export_plugin(p_exporter); } void EditorPlugin::remove_export_plugin(const Ref<EditorExportPlugin> &p_exporter) { + ERR_FAIL_COND(!p_exporter.is_valid()); EditorExport::get_singleton()->remove_export_plugin(p_exporter); } void EditorPlugin::add_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin) { + ERR_FAIL_COND(!p_gizmo_plugin.is_valid()); Node3DEditor::get_singleton()->add_gizmo_plugin(p_gizmo_plugin); } void EditorPlugin::remove_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin) { + ERR_FAIL_COND(!p_gizmo_plugin.is_valid()); Node3DEditor::get_singleton()->remove_gizmo_plugin(p_gizmo_plugin); } void EditorPlugin::add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin) { + ERR_FAIL_COND(!p_plugin.is_valid()); EditorInspector::add_inspector_plugin(p_plugin); } void EditorPlugin::remove_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin) { + ERR_FAIL_COND(!p_plugin.is_valid()); EditorInspector::remove_inspector_plugin(p_plugin); } void EditorPlugin::add_scene_import_plugin(const Ref<EditorSceneImporter> &p_importer) { + ERR_FAIL_COND(!p_importer.is_valid()); ResourceImporterScene::get_singleton()->add_importer(p_importer); } void EditorPlugin::remove_scene_import_plugin(const Ref<EditorSceneImporter> &p_importer) { + ERR_FAIL_COND(!p_importer.is_valid()); ResourceImporterScene::get_singleton()->remove_importer(p_importer); } @@ -779,8 +791,8 @@ int find(const PackedStringArray &a, const String &v) { void EditorPlugin::enable_plugin() { // Called when the plugin gets enabled in project settings, after it's added to the tree. // You can implement it to register autoloads. - if (get_script_instance() && get_script_instance()->has_method("enable_plugin")) { - get_script_instance()->call("enable_plugin"); + if (get_script_instance() && get_script_instance()->has_method("_enable_plugin")) { + get_script_instance()->call("_enable_plugin"); } } @@ -788,26 +800,26 @@ void EditorPlugin::disable_plugin() { // Last function called when the plugin gets disabled in project settings. // Implement it to cleanup things from the project, such as unregister autoloads. - if (get_script_instance() && get_script_instance()->has_method("disable_plugin")) { - get_script_instance()->call("disable_plugin"); + if (get_script_instance() && get_script_instance()->has_method("_disable_plugin")) { + get_script_instance()->call("_disable_plugin"); } } void EditorPlugin::set_window_layout(Ref<ConfigFile> p_layout) { - if (get_script_instance() && get_script_instance()->has_method("set_window_layout")) { - get_script_instance()->call("set_window_layout", p_layout); + if (get_script_instance() && get_script_instance()->has_method("_set_window_layout")) { + get_script_instance()->call("_set_window_layout", p_layout); } } void EditorPlugin::get_window_layout(Ref<ConfigFile> p_layout) { - if (get_script_instance() && get_script_instance()->has_method("get_window_layout")) { - get_script_instance()->call("get_window_layout", p_layout); + if (get_script_instance() && get_script_instance()->has_method("_get_window_layout")) { + get_script_instance()->call("_get_window_layout", p_layout); } } bool EditorPlugin::build() { - if (get_script_instance() && get_script_instance()->has_method("build")) { - return get_script_instance()->call("build"); + if (get_script_instance() && get_script_instance()->has_method("_build")) { + return get_script_instance()->call("_build"); } return true; @@ -898,29 +910,29 @@ void EditorPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("add_debugger_plugin", "script"), &EditorPlugin::add_debugger_plugin); ClassDB::bind_method(D_METHOD("remove_debugger_plugin", "script"), &EditorPlugin::remove_debugger_plugin); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_force_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_spatial_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_spatial_force_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_plugin_name")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "get_plugin_icon")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "has_main_screen")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("make_visible", PropertyInfo(Variant::BOOL, "visible"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("edit", PropertyInfo(Variant::OBJECT, "object"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "handles", PropertyInfo(Variant::OBJECT, "object"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::DICTIONARY, "get_state")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_state", PropertyInfo(Variant::DICTIONARY, "state"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("clear")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("save_external_data")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("apply_changes")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::PACKED_STRING_ARRAY, "get_breakpoints")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("get_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "build")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("enable_plugin")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("disable_plugin")); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_forward_canvas_gui_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); + BIND_VMETHOD(MethodInfo("_forward_canvas_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); + BIND_VMETHOD(MethodInfo("_forward_canvas_force_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); + BIND_VMETHOD(MethodInfo("_forward_spatial_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); + BIND_VMETHOD(MethodInfo("_forward_spatial_force_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_plugin_name")); + BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "_get_plugin_icon")); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_has_main_screen")); + BIND_VMETHOD(MethodInfo("_make_visible", PropertyInfo(Variant::BOOL, "visible"))); + BIND_VMETHOD(MethodInfo("_edit", PropertyInfo(Variant::OBJECT, "object"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_handles", PropertyInfo(Variant::OBJECT, "object"))); + BIND_VMETHOD(MethodInfo(Variant::DICTIONARY, "_get_state")); + BIND_VMETHOD(MethodInfo("_set_state", PropertyInfo(Variant::DICTIONARY, "state"))); + BIND_VMETHOD(MethodInfo("_clear")); + BIND_VMETHOD(MethodInfo("_save_external_data")); + BIND_VMETHOD(MethodInfo("_apply_changes")); + BIND_VMETHOD(MethodInfo(Variant::PACKED_STRING_ARRAY, "_get_breakpoints")); + BIND_VMETHOD(MethodInfo("_set_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile"))); + BIND_VMETHOD(MethodInfo("_get_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_build")); + BIND_VMETHOD(MethodInfo("_enable_plugin")); + BIND_VMETHOD(MethodInfo("_disable_plugin")); ADD_SIGNAL(MethodInfo("scene_changed", PropertyInfo(Variant::OBJECT, "scene_root", PROPERTY_HINT_RESOURCE_TYPE, "Node"))); ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "filepath"))); diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index e5b62513ff..1db24bb908 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -32,7 +32,7 @@ #include "core/config/project_settings.h" #include "core/io/config_file.h" -#include "core/os/file_access.h" +#include "core/io/file_access.h" #include "core/os/main_loop.h" #include "editor_node.h" #include "editor_scale.h" diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index ece7094767..0feee447a4 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2261,7 +2261,7 @@ void EditorPropertyNodePath::_node_selected(const NodePath &p_path) { base_node = get_edited_object()->call("get_root_path"); } - if (!base_node && Object::cast_to<Reference>(get_edited_object())) { + if (!base_node && Object::cast_to<RefCounted>(get_edited_object())) { Node *to_node = get_node(p_path); ERR_FAIL_COND(!to_node); path = get_tree()->get_edited_scene_root()->get_path_to(to_node); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index bfa85f4aab..66fabcd940 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -567,8 +567,8 @@ void EditorPropertyArray::setup(Variant::Type p_array_type, const String &p_hint } void EditorPropertyArray::_bind_methods() { - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &EditorPropertyArray::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &EditorPropertyArray::drop_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &EditorPropertyArray::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &EditorPropertyArray::drop_data_fw); } EditorPropertyArray::EditorPropertyArray() { diff --git a/editor/editor_properties_array_dict.h b/editor/editor_properties_array_dict.h index fa5adc788d..aa2d8744b1 100644 --- a/editor/editor_properties_array_dict.h +++ b/editor/editor_properties_array_dict.h @@ -36,8 +36,8 @@ #include "editor/filesystem_dock.h" #include "scene/gui/button.h" -class EditorPropertyArrayObject : public Reference { - GDCLASS(EditorPropertyArrayObject, Reference); +class EditorPropertyArrayObject : public RefCounted { + GDCLASS(EditorPropertyArrayObject, RefCounted); Variant array; @@ -52,8 +52,8 @@ public: EditorPropertyArrayObject(); }; -class EditorPropertyDictionaryObject : public Reference { - GDCLASS(EditorPropertyDictionaryObject, Reference); +class EditorPropertyDictionaryObject : public RefCounted { + GDCLASS(EditorPropertyDictionaryObject, RefCounted); Variant new_item_key; Variant new_item_value; diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index d1a0bfeded..1ea8c71f85 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -361,8 +361,8 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) { void EditorResourcePicker::set_create_options(Object *p_menu_node) { // If a subclass implements this method, use it to replace all create items. - if (get_script_instance() && get_script_instance()->has_method("set_create_options")) { - get_script_instance()->call("set_create_options", p_menu_node); + if (get_script_instance() && get_script_instance()->has_method("_set_create_options")) { + get_script_instance()->call("_set_create_options", p_menu_node); return; } @@ -418,8 +418,8 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) { } bool EditorResourcePicker::handle_menu_selected(int p_which) { - if (get_script_instance() && get_script_instance()->has_method("handle_menu_selected")) { - return get_script_instance()->call("handle_menu_selected", p_which); + if (get_script_instance() && get_script_instance()->has_method("_handle_menu_selected")) { + return get_script_instance()->call("_handle_menu_selected", p_which); } return false; @@ -625,9 +625,9 @@ void EditorResourcePicker::drop_data_fw(const Point2 &p_point, const Variant &p_ void EditorResourcePicker::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_resource_preview"), &EditorResourcePicker::_update_resource_preview); - ClassDB::bind_method(D_METHOD("get_drag_data_fw", "position", "from"), &EditorResourcePicker::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw", "position", "data", "from"), &EditorResourcePicker::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw", "position", "data", "from"), &EditorResourcePicker::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw", "position", "from"), &EditorResourcePicker::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw", "position", "data", "from"), &EditorResourcePicker::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw", "position", "data", "from"), &EditorResourcePicker::drop_data_fw); ClassDB::bind_method(D_METHOD("set_base_type", "base_type"), &EditorResourcePicker::set_base_type); ClassDB::bind_method(D_METHOD("get_base_type"), &EditorResourcePicker::get_base_type); @@ -640,8 +640,8 @@ void EditorResourcePicker::_bind_methods() { ClassDB::bind_method(D_METHOD("set_editable", "enable"), &EditorResourcePicker::set_editable); ClassDB::bind_method(D_METHOD("is_editable"), &EditorResourcePicker::is_editable); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_create_options", PropertyInfo(Variant::OBJECT, "menu_node"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("handle_menu_selected", PropertyInfo(Variant::INT, "id"))); + ClassDB::add_virtual_method(get_class_static(), MethodInfo("_set_create_options", PropertyInfo(Variant::OBJECT, "menu_node"))); + ClassDB::add_virtual_method(get_class_static(), MethodInfo("_handle_menu_selected", PropertyInfo(Variant::INT, "id"))); ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type"), "set_base_type", "get_base_type"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "edited_resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource", 0), "set_edited_resource", "get_edited_resource"); diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 35cf08b4d7..0f1b70936a 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -31,31 +31,31 @@ #include "editor_resource_preview.h" #include "core/config/project_settings.h" +#include "core/io/file_access.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/object/message_queue.h" -#include "core/os/file_access.h" #include "editor_node.h" #include "editor_scale.h" #include "editor_settings.h" bool EditorResourcePreviewGenerator::handles(const String &p_type) const { - if (get_script_instance() && get_script_instance()->has_method("handles")) { - return get_script_instance()->call("handles", p_type); + if (get_script_instance() && get_script_instance()->has_method("_handles")) { + return get_script_instance()->call("_handles", p_type); } - ERR_FAIL_V_MSG(false, "EditorResourcePreviewGenerator::handles needs to be overridden."); + ERR_FAIL_V_MSG(false, "EditorResourcePreviewGenerator::_handles needs to be overridden."); } Ref<Texture2D> EditorResourcePreviewGenerator::generate(const RES &p_from, const Size2 &p_size) const { - if (get_script_instance() && get_script_instance()->has_method("generate")) { - return get_script_instance()->call("generate", p_from, p_size); + if (get_script_instance() && get_script_instance()->has_method("_generate")) { + return get_script_instance()->call("_generate", p_from, p_size); } - ERR_FAIL_V_MSG(Ref<Texture2D>(), "EditorResourcePreviewGenerator::generate needs to be overridden."); + ERR_FAIL_V_MSG(Ref<Texture2D>(), "EditorResourcePreviewGenerator::_generate needs to be overridden."); } Ref<Texture2D> EditorResourcePreviewGenerator::generate_from_path(const String &p_path, const Size2 &p_size) const { - if (get_script_instance() && get_script_instance()->has_method("generate_from_path")) { - return get_script_instance()->call("generate_from_path", p_path, p_size); + if (get_script_instance() && get_script_instance()->has_method("_generate_from_path")) { + return get_script_instance()->call("_generate_from_path", p_path, p_size); } RES res = ResourceLoader::load(p_path); @@ -66,27 +66,27 @@ Ref<Texture2D> EditorResourcePreviewGenerator::generate_from_path(const String & } bool EditorResourcePreviewGenerator::generate_small_preview_automatically() const { - if (get_script_instance() && get_script_instance()->has_method("generate_small_preview_automatically")) { - return get_script_instance()->call("generate_small_preview_automatically"); + if (get_script_instance() && get_script_instance()->has_method("_generate_small_preview_automatically")) { + return get_script_instance()->call("_generate_small_preview_automatically"); } return false; } bool EditorResourcePreviewGenerator::can_generate_small_preview() const { - if (get_script_instance() && get_script_instance()->has_method("can_generate_small_preview")) { - return get_script_instance()->call("can_generate_small_preview"); + if (get_script_instance() && get_script_instance()->has_method("_can_generate_small_preview")) { + return get_script_instance()->call("_can_generate_small_preview"); } return false; } void EditorResourcePreviewGenerator::_bind_methods() { - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "handles", PropertyInfo(Variant::STRING, "type"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(CLASS_INFO(Texture2D), "generate", PropertyInfo(Variant::OBJECT, "from", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), PropertyInfo(Variant::VECTOR2, "size"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(CLASS_INFO(Texture2D), "generate_from_path", PropertyInfo(Variant::STRING, "path", PROPERTY_HINT_FILE), PropertyInfo(Variant::VECTOR2, "size"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "generate_small_preview_automatically")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "can_generate_small_preview")); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_handles", PropertyInfo(Variant::STRING, "type"))); + BIND_VMETHOD(MethodInfo(CLASS_INFO(Texture2D), "_generate", PropertyInfo(Variant::OBJECT, "from", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), PropertyInfo(Variant::VECTOR2, "size"))); + BIND_VMETHOD(MethodInfo(CLASS_INFO(Texture2D), "_generate_from_path", PropertyInfo(Variant::STRING, "path", PROPERTY_HINT_FILE), PropertyInfo(Variant::VECTOR2, "size"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_generate_small_preview_automatically")); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_can_generate_small_preview")); } EditorResourcePreviewGenerator::EditorResourcePreviewGenerator() { diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index ffeb22162e..67f83220d0 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -37,8 +37,8 @@ #include "scene/main/node.h" #include "scene/resources/texture.h" -class EditorResourcePreviewGenerator : public Reference { - GDCLASS(EditorResourcePreviewGenerator, Reference); +class EditorResourcePreviewGenerator : public RefCounted { + GDCLASS(EditorResourcePreviewGenerator, RefCounted); protected: static void _bind_methods(); diff --git a/editor/editor_run_script.h b/editor/editor_run_script.h index 83987ecba1..c8412c3c92 100644 --- a/editor/editor_run_script.h +++ b/editor/editor_run_script.h @@ -31,11 +31,11 @@ #ifndef EDITOR_RUN_SCRIPT_H #define EDITOR_RUN_SCRIPT_H -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "editor_plugin.h" class EditorNode; -class EditorScript : public Reference { - GDCLASS(EditorScript, Reference); +class EditorScript : public RefCounted { + GDCLASS(EditorScript, RefCounted); EditorNode *editor; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 71dc1b531a..949638f0c9 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -35,13 +35,13 @@ #include "core/io/certs_compressed.gen.h" #include "core/io/compression.h" #include "core/io/config_file.h" +#include "core/io/dir_access.h" +#include "core/io/file_access.h" #include "core/io/file_access_memory.h" #include "core/io/ip.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/io/translation_loader_po.h" -#include "core/os/dir_access.h" -#include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/version.h" diff --git a/editor/editor_translation_parser.cpp b/editor/editor_translation_parser.cpp index 49d5cf1fd3..27d428e682 100644 --- a/editor/editor_translation_parser.cpp +++ b/editor/editor_translation_parser.cpp @@ -31,8 +31,8 @@ #include "editor_translation_parser.h" #include "core/error/error_macros.h" +#include "core/io/file_access.h" #include "core/object/script_language.h" -#include "core/os/file_access.h" #include "core/templates/set.h" EditorTranslationParser *EditorTranslationParser::singleton = nullptr; @@ -42,10 +42,10 @@ Error EditorTranslationParserPlugin::parse_file(const String &p_path, Vector<Str return ERR_UNAVAILABLE; } - if (get_script_instance()->has_method("parse_file")) { + if (get_script_instance()->has_method("_parse_file")) { Array ids; Array ids_ctx_plural; - get_script_instance()->call("parse_file", p_path, ids, ids_ctx_plural); + get_script_instance()->call("_parse_file", p_path, ids, ids_ctx_plural); // Add user's extracted translatable messages. for (int i = 0; i < ids.size(); i++) { @@ -75,8 +75,8 @@ void EditorTranslationParserPlugin::get_recognized_extensions(List<String> *r_ex return; } - if (get_script_instance()->has_method("get_recognized_extensions")) { - Array extensions = get_script_instance()->call("get_recognized_extensions"); + if (get_script_instance()->has_method("_get_recognized_extensions")) { + Array extensions = get_script_instance()->call("_get_recognized_extensions"); for (int i = 0; i < extensions.size(); i++) { r_extensions->push_back(extensions[i]); } @@ -86,8 +86,8 @@ void EditorTranslationParserPlugin::get_recognized_extensions(List<String> *r_ex } void EditorTranslationParserPlugin::_bind_methods() { - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::NIL, "parse_file", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::ARRAY, "msgids"), PropertyInfo(Variant::ARRAY, "msgids_context_plural"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::ARRAY, "get_recognized_extensions")); + BIND_VMETHOD(MethodInfo(Variant::NIL, "_parse_file", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::ARRAY, "msgids"), PropertyInfo(Variant::ARRAY, "msgids_context_plural"))); + BIND_VMETHOD(MethodInfo(Variant::ARRAY, "_get_recognized_extensions")); } ///////////////////////// diff --git a/editor/editor_translation_parser.h b/editor/editor_translation_parser.h index 4f8f3537f2..7013bbb8c4 100644 --- a/editor/editor_translation_parser.h +++ b/editor/editor_translation_parser.h @@ -32,10 +32,10 @@ #define EDITOR_TRANSLATION_PARSER_H #include "core/error/error_list.h" -#include "core/object/reference.h" +#include "core/object/ref_counted.h" -class EditorTranslationParserPlugin : public Reference { - GDCLASS(EditorTranslationParserPlugin, Reference); +class EditorTranslationParserPlugin : public RefCounted { + GDCLASS(EditorTranslationParserPlugin, RefCounted); protected: static void _bind_methods(); diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 39d7c7acd4..76c6fcc3d3 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -31,9 +31,9 @@ #include "export_template_manager.h" #include "core/input/input.h" +#include "core/io/dir_access.h" #include "core/io/json.h" #include "core/io/zip_io.h" -#include "core/os/dir_access.h" #include "core/os/keyboard.h" #include "core/version.h" #include "editor_node.h" diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index ce98f699ae..46bb6a1632 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -31,9 +31,9 @@ #include "filesystem_dock.h" #include "core/config/project_settings.h" +#include "core/io/dir_access.h" +#include "core/io/file_access.h" #include "core/io/resource_loader.h" -#include "core/os/dir_access.h" -#include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/templates/list.h" @@ -2751,9 +2751,9 @@ void FileSystemDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_tree_thumbnail_done"), &FileSystemDock::_tree_thumbnail_done); ClassDB::bind_method(D_METHOD("_select_file"), &FileSystemDock::_select_file); - ClassDB::bind_method(D_METHOD("get_drag_data_fw", "position", "from"), &FileSystemDock::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw", "position", "data", "from"), &FileSystemDock::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw", "position", "data", "from"), &FileSystemDock::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw", "position", "from"), &FileSystemDock::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw", "position", "data", "from"), &FileSystemDock::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw", "position", "data", "from"), &FileSystemDock::drop_data_fw); ClassDB::bind_method(D_METHOD("navigate_to_path", "path"), &FileSystemDock::navigate_to_path); ClassDB::bind_method(D_METHOD("_update_import_dock"), &FileSystemDock::_update_import_dock); @@ -2777,22 +2777,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { // `KEY_MASK_CMD | KEY_C` conflicts with other editor shortcuts. ED_SHORTCUT("filesystem_dock/copy_path", TTR("Copy Path"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_C); ED_SHORTCUT("filesystem_dock/duplicate", TTR("Duplicate..."), KEY_MASK_CMD | KEY_D); - -#if defined(WINDOWS_ENABLED) - // TRANSLATORS: This string is only used on Windows, as it refers to the system trash - // as "Recycle Bin" instead of "Trash". Make sure to use the translation of "Recycle Bin" - // recommended by Microsoft for the target language. - ED_SHORTCUT("filesystem_dock/delete", TTR("Move to Recycle Bin"), KEY_DELETE); -#elif defined(OSX_ENABLED) - // TRANSLATORS: This string is only used on macOS, as it refers to the system trash - // as "Bin" instead of "Trash". Make sure to use the translation of "Bin" - // recommended by Apple for the target language. - ED_SHORTCUT("filesystem_dock/delete", TTR("Move to Bin"), KEY_DELETE); -#else - // TRANSLATORS: This string is only used on platforms other than Windows and macOS. - ED_SHORTCUT("filesystem_dock/delete", TTR("Move to Trash"), KEY_DELETE); -#endif - + ED_SHORTCUT("filesystem_dock/delete", TTR("Delete"), KEY_DELETE); ED_SHORTCUT("filesystem_dock/rename", TTR("Rename..."), KEY_F2); VBoxContainer *top_vbc = memnew(VBoxContainer); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 8783c402cd..12c567fb69 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -43,7 +43,7 @@ #include "scene/gui/tree.h" #include "scene/main/timer.h" -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "core/os/thread.h" #include "create_dialog.h" diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index d9b956ed08..17d24a295c 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -30,7 +30,7 @@ #include "find_in_files.h" -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "core/os/os.h" #include "editor_node.h" #include "editor_scale.h" diff --git a/editor/import/editor_import_plugin.cpp b/editor/import/editor_import_plugin.cpp index 44aff874eb..8660289c40 100644 --- a/editor/import/editor_import_plugin.cpp +++ b/editor/import/editor_import_plugin.cpp @@ -35,63 +35,63 @@ EditorImportPlugin::EditorImportPlugin() { } String EditorImportPlugin::get_importer_name() const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_importer_name")), ""); - return get_script_instance()->call("get_importer_name"); + ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_importer_name")), ""); + return get_script_instance()->call("_get_importer_name"); } String EditorImportPlugin::get_visible_name() const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_visible_name")), ""); - return get_script_instance()->call("get_visible_name"); + ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_visible_name")), ""); + return get_script_instance()->call("_get_visible_name"); } void EditorImportPlugin::get_recognized_extensions(List<String> *p_extensions) const { - ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("get_recognized_extensions"))); - Array extensions = get_script_instance()->call("get_recognized_extensions"); + ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("_get_recognized_extensions"))); + Array extensions = get_script_instance()->call("_get_recognized_extensions"); for (int i = 0; i < extensions.size(); i++) { p_extensions->push_back(extensions[i]); } } String EditorImportPlugin::get_preset_name(int p_idx) const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_preset_name")), ""); - return get_script_instance()->call("get_preset_name", p_idx); + ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_preset_name")), ""); + return get_script_instance()->call("_get_preset_name", p_idx); } int EditorImportPlugin::get_preset_count() const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_preset_count")), 0); - return get_script_instance()->call("get_preset_count"); + ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_preset_count")), 0); + return get_script_instance()->call("_get_preset_count"); } String EditorImportPlugin::get_save_extension() const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_save_extension")), ""); - return get_script_instance()->call("get_save_extension"); + ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_save_extension")), ""); + return get_script_instance()->call("_get_save_extension"); } String EditorImportPlugin::get_resource_type() const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_resource_type")), ""); - return get_script_instance()->call("get_resource_type"); + ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_resource_type")), ""); + return get_script_instance()->call("_get_resource_type"); } float EditorImportPlugin::get_priority() const { - if (!(get_script_instance() && get_script_instance()->has_method("get_priority"))) { + if (!(get_script_instance() && get_script_instance()->has_method("_get_priority"))) { return ResourceImporter::get_priority(); } - return get_script_instance()->call("get_priority"); + return get_script_instance()->call("_get_priority"); } int EditorImportPlugin::get_import_order() const { - if (!(get_script_instance() && get_script_instance()->has_method("get_import_order"))) { + if (!(get_script_instance() && get_script_instance()->has_method("_get_import_order"))) { return ResourceImporter::get_import_order(); } - return get_script_instance()->call("get_import_order"); + return get_script_instance()->call("_get_import_order"); } void EditorImportPlugin::get_import_options(List<ResourceImporter::ImportOption> *r_options, int p_preset) const { - ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("get_import_options"))); + ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("_get_import_options"))); Array needed; needed.push_back("name"); needed.push_back("default_value"); - Array options = get_script_instance()->call("get_import_options", p_preset); + Array options = get_script_instance()->call("_get_import_options", p_preset); for (int i = 0; i < options.size(); i++) { Dictionary d = options[i]; ERR_FAIL_COND(!d.has_all(needed)); @@ -119,18 +119,18 @@ void EditorImportPlugin::get_import_options(List<ResourceImporter::ImportOption> } bool EditorImportPlugin::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_option_visibility")), true); + ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_option_visibility")), true); Dictionary d; Map<StringName, Variant>::Element *E = p_options.front(); while (E) { d[E->key()] = E->get(); E = E->next(); } - return get_script_instance()->call("get_option_visibility", p_option, d); + return get_script_instance()->call("_get_option_visibility", p_option, d); } Error EditorImportPlugin::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) { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("import")), ERR_UNAVAILABLE); + ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_import")), ERR_UNAVAILABLE); Dictionary options; Array platform_variants, gen_files; @@ -139,7 +139,7 @@ Error EditorImportPlugin::import(const String &p_source_file, const String &p_sa options[E->key()] = E->get(); E = E->next(); } - Error err = (Error)get_script_instance()->call("import", p_source_file, p_save_path, options, platform_variants, gen_files).operator int64_t(); + Error err = (Error)get_script_instance()->call("_import", p_source_file, p_save_path, options, platform_variants, gen_files).operator int64_t(); for (int i = 0; i < platform_variants.size(); i++) { r_platform_variants->push_back(platform_variants[i]); @@ -151,16 +151,16 @@ Error EditorImportPlugin::import(const String &p_source_file, const String &p_sa } void EditorImportPlugin::_bind_methods() { - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_importer_name")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_visible_name")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "get_preset_count")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_preset_name", PropertyInfo(Variant::INT, "preset"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::ARRAY, "get_recognized_extensions")); - 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::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"))); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_importer_name")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_visible_name")); + BIND_VMETHOD(MethodInfo(Variant::INT, "_get_preset_count")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_preset_name", PropertyInfo(Variant::INT, "preset"))); + BIND_VMETHOD(MethodInfo(Variant::ARRAY, "_get_recognized_extensions")); + BIND_VMETHOD(MethodInfo(Variant::ARRAY, "_get_import_options", PropertyInfo(Variant::INT, "preset"))); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_save_extension")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_resource_type")); + BIND_VMETHOD(MethodInfo(Variant::FLOAT, "_get_priority")); + BIND_VMETHOD(MethodInfo(Variant::INT, "_get_import_order")); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_get_option_visibility", PropertyInfo(Variant::STRING, "option"), PropertyInfo(Variant::DICTIONARY, "options"))); + BIND_VMETHOD(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/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index 4a4d9d8f06..c9e446a1a2 100644 --- a/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -30,8 +30,8 @@ #include "resource_importer_csv_translation.h" +#include "core/io/file_access.h" #include "core/io/resource_saver.h" -#include "core/os/file_access.h" #include "core/string/optimized_translation.h" #include "core/string/translation.h" diff --git a/editor/import/resource_importer_image.cpp b/editor/import/resource_importer_image.cpp index c5b2a8dc3a..2dea359188 100644 --- a/editor/import/resource_importer_image.cpp +++ b/editor/import/resource_importer_image.cpp @@ -30,9 +30,9 @@ #include "resource_importer_image.h" +#include "core/io/file_access.h" #include "core/io/image_loader.h" #include "core/io/resource_saver.h" -#include "core/os/file_access.h" #include "scene/resources/texture.h" String ResourceImporterImage::get_importer_name() const { diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index e932ac778c..3aa17ee581 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -30,8 +30,8 @@ #include "resource_importer_obj.h" +#include "core/io/file_access.h" #include "core/io/resource_saver.h" -#include "core/os/file_access.h" #include "editor/import/scene_importer_mesh.h" #include "editor/import/scene_importer_mesh_node_3d.h" #include "scene/3d/mesh_instance_3d.h" diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index b589a6aaa0..e4d88850ea 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -120,13 +120,13 @@ void EditorSceneImporter::_bind_methods() { ///////////////////////////////// void EditorScenePostImport::_bind_methods() { - BIND_VMETHOD(MethodInfo(Variant::OBJECT, "post_import", PropertyInfo(Variant::OBJECT, "scene"))); + BIND_VMETHOD(MethodInfo(Variant::OBJECT, "_post_import", PropertyInfo(Variant::OBJECT, "scene"))); ClassDB::bind_method(D_METHOD("get_source_file"), &EditorScenePostImport::get_source_file); } Node *EditorScenePostImport::post_import(Node *p_scene) { if (get_script_instance()) { - return get_script_instance()->call("post_import", p_scene); + return get_script_instance()->call("_post_import", p_scene); } return p_scene; @@ -1508,7 +1508,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p if (!scene) { EditorNode::add_io_error( TTR("Error running post-import script:") + " " + post_import_script_path + "\n" + - TTR("Did you return a Node-derived object in the `post_import()` method?")); + TTR("Did you return a Node-derived object in the `_post_import()` method?")); return err; } } diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index 8cb84abce2..c6e5836a23 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -42,8 +42,8 @@ class Material; class AnimationPlayer; class EditorSceneImporterMesh; -class EditorSceneImporter : public Reference { - GDCLASS(EditorSceneImporter, Reference); +class EditorSceneImporter : public RefCounted { + GDCLASS(EditorSceneImporter, RefCounted); protected: static void _bind_methods(); @@ -69,8 +69,8 @@ public: EditorSceneImporter() {} }; -class EditorScenePostImport : public Reference { - GDCLASS(EditorScenePostImport, Reference); +class EditorScenePostImport : public RefCounted { + GDCLASS(EditorScenePostImport, RefCounted); String source_file; diff --git a/editor/import/resource_importer_shader_file.cpp b/editor/import/resource_importer_shader_file.cpp index f4d20a6296..70119bfd1c 100644 --- a/editor/import/resource_importer_shader_file.cpp +++ b/editor/import/resource_importer_shader_file.cpp @@ -30,9 +30,9 @@ #include "resource_importer_shader_file.h" +#include "core/io/file_access.h" #include "core/io/marshalls.h" #include "core/io/resource_saver.h" -#include "core/os/file_access.h" #include "editor/editor_node.h" #include "editor/plugins/shader_file_editor_plugin.h" #include "servers/rendering/rendering_device_binds.h" diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 74b30f4e3e..809f47bad9 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -218,14 +218,21 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options, 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) { switch (p_compress_mode) { case COMPRESS_LOSSLESS: { - f->store_32(StreamTexture2D::DATA_FORMAT_LOSSLESS); + bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/textures/lossless_compression/force_png"); + bool use_webp = !lossless_force_png && p_image->get_width() <= 16383 && p_image->get_height() <= 16383; // WebP has a size limit + f->store_32(use_webp ? StreamTexture2D::DATA_FORMAT_WEBP : StreamTexture2D::DATA_FORMAT_PNG); f->store_16(p_image->get_width()); f->store_16(p_image->get_height()); f->store_32(p_image->get_mipmap_count()); f->store_32(p_image->get_format()); for (int i = 0; i < p_image->get_mipmap_count() + 1; i++) { - Vector<uint8_t> data = Image::lossless_packer(p_image->get_image_from_mipmap(i)); + Vector<uint8_t> data; + if (use_webp) { + data = Image::webp_lossless_packer(p_image->get_image_from_mipmap(i)); + } else { + data = Image::png_packer(p_image->get_image_from_mipmap(i)); + } int data_len = data.size(); f->store_32(data_len); @@ -235,14 +242,14 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image } break; case COMPRESS_LOSSY: { - f->store_32(StreamTexture2D::DATA_FORMAT_LOSSY); + f->store_32(StreamTexture2D::DATA_FORMAT_WEBP); f->store_16(p_image->get_width()); f->store_16(p_image->get_height()); f->store_32(p_image->get_mipmap_count()); f->store_32(p_image->get_format()); for (int i = 0; i < p_image->get_mipmap_count() + 1; i++) { - Vector<uint8_t> data = Image::lossy_packer(p_image->get_image_from_mipmap(i), p_lossy_quality); + Vector<uint8_t> data = Image::webp_lossy_packer(p_image->get_image_from_mipmap(i), p_lossy_quality); int data_len = data.size(); f->store_32(data_len); diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h index 0d551a965c..41220009cd 100644 --- a/editor/import/resource_importer_texture.h +++ b/editor/import/resource_importer_texture.h @@ -31,9 +31,9 @@ #ifndef RESOURCEIMPORTTEXTURE_H #define RESOURCEIMPORTTEXTURE_H +#include "core/io/file_access.h" #include "core/io/image.h" #include "core/io/resource_importer.h" -#include "core/os/file_access.h" #include "scene/resources/texture.h" #include "servers/rendering_server.h" diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp index 4c3ae59951..d5d1a14be3 100644 --- a/editor/import/resource_importer_texture_atlas.cpp +++ b/editor/import/resource_importer_texture_atlas.cpp @@ -31,10 +31,10 @@ #include "resource_importer_texture_atlas.h" #include "atlas_import_failed.xpm" +#include "core/io/file_access.h" #include "core/io/image_loader.h" #include "core/io/resource_saver.h" #include "core/math/geometry_2d.h" -#include "core/os/file_access.h" #include "editor/editor_atlas_packer.h" #include "scene/resources/mesh.h" #include "scene/resources/texture.h" diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index bcc55b330b..e615212569 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -30,9 +30,9 @@ #include "resource_importer_wav.h" +#include "core/io/file_access.h" #include "core/io/marshalls.h" #include "core/io/resource_saver.h" -#include "core/os/file_access.h" #include "scene/resources/audio_stream_sample.h" const float TRIM_DB_LIMIT = -50; diff --git a/editor/multi_node_edit.h b/editor/multi_node_edit.h index 0544eb2d50..2efecb9f65 100644 --- a/editor/multi_node_edit.h +++ b/editor/multi_node_edit.h @@ -33,8 +33,8 @@ #include "scene/main/node.h" -class MultiNodeEdit : public Reference { - GDCLASS(MultiNodeEdit, Reference); +class MultiNodeEdit : public RefCounted { + GDCLASS(MultiNodeEdit, RefCounted); List<NodePath> nodes; struct PLData { diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index 9323c31fae..5c69a1e975 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -104,8 +104,8 @@ void EditorNode3DGizmo::clear() { } void EditorNode3DGizmo::redraw() { - if (get_script_instance() && get_script_instance()->has_method("redraw")) { - get_script_instance()->call("redraw"); + if (get_script_instance() && get_script_instance()->has_method("_redraw")) { + get_script_instance()->call("_redraw"); return; } @@ -114,8 +114,8 @@ void EditorNode3DGizmo::redraw() { } String EditorNode3DGizmo::get_handle_name(int p_idx) const { - if (get_script_instance() && get_script_instance()->has_method("get_handle_name")) { - return get_script_instance()->call("get_handle_name", p_idx); + if (get_script_instance() && get_script_instance()->has_method("_get_handle_name")) { + return get_script_instance()->call("_get_handle_name", p_idx); } ERR_FAIL_COND_V(!gizmo_plugin, ""); @@ -123,8 +123,8 @@ String EditorNode3DGizmo::get_handle_name(int p_idx) const { } bool EditorNode3DGizmo::is_handle_highlighted(int p_idx) const { - if (get_script_instance() && get_script_instance()->has_method("is_handle_highlighted")) { - return get_script_instance()->call("is_handle_highlighted", p_idx); + if (get_script_instance() && get_script_instance()->has_method("_is_handle_highlighted")) { + return get_script_instance()->call("_is_handle_highlighted", p_idx); } ERR_FAIL_COND_V(!gizmo_plugin, false); @@ -132,8 +132,8 @@ bool EditorNode3DGizmo::is_handle_highlighted(int p_idx) const { } Variant EditorNode3DGizmo::get_handle_value(int p_idx) { - if (get_script_instance() && get_script_instance()->has_method("get_handle_value")) { - return get_script_instance()->call("get_handle_value", p_idx); + if (get_script_instance() && get_script_instance()->has_method("_get_handle_value")) { + return get_script_instance()->call("_get_handle_value", p_idx); } ERR_FAIL_COND_V(!gizmo_plugin, Variant()); @@ -141,8 +141,8 @@ Variant EditorNode3DGizmo::get_handle_value(int p_idx) { } void EditorNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point) { - if (get_script_instance() && get_script_instance()->has_method("set_handle")) { - get_script_instance()->call("set_handle", p_idx, p_camera, p_point); + if (get_script_instance() && get_script_instance()->has_method("_set_handle")) { + get_script_instance()->call("_set_handle", p_idx, p_camera, p_point); return; } @@ -151,8 +151,8 @@ void EditorNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 & } void EditorNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) { - if (get_script_instance() && get_script_instance()->has_method("commit_handle")) { - get_script_instance()->call("commit_handle", p_idx, p_restore, p_cancel); + if (get_script_instance() && get_script_instance()->has_method("_commit_handle")) { + get_script_instance()->call("_commit_handle", p_idx, p_restore, p_cancel); return; } @@ -739,16 +739,16 @@ void EditorNode3DGizmo::_bind_methods() { ClassDB::bind_method(D_METHOD("clear"), &EditorNode3DGizmo::clear); ClassDB::bind_method(D_METHOD("set_hidden", "hidden"), &EditorNode3DGizmo::set_hidden); - BIND_VMETHOD(MethodInfo("redraw")); - BIND_VMETHOD(MethodInfo(Variant::STRING, "get_handle_name", PropertyInfo(Variant::INT, "index"))); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "is_handle_highlighted", PropertyInfo(Variant::INT, "index"))); + BIND_VMETHOD(MethodInfo("_redraw")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_handle_name", PropertyInfo(Variant::INT, "index"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_is_handle_highlighted", PropertyInfo(Variant::INT, "index"))); - MethodInfo hvget(Variant::NIL, "get_handle_value", PropertyInfo(Variant::INT, "index")); + MethodInfo hvget(Variant::NIL, "_get_handle_value", PropertyInfo(Variant::INT, "index")); hvget.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; BIND_VMETHOD(hvget); - BIND_VMETHOD(MethodInfo("set_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::VECTOR2, "point"))); - MethodInfo cm = MethodInfo("commit_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel")); + BIND_VMETHOD(MethodInfo("_set_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::VECTOR2, "point"))); + MethodInfo cm = MethodInfo("_commit_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel")); cm.default_arguments.push_back(false); BIND_VMETHOD(cm); } diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 7dda61f0bf..f55d77d782 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -30,7 +30,7 @@ #include "plugin_config_dialog.h" #include "core/io/config_file.h" -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "editor/editor_scale.h" diff --git a/editor/plugins/collision_polygon_3d_editor_plugin.cpp b/editor/plugins/collision_polygon_3d_editor_plugin.cpp index 6e71133c4f..a0df7e289e 100644 --- a/editor/plugins/collision_polygon_3d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_3d_editor_plugin.cpp @@ -32,8 +32,8 @@ #include "canvas_item_editor_plugin.h" #include "core/input/input.h" +#include "core/io/file_access.h" #include "core/math/geometry_2d.h" -#include "core/os/file_access.h" #include "core/os/keyboard.h" #include "editor/editor_settings.h" #include "node_3d_editor_plugin.h" diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 6ab15f763f..46c35291ac 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -3551,8 +3551,8 @@ Dictionary Node3DEditorViewport::get_state() const { void Node3DEditorViewport::_bind_methods() { ClassDB::bind_method(D_METHOD("update_transform_gizmo_view"), &Node3DEditorViewport::update_transform_gizmo_view); // Used by call_deferred. - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &Node3DEditorViewport::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &Node3DEditorViewport::drop_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &Node3DEditorViewport::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &Node3DEditorViewport::drop_data_fw); ADD_SIGNAL(MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport"))); ADD_SIGNAL(MethodInfo("clicked", PropertyInfo(Variant::OBJECT, "viewport"))); @@ -5056,11 +5056,11 @@ void Node3DEditor::_update_camera_override_button(bool p_game_running) { if (p_game_running) { button->set_disabled(false); - button->set_tooltip(TTR("Game Camera Override\nNo game instance running.")); + button->set_tooltip(TTR("Project Camera Override\nOverrides the running project's camera with the editor viewport camera.")); } else { button->set_disabled(true); button->set_pressed(false); - button->set_tooltip(TTR("Game Camera Override\nOverrides game camera with editor viewport camera.")); + button->set_tooltip(TTR("Project Camera Override\nNo project instance running. Run the project from the editor to use this feature.")); } } @@ -7475,15 +7475,15 @@ Ref<StandardMaterial3D> EditorNode3DGizmoPlugin::get_material(const String &p_na } String EditorNode3DGizmoPlugin::get_gizmo_name() const { - if (get_script_instance() && get_script_instance()->has_method("get_gizmo_name")) { - return get_script_instance()->call("get_gizmo_name"); + if (get_script_instance() && get_script_instance()->has_method("_get_gizmo_name")) { + return get_script_instance()->call("_get_gizmo_name"); } return TTR("Nameless gizmo"); } int EditorNode3DGizmoPlugin::get_priority() const { - if (get_script_instance() && get_script_instance()->has_method("get_priority")) { - return get_script_instance()->call("get_priority"); + if (get_script_instance() && get_script_instance()->has_method("_get_priority")) { + return get_script_instance()->call("_get_priority"); } return 0; } @@ -7510,8 +7510,8 @@ Ref<EditorNode3DGizmo> EditorNode3DGizmoPlugin::get_gizmo(Node3D *p_spatial) { void EditorNode3DGizmoPlugin::_bind_methods() { #define GIZMO_REF PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "EditorNode3DGizmo") - BIND_VMETHOD(MethodInfo(Variant::BOOL, "has_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Node3D"))); - BIND_VMETHOD(MethodInfo(GIZMO_REF, "create_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Node3D"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_has_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Node3D"))); + BIND_VMETHOD(MethodInfo(GIZMO_REF, "_create_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Node3D"))); ClassDB::bind_method(D_METHOD("create_material", "name", "color", "billboard", "on_top", "use_vertex_color"), &EditorNode3DGizmoPlugin::create_material, DEFVAL(false), DEFVAL(false), DEFVAL(false)); ClassDB::bind_method(D_METHOD("create_icon_material", "name", "texture", "on_top", "color"), &EditorNode3DGizmoPlugin::create_icon_material, DEFVAL(false), DEFVAL(Color(1, 1, 1, 1))); @@ -7520,38 +7520,38 @@ void EditorNode3DGizmoPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("get_material", "name", "gizmo"), &EditorNode3DGizmoPlugin::get_material, DEFVAL(Ref<EditorNode3DGizmo>())); - BIND_VMETHOD(MethodInfo(Variant::STRING, "get_gizmo_name")); - BIND_VMETHOD(MethodInfo(Variant::INT, "get_priority")); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "can_be_hidden")); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "is_selectable_when_hidden")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_gizmo_name")); + BIND_VMETHOD(MethodInfo(Variant::INT, "_get_priority")); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_can_be_hidden")); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_is_selectable_when_hidden")); - BIND_VMETHOD(MethodInfo("redraw", GIZMO_REF)); - BIND_VMETHOD(MethodInfo(Variant::STRING, "get_handle_name", GIZMO_REF, PropertyInfo(Variant::INT, "index"))); + BIND_VMETHOD(MethodInfo("_redraw", GIZMO_REF)); + BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_handle_name", GIZMO_REF, PropertyInfo(Variant::INT, "index"))); - MethodInfo hvget(Variant::NIL, "get_handle_value", GIZMO_REF, PropertyInfo(Variant::INT, "index")); + MethodInfo hvget(Variant::NIL, "_get_handle_value", GIZMO_REF, PropertyInfo(Variant::INT, "index")); hvget.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; BIND_VMETHOD(hvget); - BIND_VMETHOD(MethodInfo("set_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::VECTOR2, "point"))); - MethodInfo cm = MethodInfo("commit_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel")); + BIND_VMETHOD(MethodInfo("_set_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::VECTOR2, "point"))); + MethodInfo cm = MethodInfo("_commit_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel")); cm.default_arguments.push_back(false); BIND_VMETHOD(cm); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "is_handle_highlighted", GIZMO_REF, PropertyInfo(Variant::INT, "index"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_is_handle_highlighted", GIZMO_REF, PropertyInfo(Variant::INT, "index"))); #undef GIZMO_REF } bool EditorNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { - if (get_script_instance() && get_script_instance()->has_method("has_gizmo")) { - return get_script_instance()->call("has_gizmo", p_spatial); + if (get_script_instance() && get_script_instance()->has_method("_has_gizmo")) { + return get_script_instance()->call("_has_gizmo", p_spatial); } return false; } Ref<EditorNode3DGizmo> EditorNode3DGizmoPlugin::create_gizmo(Node3D *p_spatial) { - if (get_script_instance() && get_script_instance()->has_method("create_gizmo")) { - return get_script_instance()->call("create_gizmo", p_spatial); + if (get_script_instance() && get_script_instance()->has_method("_create_gizmo")) { + return get_script_instance()->call("_create_gizmo", p_spatial); } Ref<EditorNode3DGizmo> ref; @@ -7562,55 +7562,55 @@ Ref<EditorNode3DGizmo> EditorNode3DGizmoPlugin::create_gizmo(Node3D *p_spatial) } bool EditorNode3DGizmoPlugin::can_be_hidden() const { - if (get_script_instance() && get_script_instance()->has_method("can_be_hidden")) { - return get_script_instance()->call("can_be_hidden"); + if (get_script_instance() && get_script_instance()->has_method("_can_be_hidden")) { + return get_script_instance()->call("_can_be_hidden"); } return true; } bool EditorNode3DGizmoPlugin::is_selectable_when_hidden() const { - if (get_script_instance() && get_script_instance()->has_method("is_selectable_when_hidden")) { - return get_script_instance()->call("is_selectable_when_hidden"); + if (get_script_instance() && get_script_instance()->has_method("_is_selectable_when_hidden")) { + return get_script_instance()->call("_is_selectable_when_hidden"); } return false; } void EditorNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - if (get_script_instance() && get_script_instance()->has_method("redraw")) { + if (get_script_instance() && get_script_instance()->has_method("_redraw")) { Ref<EditorNode3DGizmo> ref(p_gizmo); - get_script_instance()->call("redraw", ref); + get_script_instance()->call("_redraw", ref); } } String EditorNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { - if (get_script_instance() && get_script_instance()->has_method("get_handle_name")) { - return get_script_instance()->call("get_handle_name", p_gizmo, p_idx); + if (get_script_instance() && get_script_instance()->has_method("_get_handle_name")) { + return get_script_instance()->call("_get_handle_name", p_gizmo, p_idx); } return ""; } Variant EditorNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { - if (get_script_instance() && get_script_instance()->has_method("get_handle_value")) { - return get_script_instance()->call("get_handle_value", p_gizmo, p_idx); + if (get_script_instance() && get_script_instance()->has_method("_get_handle_value")) { + return get_script_instance()->call("_get_handle_value", p_gizmo, p_idx); } return Variant(); } void EditorNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { - if (get_script_instance() && get_script_instance()->has_method("set_handle")) { - get_script_instance()->call("set_handle", p_gizmo, p_idx, p_camera, p_point); + if (get_script_instance() && get_script_instance()->has_method("_set_handle")) { + get_script_instance()->call("_set_handle", p_gizmo, p_idx, p_camera, p_point); } } void EditorNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { - if (get_script_instance() && get_script_instance()->has_method("commit_handle")) { - get_script_instance()->call("commit_handle", p_gizmo, p_idx, p_restore, p_cancel); + if (get_script_instance() && get_script_instance()->has_method("_commit_handle")) { + get_script_instance()->call("_commit_handle", p_gizmo, p_idx, p_restore, p_cancel); } } bool EditorNode3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_idx) const { - if (get_script_instance() && get_script_instance()->has_method("is_handle_highlighted")) { - return get_script_instance()->call("is_handle_highlighted", p_gizmo, p_idx); + if (get_script_instance() && get_script_instance()->has_method("_is_handle_highlighted")) { + return get_script_instance()->call("_is_handle_highlighted", p_gizmo, p_idx); } return false; } diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 208abeb87f..838e67b5e7 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -31,7 +31,7 @@ #include "path_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" -#include "core/os/file_access.h" +#include "core/io/file_access.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index d2ea7a10dc..8a14db0cfd 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -32,8 +32,8 @@ #include "canvas_item_editor_plugin.h" #include "core/input/input.h" +#include "core/io/file_access.h" #include "core/math/geometry_2d.h" -#include "core/os/file_access.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index b4b8e82124..b8b2c6d343 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -339,9 +339,9 @@ void ResourcePreloaderEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_library"), &ResourcePreloaderEditor::_update_library); ClassDB::bind_method(D_METHOD("_remove_resource", "to_remove"), &ResourcePreloaderEditor::_remove_resource); - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &ResourcePreloaderEditor::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &ResourcePreloaderEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &ResourcePreloaderEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw"), &ResourcePreloaderEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &ResourcePreloaderEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &ResourcePreloaderEditor::drop_data_fw); } ResourcePreloaderEditor::ResourcePreloaderEditor() { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index d66217ec2d..0410ab3a45 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -32,8 +32,8 @@ #include "core/config/project_settings.h" #include "core/input/input.h" +#include "core/io/file_access.h" #include "core/io/resource_loader.h" -#include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" #include "editor/debugger/editor_debugger_node.h" @@ -230,7 +230,7 @@ void ScriptEditorBase::_bind_methods() { ADD_SIGNAL(MethodInfo("search_in_files_requested", PropertyInfo(Variant::STRING, "text"))); ADD_SIGNAL(MethodInfo("replace_in_files_requested", PropertyInfo(Variant::STRING, "text"))); - BIND_VMETHOD(MethodInfo("add_syntax_highlighter", PropertyInfo(Variant::OBJECT, "highlighter"))); + BIND_VMETHOD(MethodInfo("_add_syntax_highlighter", PropertyInfo(Variant::OBJECT, "highlighter"))); } static bool _is_built_in_script(Script *p_script) { @@ -3276,9 +3276,9 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("register_syntax_highlighter", "syntax_highlighter"), &ScriptEditor::register_syntax_highlighter); ClassDB::bind_method(D_METHOD("unregister_syntax_highlighter", "syntax_highlighter"), &ScriptEditor::unregister_syntax_highlighter); - ClassDB::bind_method(D_METHOD("get_drag_data_fw", "point", "from"), &ScriptEditor::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw", "point", "data", "from"), &ScriptEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw", "point", "data", "from"), &ScriptEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw", "point", "from"), &ScriptEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw", "point", "data", "from"), &ScriptEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw", "point", "data", "from"), &ScriptEditor::drop_data_fw); ClassDB::bind_method(D_METHOD("goto_line", "line_number"), &ScriptEditor::_goto_script_line2); ClassDB::bind_method(D_METHOD("get_current_script"), &ScriptEditor::_get_current_script); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 8fa6b66eda..1f6da30547 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1343,9 +1343,9 @@ void ScriptTextEditor::_notification(int p_what) { void ScriptTextEditor::_bind_methods() { ClassDB::bind_method("_update_connected_methods", &ScriptTextEditor::_update_connected_methods); - ClassDB::bind_method("get_drag_data_fw", &ScriptTextEditor::get_drag_data_fw); - ClassDB::bind_method("can_drop_data_fw", &ScriptTextEditor::can_drop_data_fw); - ClassDB::bind_method("drop_data_fw", &ScriptTextEditor::drop_data_fw); + ClassDB::bind_method("_get_drag_data_fw", &ScriptTextEditor::get_drag_data_fw); + ClassDB::bind_method("_can_drop_data_fw", &ScriptTextEditor::can_drop_data_fw); + ClassDB::bind_method("_drop_data_fw", &ScriptTextEditor::drop_data_fw); ClassDB::bind_method(D_METHOD("add_syntax_highlighter", "highlighter"), &ScriptTextEditor::add_syntax_highlighter); } diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index 6dc98503ca..a97584ebce 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -666,9 +666,9 @@ void Skeleton3DEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_properties"), &Skeleton3DEditor::_update_properties); ClassDB::bind_method(D_METHOD("_on_click_option"), &Skeleton3DEditor::_on_click_option); - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &Skeleton3DEditor::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &Skeleton3DEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &Skeleton3DEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw"), &Skeleton3DEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &Skeleton3DEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &Skeleton3DEditor::drop_data_fw); ClassDB::bind_method(D_METHOD("move_skeleton_bone"), &Skeleton3DEditor::move_skeleton_bone); } diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 59bc8f9e55..a5a3d624ec 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -964,9 +964,9 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da void SpriteFramesEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_library", "skipsel"), &SpriteFramesEditor::_update_library, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &SpriteFramesEditor::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SpriteFramesEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &SpriteFramesEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw"), &SpriteFramesEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &SpriteFramesEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &SpriteFramesEditor::drop_data_fw); } SpriteFramesEditor::SpriteFramesEditor() { diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index f1c73f99dc..7d38a8cb98 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "theme_editor_plugin.h" -#include "core/os/file_access.h" +#include "core/io/file_access.h" #include "core/os/keyboard.h" #include "core/version.h" #include "editor/editor_scale.h" diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index 6078c986cb..11842981f3 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -436,8 +436,8 @@ void TileSetEditor::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p } void TileSetEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &TileSetEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &TileSetEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &TileSetEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &TileSetEditor::drop_data_fw); } TileDataEditor *TileSetEditor::get_tile_data_editor(String p_property) { diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 2bb9e64262..9217f2ac4c 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -72,13 +72,13 @@ const int MAX_FLOAT_CONST_DEFS = sizeof(float_constant_defs) / sizeof(FloatConst Control *VisualShaderNodePlugin::create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node) { if (get_script_instance()) { - return get_script_instance()->call("create_editor", p_parent_resource, p_node); + return get_script_instance()->call("_create_editor", p_parent_resource, p_node); } return nullptr; } void VisualShaderNodePlugin::_bind_methods() { - BIND_VMETHOD(MethodInfo(Variant::OBJECT, "create_editor", PropertyInfo(Variant::OBJECT, "parent_resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), PropertyInfo(Variant::OBJECT, "for_node", PROPERTY_HINT_RESOURCE_TYPE, "VisualShaderNode"))); + BIND_VMETHOD(MethodInfo(Variant::OBJECT, "_create_editor", PropertyInfo(Variant::OBJECT, "parent_resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource"), PropertyInfo(Variant::OBJECT, "for_node", PROPERTY_HINT_RESOURCE_TYPE, "VisualShaderNode"))); } /////////////////// @@ -3694,9 +3694,9 @@ void VisualShaderEditor::_bind_methods() { ClassDB::bind_method("_update_uniform", &VisualShaderEditor::_update_uniform); ClassDB::bind_method("_expand_output_port", &VisualShaderEditor::_expand_output_port); - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &VisualShaderEditor::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &VisualShaderEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &VisualShaderEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw"), &VisualShaderEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &VisualShaderEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &VisualShaderEditor::drop_data_fw); ClassDB::bind_method("_is_available", &VisualShaderEditor::_is_available); } diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index ad57850e9d..fa98c6b780 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -41,8 +41,8 @@ #include "scene/gui/tree.h" #include "scene/resources/visual_shader.h" -class VisualShaderNodePlugin : public Reference { - GDCLASS(VisualShaderNodePlugin, Reference); +class VisualShaderNodePlugin : public RefCounted { + GDCLASS(VisualShaderNodePlugin, RefCounted); protected: static void _bind_methods(); @@ -51,8 +51,8 @@ public: virtual Control *create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node); }; -class VisualShaderGraphPlugin : public Reference { - GDCLASS(VisualShaderGraphPlugin, Reference); +class VisualShaderGraphPlugin : public RefCounted { + GDCLASS(VisualShaderGraphPlugin, RefCounted); private: struct InputPort { diff --git a/editor/pot_generator.h b/editor/pot_generator.h index ab055e0c0e..61300064ba 100644 --- a/editor/pot_generator.h +++ b/editor/pot_generator.h @@ -31,7 +31,7 @@ #ifndef POT_GENERATOR_H #define POT_GENERATOR_H -#include "core/os/file_access.h" +#include "core/io/file_access.h" #include "core/templates/ordered_hash_map.h" #include "core/templates/set.h" diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 9b99372735..7ca2d4d324 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -31,11 +31,11 @@ #include "project_export.h" #include "core/config/project_settings.h" +#include "core/io/dir_access.h" +#include "core/io/file_access.h" #include "core/io/image_loader.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/os/dir_access.h" -#include "core/os/file_access.h" #include "core/os/os.h" #include "core/string/optimized_translation.h" #include "editor_data.h" @@ -978,9 +978,9 @@ void ProjectExportDialog::_export_all(bool p_debug) { } void ProjectExportDialog::_bind_methods() { - ClassDB::bind_method("get_drag_data_fw", &ProjectExportDialog::get_drag_data_fw); - ClassDB::bind_method("can_drop_data_fw", &ProjectExportDialog::can_drop_data_fw); - ClassDB::bind_method("drop_data_fw", &ProjectExportDialog::drop_data_fw); + ClassDB::bind_method("_get_drag_data_fw", &ProjectExportDialog::get_drag_data_fw); + ClassDB::bind_method("_can_drop_data_fw", &ProjectExportDialog::can_drop_data_fw); + ClassDB::bind_method("_drop_data_fw", &ProjectExportDialog::drop_data_fw); ClassDB::bind_method("_export_all", &ProjectExportDialog::_export_all); ClassDB::bind_method("set_export_path", &ProjectExportDialog::set_export_path); ClassDB::bind_method("get_export_path", &ProjectExportDialog::get_export_path); diff --git a/editor/project_export.h b/editor/project_export.h index cfd4934c34..aeace708b8 100644 --- a/editor/project_export.h +++ b/editor/project_export.h @@ -31,7 +31,7 @@ #ifndef PROJECT_EXPORT_SETTINGS_H #define PROJECT_EXPORT_SETTINGS_H -#include "core/os/dir_access.h" +#include "core/io/dir_access.h" #include "core/os/thread.h" #include "editor/editor_export.h" #include "editor/editor_file_dialog.h" diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 1b596ce599..12490f687e 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -31,11 +31,11 @@ #include "project_manager.h" #include "core/io/config_file.h" +#include "core/io/dir_access.h" +#include "core/io/file_access.h" #include "core/io/resource_saver.h" #include "core/io/stream_peer_ssl.h" #include "core/io/zip_io.h" -#include "core/os/dir_access.h" -#include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/string/translation.h" diff --git a/editor/property_editor.h b/editor/property_editor.h index c6929f3b42..8a587b50b0 100644 --- a/editor/property_editor.h +++ b/editor/property_editor.h @@ -50,8 +50,8 @@ class PropertyValueEvaluator; class CreateDialog; class PropertySelector; -class EditorResourceConversionPlugin : public Reference { - GDCLASS(EditorResourceConversionPlugin, Reference); +class EditorResourceConversionPlugin : public RefCounted { + GDCLASS(EditorResourceConversionPlugin, RefCounted); protected: static void _bind_methods(); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 6f9b0ae873..a5620f8cc5 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -1129,9 +1129,9 @@ void SceneTreeEditor::_bind_methods() { ClassDB::bind_method("_rename_node", &SceneTreeEditor::_rename_node); ClassDB::bind_method("_test_update_tree", &SceneTreeEditor::_test_update_tree); - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("_drop_data_fw"), &SceneTreeEditor::drop_data_fw); ClassDB::bind_method(D_METHOD("update_tree"), &SceneTreeEditor::update_tree); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index c2bfdaae96..650decfd49 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -31,9 +31,9 @@ #include "script_create_dialog.h" #include "core/config/project_settings.h" +#include "core/io/file_access.h" #include "core/io/resource_saver.h" #include "core/object/script_language.h" -#include "core/os/file_access.h" #include "core/string/string_builder.h" #include "editor/create_dialog.h" #include "editor/editor_node.h" |