summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_editor.cpp2
-rw-r--r--editor/editor_help.cpp30
-rw-r--r--editor/editor_node.cpp14
-rw-r--r--editor/editor_settings.cpp6
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp6
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h1
-rw-r--r--editor/plugins/collision_polygon_editor_plugin.cpp3
-rw-r--r--editor/project_manager.cpp3
-rw-r--r--editor/script_create_dialog.cpp3
-rw-r--r--editor/script_editor_debugger.cpp9
10 files changed, 59 insertions, 18 deletions
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp
index 55542a59a2..5b24baabea 100644
--- a/editor/animation_editor.cpp
+++ b/editor/animation_editor.cpp
@@ -1646,7 +1646,7 @@ PropertyInfo AnimationKeyEditor::_find_hint_for_track(int p_idx, NodePath &r_bas
List<PropertyInfo> pinfo;
if (res.is_valid())
res->get_property_list(&pinfo);
- else
+ else if (node)
node->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 86f31d7589..17105606df 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -294,7 +294,6 @@ EditorHelpSearch::EditorHelpSearch() {
VBoxContainer *vbc = memnew(VBoxContainer);
add_child(vbc);
- HBoxContainer *sb_hb = memnew(HBoxContainer);
search_box = memnew(LineEdit);
vbc->add_child(search_box);
search_box->connect("text_changed", this, "_text_changed");
@@ -893,6 +892,8 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
for (int i = 0; i < methods.size(); i++) {
+ bool is_vararg = methods[i].qualifiers.find("vararg") != -1;
+
class_desc->push_cell();
method_line[methods[i].name] = class_desc->get_line_count() - 2; //gets overridden if description
@@ -916,7 +917,7 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
if (methods[i].description != "")
class_desc->pop();
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
- class_desc->add_text(methods[i].arguments.size() ? "( " : "(");
+ class_desc->add_text(methods[i].arguments.size() || is_vararg ? "( " : "(");
class_desc->pop();
for (int j = 0; j < methods[i].arguments.size(); j++) {
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
@@ -936,17 +937,18 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
class_desc->pop();
}
- if (methods[i].qualifiers.find("vararg") != -1) {
+ if (is_vararg) {
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
- class_desc->add_text(",");
+ if (methods[i].arguments.size())
+ class_desc->add_text(", ");
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
- class_desc->add_text(" ... ");
+ class_desc->add_text("...");
class_desc->pop();
class_desc->pop();
}
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
- class_desc->add_text(methods[i].arguments.size() ? " )" : ")");
+ class_desc->add_text(methods[i].arguments.size() || is_vararg ? " )" : ")");
class_desc->pop();
if (methods[i].qualifiers != "") {
@@ -1313,6 +1315,8 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
for (int i = 0; i < methods.size(); i++) {
+ bool is_vararg = methods[i].qualifiers.find("vararg") != -1;
+
method_line[methods[i].name] = class_desc->get_line_count() - 2;
class_desc->push_font(doc_code_font);
@@ -1323,7 +1327,7 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
_add_text(methods[i].name);
class_desc->pop();
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
- class_desc->add_text(methods[i].arguments.size() ? "( " : "(");
+ class_desc->add_text(methods[i].arguments.size() || is_vararg ? "( " : "(");
class_desc->pop();
for (int j = 0; j < methods[i].arguments.size(); j++) {
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
@@ -1343,8 +1347,18 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
class_desc->pop();
}
+ if (is_vararg) {
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
+ if (methods[i].arguments.size())
+ class_desc->add_text(", ");
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
+ class_desc->add_text("...");
+ class_desc->pop();
+ class_desc->pop();
+ }
+
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
- class_desc->add_text(methods[i].arguments.size() ? " )" : ")");
+ class_desc->add_text(methods[i].arguments.size() || is_vararg ? " )" : ")");
class_desc->pop();
if (methods[i].qualifiers != "") {
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index c07055114d..06e9860552 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -2218,16 +2218,21 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
update_menu->get_popup()->set_item_checked(0, true);
update_menu->get_popup()->set_item_checked(1, false);
OS::get_singleton()->set_low_processor_usage_mode(false);
+ EditorSettings::get_singleton()->set_project_metadata("editor_options", "update_mode", SETTINGS_UPDATE_ALWAYS);
} break;
case SETTINGS_UPDATE_CHANGES: {
update_menu->get_popup()->set_item_checked(0, false);
update_menu->get_popup()->set_item_checked(1, true);
OS::get_singleton()->set_low_processor_usage_mode(true);
+ EditorSettings::get_singleton()->set_project_metadata("editor_options", "update_mode", SETTINGS_UPDATE_CHANGES);
} break;
case SETTINGS_UPDATE_SPINNER_HIDE: {
+
update_menu->set_icon(gui_base->get_icon("Collapse", "EditorIcons"));
update_menu->get_popup()->toggle_item_checked(3);
+ bool checked = update_menu->get_popup()->is_item_checked(3);
+ EditorSettings::get_singleton()->set_project_metadata("editor_options", "update_spinner_hide", checked);
} break;
case SETTINGS_PREFERENCES: {
@@ -4980,7 +4985,12 @@ EditorNode::EditorNode() {
p->add_check_item(TTR("Update Changes"), SETTINGS_UPDATE_CHANGES);
p->add_separator();
p->add_check_item(TTR("Disable Update Spinner"), SETTINGS_UPDATE_SPINNER_HIDE);
- p->set_item_checked(1, true);
+ int update_mode = EditorSettings::get_singleton()->get_project_metadata("editor_options", "update_mode", SETTINGS_UPDATE_CHANGES);
+ int hide_spinner = EditorSettings::get_singleton()->get_project_metadata("editor_options", "update_spinner_hide", false);
+ _menu_option(update_mode);
+ if (hide_spinner) {
+ _menu_option(SETTINGS_UPDATE_SPINNER_HIDE);
+ }
scene_tree_dock = memnew(SceneTreeDock(this, scene_root, editor_selection, editor_data));
scene_tree_dock->set_name(TTR("Scene"));
@@ -5367,7 +5377,6 @@ EditorNode::EditorNode() {
save_external_resources_mem = true;
set_process(true);
- OS::get_singleton()->set_low_processor_usage_mode(true);
open_imported = memnew(ConfirmationDialog);
open_imported->get_ok()->set_text(TTR("Open Anyway"));
@@ -5475,6 +5484,7 @@ EditorNode::~EditorNode() {
memdelete(editor_plugins_over);
memdelete(editor_plugins_force_input_forwarding);
memdelete(file_server);
+ memdelete(progress_hb);
EditorSettings::destroy();
}
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 5b73d83691..c30ffd4b4e 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -253,13 +253,14 @@ static void _create_script_templates(const String &p_path) {
dir->change_dir(p_path);
for (int i = 0; i < keys.size(); i++) {
if (!dir->file_exists(keys[i])) {
- file->reopen(p_path.plus_file((String)keys[i]), FileAccess::WRITE);
- ERR_FAIL_COND(!file);
+ Error err = file->reopen(p_path.plus_file((String)keys[i]), FileAccess::WRITE);
+ ERR_FAIL_COND(err != OK);
file->store_string(templates[keys[i]]);
file->close();
}
}
+ memdelete(dir);
memdelete(file);
}
@@ -286,6 +287,7 @@ void EditorSettings::create() {
self_contained = true;
extra_config->load(exe_path + "/_sc_");
}
+ memdelete(d);
if (self_contained) {
// editor is self contained
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 0dcabb1776..701952d249 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3766,7 +3766,7 @@ bool CanvasItemEditorViewport::_cyclical_dependency_exists(const String &p_targe
void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &path, const Point2 &p_point) {
child->set_name(path.get_file().get_basename());
- Ref<Texture> texture = Object::cast_to<Texture>(Ref<Texture>(ResourceCache::get(path)).ptr());
+ Ref<Texture> texture = Ref<Texture>(Object::cast_to<Texture>(ResourceCache::get(path)));
Size2 texture_size = texture->get_size();
editor_data->get_undo_redo().add_do_method(parent, "add_child", child);
@@ -4102,3 +4102,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte
label_desc->hide();
editor->get_gui_base()->add_child(label_desc);
}
+
+CanvasItemEditorViewport::~CanvasItemEditorViewport() {
+ memdelete(preview);
+}
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 9b027fda60..0291660d42 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -512,6 +512,7 @@ public:
virtual void drop_data(const Point2 &p_point, const Variant &p_data);
CanvasItemEditorViewport(EditorNode *p_node, CanvasItemEditor *p_canvas);
+ ~CanvasItemEditorViewport();
};
#endif
diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp
index 5520d196e0..c6fa796226 100644
--- a/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -48,6 +48,9 @@ void CollisionPolygonEditor::_notification(int p_what) {
} break;
case NOTIFICATION_PROCESS: {
+ if (!node) {
+ return;
+ }
if (node->get_depth() != prev_depth) {
_polygon_draw();
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 0d57fe05b9..9cb110a2ca 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -805,7 +805,8 @@ void ProjectManager::_load_recent_projects() {
Error err = img->load(appicon.replace_first("res://", path + "/"));
if (err == OK) {
- img->resize(64, 64);
+ Ref<Texture> default_icon = get_icon("DefaultProjectIcon", "EditorIcons");
+ img->resize(default_icon->get_width(), default_icon->get_height());
Ref<ImageTexture> it = memnew(ImageTexture);
it->create_from_image(img);
icon = it;
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index 299538a2b3..b70c63c97c 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -591,6 +591,9 @@ ScriptCreateDialog::ScriptCreateDialog() {
hb->add_child(vb);
hb->add_child(empty_v->duplicate());
+ memdelete(empty_h);
+ memdelete(empty_v);
+
add_child(hb);
/* Language */
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 689bea2749..d1d9f86b66 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -789,14 +789,17 @@ void ScriptEditorDebugger::_performance_draw() {
which.push_back(i);
}
- if (which.empty())
+ Ref<Font> graph_font = get_font("font", "TextEdit");
+
+ if (which.empty()) {
+ perf_draw->draw_string(graph_font, Point2(0, graph_font->get_ascent()), TTR("Pick one or more items from the list to display the graph."), get_color("font_color", "Label"), perf_draw->get_size().x);
return;
+ }
Ref<StyleBox> graph_sb = get_stylebox("normal", "TextEdit");
- Ref<Font> graph_font = get_font("font", "TextEdit");
int cols = Math::ceil(Math::sqrt((float)which.size()));
- int rows = (which.size() + 1) / cols;
+ int rows = Math::ceil((float)which.size() / cols);
if (which.size() == 1)
rows = 1;