diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_autoload_settings.cpp | 2 | ||||
-rw-r--r-- | editor/editor_data.cpp | 4 | ||||
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/animation_blend_tree_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/version_control_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/property_editor.cpp | 26 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 4 | ||||
-rw-r--r-- | editor/scene_tree_editor.cpp | 5 | ||||
-rw-r--r-- | editor/script_create_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 2 |
13 files changed, 28 insertions, 31 deletions
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index dba8c2ec8c..549b15d6f9 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -361,7 +361,7 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) { ERR_FAIL_COND_V_MSG(obj == NULL, NULL, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + "."); n = Object::cast_to<Node>(obj); - n->set_script(s.get_ref_ptr()); + n->set_script(s); } ERR_FAIL_COND_V_MSG(!n, NULL, "Path in autoload not a node or script: " + p_path + "."); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 5cb7720170..1468b8fc35 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -506,7 +506,7 @@ Object *EditorData::instance_custom_type(const String &p_type, const String &p_i if (ob->is_class("Node")) { ob->call("set_name", p_type); } - ob->set_script(script.get_ref_ptr()); + ob->set_script(script); return ob; } } @@ -907,7 +907,7 @@ Object *EditorData::script_class_instance(const String &p_class) { if (obj) { Ref<Script> script = script_class_load_script(p_class); if (script.is_valid()) - obj->set_script(script.get_ref_ptr()); + obj->set_script(script); return obj; } } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 56581d671a..24656410e8 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3107,7 +3107,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled, } EditorPlugin *ep = memnew(EditorPlugin); - ep->set_script(script.get_ref_ptr()); + ep->set_script(script); plugin_addons[p_addon] = ep; add_editor_plugin(ep, p_config_changed); diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 2c2b05d6fc..4b0bfa7222 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1473,7 +1473,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p } else { post_import_script = Ref<EditorScenePostImport>(memnew(EditorScenePostImport)); - post_import_script->set_script(scr.get_ref_ptr()); + post_import_script->set_script(scr); if (!post_import_script->get_script_instance()) { EditorNode::add_io_error(TTR("Invalid/broken script for post-import (check console):") + " " + post_import_script_path); post_import_script.unref(); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 2de224c043..a100525d10 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -312,7 +312,7 @@ void AnimationNodeBlendTreeEditor::_add_node(int p_idx) { AnimationNode *an = Object::cast_to<AnimationNode>(ClassDB::instance(base_type)); ERR_FAIL_COND(!an); anode = Ref<AnimationNode>(an); - anode->set_script(add_options[p_idx].script.get_ref_ptr()); + anode->set_script(add_options[p_idx].script); base_name = add_options[p_idx].name; } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index b8c1ba2e96..76312df20a 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1257,7 +1257,7 @@ void ScriptEditor::_menu_option(int p_option) { } Ref<EditorScript> es = memnew(EditorScript); - es->set_script(scr.get_ref_ptr()); + es->set_script(scr); es->set_editor(EditorNode::get_singleton()); es->_run(); diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 3622ca8d61..e17e6a9d16 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -124,7 +124,7 @@ void VersionControlEditorPlugin::_initialize_vcs() { ERR_FAIL_COND_MSG(!addon_script_instance, "Failed to create addon script instance."); // The addon is attached as a script to the VCS interface as a proxy end-point - vcs_interface->set_script_and_instance(script.get_ref_ptr(), addon_script_instance); + vcs_interface->set_script_and_instance(script, addon_script_instance); EditorVCSInterface::set_singleton(vcs_interface); EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_refresh_stage_area"); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index d9bccc35f4..ecc140d7d2 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -216,7 +216,7 @@ void VisualShaderEditor::update_custom_nodes() { Ref<VisualShaderNodeCustom> ref; ref.instance(); - ref->set_script(script.get_ref_ptr()); + ref->set_script(script); String name; if (ref->has_method("_get_name")) { @@ -1415,7 +1415,7 @@ VisualShaderNode *VisualShaderEditor::_add_node(int p_idx, int p_op_idx) { VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instance(base_type)); ERR_FAIL_COND_V(!vsn, NULL); vsnode = Ref<VisualShaderNode>(vsn); - vsnode->set_script(add_options[p_idx].script.get_ref_ptr()); + vsnode->set_script(add_options[p_idx].script); } Point2 position = graph->get_scroll_ofs(); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 1691ce3a63..e6128f255d 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -176,9 +176,9 @@ void CustomPropertyEditor::_menu_option(int p_which) { case OBJ_MENU_EDIT: { - RefPtr RefPtr = v; + REF r = v; - if (!RefPtr.is_null()) { + if (!r.is_null()) { emit_signal("resource_edit_request"); hide(); @@ -193,8 +193,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { case OBJ_MENU_MAKE_UNIQUE: { - RefPtr RefPtr = v; - Ref<Resource> res_orig = RefPtr; + Ref<Resource> res_orig = v; if (res_orig.is_null()) return; @@ -229,7 +228,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { res->set(p.first, p.second); } - v = res.get_ref_ptr(); + v = res; emit_signal("variant_changed"); hide(); } break; @@ -311,7 +310,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { res->call("set_instance_base_type", owner->get_class()); } - v = Ref<Resource>(res).get_ref_ptr(); + v = res; emit_signal("variant_changed"); } break; @@ -1103,7 +1102,7 @@ void CustomPropertyEditor::_file_selected(String p_file) { error->popup_centered_minsize(); break; } - v = res.get_ref_ptr(); + v = res; emit_signal("variant_changed"); hide(); } break; @@ -1168,7 +1167,7 @@ void CustomPropertyEditor::_type_create_selected(int p_idx) { Resource *res = Object::cast_to<Resource>(obj); ERR_FAIL_COND(!res); - v = Ref<Resource>(res).get_ref_ptr(); + v = res; emit_signal("variant_changed"); hide(); } @@ -1373,7 +1372,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { Resource *res = Object::cast_to<Resource>(obj); ERR_BREAK(!res); - v = Ref<Resource>(res).get_ref_ptr(); + v = res; emit_signal("variant_changed"); hide(); } @@ -1395,9 +1394,9 @@ void CustomPropertyEditor::_action_pressed(int p_which) { } else if (p_which == 2) { - RefPtr RefPtr = v; + RES r = v; - if (!RefPtr.is_null()) { + if (!r.is_null()) { emit_signal("resource_edit_request"); hide(); @@ -1410,8 +1409,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { hide(); } else if (p_which == 4) { - RefPtr RefPtr = v; - Ref<Resource> res_orig = RefPtr; + Ref<Resource> res_orig = v; if (res_orig.is_null()) return; @@ -1442,7 +1440,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { res->set(p.first, p.second); } - v = res.get_ref_ptr(); + v = res; emit_signal("variant_changed"); hide(); } diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 34d6d0580e..784791d40c 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -972,7 +972,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { new_node = Object::cast_to<Node>(ClassDB::instance(ScriptServer::get_global_class_native_base(name))); Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(name), "Script"); if (new_node && script.is_valid()) { - new_node->set_script(script.get_ref_ptr()); + new_node->set_script(script); new_node->set_name(name); } } else { @@ -1725,7 +1725,7 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) { for (List<Node *>::Element *E = selected.front(); E; E = E->next()) { Ref<Script> existing = E->get()->get_script(); - editor_data->get_undo_redo().add_do_method(E->get(), "set_script", p_script.get_ref_ptr()); + editor_data->get_undo_redo().add_do_method(E->get(), "set_script", p_script); editor_data->get_undo_redo().add_undo_method(E->get(), "set_script", existing); editor_data->get_undo_redo().add_do_method(this, "_update_script_button"); editor_data->get_undo_redo().add_undo_method(this, "_update_script_button"); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index a0b846beb0..0e8a9146e1 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -70,10 +70,9 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i emit_signal("open", n->get_filename()); } } else if (p_id == BUTTON_SCRIPT) { - RefPtr script = n->get_script(); - Ref<Script> script_typed = script; + Ref<Script> script_typed = n->get_script(); if (!script_typed.is_null()) - emit_signal("open_script", script); + emit_signal("open_script", script_typed); } else if (p_id == BUTTON_VISIBILITY) { undo_redo->create_action(TTR("Toggle Visible")); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 6327f30eb4..959bb67e12 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -332,7 +332,7 @@ void ScriptCreateDialog::_load_exist() { return; } - emit_signal("script_created", p_script.get_ref_ptr()); + emit_signal("script_created", p_script); hide(); } diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 2b28aa87a3..88d45d5dde 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -619,7 +619,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da if (pinfo.hint_string == "Script") { if (debugObj->get_script() != var) { - debugObj->set_script(RefPtr()); + debugObj->set_script(REF()); Ref<Script> script(var); if (!script.is_null()) { ScriptInstance *script_instance = script->placeholder_instance_create(debugObj); |