summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/create_dialog.cpp6
-rw-r--r--tools/editor/editor_file_dialog.cpp4
-rw-r--r--tools/editor/editor_help.cpp2
-rw-r--r--tools/editor/editor_node.cpp9
-rw-r--r--tools/editor/editor_node.h1
-rw-r--r--tools/editor/editor_settings.cpp2
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp9
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.cpp6
-rw-r--r--tools/editor/property_editor.cpp10
-rw-r--r--tools/editor/quick_open.cpp4
-rw-r--r--tools/editor/scene_tree_editor.cpp2
-rw-r--r--tools/editor/scenes_dock.cpp5
13 files changed, 43 insertions, 19 deletions
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index b6137ddac0..5275e1beeb 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -103,7 +103,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
item->set_selectable(0,false);
} else {
- if (!*to_select && (search_box->get_text()=="" || p_type.findn(search_box->get_text())!=-1)) {
+ if (!*to_select && (search_box->get_text().is_subsequence_ofi(p_type))) {
*to_select=item;
}
@@ -172,7 +172,7 @@ void CreateDialog::_update_search() {
bool found=false;
String type=I->get();
while(type!="" && ObjectTypeDB::is_type(type,base_type) && type!=base_type) {
- if (type.findn(search_box->get_text())!=-1) {
+ if (search_box->get_text().is_subsequence_ofi(type)) {
found=true;
break;
@@ -194,7 +194,7 @@ void CreateDialog::_update_search() {
const Vector<EditorData::CustomType> &ct = EditorNode::get_editor_data().get_custom_types()[type];
for(int i=0;i<ct.size();i++) {
- bool show = search_box->get_text()=="" || ct[i].name.findn(search_box->get_text())!=-1;
+ bool show = search_box->get_text().is_subsequence_ofi(ct[i].name);
if (!show)
continue;
diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp
index 185ec17459..e631aad7f6 100644
--- a/tools/editor/editor_file_dialog.cpp
+++ b/tools/editor/editor_file_dialog.cpp
@@ -443,7 +443,7 @@ void EditorFileDialog::update_file_list() {
item_list->set_icon_mode(ItemList::ICON_MODE_TOP);
item_list->set_fixed_column_width(thumbnail_size*3/2);
item_list->set_max_text_lines(2);
- item_list->set_min_icon_size(Size2(thumbnail_size,thumbnail_size));
+ item_list->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size));
if (!has_icon("ResizedFolder","EditorIcons")) {
Ref<ImageTexture> folder = get_icon("FolderBig","EditorIcons");
@@ -475,7 +475,7 @@ void EditorFileDialog::update_file_list() {
item_list->set_max_columns(1);
item_list->set_max_text_lines(1);
item_list->set_fixed_column_width(0);
- item_list->set_min_icon_size(Size2());
+ item_list->set_fixed_icon_size(Size2());
if (preview->get_texture().is_valid())
preview_vb->show();
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index ac9feacd46..0b60db5ee3 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -453,7 +453,7 @@ void EditorHelpIndex::_update_class_list() {
String type = E->key();
while(type != "") {
- if (type.findn(filter)!=-1) {
+ if (filter.is_subsequence_ofi(type)) {
if (to_select.empty()) {
to_select = type;
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index b90b017f53..2e8bf0f311 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -217,7 +217,7 @@ void EditorNode::_notification(int p_what) {
if (p_what==NOTIFICATION_EXIT_TREE) {
editor_data.save_editor_external_data();
-
+ FileAccess::set_file_close_fail_notify_callback(NULL);
log->deinit(); // do not get messages anymore
}
if (p_what==NOTIFICATION_PROCESS) {
@@ -5138,6 +5138,10 @@ void EditorNode::_dropped_files(const Vector<String>& p_files,int p_screen) {
EditorImportExport::get_singleton()->get_import_plugin(i)->import_from_drop(p_files,cur_path);
}
}
+void EditorNode::_file_access_close_error_notify(const String& p_str) {
+
+ add_io_error("Unable to write to file '"+p_str+"', file in use, locked or lacking permissions.");
+}
void EditorNode::_bind_methods() {
@@ -5233,7 +5237,6 @@ EditorNode::EditorNode() {
SceneState::set_disable_placeholders(true);
editor_initialize_certificates(); //for asset sharing
-
InputDefault *id = Input::get_singleton()->cast_to<InputDefault>();
if (id) {
@@ -6575,6 +6578,7 @@ EditorNode::EditorNode() {
_load_docks();
+ FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify);
}
@@ -6582,6 +6586,7 @@ EditorNode::EditorNode() {
EditorNode::~EditorNode() {
+
memdelete( EditorHelp::get_doc_data() );
memdelete(editor_selection);
memdelete(editor_plugins_over);
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 65a5687dce..7023c6c174 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -574,6 +574,7 @@ private:
void _update_addon_config();
+ static void _file_access_close_error_notify(const String& p_str);
protected:
void _notification(int p_what);
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 26c8826d87..0d0008fcb8 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -166,7 +166,7 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const {
pinfo|=PROPERTY_USAGE_STORAGE;
}
- if (!E->get().name.begins_with("_")) {
+ if (!E->get().name.begins_with("_") && !E->get().name.begins_with("projects/")) {
pinfo|=PROPERTY_USAGE_EDITOR;
} else {
pinfo|=PROPERTY_USAGE_STORAGE; //hiddens must always be saved
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 0735672214..48505324d3 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -2155,7 +2155,9 @@ void ScriptEditor::save_all_scripts() {
editor->save_resource(script);
//ResourceSaver::save(script->get_path(),script);
+
}
+
}
}
@@ -2276,6 +2278,8 @@ void ScriptEditor::_editor_settings_changed() {
ste->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter"));
}
+ ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true));
+
}
void ScriptEditor::_autosave_scripts() {
@@ -2617,8 +2621,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
edit_menu->get_popup()->add_item(TTR("Auto Indent"),EDIT_AUTO_INDENT,KEY_MASK_CMD|KEY_I);
edit_menu->get_popup()->connect("item_pressed", this,"_menu_option");
edit_menu->get_popup()->add_separator();
- edit_menu->get_popup()->add_item(TTR("Reload Tool Script"),FILE_TOOL_RELOAD,KEY_MASK_CMD|KEY_R);
- edit_menu->get_popup()->add_item(TTR("Reload Tool Script (Soft)"),FILE_TOOL_RELOAD_SOFT,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R);
+ edit_menu->get_popup()->add_item(TTR("Soft Reload Script"),FILE_TOOL_RELOAD_SOFT,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R);
search_menu = memnew( MenuButton );
@@ -2922,6 +2925,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
script_editor->hide();
EDITOR_DEF("text_editor/auto_reload_scripts_on_external_change",true);
+ ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true));
EDITOR_DEF("text_editor/open_dominant_script_on_scene_change",true);
EDITOR_DEF("external_editor/use_external_editor",false);
EDITOR_DEF("external_editor/exec_path","");
@@ -2933,6 +2937,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE));
EDITOR_DEF("external_editor/exec_flags","");
+
}
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
index 4532e91e1f..4f59287994 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -825,7 +825,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
tree->set_icon_mode(ItemList::ICON_MODE_TOP);
tree->set_fixed_column_width(thumbnail_size*3/2);
tree->set_max_text_lines(2);
- tree->set_max_icon_size(Size2(thumbnail_size,thumbnail_size));
+ tree->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size));
//tree->set_min_icon_size(Size2(thumbnail_size,thumbnail_size));
tree->set_drag_forwarding(this);
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp
index 6d5f2a519c..5a40777665 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_map_editor_plugin.cpp
@@ -208,9 +208,14 @@ void TileMapEditor::_update_palette() {
palette->set_max_columns(0);
palette->add_constant_override("hseparation", 6);
+
+ float min_size = EDITOR_DEF("tile_map/preview_size",64);
+ palette->set_fixed_icon_size(Size2(min_size, min_size));
+ palette->set_fixed_column_width(min_size*3/2);
palette->set_icon_mode(ItemList::ICON_MODE_TOP);
palette->set_max_text_lines(2);
+
String filter = search_box->get_text().strip_edges();
for (List<int>::Element *E=tiles.front();E;E=E->next()) {
@@ -1434,6 +1439,7 @@ void TileMapEditorPlugin::make_visible(bool p_visible) {
TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) {
+ EDITOR_DEF("tile_map/preview_size",64);
tile_map_editor = memnew( TileMapEditor(p_node) );
add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor);
tile_map_editor->hide();
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 2f0ba2da99..763734f035 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -1963,6 +1963,13 @@ bool PropertyEditor::_is_property_different(const Variant& p_current, const Vari
return false;
}
+ if (p_current.get_type()==Variant::REAL && p_orig.get_type()==Variant::REAL) {
+ float a = p_current;
+ float b = p_orig;
+
+ return Math::abs(a-b)>CMP_EPSILON; //this must be done because, as some scenes save as text, there might be a tiny difference in floats due to numerical error
+ }
+
return bool(Variant::evaluate(Variant::OP_NOT_EQUAL,p_current,p_orig));
}
@@ -2232,6 +2239,7 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) {
if (_get_instanced_node_original_property(p_name,vorig) || usage) {
Variant v = obj->get(p_name);
+
bool changed = _is_property_different(v,vorig,usage);
//if ((found!=-1 && !is_disabled)!=changed) {
@@ -2804,7 +2812,7 @@ void PropertyEditor::update_tree() {
if (capitalize_paths)
cat = cat.capitalize();
- if (cat.findn(filter)==-1 && name.findn(filter)==-1)
+ if (!filter.is_subsequence_ofi(cat) && !filter.is_subsequence_ofi(name))
continue;
}
diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp
index 72059c264f..fc2a2241ab 100644
--- a/tools/editor/quick_open.cpp
+++ b/tools/editor/quick_open.cpp
@@ -126,7 +126,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) {
path+="/";
if (path!="res://") {
path=path.substr(6,path.length());
- if (path.findn(search_box->get_text())!=-1) {
+ if (search_box->get_text().is_subsequence_ofi(path)) {
TreeItem *ti = search_options->create_item(root);
ti->set_text(0,path);
Ref<Texture> icon = get_icon("folder","FileDialog");
@@ -138,7 +138,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) {
String file = efsd->get_file_path(i);
file=file.substr(6,file.length());
- if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text()=="" || file.findn(search_box->get_text())!=-1)) {
+ if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text().is_subsequence_ofi(file))) {
TreeItem *ti = search_options->create_item(root);
ti->set_text(0,file);
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index 65e731dd4d..2de6fc5cf2 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -428,7 +428,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) {
item->set_as_cursor(0);
}
- bool keep= ( filter==String() || String(p_node->get_name()).to_lower().find(filter.to_lower())!=-1 );
+ bool keep= (filter.is_subsequence_ofi(String(p_node->get_name())));
for (int i=0;i<p_node->get_child_count();i++) {
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index 7953cf2739..44832c84eb 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -454,8 +454,7 @@ void ScenesDock::_update_files(bool p_keep_selection) {
files->set_icon_mode(ItemList::ICON_MODE_TOP);
files->set_fixed_column_width(thumbnail_size*3/2);
files->set_max_text_lines(2);
- files->set_min_icon_size(Size2(thumbnail_size,thumbnail_size));
- files->set_max_icon_size(Size2(thumbnail_size,thumbnail_size));
+ files->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size));
if (!has_icon("ResizedFolder","EditorIcons")) {
Ref<ImageTexture> folder = get_icon("FolderBig","EditorIcons");
@@ -485,7 +484,7 @@ void ScenesDock::_update_files(bool p_keep_selection) {
files->set_max_columns(1);
files->set_max_text_lines(1);
files->set_fixed_column_width(0);
- files->set_min_icon_size(Size2());
+ files->set_fixed_icon_size(Size2());
}