diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-03-09 14:27:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-09 14:27:43 +0100 |
commit | 0d728123c674a1ccbbf60707a65016f9c71c3731 (patch) | |
tree | 7087d16915b6a5b93b9dfb08b7764db8fbe9d9e1 /editor | |
parent | 9d36ce25e81c6d19e82e87a0468578b12b6b4be8 (diff) | |
parent | 25f9aee00565996eae4c1cd011c9573a7e37922c (diff) |
Merge pull request #26818 from vnen/class_name-inheritance
Allow class_name scripts to have nested inheritance
Diffstat (limited to 'editor')
-rw-r--r-- | editor/create_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/editor_data.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 2 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index f42154bd39..364c5126d7 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -204,7 +204,7 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p if (cpp_type) { String cpp_to_select_type = to_select_type; if (ScriptServer::is_global_class(to_select_type)) - cpp_to_select_type = ScriptServer::get_global_class_base(to_select_type); + cpp_to_select_type = ScriptServer::get_global_class_native_base(to_select_type); current_item_is_preferred = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(cpp_to_select_type, preferred_search_result_type); } else { current_item_is_preferred = ed.script_class_is_parent(p_type, preferred_search_result_type) && !ed.script_class_is_parent(to_select_type, preferred_search_result_type) && search_box->get_text() != to_select_type; diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index b87b80dafd..f61a831015 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -895,7 +895,7 @@ StringName EditorData::script_class_get_base(const String &p_class) const { Object *EditorData::script_class_instance(const String &p_class) { if (ScriptServer::is_global_class(p_class)) { - Object *obj = ClassDB::instance(ScriptServer::get_global_class_base(p_class)); + Object *obj = ClassDB::instance(ScriptServer::get_global_class_native_base(p_class)); if (obj) { RES script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class)); if (script.is_valid()) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f0c9e87b76..1e03adc219 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3354,7 +3354,7 @@ Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_f icon = ResourceLoader::load(icon_path); } if (!icon.is_valid()) { - icon = gui_base->get_icon(ScriptServer::get_global_class_base(p_class), "EditorIcons"); + icon = gui_base->get_icon(ScriptServer::get_global_class_native_base(p_class), "EditorIcons"); } return icon; } diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 4f32fc7ac4..d7faa44441 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2190,7 +2190,7 @@ void EditorPropertyResource::_menu_option(int p_which) { Object *obj = NULL; if (ScriptServer::is_global_class(intype)) { - obj = ClassDB::instance(ScriptServer::get_global_class_base(intype)); + obj = ClassDB::instance(ScriptServer::get_global_class_native_base(intype)); if (obj) { Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(intype)); if (script.is_valid()) { diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 084830ed7b..66163d7e0a 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -827,7 +827,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (TOOL_CREATE_FAVORITE == p_tool) { String name = selected_favorite_root.get_slicec(' ', 0); if (ScriptServer::is_global_class(name)) { - new_node = Object::cast_to<Node>(ClassDB::instance(ScriptServer::get_global_class_base(name))); + 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()); @@ -2294,7 +2294,7 @@ void SceneTreeDock::_update_create_root_dialog() { button->set_text(TTR(l)); String name = l.get_slicec(' ', 0); if (ScriptServer::is_global_class(name)) - name = ScriptServer::get_global_class_base(name); + name = ScriptServer::get_global_class_native_base(name); button->set_icon(EditorNode::get_singleton()->get_class_icon(name)); button->connect("pressed", this, "_favorite_root_selected", make_binds(l)); } |