summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/object.h1
-rw-r--r--editor/editor_help.cpp30
-rw-r--r--editor/editor_node.cpp14
-rw-r--r--editor/editor_settings.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
-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
-rw-r--r--modules/gdscript/gd_editor.cpp8
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp3
-rw-r--r--platform/windows/godot_win.cpp7
-rw-r--r--platform/x11/godot_x11.cpp4
-rw-r--r--platform/x11/os_x11.cpp2
-rw-r--r--scene/gui/text_edit.cpp4
-rw-r--r--scene/gui/tree.cpp28
-rw-r--r--scene/main/scene_tree.cpp5
18 files changed, 97 insertions, 34 deletions
diff --git a/core/object.h b/core/object.h
index 9eb6cd1d56..746450ef6a 100644
--- a/core/object.h
+++ b/core/object.h
@@ -185,6 +185,7 @@ struct MethodInfo {
uint32_t flags;
int id;
+ inline bool operator==(const MethodInfo &p_method) const { return id == p_method.id; }
inline bool operator<(const MethodInfo &p_method) const { return id == p_method.id ? (name < p_method.name) : (id < p_method.id); }
operator Dictionary() const;
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 f8c37d586d..c30ffd4b4e 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -260,6 +260,7 @@ static void _create_script_templates(const String &p_path) {
}
}
+ 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 433145a2ee..701952d249 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -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;
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index d06da08551..905c784ab9 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -1546,7 +1546,9 @@ static void _find_type_arguments(GDCompletionContext &context, const GDParser::N
scr = NULL;
}
} else {
- on_script = obj->get_script();
+ if (obj) {
+ on_script = obj->get_script();
+ }
}
}
@@ -2237,7 +2239,9 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
scr = NULL;
}
} else {
- on_script = obj->get_script();
+ if (obj) {
+ on_script = obj->get_script();
+ }
}
}
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 561efb9d0f..3bab1bfbc1 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -835,6 +835,9 @@ void GridMapEditor::_notification(int p_what) {
duplicate_instance = RID();
} else if (p_what == NOTIFICATION_PROCESS) {
+ if (!node) {
+ return;
+ }
Transform xf = node->get_global_transform();
diff --git a/platform/windows/godot_win.cpp b/platform/windows/godot_win.cpp
index df2d96e516..6f1fb04706 100644
--- a/platform/windows/godot_win.cpp
+++ b/platform/windows/godot_win.cpp
@@ -136,8 +136,13 @@ int widechar_main(int argc, wchar_t **argv) {
Error err = Main::setup(argv_utf8[0], argc - 1, &argv_utf8[1]);
- if (err != OK)
+ if (err != OK) {
+ for (int i = 0; i < argc; ++i) {
+ delete[] argv_utf8[i];
+ }
+ delete[] argv_utf8;
return 255;
+ }
if (Main::start())
os.run();
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index 6f418b213f..f02f3cb881 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -45,8 +45,10 @@ int main(int argc, char *argv[]) {
getcwd(cwd, PATH_MAX);
Error err = Main::setup(argv[0], argc - 1, &argv[1]);
- if (err != OK)
+ if (err != OK) {
+ free(cwd);
return 255;
+ }
if (Main::start())
os.run(); // it is actually the OS that decides how to run
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 7e712ee325..8332b2f51c 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -534,6 +534,8 @@ void OS_X11::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
+ memdelete(power_manager);
+
if (xrandr_handle)
dlclose(xrandr_handle);
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 6e7d1eb8a9..a5de50af99 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2115,14 +2115,14 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
//keep indentation
int space_count = 0;
for (int i = 0; i < text[cursor.line].length(); i++) {
- if (text[cursor.line][i] == '\t') {
+ if (text[cursor.line][i] == '\t' && cursor.column > 0) {
if (indent_using_spaces) {
ins += space_indent;
} else {
ins += "\t";
}
space_count = 0;
- } else if (text[cursor.line][i] == ' ') {
+ } else if (text[cursor.line][i] == ' ' && cursor.column > 0) {
space_count++;
if (space_count == indent_size) {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index f4e1bff9af..a40d1acb8f 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2473,22 +2473,24 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
Point2 pos = b->get_position() - bg->get_offset();
cache.click_type = Cache::CLICK_NONE;
- if (show_column_titles && b->get_button_index() == BUTTON_LEFT) {
+ if (show_column_titles) {
pos.y -= _get_title_button_height();
if (pos.y < 0) {
- pos.x += cache.offset.x;
- int len = 0;
- for (int i = 0; i < columns.size(); i++) {
-
- len += get_column_width(i);
- if (pos.x < len) {
-
- cache.click_type = Cache::CLICK_TITLE;
- cache.click_index = i;
- //cache.click_id=;
- update();
- break;
+ if (b->get_button_index() == BUTTON_LEFT) {
+ pos.x += cache.offset.x;
+ int len = 0;
+ for (int i = 0; i < columns.size(); i++) {
+
+ len += get_column_width(i);
+ if (pos.x < len) {
+
+ cache.click_type = Cache::CLICK_TITLE;
+ cache.click_index = i;
+ //cache.click_id=;
+ update();
+ break;
+ }
}
}
break;
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 03a604734e..33331a465f 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -1401,8 +1401,11 @@ void SceneTree::_live_edit_create_node_func(const NodePath &p_parent, const Stri
Node *n2 = n->get_node(p_parent);
Node *no = Object::cast_to<Node>(ClassDB::instance(p_type));
- no->set_name(p_name);
+ if (!no) {
+ continue;
+ }
+ no->set_name(p_name);
n2->add_child(no);
}
}