summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/code_editor.cpp2
-rw-r--r--editor/editor_properties.cpp4
-rw-r--r--editor/find_in_files.cpp12
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp14
-rw-r--r--editor/scene_tree_editor.cpp2
5 files changed, 21 insertions, 13 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 79c22f667a..aeb304d3b9 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1039,6 +1039,8 @@ void CodeTextEditor::delete_lines() {
int to_line = text_editor->get_selection_to_line();
int from_line = text_editor->get_selection_from_line();
int count = Math::abs(to_line - from_line) + 1;
+
+ text_editor->cursor_set_line(to_line, false);
while (count) {
text_editor->set_line(text_editor->cursor_get_line(), "");
text_editor->backspace_at_cursor();
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index ce51e31ff6..96d482f47e 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -1769,7 +1769,7 @@ void EditorPropertyColor::_color_changed(const Color &p_color) {
void EditorPropertyColor::_popup_closed() {
- emit_signal("property_changed", get_edited_property(), picker->get_pick_color(), true);
+ emit_signal("property_changed", get_edited_property(), picker->get_pick_color(), false);
}
void EditorPropertyColor::_bind_methods() {
@@ -2370,7 +2370,7 @@ void EditorPropertyResource::update_property() {
if (res->get_name() != String()) {
assign->set_text(res->get_name());
} else if (res->get_path().is_resource_file()) {
- assign->set_text(res->get_name());
+ assign->set_text(res->get_path().get_file());
assign->set_tooltip(res->get_path());
} else {
assign->set_text(res->get_class());
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index f88d1b24a6..0ccaa95fb7 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -336,12 +336,10 @@ FindInFilesDialog::FindInFilesDialog() {
_whole_words_checkbox = memnew(CheckBox);
_whole_words_checkbox->set_text(TTR("Whole Words"));
- _whole_words_checkbox->set_pressed(true);
hbc->add_child(_whole_words_checkbox);
_match_case_checkbox = memnew(CheckBox);
_match_case_checkbox->set_text(TTR("Match Case"));
- _match_case_checkbox->set_pressed(true);
hbc->add_child(_match_case_checkbox);
gc->add_child(hbc);
@@ -563,7 +561,7 @@ FindInFilesPanel::FindInFilesPanel() {
_cancel_button = memnew(Button);
_cancel_button->set_text(TTR("Cancel"));
_cancel_button->connect("pressed", this, "_on_cancel_button_clicked");
- _cancel_button->set_disabled(true);
+ _cancel_button->hide();
hbc->add_child(_cancel_button);
vbc->add_child(hbc);
@@ -642,7 +640,7 @@ void FindInFilesPanel::start_search() {
_finder->start();
update_replace_buttons();
- _cancel_button->set_disabled(false);
+ _cancel_button->show();
}
void FindInFilesPanel::stop_search() {
@@ -652,7 +650,7 @@ void FindInFilesPanel::stop_search() {
_status_label->set_text("");
update_replace_buttons();
set_progress_visible(false);
- _cancel_button->set_disabled(true);
+ _cancel_button->hide();
}
void FindInFilesPanel::_notification(int p_what) {
@@ -688,7 +686,7 @@ void FindInFilesPanel::_on_result_found(String fpath, int line_number, int begin
// Do this first because it resets properties of the cell...
item->set_cell_mode(text_index, TreeItem::CELL_MODE_CUSTOM);
- String item_text = String::num_int64(line_number) + ": " + text.replace("\t", " ");
+ String item_text = vformat("%3s: %s", line_number, text.replace("\t", " "));
item->set_text(text_index, item_text);
item->set_custom_draw(text_index, this, "_draw_result_text");
@@ -754,7 +752,7 @@ void FindInFilesPanel::_on_finished() {
_status_label->set_text(TTR("Search complete"));
update_replace_buttons();
set_progress_visible(false);
- _cancel_button->set_disabled(true);
+ _cancel_button->hide();
}
void FindInFilesPanel::_on_cancel_button_clicked() {
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 3de2284cea..9988d82fb8 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -569,6 +569,10 @@ void TileSetEditor::_on_textures_added(const PoolStringArray &p_paths) {
int invalid_count = 0;
for (int i = 0; i < p_paths.size(); i++) {
Ref<Texture> t = Ref<Texture>(ResourceLoader::load(p_paths[i]));
+
+ ERR_EXPLAIN("'" + p_paths[i] + "' is not a valid texture.");
+ ERR_CONTINUE(!t.is_valid());
+
if (texture_map.has(t->get_rid())) {
invalid_count++;
} else {
@@ -577,9 +581,13 @@ void TileSetEditor::_on_textures_added(const PoolStringArray &p_paths) {
texture_list->set_item_metadata(texture_list->get_item_count() - 1, t->get_rid());
}
}
- update_texture_list_icon();
- texture_list->select(texture_list->get_item_count() - 1);
- _on_texture_list_selected(texture_list->get_item_count() - 1);
+
+ if (texture_list->get_item_count() > 0) {
+ update_texture_list_icon();
+ texture_list->select(texture_list->get_item_count() - 1);
+ _on_texture_list_selected(texture_list->get_item_count() - 1);
+ }
+
if (invalid_count > 0) {
err_dialog->set_text(vformat(TTR("%s file(s) were not added because was already on the list."), String::num(invalid_count, 0)));
err_dialog->popup_centered(Size2(300, 60));
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 07670bb420..848e4def6d 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -73,7 +73,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
undo_redo->create_action(TTR("Toggle Visible"));
_toggle_visible(n);
List<Node *> selection = editor_selection->get_selected_node_list();
- if (selection.size() > 1) {
+ if (selection.size() > 1 && selection.find(n) != NULL) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node *nv = E->get();
ERR_FAIL_COND(!nv);