summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/code_editor.cpp5
-rw-r--r--editor/code_editor.h2
-rw-r--r--editor/editor_autoload_settings.cpp2
-rw-r--r--editor/editor_feature_profile.cpp2
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp9
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.h2
-rw-r--r--editor/plugins/script_text_editor.cpp4
-rw-r--r--editor/plugins/script_text_editor.h2
-rw-r--r--editor/plugins/text_editor.cpp3
-rw-r--r--editor/plugins/text_editor.h2
12 files changed, 31 insertions, 8 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 01773a0bcd..e471993fc7 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1330,11 +1330,14 @@ void CodeTextEditor::_on_settings_change() {
}
void CodeTextEditor::_text_changed_idle_timeout() {
-
_validate_script();
emit_signal("validate_script");
}
+void CodeTextEditor::validate_script() {
+ idle->start();
+}
+
void CodeTextEditor::_warning_label_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
diff --git a/editor/code_editor.h b/editor/code_editor.h
index cf97f30b72..0ef8ec7061 100644
--- a/editor/code_editor.h
+++ b/editor/code_editor.h
@@ -242,6 +242,8 @@ public:
void set_code_complete_func(CodeTextEditorCodeCompleteFunc p_code_complete_func, void *p_ud);
+ void validate_script();
+
CodeTextEditor();
};
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index a7975c86c5..913eb35f8a 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -81,7 +81,7 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
if (Variant::get_type_name(Variant::Type(i)) == p_name) {
if (r_error)
- *r_error = TTR("Invalid name.") + "\n" + TTR("Must not collide with an existing buit-in type name.");
+ *r_error = TTR("Invalid name.") + "\n" + TTR("Must not collide with an existing built-in type name.");
return false;
}
diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp
index 56358f059a..36a8772faf 100644
--- a/editor/editor_feature_profile.cpp
+++ b/editor/editor_feature_profile.cpp
@@ -721,7 +721,7 @@ void EditorFeatureProfileManager::_import_profiles(const Vector<String> &p_paths
String dst_file = EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(basefile);
if (FileAccess::exists(dst_file)) {
- EditorNode::get_singleton()->show_warning(vformat(TTR("Profile '%s' already exists. Remote it first before importing, import aborted."), basefile.get_basename()));
+ EditorNode::get_singleton()->show_warning(vformat(TTR("Profile '%s' already exists. Remove it first before importing, import aborted."), basefile.get_basename()));
return;
}
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 372e5c7d05..b6d28dce29 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -2319,7 +2319,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
}
} break;
case FILE_EXPLORE_ANDROID_BUILD_TEMPLATES: {
- OS::get_singleton()->shell_open(String("file://") + ProjectSettings::get_singleton()->get_resource_path().plus_file("android"));
+ OS::get_singleton()->shell_open("file://" + ProjectSettings::get_singleton()->get_resource_path().plus_file("android"));
} break;
case FILE_QUIT:
case RUN_PROJECT_MANAGER: {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index fbf01a9405..3c24fd19b6 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -731,6 +731,8 @@ Vector2 CanvasItemEditor::_position_to_anchor(const Control *p_control, Vector2
ERR_FAIL_COND_V(!p_control, Vector2());
Rect2 parent_rect = p_control->get_parent_anchorable_rect();
+ ERR_FAIL_COND_V(parent_rect.size.x == 0, Vector2());
+ ERR_FAIL_COND_V(parent_rect.size.y == 0, Vector2());
return (p_control->get_transform().xform(position) - parent_rect.position) / parent_rect.size;
}
@@ -3348,9 +3350,6 @@ void CanvasItemEditor::_notification(int p_what) {
presets_menu->set_visible(true);
anchor_mode_button->set_visible(true);
- // Set the pressed state of the node
- anchor_mode_button->set_pressed(anchors_mode);
-
// Disable if the selected node is child of a container
if (has_container_parents) {
presets_menu->set_disabled(true);
@@ -3521,6 +3520,7 @@ void CanvasItemEditor::_selection_changed() {
}
}
anchors_mode = (nbValidControls == nbAnchorsMode);
+ anchor_mode_button->set_pressed(anchors_mode);
}
void CanvasItemEditor::edit(CanvasItem *p_canvas_item) {
@@ -3742,6 +3742,7 @@ void CanvasItemEditor::_set_anchors_and_margins_preset(Control::LayoutPreset p_p
undo_redo->commit_action();
anchors_mode = false;
+ anchor_mode_button->set_pressed(anchors_mode);
}
void CanvasItemEditor::_set_anchors_and_margins_to_keep_ratio() {
@@ -3766,6 +3767,7 @@ void CanvasItemEditor::_set_anchors_and_margins_to_keep_ratio() {
undo_redo->add_undo_method(control, "set_meta", "_edit_use_anchors_", use_anchors);
anchors_mode = true;
+ anchor_mode_button->set_pressed(anchors_mode);
}
}
@@ -3912,7 +3914,6 @@ void CanvasItemEditor::_button_toggle_anchor_mode(bool p_status) {
}
anchors_mode = p_status;
-
viewport->update();
}
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 7456c5d016..df9ce73914 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -437,6 +437,8 @@ void ScriptEditor::_go_to_tab(int p_idx) {
if (script != NULL) {
notify_script_changed(script);
}
+
+ Object::cast_to<ScriptEditorBase>(c)->validate();
}
if (Object::cast_to<EditorHelp>(c)) {
@@ -2056,6 +2058,8 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra
se->goto_line(p_line - 1);
}
}
+ _update_script_names();
+ script_list->ensure_current_is_visible();
return true;
}
}
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index 7cd347e2d0..549af1ca31 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -117,6 +117,8 @@ public:
virtual Control *get_edit_menu() = 0;
virtual void clear_edit_menu() = 0;
+ virtual void validate() = 0;
+
ScriptEditorBase() {}
};
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index c7a438948d..ce0859a1f6 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1810,3 +1810,7 @@ void ScriptTextEditor::register_editor() {
ScriptEditor::register_create_script_editor_function(create_editor);
}
+
+void ScriptTextEditor::validate() {
+ this->code_editor->validate_script();
+}
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index 7f5b6c065d..24d40a5eec 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -220,6 +220,8 @@ public:
virtual void clear_edit_menu();
static void register_editor();
+ virtual void validate();
+
ScriptTextEditor();
};
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index d036d7e965..eeef3397d2 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -654,3 +654,6 @@ TextEditor::TextEditor() {
code_editor->get_text_edit()->set_drag_forwarding(this);
}
+
+void TextEditor::validate() {
+}
diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h
index e06d816177..e91909e0ea 100644
--- a/editor/plugins/text_editor.h
+++ b/editor/plugins/text_editor.h
@@ -145,6 +145,8 @@ public:
virtual Control *get_edit_menu();
virtual void clear_edit_menu();
+ virtual void validate();
+
static void register_editor();
TextEditor();