summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp43
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp78
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h5
-rw-r--r--editor/plugins/particles_editor_plugin.cpp1
-rw-r--r--editor/plugins/skeleton_editor_plugin.cpp1
-rw-r--r--editor/project_export.cpp1
-rw-r--r--editor/script_editor_debugger.cpp2
7 files changed, 68 insertions, 63 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index d8cb12543f..dbbf5d08b8 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -3150,34 +3150,33 @@ Ref<Texture> EditorNode::get_object_icon(const Object *p_object, const String &p
script = p_object;
}
- StringName name;
- String icon_path;
if (script.is_valid()) {
- name = EditorNode::get_editor_data().script_class_get_name(script->get_path());
- icon_path = EditorNode::get_editor_data().script_class_get_icon_path(name);
- name = script->get_instance_base_type();
+ StringName name = EditorNode::get_editor_data().script_class_get_name(script->get_path());
+ String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(name);
+ if (icon_path.length())
+ return ResourceLoader::load(icon_path);
+
+ // should probably be deprecated in 4.x
+ StringName base = script->get_instance_base_type();
+ if (base != StringName()) {
+ const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types();
+ for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) {
+ const Vector<EditorData::CustomType> &ct = E->value();
+ for (int i = 0; i < ct.size(); ++i) {
+ if (ct[i].name == base && ct[i].icon.is_valid()) {
+ return ct[i].icon;
+ }
+ }
+ }
+ }
}
- if (gui_base->has_icon(p_object->get_class(), "EditorIcons"))
- return gui_base->get_icon(p_object->get_class(), "EditorIcons");
-
- if (icon_path.length())
- return ResourceLoader::load(icon_path);
-
+ // should probably be deprecated in 4.x
if (p_object->has_meta("_editor_icon"))
return p_object->get_meta("_editor_icon");
- if (name != StringName()) {
- const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types();
- for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) {
- const Vector<EditorData::CustomType> &ct = E->value();
- for (int i = 0; i < ct.size(); ++i) {
- if (ct[i].name == name && ct[i].icon.is_valid()) {
- return ct[i].icon;
- }
- }
- }
- }
+ if (gui_base->has_icon(p_object->get_class(), "EditorIcons"))
+ return gui_base->get_icon(p_object->get_class(), "EditorIcons");
if (p_fallback.length())
return gui_base->get_icon(p_fallback, "EditorIcons");
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index a0763e03f1..1add99bdcc 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -4504,6 +4504,46 @@ void CanvasItemEditor::focus_selection() {
CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
+ key_pos = true;
+ key_rot = true;
+ key_scale = false;
+
+ show_grid = false;
+ show_origin = true;
+ show_viewport = true;
+ show_helpers = false;
+ show_rulers = true;
+ show_guides = true;
+ show_edit_locks = true;
+ zoom = 1;
+ view_offset = Point2(-150 - RULER_WIDTH, -95 - RULER_WIDTH);
+ previous_update_view_offset = view_offset; // Moves the view a little bit to the left so that (0,0) is visible. The values a relative to a 16/10 screen
+ grid_offset = Point2();
+ grid_step = Point2(10, 10);
+ grid_step_multiplier = 0;
+ snap_rotation_offset = 0;
+ snap_rotation_step = 15 / (180 / Math_PI);
+ snap_active = false;
+ snap_node_parent = true;
+ snap_node_anchors = true;
+ snap_node_sides = true;
+ snap_node_center = true;
+ snap_other_nodes = true;
+ snap_grid = true;
+ snap_guides = true;
+ snap_rotation = false;
+ snap_pixel = false;
+
+ skeleton_show_bones = true;
+
+ drag_type = DRAG_NONE;
+ drag_from = Vector2();
+ drag_to = Vector2();
+ dragged_guide_pos = Point2();
+ dragged_guide_index = -1;
+
+ bone_last_frame = 0;
+
bone_list_dirty = false;
tool = TOOL_SELECT;
undo_redo = p_editor->get_undo_redo();
@@ -4826,49 +4866,11 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
multiply_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/multiply_grid_step", TTR("Multiply grid step by 2"), KEY_KP_MULTIPLY);
divide_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/divide_grid_step", TTR("Divide grid step by 2"), KEY_KP_DIVIDE);
- key_pos = true;
- key_rot = true;
- key_scale = false;
-
- show_grid = false;
- show_origin = true;
- show_viewport = true;
- show_helpers = false;
- show_rulers = true;
- show_guides = true;
- show_edit_locks = true;
- zoom = 1;
- view_offset = Point2(-150 - RULER_WIDTH, -95 - RULER_WIDTH);
- previous_update_view_offset = view_offset; // Moves the view a little bit to the left so that (0,0) is visible. The values a relative to a 16/10 screen
- grid_offset = Point2();
- grid_step = Point2(10, 10);
- grid_step_multiplier = 0;
- snap_rotation_offset = 0;
- snap_rotation_step = 15 / (180 / Math_PI);
- snap_active = false;
- snap_node_parent = true;
- snap_node_anchors = true;
- snap_node_sides = true;
- snap_node_center = true;
- snap_other_nodes = true;
- snap_grid = true;
- snap_guides = true;
- snap_rotation = false;
- snap_pixel = false;
- skeleton_show_bones = true;
skeleton_menu->get_popup()->set_item_checked(skeleton_menu->get_popup()->get_item_index(SKELETON_SHOW_BONES), true);
singleton = this;
set_process_unhandled_key_input(true);
- drag_type = DRAG_NONE;
- drag_from = Vector2();
- drag_to = Vector2();
- dragged_guide_pos = Point2();
- dragged_guide_index = -1;
-
- bone_last_frame = 0;
-
// Update the menus' checkboxes
call_deferred("set_state", get_state());
}
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 59777fb085..f71eb1b605 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -64,7 +64,10 @@ public:
Dictionary undo_state;
- CanvasItemEditorSelectedItem() { prev_rot = 0; }
+ CanvasItemEditorSelectedItem() :
+ prev_anchors() {
+ prev_rot = 0;
+ }
};
class CanvasItemEditor : public VBoxContainer {
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index 6b41946918..f2dfae7a9f 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -453,6 +453,7 @@ void ParticlesEditor::_bind_methods() {
ParticlesEditor::ParticlesEditor() {
+ node = NULL;
particles_editor_hb = memnew(HBoxContainer);
SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb);
options = memnew(MenuButton);
diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp
index e7d9f1b702..8b0beefb3e 100644
--- a/editor/plugins/skeleton_editor_plugin.cpp
+++ b/editor/plugins/skeleton_editor_plugin.cpp
@@ -151,6 +151,7 @@ void SkeletonEditor::_bind_methods() {
}
SkeletonEditor::SkeletonEditor() {
+ skeleton = NULL;
options = memnew(MenuButton);
SpatialEditor::get_singleton()->add_control_to_menu_panel(options);
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 27d8bd97fb..f8ba6fd4e3 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -946,6 +946,7 @@ void ProjectExportDialog::_bind_methods() {
ClassDB::bind_method("_export_pck_zip_selected", &ProjectExportDialog::_export_pck_zip_selected);
ClassDB::bind_method("_open_export_template_manager", &ProjectExportDialog::_open_export_template_manager);
ClassDB::bind_method("_validate_export_path", &ProjectExportDialog::_validate_export_path);
+ ClassDB::bind_method("_export_path_changed", &ProjectExportDialog::_export_path_changed);
ClassDB::bind_method("_export_project", &ProjectExportDialog::_export_project);
ClassDB::bind_method("_export_project_to_path", &ProjectExportDialog::_export_project_to_path);
ClassDB::bind_method("_export_all", &ProjectExportDialog::_export_all);
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index ba9837ef6e..089ffa285d 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -467,7 +467,6 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
String type = p_data[1];
Array properties = p_data[2];
- bool is_new_object = false;
if (remote_objects.has(id)) {
debugObj = remote_objects[id];
} else {
@@ -475,7 +474,6 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
debugObj->remote_object_id = id;
debugObj->type_name = type;
remote_objects[id] = debugObj;
- is_new_object = true;
debugObj->connect("value_edited", this, "_scene_tree_property_value_edited");
}