summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_track_editor.cpp81
-rw-r--r--editor/animation_track_editor.h14
-rw-r--r--editor/code_editor.cpp5
-rw-r--r--editor/code_editor.h1
-rw-r--r--editor/doc/doc_data.cpp1
-rw-r--r--editor/editor_autoload_settings.cpp2
-rw-r--r--editor/editor_help.cpp12
-rw-r--r--editor/editor_help_search.cpp6
-rw-r--r--editor/editor_layouts_dialog.cpp (renamed from editor/editor_name_dialog.cpp)75
-rw-r--r--editor/editor_layouts_dialog.h (renamed from editor/editor_name_dialog.h)23
-rw-r--r--editor/editor_node.cpp108
-rw-r--r--editor/editor_node.h20
-rw-r--r--editor/editor_settings.cpp2
-rw-r--r--editor/icons/icon_key_valid.svg5
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp13
-rw-r--r--editor/plugins/cpu_particles_2d_editor_plugin.cpp6
-rw-r--r--editor/plugins/cpu_particles_2d_editor_plugin.h3
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.cpp8
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.h1
-rw-r--r--editor/plugins/particles_2d_editor_plugin.cpp10
-rw-r--r--editor/plugins/particles_2d_editor_plugin.h3
-rw-r--r--editor/plugins/particles_editor_plugin.cpp11
-rw-r--r--editor/plugins/particles_editor_plugin.h1
-rw-r--r--editor/plugins/script_editor_plugin.cpp5
-rw-r--r--editor/plugins/script_text_editor.cpp7
-rw-r--r--editor/plugins/script_text_editor.h1
-rw-r--r--editor/plugins/shader_editor_plugin.cpp2
-rw-r--r--editor/plugins/text_editor.cpp2
-rw-r--r--editor/plugins/tile_set_editor_plugin.h1
29 files changed, 279 insertions, 150 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 4d48beed0a..721ed23d8a 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1203,7 +1203,9 @@ AnimationTimelineEdit::AnimationTimelineEdit() {
////////////////////////////////////
void AnimationTrackEdit::_notification(int p_what) {
+
if (p_what == NOTIFICATION_DRAW) {
+
if (animation.is_null())
return;
ERR_FAIL_INDEX(track, animation->get_track_count());
@@ -1240,20 +1242,15 @@ void AnimationTrackEdit::_notification(int p_what) {
int ofs = in_group ? check->get_width() : 0; //not the best reference for margin but..
check_rect = Rect2(Point2(ofs, int(get_size().height - check->get_height()) / 2), check->get_size());
-
draw_texture(check, check_rect.position);
-
ofs += check->get_width() + hsep;
Ref<Texture> type_icon = type_icons[animation->track_get_type(track)];
-
draw_texture(type_icon, Point2(ofs, int(get_size().height - type_icon->get_height()) / 2));
ofs += type_icon->get_width() + hsep;
NodePath path = animation->track_get_path(track);
-
Node *node = NULL;
-
if (root && root->has_node(path)) {
node = root->get_node(path);
}
@@ -1308,12 +1305,11 @@ void AnimationTrackEdit::_notification(int p_what) {
draw_line(Point2(limit, 0), Point2(limit, get_size().height), linecolor, Math::round(EDSCALE));
}
- // KEYFAMES //
+ // KEYFRAMES //
draw_bg(limit, get_size().width - timeline->get_buttons_width());
{
-
float scale = timeline->get_zoom_scale();
int limit_end = get_size().width - timeline->get_buttons_width();
@@ -1342,6 +1338,7 @@ void AnimationTrackEdit::_notification(int p_what) {
draw_fg(limit, get_size().width - timeline->get_buttons_width());
// BUTTONS //
+
{
Ref<Texture> wrap_icon[2] = {
@@ -1566,7 +1563,18 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool
if (p_x < p_clip_left || p_x > p_clip_right)
return;
- Vector2 ofs(p_x - type_icon->get_width() / 2, int(get_size().height - type_icon->get_height()) / 2);
+ Ref<Texture> icon_to_draw = p_selected ? selected_icon : type_icon;
+
+ // Override type icon for invalid value keys, unless selected.
+ if (!p_selected && animation->track_get_type(track) == Animation::TYPE_VALUE) {
+ const Variant &v = animation->track_get_key_value(track, p_index);
+ Variant::Type valid_type = Variant::NIL;
+ if (!_is_value_key_valid(v, valid_type)) {
+ icon_to_draw = get_icon("KeyInvalid", "EditorIcons");
+ }
+ }
+
+ Vector2 ofs(p_x - icon_to_draw->get_width() / 2, int(get_size().height - icon_to_draw->get_height()) / 2);
if (animation->track_get_type(track) == Animation::TYPE_METHOD) {
Ref<Font> font = get_font("font", "Label");
@@ -1590,16 +1598,13 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool
}
text += ")";
- int limit = MAX(0, p_clip_right - p_x - type_icon->get_width());
+ int limit = MAX(0, p_clip_right - p_x - icon_to_draw->get_width());
if (limit > 0) {
- draw_string(font, Vector2(p_x + type_icon->get_width(), int(get_size().height - font->get_height()) / 2 + font->get_ascent()), text, color, limit);
+ draw_string(font, Vector2(p_x + icon_to_draw->get_width(), int(get_size().height - font->get_height()) / 2 + font->get_ascent()), text, color, limit);
}
}
- if (p_selected) {
- draw_texture(selected_icon, ofs);
- } else {
- draw_texture(type_icon, ofs);
- }
+
+ draw_texture(icon_to_draw, ofs);
}
//helper
@@ -1764,6 +1769,27 @@ void AnimationTrackEdit::_path_entered(const String &p_text) {
undo_redo->commit_action();
}
+bool AnimationTrackEdit::_is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const {
+
+ RES res;
+ Vector<StringName> leftover_path;
+ Node *node = root->get_node_and_resource(animation->track_get_path(track), res, leftover_path);
+
+ Object *obj = NULL;
+ if (res.is_valid()) {
+ obj = res.ptr();
+ } else if (node) {
+ obj = node;
+ }
+
+ bool prop_exists = false;
+ if (obj) {
+ r_valid_type = obj->get_static_property_type_indexed(leftover_path, &prop_exists);
+ }
+
+ return (!prop_exists || Variant::can_convert(p_key_value.get_type(), r_valid_type));
+}
+
String AnimationTrackEdit::get_tooltip(const Point2 &p_pos) const {
if (check_rect.has_point(p_pos)) {
@@ -1834,29 +1860,10 @@ String AnimationTrackEdit::get_tooltip(const Point2 &p_pos) const {
} break;
case Animation::TYPE_VALUE: {
- Variant v = animation->track_get_key_value(track, key_idx);
- //text+="value: "+String(v)+"\n";
-
- bool prop_exists = false;
- Variant::Type valid_type = Variant::NIL;
- Object *obj = NULL;
-
- RES res;
- Vector<StringName> leftover_path;
- Node *node = root->get_node_and_resource(animation->track_get_path(track), res, leftover_path);
-
- if (res.is_valid()) {
- obj = res.ptr();
- } else if (node) {
- obj = node;
- }
-
- if (obj) {
- valid_type = obj->get_static_property_type_indexed(leftover_path, &prop_exists);
- }
-
+ const Variant &v = animation->track_get_key_value(track, key_idx);
text += "Type: " + Variant::get_type_name(v.get_type()) + "\n";
- if (prop_exists && !Variant::can_convert(v.get_type(), valid_type)) {
+ Variant::Type valid_type = Variant::NIL;
+ if (!_is_value_key_valid(v, valid_type)) {
text += "Value: " + String(v) + " (Invalid, expected type: " + Variant::get_type_name(valid_type) + ")\n";
} else {
text += "Value: " + String(v) + "\n";
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 61a2cf02b3..0d5a621e07 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -31,6 +31,11 @@
#ifndef ANIMATION_TRACK_EDITOR_H
#define ANIMATION_TRACK_EDITOR_H
+#include "editor/editor_data.h"
+#include "editor/editor_spin_slider.h"
+#include "editor/property_editor.h"
+#include "editor/property_selector.h"
+#include "scene/animation/animation_cache.h"
#include "scene/gui/control.h"
#include "scene/gui/file_dialog.h"
#include "scene/gui/menu_button.h"
@@ -40,12 +45,6 @@
#include "scene/gui/tab_container.h"
#include "scene/gui/texture_rect.h"
#include "scene/gui/tool_button.h"
-
-#include "editor/property_selector.h"
-#include "editor_data.h"
-#include "editor_spin_slider.h"
-#include "property_editor.h"
-#include "scene/animation/animation_cache.h"
#include "scene/resources/animation.h"
#include "scene_tree_editor.h"
@@ -175,8 +174,9 @@ class AnimationTrackEdit : public Control {
void _path_entered(const String &p_text);
void _play_position_draw();
- mutable int dropping_at;
+ bool _is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const;
+ mutable int dropping_at;
float insert_at_pos;
bool moving_selection_attempt;
int select_single_attempt;
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 8b3c537fe3..848921d870 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1217,6 +1217,11 @@ void CodeTextEditor::goto_line_selection(int p_line, int p_begin, int p_end) {
text_editor->select(p_line, p_begin, p_line, p_end);
}
+void CodeTextEditor::goto_line_centered(int p_line) {
+ goto_line(p_line);
+ text_editor->call_deferred("center_viewport_to_cursor");
+}
+
void CodeTextEditor::set_executing_line(int p_line) {
text_editor->set_executing_line(p_line);
}
diff --git a/editor/code_editor.h b/editor/code_editor.h
index ce219f340c..c0989f9704 100644
--- a/editor/code_editor.h
+++ b/editor/code_editor.h
@@ -219,6 +219,7 @@ public:
void goto_line(int p_line);
void goto_line_selection(int p_line, int p_begin, int p_end);
+ void goto_line_centered(int p_line);
void set_executing_line(int p_line);
void clear_executing_line();
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp
index 7d2159d365..041f81d063 100644
--- a/editor/doc/doc_data.cpp
+++ b/editor/doc/doc_data.cpp
@@ -1126,6 +1126,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
const PropertyDoc &p = c.theme_properties[i];
_write_string(f, 2, "<theme_item name=\"" + p.name + "\" type=\"" + p.type + "\">");
+ _write_string(f, 3, p.description.strip_edges().xml_escape());
_write_string(f, 2, "</theme_item>");
}
_write_string(f, 1, "</theme_items>");
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 0be7db3236..7210211d90 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -786,7 +786,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
}
}
- if (!info.is_singleton && !info.in_editor) {
+ if (!info.is_singleton && !info.in_editor && info.node != NULL) {
memdelete(info.node);
info.node = NULL;
}
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 790a70a3cc..9918b655fb 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -415,6 +415,7 @@ void EditorHelp::_update_doc() {
class_desc->pop();
class_desc->add_newline();
+ class_desc->add_newline();
class_desc->push_color(text_color);
class_desc->push_font(doc_font);
class_desc->push_indent(1);
@@ -440,6 +441,7 @@ void EditorHelp::_update_doc() {
class_desc->pop();
class_desc->pop();
+ class_desc->add_newline();
class_desc->push_indent(1);
class_desc->push_table(2);
class_desc->set_table_column_expand(1, 1);
@@ -478,14 +480,15 @@ void EditorHelp::_update_doc() {
class_desc->push_color(headline_color);
_add_text(cd.properties[i].name);
+ class_desc->pop();
+ class_desc->pop();
+
if (describe) {
class_desc->pop();
property_descr = true;
}
class_desc->pop();
- class_desc->pop();
- class_desc->pop();
}
class_desc->pop(); //table
@@ -518,6 +521,7 @@ void EditorHelp::_update_doc() {
class_desc->pop();
class_desc->pop();
+ class_desc->add_newline();
class_desc->push_font(doc_code_font);
class_desc->push_indent(1);
class_desc->push_table(2);
@@ -874,6 +878,7 @@ void EditorHelp::_update_doc() {
class_desc->pop();
class_desc->add_newline();
+ class_desc->add_newline();
class_desc->push_color(text_color);
class_desc->push_font(doc_font);
class_desc->push_indent(1);
@@ -998,6 +1003,7 @@ void EditorHelp::_update_doc() {
class_desc->pop(); // table
class_desc->add_newline();
+ class_desc->add_newline();
class_desc->push_color(text_color);
class_desc->push_font(doc_font);
@@ -1040,6 +1046,8 @@ void EditorHelp::_update_doc() {
class_desc->pop();
class_desc->add_newline();
+ class_desc->add_newline();
+
class_desc->push_color(text_color);
class_desc->push_font(doc_font);
class_desc->push_indent(1);
diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp
index 55ab38ba6c..4ec24c76f2 100644
--- a/editor/editor_help_search.cpp
+++ b/editor/editor_help_search.cpp
@@ -260,7 +260,11 @@ bool EditorHelpSearch::Runner::_is_class_disabled_by_feature_profile(const Strin
StringName class_name = p_class;
while (class_name != StringName()) {
- if (!ClassDB::class_exists(class_name) || profile->is_class_disabled(class_name)) {
+ if (!ClassDB::class_exists(class_name)) {
+ return false;
+ }
+
+ if (profile->is_class_disabled(class_name)) {
return true;
}
class_name = ClassDB::get_parent_class(class_name);
diff --git a/editor/editor_name_dialog.cpp b/editor/editor_layouts_dialog.cpp
index 63a91a594c..36f7b30016 100644
--- a/editor/editor_name_dialog.cpp
+++ b/editor/editor_layouts_dialog.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* editor_name_dialog.cpp */
+/* editor_layouts_dialog.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,13 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "editor_name_dialog.h"
-
+#include "editor_layouts_dialog.h"
#include "core/class_db.h"
+#include "core/io/config_file.h"
#include "core/os/keyboard.h"
+#include "editor/editor_settings.h"
+#include "scene/gui/item_list.h"
+#include "scene/gui/line_edit.h"
-void EditorNameDialog::_line_gui_input(const Ref<InputEvent> &p_event) {
-
+void EditorLayoutsDialog::_line_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> k = p_event;
if (k.is_valid()) {
@@ -60,34 +62,77 @@ void EditorNameDialog::_line_gui_input(const Ref<InputEvent> &p_event) {
}
}
-void EditorNameDialog::_post_popup() {
+void EditorLayoutsDialog::_bind_methods() {
+ ClassDB::bind_method("_line_gui_input", &EditorLayoutsDialog::_line_gui_input);
- ConfirmationDialog::_post_popup();
- name->clear();
- name->grab_focus();
+ ADD_SIGNAL(MethodInfo("name_confirmed", PropertyInfo(Variant::STRING, "name")));
}
-void EditorNameDialog::ok_pressed() {
+void EditorLayoutsDialog::ok_pressed() {
+
+ if (layout_names->is_anything_selected()) {
+
+ Vector<int> const selected_items = layout_names->get_selected_items();
+ for (int i = 0; i < selected_items.size(); ++i) {
+
+ emit_signal("name_confirmed", layout_names->get_item_text(selected_items[i]));
+ }
+ } else if (name->is_visible() && name->get_text() != "") {
- if (name->get_text() != "") {
emit_signal("name_confirmed", name->get_text());
}
}
-void EditorNameDialog::_bind_methods() {
+void EditorLayoutsDialog::_post_popup() {
- ClassDB::bind_method("_line_gui_input", &EditorNameDialog::_line_gui_input);
+ ConfirmationDialog::_post_popup();
+ name->clear();
+ layout_names->clear();
- ADD_SIGNAL(MethodInfo("name_confirmed", PropertyInfo(Variant::STRING, "name")));
+ Ref<ConfigFile> config;
+ config.instance();
+ Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
+ if (err != OK) {
+
+ return;
+ }
+
+ List<String> layouts;
+ config.ptr()->get_sections(&layouts);
+
+ for (List<String>::Element *E = layouts.front(); E; E = E->next()) {
+
+ layout_names->add_item(**E);
+ }
}
-EditorNameDialog::EditorNameDialog() {
+EditorLayoutsDialog::EditorLayoutsDialog() {
+
makevb = memnew(VBoxContainer);
add_child(makevb);
+ makevb->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5);
+ makevb->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5);
+
+ layout_names = memnew(ItemList);
+ makevb->add_child(layout_names);
+ layout_names->set_visible(true);
+ layout_names->set_margin(MARGIN_TOP, 5);
+ layout_names->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5);
+ layout_names->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5);
+ layout_names->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ layout_names->set_select_mode(ItemList::SELECT_MULTI);
+ layout_names->set_allow_rmb_select(true);
+
name = memnew(LineEdit);
makevb->add_child(name);
name->set_margin(MARGIN_TOP, 5);
name->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5);
name->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5);
name->connect("gui_input", this, "_line_gui_input");
+ name->connect("focus_entered", layout_names, "unselect_all");
+}
+
+void EditorLayoutsDialog::set_name_line_enabled(bool p_enabled) {
+
+ name->set_visible(p_enabled);
}
diff --git a/editor/editor_name_dialog.h b/editor/editor_layouts_dialog.h
index 314fc27124..5e3a1d5a46 100644
--- a/editor/editor_name_dialog.h
+++ b/editor/editor_layouts_dialog.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* editor_name_dialog.h */
+/* editor_layouts_dialog.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,18 +28,21 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef EDITOR_NAME_DIALOG_H
-#define EDITOR_NAME_DIALOG_H
+#ifndef EDITOR_LAYOUTS_DIALOG_H
+#define EDITOR_LAYOUTS_DIALOG_H
#include "scene/gui/dialogs.h"
-#include "scene/gui/line_edit.h"
-class EditorNameDialog : public ConfirmationDialog {
+class LineEdit;
+class ItemList;
- GDCLASS(EditorNameDialog, ConfirmationDialog);
+class EditorLayoutsDialog : public ConfirmationDialog {
+
+ GDCLASS(EditorLayoutsDialog, ConfirmationDialog);
- VBoxContainer *makevb;
LineEdit *name;
+ ItemList *layout_names;
+ VBoxContainer *makevb;
void _line_gui_input(const Ref<InputEvent> &p_event);
@@ -49,9 +52,9 @@ protected:
virtual void _post_popup();
public:
- LineEdit *get_line_edit() { return name; }
+ EditorLayoutsDialog();
- EditorNameDialog();
+ void set_name_line_enabled(bool p_enabled);
};
-#endif // EDITOR_NAME_DIALOG_H
+#endif // EDITOR_LAYOUTS_DIALOG_H
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 2d2f67314d..3d640b4d35 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -260,24 +260,25 @@ void EditorNode::_notification(int p_what) {
last_checked_version = editor_data.get_undo_redo().get_version();
}
- //update the circle
+ // update the animation frame of the update spinner
uint64_t frame = Engine::get_singleton()->get_frames_drawn();
uint32_t tick = OS::get_singleton()->get_ticks_msec();
- if (frame != circle_step_frame && (tick - circle_step_msec) > (1000 / 8)) {
+ if (frame != update_spinner_step_frame && (tick - update_spinner_step_msec) > (1000 / 8)) {
- circle_step++;
- if (circle_step >= 8)
- circle_step = 0;
+ update_spinner_step++;
+ if (update_spinner_step >= 8)
+ update_spinner_step = 0;
- circle_step_msec = tick;
- circle_step_frame = frame + 1;
+ update_spinner_step_msec = tick;
+ update_spinner_step_frame = frame + 1;
- // update the circle itself only when its enabled
- if (!update_menu->get_popup()->is_item_checked(3)) {
- update_menu->set_icon(gui_base->get_icon("Progress" + itos(circle_step + 1), "EditorIcons"));
+ // update the icon itself only when the spinner is visible
+ if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) {
+ update_spinner->set_icon(gui_base->get_icon("Progress" + itos(update_spinner_step + 1), "EditorIcons"));
}
}
+
editor_selection->update();
scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height")));
@@ -400,10 +401,8 @@ void EditorNode::_notification(int p_what) {
scene_tab_add->set_icon(gui_base->get_icon("Add", "EditorIcons"));
// clear_button->set_icon(gui_base->get_icon("Close", "EditorIcons")); don't have access to that node. needs to become a class property
- update_menu->set_icon(gui_base->get_icon("Collapse", "EditorIcons"));
dock_tab_move_left->set_icon(theme->get_icon("Back", "EditorIcons"));
dock_tab_move_right->set_icon(theme->get_icon("Forward", "EditorIcons"));
- update_menu->set_icon(gui_base->get_icon("Progress1", "EditorIcons"));
PopupMenu *p = help_menu->get_popup();
p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_icon("HelpSearch", "EditorIcons"));
@@ -412,6 +411,8 @@ void EditorNode::_notification(int p_what) {
p->set_item_icon(p->get_item_index(HELP_ISSUES), gui_base->get_icon("Instance", "EditorIcons"));
p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_icon("Instance", "EditorIcons"));
p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_icon("Godot", "EditorIcons"));
+
+ _update_update_spinner();
}
if (p_what == Control::NOTIFICATION_RESIZED) {
@@ -419,6 +420,17 @@ void EditorNode::_notification(int p_what) {
}
}
+void EditorNode::_update_update_spinner() {
+ update_spinner->set_visible(EditorSettings::get_singleton()->get("interface/editor/show_update_spinner"));
+
+ bool update_continuously = EditorSettings::get_singleton()->get("interface/editor/update_continuously");
+ PopupMenu *update_popup = update_spinner->get_popup();
+ update_popup->set_item_checked(update_popup->get_item_index(SETTINGS_UPDATE_CONTINUOUSLY), update_continuously);
+ update_popup->set_item_checked(update_popup->get_item_index(SETTINGS_UPDATE_WHEN_CHANGED), !update_continuously);
+
+ OS::get_singleton()->set_low_processor_usage_mode(!update_continuously);
+}
+
void EditorNode::_on_plugin_ready(Object *p_script, const String &p_activate_name) {
Ref<Script> script = Object::cast_to<Script>(p_script);
if (script.is_null())
@@ -2426,28 +2438,21 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
EditorSettings::get_singleton()->set_project_metadata("debug_options", "run_reload_scripts", !ischecked);
} break;
- case SETTINGS_UPDATE_ALWAYS: {
-
- 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_always", true);
+ case SETTINGS_UPDATE_CONTINUOUSLY: {
+ EditorSettings::get_singleton()->set("interface/editor/update_continuously", true);
+ _update_update_spinner();
show_accept(TTR("This option is deprecated. Situations where refresh must be forced are now considered a bug. Please report."), TTR("OK"));
} break;
- case SETTINGS_UPDATE_CHANGES: {
+ case SETTINGS_UPDATE_WHEN_CHANGED: {
- 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_always", false);
+ EditorSettings::get_singleton()->set("interface/editor/update_continuously", false);
+ _update_update_spinner();
} 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);
+ EditorSettings::get_singleton()->set("interface/editor/show_update_spinner", false);
+ _update_update_spinner();
} break;
case SETTINGS_PREFERENCES: {
@@ -2475,6 +2480,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
OS::get_singleton()->set_window_fullscreen(!OS::get_singleton()->is_window_fullscreen());
} break;
+ case SETTINGS_TOGGLE_CONSOLE: {
+
+ bool was_visible = OS::get_singleton()->is_console_visible();
+ OS::get_singleton()->set_console_visible(!was_visible);
+ EditorSettings::get_singleton()->set_setting("interface/editor/hide_console_window", !was_visible);
+
+ } break;
case SETTINGS_PICK_MAIN_SCENE: {
file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
@@ -4249,6 +4261,7 @@ void EditorNode::_layout_menu_option(int p_id) {
layout_dialog->set_title(TTR("Save Layout"));
layout_dialog->get_ok()->set_text(TTR("Save"));
layout_dialog->popup_centered();
+ layout_dialog->set_name_line_enabled(true);
} break;
case SETTINGS_LAYOUT_DELETE: {
@@ -4256,6 +4269,7 @@ void EditorNode::_layout_menu_option(int p_id) {
layout_dialog->set_title(TTR("Delete Layout"));
layout_dialog->get_ok()->set_text(TTR("Delete"));
layout_dialog->popup_centered();
+ layout_dialog->set_name_line_enabled(false);
} break;
case SETTINGS_LAYOUT_DEFAULT: {
@@ -5431,6 +5445,8 @@ EditorNode::EditorNode() {
EDITOR_DEF("run/auto_save/save_before_running", true);
EDITOR_DEF_RST("interface/editor/save_each_scene_on_quit", true);
EDITOR_DEF("interface/editor/quit_confirmation", true);
+ EDITOR_DEF("interface/editor/show_update_spinner", false);
+ EDITOR_DEF("interface/editor/update_continuously", false);
EDITOR_DEF_RST("interface/scene_tabs/restore_scenes_on_load", false);
EDITOR_DEF_RST("interface/scene_tabs/show_thumbnail_on_hover", true);
EDITOR_DEF_RST("interface/inspector/capitalize_properties", true);
@@ -5874,6 +5890,9 @@ EditorNode::EditorNode() {
#else
p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREEN);
#endif
+#ifdef WINDOWS_ENABLED
+ p->add_item(TTR("Toggle System Console"), SETTINGS_TOGGLE_CONSOLE);
+#endif
p->add_separator();
if (OS::get_singleton()->get_data_path() == OS::get_singleton()->get_config_path()) {
@@ -6019,28 +6038,23 @@ EditorNode::EditorNode() {
progress_hb = memnew(BackgroundProgress);
- layout_dialog = memnew(EditorNameDialog);
+ layout_dialog = memnew(EditorLayoutsDialog);
gui_base->add_child(layout_dialog);
layout_dialog->set_hide_on_ok(false);
- layout_dialog->set_size(Size2(175, 70) * EDSCALE);
+ layout_dialog->set_size(Size2(225, 270) * EDSCALE);
layout_dialog->connect("name_confirmed", this, "_dialog_action");
- update_menu = memnew(MenuButton);
- update_menu->set_tooltip(TTR("Spins when the editor window redraws."));
- right_menu_hb->add_child(update_menu);
- update_menu->set_icon(gui_base->get_icon("Progress1", "EditorIcons"));
- update_menu->get_popup()->connect("id_pressed", this, "_menu_option");
- p = update_menu->get_popup();
- p->add_radio_check_item(TTR("Update Always"), SETTINGS_UPDATE_ALWAYS);
- p->add_radio_check_item(TTR("Update Changes"), SETTINGS_UPDATE_CHANGES);
+ update_spinner = memnew(MenuButton);
+ update_spinner->set_tooltip(TTR("Spins when the editor window redraws."));
+ right_menu_hb->add_child(update_spinner);
+ update_spinner->set_icon(gui_base->get_icon("Progress1", "EditorIcons"));
+ update_spinner->get_popup()->connect("id_pressed", this, "_menu_option");
+ p = update_spinner->get_popup();
+ p->add_radio_check_item(TTR("Update Continuously"), SETTINGS_UPDATE_CONTINUOUSLY);
+ p->add_radio_check_item(TTR("Update When Changed"), SETTINGS_UPDATE_WHEN_CHANGED);
p->add_separator();
- p->add_check_item(TTR("Disable Update Spinner"), SETTINGS_UPDATE_SPINNER_HIDE);
- int update_always = EditorSettings::get_singleton()->get_project_metadata("editor_options", "update_always", false);
- int hide_spinner = EditorSettings::get_singleton()->get_project_metadata("editor_options", "update_spinner_hide", false);
- _menu_option(update_always ? SETTINGS_UPDATE_ALWAYS : SETTINGS_UPDATE_CHANGES);
- if (hide_spinner) {
- _menu_option(SETTINGS_UPDATE_SPINNER_HIDE);
- }
+ p->add_item(TTR("Hide Update Spinner"), SETTINGS_UPDATE_SPINNER_HIDE);
+ _update_update_spinner();
// Instantiate and place editor docks
@@ -6329,9 +6343,9 @@ EditorNode::EditorNode() {
particles_mat_convert.instance();
resource_conversion_plugins.push_back(particles_mat_convert);
}
- circle_step_msec = OS::get_singleton()->get_ticks_msec();
- circle_step_frame = Engine::get_singleton()->get_frames_drawn();
- circle_step = 0;
+ update_spinner_step_msec = OS::get_singleton()->get_ticks_msec();
+ update_spinner_step_frame = Engine::get_singleton()->get_frames_drawn();
+ update_spinner_step = 0;
editor_plugin_screen = NULL;
editor_plugins_over = memnew(EditorPluginList);
diff --git a/editor/editor_node.h b/editor/editor_node.h
index f3bc95c409..8222f6213b 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -41,8 +41,8 @@
#include "editor/editor_feature_profile.h"
#include "editor/editor_folding.h"
#include "editor/editor_inspector.h"
+#include "editor/editor_layouts_dialog.h"
#include "editor/editor_log.h"
-#include "editor/editor_name_dialog.h"
#include "editor/editor_plugin.h"
#include "editor/editor_resource_preview.h"
#include "editor/editor_run.h"
@@ -85,6 +85,7 @@
#include "scene/gui/tool_button.h"
#include "scene/gui/tree.h"
#include "scene/gui/viewport_container.h"
+
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
@@ -181,8 +182,8 @@ private:
RUN_DEBUG_NAVIGATION,
RUN_DEPLOY_REMOTE_DEBUG,
RUN_RELOAD_SCRIPTS,
- SETTINGS_UPDATE_ALWAYS,
- SETTINGS_UPDATE_CHANGES,
+ SETTINGS_UPDATE_CONTINUOUSLY,
+ SETTINGS_UPDATE_WHEN_CHANGED,
SETTINGS_UPDATE_SPINNER_HIDE,
SETTINGS_PREFERENCES,
SETTINGS_LAYOUT_SAVE,
@@ -193,6 +194,7 @@ private:
SETTINGS_MANAGE_EXPORT_TEMPLATES,
SETTINGS_MANAGE_FEATURE_PROFILES,
SETTINGS_PICK_MAIN_SCENE,
+ SETTINGS_TOGGLE_CONSOLE,
SETTINGS_TOGGLE_FULLSCREEN,
SETTINGS_HELP,
SCENE_TAB_CLOSE,
@@ -307,7 +309,7 @@ private:
int overridden_default_layout;
Ref<ConfigFile> default_layout;
PopupMenu *editor_layouts;
- EditorNameDialog *layout_dialog;
+ EditorLayoutsDialog *layout_dialog;
ConfirmationDialog *custom_build_manage_templates;
ConfirmationDialog *install_android_build_template;
@@ -326,7 +328,7 @@ private:
CheckButton *file_export_lib_merge;
LineEdit *file_export_password;
String current_path;
- MenuButton *update_menu;
+ MenuButton *update_spinner;
String defer_load_scene;
String defer_export;
@@ -392,9 +394,9 @@ private:
bool waiting_for_sources_changed;
- uint32_t circle_step_msec;
- uint64_t circle_step_frame;
- int circle_step;
+ uint32_t update_spinner_step_msec;
+ uint64_t update_spinner_step_frame;
+ int update_spinner_step;
Vector<EditorPlugin *> editor_plugins;
EditorPlugin *editor_plugin_screen;
@@ -627,6 +629,8 @@ private:
void _license_tree_selected();
+ void _update_update_spinner();
+
Vector<Ref<EditorResourceConversionPlugin> > resource_conversion_plugins;
PrintHandlerList print_handler;
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 8dfac3ce52..8521c0c723 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -345,6 +345,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("interface/editor/unfocused_low_processor_mode_sleep_usec", 50000); // 20 FPS
hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT);
_initial_set("interface/editor/separate_distraction_mode", false);
+ _initial_set("interface/editor/hide_console_window", false);
_initial_set("interface/editor/save_each_scene_on_quit", true); // Regression
_initial_set("interface/editor/quit_confirmation", true);
@@ -572,6 +573,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("editors/2d/bone_outline_color", Color(0.35, 0.35, 0.35));
_initial_set("editors/2d/bone_outline_size", 2);
_initial_set("editors/2d/viewport_border_color", Color(0.4, 0.4, 1.0, 0.4));
+ _initial_set("editors/2d/constrain_editor_view", true);
_initial_set("editors/2d/warped_mouse_panning", true);
_initial_set("editors/2d/simple_panning", false);
_initial_set("editors/2d/scroll_to_pan", false);
diff --git a/editor/icons/icon_key_valid.svg b/editor/icons/icon_key_valid.svg
deleted file mode 100644
index 4a3fab4754..0000000000
--- a/editor/icons/icon_key_valid.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="8" height="8" version="1.1" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1044.4)">
-<rect transform="rotate(-45)" x="-741.53" y="741.08" width="6.1027" height="6.1027" ry=".76286" fill="#fff"/>
-</g>
-</svg>
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 10f53182bf..6ae3e2132a 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3608,18 +3608,19 @@ void CanvasItemEditor::_update_scrollbars() {
// Constraints the view offset and updates the scrollbars
Point2 begin = canvas_item_rect.position;
Point2 end = canvas_item_rect.position + canvas_item_rect.size - local_rect.size / zoom;
+ bool constrain_editor_view = bool(EditorSettings::get_singleton()->get("editors/2d/constrain_editor_view"));
if (canvas_item_rect.size.height <= (local_rect.size.y / zoom)) {
- if (ABS(begin.y - previous_update_view_offset.y) < ABS(begin.y - view_offset.y)) {
+ if (constrain_editor_view && ABS(begin.y - previous_update_view_offset.y) < ABS(begin.y - view_offset.y)) {
view_offset.y = previous_update_view_offset.y;
}
v_scroll->hide();
} else {
- if (view_offset.y > end.y && view_offset.y > previous_update_view_offset.y) {
+ if (constrain_editor_view && view_offset.y > end.y && view_offset.y > previous_update_view_offset.y) {
view_offset.y = MAX(end.y, previous_update_view_offset.y);
}
- if (view_offset.y < begin.y && view_offset.y < previous_update_view_offset.y) {
+ if (constrain_editor_view && view_offset.y < begin.y && view_offset.y < previous_update_view_offset.y) {
view_offset.y = MIN(begin.y, previous_update_view_offset.y);
}
@@ -3630,16 +3631,16 @@ void CanvasItemEditor::_update_scrollbars() {
}
if (canvas_item_rect.size.width <= (local_rect.size.x / zoom)) {
- if (ABS(begin.x - previous_update_view_offset.x) < ABS(begin.x - view_offset.x)) {
+ if (constrain_editor_view && ABS(begin.x - previous_update_view_offset.x) < ABS(begin.x - view_offset.x)) {
view_offset.x = previous_update_view_offset.x;
}
h_scroll->hide();
} else {
- if (view_offset.x > end.x && view_offset.x > previous_update_view_offset.x) {
+ if (constrain_editor_view && view_offset.x > end.x && view_offset.x > previous_update_view_offset.x) {
view_offset.x = MAX(end.x, previous_update_view_offset.x);
}
- if (view_offset.x < begin.x && view_offset.x < previous_update_view_offset.x) {
+ if (constrain_editor_view && view_offset.x < begin.x && view_offset.x < previous_update_view_offset.x) {
view_offset.x = MIN(begin.x, previous_update_view_offset.x);
}
diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp
index 1622ce17b2..7c2116f06b 100644
--- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp
+++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp
@@ -75,6 +75,10 @@ void CPUParticles2DEditorPlugin::_menu_callback(int p_idx) {
emission_mask->popup_centered_minsize();
} break;
+ case MENU_RESTART: {
+
+ particles->restart();
+ }
}
}
@@ -265,6 +269,8 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) {
menu = memnew(MenuButton);
menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK);
+ menu->get_popup()->add_separator();
+ menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART);
// menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK);
menu->set_text(TTR("Particles"));
menu->set_switch_on_hover(true);
diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.h b/editor/plugins/cpu_particles_2d_editor_plugin.h
index f715abd87b..84bbfff095 100644
--- a/editor/plugins/cpu_particles_2d_editor_plugin.h
+++ b/editor/plugins/cpu_particles_2d_editor_plugin.h
@@ -44,7 +44,8 @@ class CPUParticles2DEditorPlugin : public EditorPlugin {
enum {
MENU_LOAD_EMISSION_MASK,
- MENU_CLEAR_EMISSION_MASK
+ MENU_CLEAR_EMISSION_MASK,
+ MENU_RESTART
};
enum EmissionMode {
diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_editor_plugin.cpp
index 70be9b95bb..93ffce41fa 100644
--- a/editor/plugins/cpu_particles_editor_plugin.cpp
+++ b/editor/plugins/cpu_particles_editor_plugin.cpp
@@ -62,6 +62,12 @@ void CPUParticlesEditor::_menu_option(int p_option) {
emission_tree_dialog->popup_centered_ratio();
} break;
+
+ case MENU_OPTION_RESTART: {
+
+ node->restart();
+
+ } break;
}
}
@@ -108,6 +114,8 @@ CPUParticlesEditor::CPUParticlesEditor() {
options->set_text(TTR("CPUParticles"));
options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH);
options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
+ options->get_popup()->add_separator();
+ options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART);
options->get_popup()->connect("id_pressed", this, "_menu_option");
}
diff --git a/editor/plugins/cpu_particles_editor_plugin.h b/editor/plugins/cpu_particles_editor_plugin.h
index 09b0adbe5d..674f00dc9f 100644
--- a/editor/plugins/cpu_particles_editor_plugin.h
+++ b/editor/plugins/cpu_particles_editor_plugin.h
@@ -43,6 +43,7 @@ class CPUParticlesEditor : public ParticlesEditorBase {
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE,
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH,
MENU_OPTION_CLEAR_EMISSION_VOLUME,
+ MENU_OPTION_RESTART
};
diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp
index 6fabdc93c6..e68bca55cb 100644
--- a/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/editor/plugins/particles_2d_editor_plugin.cpp
@@ -96,12 +96,16 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) {
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
ur->create_action(TTR("Convert to CPUParticles"));
ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", particles, cpu_particles, true, false);
- ur->add_do_reference(particles);
+ ur->add_do_reference(cpu_particles);
ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, particles, false, false);
- ur->add_undo_reference(this);
+ ur->add_undo_reference(particles);
ur->commit_action();
} break;
+ case MENU_RESTART: {
+
+ particles->restart();
+ }
}
}
@@ -380,6 +384,8 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) {
// menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK);
menu->get_popup()->add_separator();
menu->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES);
+ menu->get_popup()->add_separator();
+ menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART);
menu->set_text(TTR("Particles"));
menu->set_switch_on_hover(true);
toolbar->add_child(menu);
diff --git a/editor/plugins/particles_2d_editor_plugin.h b/editor/plugins/particles_2d_editor_plugin.h
index 35b874fb25..0f092aaa4f 100644
--- a/editor/plugins/particles_2d_editor_plugin.h
+++ b/editor/plugins/particles_2d_editor_plugin.h
@@ -47,7 +47,8 @@ class Particles2DEditorPlugin : public EditorPlugin {
MENU_GENERATE_VISIBILITY_RECT,
MENU_LOAD_EMISSION_MASK,
MENU_CLEAR_EMISSION_MASK,
- MENU_OPTION_CONVERT_TO_CPU_PARTICLES
+ MENU_OPTION_CONVERT_TO_CPU_PARTICLES,
+ MENU_RESTART
};
enum EmissionMode {
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index 3f4f66a26d..f05e7d65d3 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -315,12 +315,17 @@ void ParticlesEditor::_menu_option(int p_option) {
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
ur->create_action(TTR("Convert to CPUParticles"));
ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", node, cpu_particles, true, false);
- ur->add_do_reference(node);
+ ur->add_do_reference(cpu_particles);
ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, node, false, false);
- ur->add_undo_reference(this);
+ ur->add_undo_reference(node);
ur->commit_action();
} break;
+ case MENU_OPTION_RESTART: {
+
+ node->restart();
+
+ } break;
}
}
@@ -471,6 +476,8 @@ ParticlesEditor::ParticlesEditor() {
options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES);
+ options->get_popup()->add_separator();
+ options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART);
options->get_popup()->connect("id_pressed", this, "_menu_option");
diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h
index b1c53dcf94..5d05fbd4ac 100644
--- a/editor/plugins/particles_editor_plugin.h
+++ b/editor/plugins/particles_editor_plugin.h
@@ -86,6 +86,7 @@ class ParticlesEditor : public ParticlesEditorBase {
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH,
MENU_OPTION_CLEAR_EMISSION_VOLUME,
MENU_OPTION_CONVERT_TO_CPU_PARTICLES,
+ MENU_OPTION_RESTART,
};
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index d5e21321c3..1b00889e9a 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -306,8 +306,11 @@ void ScriptEditor::_goto_script_line(REF p_script, int p_line) {
editor->push_item(p_script.ptr());
ScriptEditorBase *current = _get_current_editor();
- if (current)
+ if (ScriptTextEditor *script_text_editor = Object::cast_to<ScriptTextEditor>(current)) {
+ script_text_editor->goto_line_centered(p_line);
+ } else if (current) {
current->goto_line(p_line, true);
+ }
}
}
}
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index ce0859a1f6..9bf3a9f0eb 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -237,7 +237,7 @@ void ScriptTextEditor::_load_theme_settings() {
text_edit->add_color_override("safe_line_number_color", safe_line_number_color);
text_edit->add_color_override("caret_color", caret_color);
text_edit->add_color_override("caret_background_color", caret_background_color);
- text_edit->add_color_override("font_selected_color", text_selected_color);
+ text_edit->add_color_override("font_color_selected", text_selected_color);
text_edit->add_color_override("selection_color", selection_color);
text_edit->add_color_override("brace_mismatch_color", brace_mismatch_color);
text_edit->add_color_override("current_line_color", current_line_color);
@@ -487,6 +487,11 @@ void ScriptTextEditor::goto_line_selection(int p_line, int p_begin, int p_end) {
code_editor->goto_line_selection(p_line, p_begin, p_end);
}
+void ScriptTextEditor::goto_line_centered(int p_line) {
+
+ code_editor->goto_line_centered(p_line);
+}
+
void ScriptTextEditor::set_executing_line(int p_line) {
code_editor->set_executing_line(p_line);
}
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index 24d40a5eec..89975e061e 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -201,6 +201,7 @@ public:
virtual void goto_line(int p_line, bool p_with_error = false);
void goto_line_selection(int p_line, int p_begin, int p_end);
+ void goto_line_centered(int p_line);
virtual void set_executing_line(int p_line);
virtual void clear_executing_line();
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index f9ca38b919..d02817f6e8 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -124,7 +124,7 @@ void ShaderTextEditor::_load_theme_settings() {
get_text_edit()->add_color_override("line_number_color", line_number_color);
get_text_edit()->add_color_override("caret_color", caret_color);
get_text_edit()->add_color_override("caret_background_color", caret_background_color);
- get_text_edit()->add_color_override("font_selected_color", text_selected_color);
+ get_text_edit()->add_color_override("font_color_selected", text_selected_color);
get_text_edit()->add_color_override("selection_color", selection_color);
get_text_edit()->add_color_override("brace_mismatch_color", brace_mismatch_color);
get_text_edit()->add_color_override("current_line_color", current_line_color);
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index eeef3397d2..787813336d 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -116,7 +116,7 @@ void TextEditor::_load_theme_settings() {
text_edit->add_color_override("line_number_color", line_number_color);
text_edit->add_color_override("caret_color", caret_color);
text_edit->add_color_override("caret_background_color", caret_background_color);
- text_edit->add_color_override("font_selected_color", text_selected_color);
+ text_edit->add_color_override("font_color_selected", text_selected_color);
text_edit->add_color_override("selection_color", selection_color);
text_edit->add_color_override("brace_mismatch_color", brace_mismatch_color);
text_edit->add_color_override("current_line_color", current_line_color);
diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h
index b417414ae0..04e8d65155 100644
--- a/editor/plugins/tile_set_editor_plugin.h
+++ b/editor/plugins/tile_set_editor_plugin.h
@@ -31,7 +31,6 @@
#ifndef TILE_SET_EDITOR_PLUGIN_H
#define TILE_SET_EDITOR_PLUGIN_H
-#include "editor/editor_name_dialog.h"
#include "editor/editor_node.h"
#include "scene/2d/sprite.h"
#include "scene/resources/concave_polygon_shape_2d.h"