summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_help.cpp2
-rw-r--r--tools/editor/editor_settings.cpp1
-rw-r--r--tools/editor/plugins/resource_preloader_editor_plugin.cpp58
-rw-r--r--tools/editor/plugins/resource_preloader_editor_plugin.h2
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp3
-rw-r--r--tools/editor/project_export.cpp9
6 files changed, 44 insertions, 31 deletions
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index 238b2d1cb8..7a8805a5a1 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -92,7 +92,7 @@ void EditorHelpSearch::_update_search() {
DocData *doc=EditorHelp::get_doc_data();
String term = search_box->get_text();
- if (term.length()<3)
+ if (term.length()<2)
return;
TreeItem *root = search_options->create_item();
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 6baa690644..6f1e90936a 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -410,6 +410,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("text_editor/tab_size", 4);
hints["text_editor/tab_size"]=PropertyInfo(Variant::INT,"text_editor/tab_size",PROPERTY_HINT_RANGE,"1, 64, 1"); // size of 0 crashes.
+ set("text_editor/draw_tabs", true);
set("text_editor/idle_parse_delay",2);
set("text_editor/create_signal_callbacks",true);
diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/tools/editor/plugins/resource_preloader_editor_plugin.cpp
index 442046b069..0459ed85bd 100644
--- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/tools/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -60,36 +60,40 @@ void ResourcePreloaderEditor::_notification(int p_what) {
}
}
-void ResourcePreloaderEditor::_file_load_request(const String& p_path) {
+void ResourcePreloaderEditor::_files_load_request(const Vector<String>& p_paths) {
+ for(int i=0;i<p_paths.size();i++) {
- RES resource;
+ String path = p_paths[i];
- resource = ResourceLoader::load(p_path);
+ RES resource;
+ resource = ResourceLoader::load(path);
- if (resource.is_null()) {
- dialog->set_text("ERROR: Couldn't load resource!");
- dialog->set_title("Error!");
- //dialog->get_cancel()->set_text("Close");
- dialog->get_ok()->set_text("Close");
- dialog->popup_centered_minsize();
- return; ///beh should show an error i guess
- }
+ if (resource.is_null()) {
+ dialog->set_text("ERROR: Couldn't load resource!");
+ dialog->set_title("Error!");
+ //dialog->get_cancel()->set_text("Close");
+ dialog->get_ok()->set_text("Close");
+ dialog->popup_centered_minsize();
+ return; ///beh should show an error i guess
+ }
- String basename = p_path.get_file().basename();
- String name=basename;
- int counter=1;
- while(preloader->has_resource(name)) {
- counter++;
- name=basename+" "+itos(counter);
- }
- undo_redo->create_action("Add Resource");
- undo_redo->add_do_method(preloader,"add_resource",name,resource);
- undo_redo->add_undo_method(preloader,"remove_resource",name);
- undo_redo->add_do_method(this,"_update_library");
- undo_redo->add_undo_method(this,"_update_library");
- undo_redo->commit_action();
+ String basename = path.get_file().basename();
+ String name=basename;
+ int counter=1;
+ while(preloader->has_resource(name)) {
+ counter++;
+ name=basename+" "+itos(counter);
+ }
+
+ undo_redo->create_action("Add Resource");
+ undo_redo->add_do_method(preloader,"add_resource",name,resource);
+ undo_redo->add_undo_method(preloader,"remove_resource",name);
+ undo_redo->add_do_method(this,"_update_library");
+ undo_redo->add_undo_method(this,"_update_library");
+ undo_redo->commit_action();
+ }
}
void ResourcePreloaderEditor::_load_pressed() {
@@ -102,7 +106,7 @@ void ResourcePreloaderEditor::_load_pressed() {
for(int i=0;i<extensions.size();i++)
file->add_filter("*."+extensions[i]);
- file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
+ file->set_mode(EditorFileDialog::MODE_OPEN_FILES);
file->popup_centered_ratio();
@@ -283,7 +287,7 @@ void ResourcePreloaderEditor::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_delete_pressed"),&ResourcePreloaderEditor::_delete_pressed);
ObjectTypeDB::bind_method(_MD("_paste_pressed"),&ResourcePreloaderEditor::_paste_pressed);
ObjectTypeDB::bind_method(_MD("_delete_confirm_pressed"),&ResourcePreloaderEditor::_delete_confirm_pressed);
- ObjectTypeDB::bind_method(_MD("_file_load_request"),&ResourcePreloaderEditor::_file_load_request);
+ ObjectTypeDB::bind_method(_MD("_files_load_request"),&ResourcePreloaderEditor::_files_load_request);
ObjectTypeDB::bind_method(_MD("_update_library"),&ResourcePreloaderEditor::_update_library);
}
@@ -330,7 +334,7 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() {
load->connect("pressed", this,"_load_pressed");
_delete->connect("pressed", this,"_delete_pressed");
paste->connect("pressed", this,"_paste_pressed");
- file->connect("file_selected", this,"_file_load_request");
+ file->connect("files_selected", this,"_files_load_request");
//dialog->connect("confirmed", this,"_delete_confirm_pressed");
tree->connect("item_edited", this,"_item_edited");
loading_scene=false;
diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.h b/tools/editor/plugins/resource_preloader_editor_plugin.h
index 53436797a9..0bc94079a5 100644
--- a/tools/editor/plugins/resource_preloader_editor_plugin.h
+++ b/tools/editor/plugins/resource_preloader_editor_plugin.h
@@ -58,7 +58,7 @@ class ResourcePreloaderEditor : public PanelContainer {
void _load_pressed();
void _load_scene_pressed();
- void _file_load_request(const String& p_path);
+ void _files_load_request(const Vector<String>& p_paths);
void _paste_pressed();
void _delete_pressed();
void _delete_confirm_pressed();
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index b383c75253..b03a9301b3 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -581,7 +581,6 @@ void ScriptTextEditor::_bind_methods() {
ScriptTextEditor::ScriptTextEditor() {
- get_text_edit()->set_draw_tabs(true);
}
/*** SCRIPT EDITOR ******/
@@ -1932,6 +1931,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
ste->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
ste->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
ste->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
+ ste->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
ste->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
ste->get_text_edit()->set_callhint_settings(
EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"),
@@ -2071,6 +2071,7 @@ void ScriptEditor::_editor_settings_changed() {
ste->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
ste->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
ste->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
+ ste->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
ste->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
}
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index b5e7715d93..df8ebad08d 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -467,6 +467,14 @@ void ProjectExportDialog::_export_action(const String& p_file) {
location=nl;
}
+ /* Checked if the export location is outside the project directory,
+ * now will check if a file name has been entered */
+ if (p_file.ends_with("/")) {
+
+ error->set_text("Please enter a file name!");
+ error->popup_centered_minsize();
+ return;
+ }
TreeItem *selected = platforms->get_selected();
if (!selected)
@@ -1908,4 +1916,3 @@ ProjectExport::ProjectExport(EditorData* p_data) {
}
-