summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/create_dialog.cpp4
-rw-r--r--editor/editor_file_system.cpp2
-rw-r--r--editor/editor_properties_array_dict.cpp179
-rw-r--r--editor/scene_tree_dock.cpp1
4 files changed, 99 insertions, 87 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index ff34618b04..eb11aea9cc 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -55,9 +55,9 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) {
while (!f->eof_reached()) {
String l = f->get_line().strip_edges();
+ String name = l.split(" ")[0];
- if (l != String()) {
-
+ if (ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) {
TreeItem *ti = recent->create_item(root);
ti->set_text(0, l);
ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 56358cf5b7..ee20d95f25 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -1378,7 +1378,6 @@ void EditorFileSystem::update_script_classes() {
ScriptServer::save_global_classes();
EditorNode::get_editor_data().script_class_save_icon_paths();
- emit_signal("script_classes_updated");
}
void EditorFileSystem::_queue_update_script_classes() {
@@ -1721,7 +1720,6 @@ void EditorFileSystem::_bind_methods() {
ADD_SIGNAL(MethodInfo("filesystem_changed"));
ADD_SIGNAL(MethodInfo("sources_changed", PropertyInfo(Variant::BOOL, "exist")));
ADD_SIGNAL(MethodInfo("resources_reimported", PropertyInfo(Variant::POOL_STRING_ARRAY, "resources")));
- ADD_SIGNAL(MethodInfo("script_classes_updated"));
}
void EditorFileSystem::_update_extensions() {
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 9982a31b7b..808a8ac2f8 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -336,16 +336,16 @@ void EditorPropertyArray::update_property() {
} break;
case Variant::INT: {
- EditorPropertyInteger *ed = memnew(EditorPropertyInteger);
- ed->setup(-100000, 100000, true, true);
- prop = ed;
+ EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
+ editor->setup(-100000, 100000, true, true);
+ prop = editor;
} break;
case Variant::REAL: {
- EditorPropertyFloat *ed = memnew(EditorPropertyFloat);
- ed->setup(-100000, 100000, 0.001, true, false, true, true);
- prop = ed;
+ EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
+ editor->setup(-100000, 100000, 0.001, true, false, true, true);
+ prop = editor;
} break;
case Variant::STRING: {
@@ -357,63 +357,63 @@ void EditorPropertyArray::update_property() {
case Variant::VECTOR2: {
- EditorPropertyVector2 *ed = memnew(EditorPropertyVector2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::RECT2: {
- EditorPropertyRect2 *ed = memnew(EditorPropertyRect2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::VECTOR3: {
- EditorPropertyVector3 *ed = memnew(EditorPropertyVector3);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM2D: {
- EditorPropertyTransform2D *ed = memnew(EditorPropertyTransform2D);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::PLANE: {
- EditorPropertyPlane *ed = memnew(EditorPropertyPlane);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::QUAT: {
- EditorPropertyQuat *ed = memnew(EditorPropertyQuat);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyQuat *editor = memnew(EditorPropertyQuat);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::AABB: {
- EditorPropertyAABB *ed = memnew(EditorPropertyAABB);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyAABB *editor = memnew(EditorPropertyAABB);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::BASIS: {
- EditorPropertyBasis *ed = memnew(EditorPropertyBasis);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyBasis *editor = memnew(EditorPropertyBasis);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM: {
- EditorPropertyTransform *ed = memnew(EditorPropertyTransform);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform *editor = memnew(EditorPropertyTransform);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
@@ -431,8 +431,9 @@ void EditorPropertyArray::update_property() {
} break;
case Variant::OBJECT: {
-
- prop = memnew(EditorPropertyResource);
+ EditorPropertyResource *editor = memnew(EditorPropertyResource);
+ editor->setup("Resource");
+ prop = editor;
} break;
case Variant::DICTIONARY: {
@@ -798,16 +799,16 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::INT: {
- EditorPropertyInteger *ed = memnew(EditorPropertyInteger);
- ed->setup(-100000, 100000, true, true);
- prop = ed;
+ EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
+ editor->setup(-100000, 100000, true, true);
+ prop = editor;
} break;
case Variant::REAL: {
- EditorPropertyFloat *ed = memnew(EditorPropertyFloat);
- ed->setup(-100000, 100000, 0.001, true, false, true, true);
- prop = ed;
+ EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
+ editor->setup(-100000, 100000, 0.001, true, false, true, true);
+ prop = editor;
} break;
case Variant::STRING: {
@@ -815,67 +816,66 @@ void EditorPropertyDictionary::update_property() {
} break;
- // math types
-
+ // math types
case Variant::VECTOR2: {
- EditorPropertyVector2 *ed = memnew(EditorPropertyVector2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::RECT2: {
- EditorPropertyRect2 *ed = memnew(EditorPropertyRect2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::VECTOR3: {
- EditorPropertyVector3 *ed = memnew(EditorPropertyVector3);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM2D: {
- EditorPropertyTransform2D *ed = memnew(EditorPropertyTransform2D);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::PLANE: {
- EditorPropertyPlane *ed = memnew(EditorPropertyPlane);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::QUAT: {
- EditorPropertyQuat *ed = memnew(EditorPropertyQuat);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyQuat *editor = memnew(EditorPropertyQuat);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::AABB: {
- EditorPropertyAABB *ed = memnew(EditorPropertyAABB);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyAABB *editor = memnew(EditorPropertyAABB);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::BASIS: {
- EditorPropertyBasis *ed = memnew(EditorPropertyBasis);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyBasis *editor = memnew(EditorPropertyBasis);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM: {
- EditorPropertyTransform *ed = memnew(EditorPropertyTransform);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform *editor = memnew(EditorPropertyTransform);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
@@ -893,8 +893,9 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::OBJECT: {
-
- prop = memnew(EditorPropertyResource);
+ EditorPropertyResource *editor = memnew(EditorPropertyResource);
+ editor->setup("Resource");
+ prop = editor;
} break;
case Variant::DICTIONARY: {
@@ -902,39 +903,53 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::ARRAY: {
-
- prop = memnew(EditorPropertyArray);
-
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::ARRAY);
+ prop = editor;
} break;
// arrays
case Variant::POOL_BYTE_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_BYTE_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_INT_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_INT_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_REAL_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_REAL_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_STRING_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_STRING_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_VECTOR2_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_VECTOR2_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_VECTOR3_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_VECTOR3_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_COLOR_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_COLOR_ARRAY);
+ prop = editor;
} break;
default: {}
}
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 8637417598..1f5cd7fe0b 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -2401,7 +2401,6 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
add_child(create_dialog);
create_dialog->connect("create", this, "_create");
create_dialog->connect("favorites_updated", this, "_update_create_root_dialog");
- EditorFileSystem::get_singleton()->connect("script_classes_updated", create_dialog, "_save_and_update_favorite_list");
rename_dialog = memnew(RenameDialog(scene_tree, &editor_data->get_undo_redo()));
add_child(rename_dialog);