summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/create_dialog.cpp2
-rw-r--r--tools/editor/project_export.cpp4
-rw-r--r--tools/editor/resources_dock.cpp67
3 files changed, 25 insertions, 48 deletions
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index 3a6b856247..43c18341be 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -289,7 +289,7 @@ CreateDialog::CreateDialog() {
search_box->connect("input_event",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child("Matches:",search_options,true);
- get_ok()->set_text("Open");
+ get_ok()->set_text("Create");
get_ok()->set_disabled(true);
register_text_enter(search_box);
set_hide_on_ok(false);
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index 1da29c5e7b..a0031ff456 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -529,6 +529,8 @@ void ProjectExportDialog::_group_selected() {
_update_group(); //?
+
+ _update_group_tree();
}
String ProjectExportDialog::_get_selected_group() {
@@ -738,6 +740,8 @@ void ProjectExportDialog::_group_changed(Variant v) {
EditorNode::get_undo_redo()->add_undo_method(this,"_save_export_cfg");
EditorNode::get_undo_redo()->commit_action();
updating=false;
+ // update atlas preview button
+ _update_group();
}
void ProjectExportDialog::_group_item_edited() {
diff --git a/tools/editor/resources_dock.cpp b/tools/editor/resources_dock.cpp
index a05fe425b3..495225b91e 100644
--- a/tools/editor/resources_dock.cpp
+++ b/tools/editor/resources_dock.cpp
@@ -69,36 +69,8 @@ void ResourcesDock::_tool_selected(int p_tool) {
TreeItem *ti = resources->get_selected();
if (!ti)
break;
- Ref<Resource> current_res = ti->get_metadata(0);
-
- RES res(current_res);
-
- List<String> extensions;
- ResourceSaver::get_recognized_extensions(res,&extensions);
- file->set_mode(FileDialog::MODE_SAVE_FILE);
- //not for now?
-
- if (current_res->get_path()!="" && current_res->get_path().find("::")==-1) {
-
- file->set_current_path(current_res->get_path());
- } else {
- String existing;
- if (extensions.size()) {
- existing="new_"+res->get_type().to_lower()+"."+extensions.front()->get().to_lower();
- }
-
- file->set_current_file(existing);
- }
-
- file->clear_filters();
- for(int i=0;i<extensions.size();i++) {
-
- file->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper());
- }
-
- //file->set_current_path(current_path);
- file->popup_centered_ratio();
+ save_resource_as(ti->get_metadata(0));
} break;
@@ -174,33 +146,34 @@ void ResourcesDock::save_resource(const String& p_path,const Ref<Resource>& p_re
void ResourcesDock::save_resource_as(const Ref<Resource>& p_resource) {
+ current_action=TOOL_SAVE_AS;
- add_resource(p_resource);
- TreeItem *root=resources->get_root();
- ERR_FAIL_COND(!root);
+ RES res(p_resource);
- TreeItem *existing=root->get_children();
+ List<String> extensions;
+ ResourceSaver::get_recognized_extensions(res,&extensions);
+ file->set_mode(FileDialog::MODE_SAVE_FILE);
- while(existing) {
+ if (p_resource->get_path()!="" && p_resource->get_path().find("::")==-1) {
- Ref<Resource> r = existing->get_metadata(0);
- if (r==p_resource) {
- //existing->move_to_top();
- existing->select(0);
- resources->ensure_cursor_is_visible();
- return; // existing
- }
- existing=existing->get_next();
- }
-
- ERR_FAIL_COND(!existing);
+ file->set_current_path(p_resource->get_path());
+ } else {
- existing->select(0);
+ String existing;
+ if (extensions.size()) {
+ existing="new_"+res->get_type().to_lower()+"."+extensions.front()->get().to_lower();
+ }
- _tool_selected(TOOL_SAVE_AS);
+ file->set_current_file(existing);
+ }
+ file->clear_filters();
+ for(int i=0;i<extensions.size();i++) {
+ file->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper());
+ }
+ file->popup_centered_ratio();
}