Fix import dock defaults: Set as default actions

This commit is contained in:
Rodrigo Troncoso 2017-08-31 11:55:54 -03:00
parent 5fac1406fd
commit 00a3ef44da

View file

@ -265,16 +265,14 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) {
void ImportDock::_preset_selected(int p_idx) {
switch (p_idx) {
int item_id = preset->get_popup()->get_item_id(p_idx);
switch (item_id) {
case ITEM_SET_AS_DEFAULT: {
List<ResourceImporter::ImportOption> options;
params->importer->get_import_options(&options, p_idx);
Dictionary d;
for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
d[E->get().option.name] = E->get().default_value;
for (const List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) {
d[E->get().name] = params->values[E->get().name];
}
ProjectSettings::get_singleton()->set("importer_defaults/" + params->importer->get_importer_name(), d);