From 7966ebe6fa57e8ff5a855fe7010ae93594f1b9ee Mon Sep 17 00:00:00 2001 From: George Marques Date: Fri, 16 Jun 2017 15:42:18 -0300 Subject: [PATCH] Complete changing of resource extensions Some places were missing in e42d59f. --- editor/editor_export.cpp | 4 ++-- editor/editor_settings.cpp | 4 ++-- editor/import/resource_importer_csv_translation.cpp | 2 +- editor/import/resource_importer_obj.cpp | 3 +-- editor/import/resource_importer_scene.cpp | 6 +++--- editor/import/resource_importer_wav.cpp | 2 +- editor/io_plugins/editor_mesh_import_plugin.cpp | 2 +- editor/io_plugins/editor_sample_import_plugin.cpp | 6 +++--- editor/io_plugins/editor_texture_import_plugin.cpp | 6 +++--- editor/io_plugins/editor_translation_import_plugin.cpp | 2 +- modules/stb_vorbis/resource_importer_ogg_vorbis.cpp | 2 +- scene/register_scene_types.cpp | 2 +- 12 files changed, 20 insertions(+), 21 deletions(-) diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index a19819a1f82..5cd00738a26 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1943,14 +1943,14 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func atex->set_region(region); atex->set_margin(margin); - String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmpatlas.atex"; + String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmpatlas.atlastex"; Error err = ResourceSaver::save(path,atex); if (err!=OK) { EditorNode::add_io_error(TTR("Could not save atlas subtexture:")+" "+path); return ERR_CANT_CREATE; } Vector data = FileAccess::get_file_as_array(path); - String dst_path = F->get().operator String().get_basename()+".atex"; + String dst_path = F->get().operator String().get_basename()+".atlastex"; err = p_func(p_udata,dst_path,data,counter++,files.size()); saved.insert(dst_path); if (err) diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 0238ae004fa..485f8236de8 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -508,7 +508,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { set("interface/source_font_size", 14); hints["interface/source_font_size"] = PropertyInfo(Variant::INT, "interface/source_font_size", PROPERTY_HINT_RANGE, "8,96,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); set("interface/custom_font", ""); - hints["interface/custom_font"] = PropertyInfo(Variant::STRING, "interface/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.fnt", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/custom_font"] = PropertyInfo(Variant::STRING, "interface/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); set("interface/dim_editor_on_dialog_popup", true); set("interface/dim_amount", 0.6f); hints["interface/dim_amount"] = PropertyInfo(Variant::REAL, "interface/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT); @@ -581,7 +581,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::REAL, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.1"); set("text_editor/theme/font", ""); - hints["text_editor/theme/font"] = PropertyInfo(Variant::STRING, "text_editor/theme/font", PROPERTY_HINT_GLOBAL_FILE, "*.fnt"); + hints["text_editor/theme/font"] = PropertyInfo(Variant::STRING, "text_editor/theme/font", PROPERTY_HINT_GLOBAL_FILE, "*.font"); set("text_editor/completion/auto_brace_complete", false); set("text_editor/files/restore_scripts_on_load", true); set("text_editor/completion/complete_file_paths", true); diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index 85d446f38ab..9214b8f45e1 100644 --- a/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -128,7 +128,7 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const xlt = cxl; } - String save_path = p_source_file.get_basename() + "." + translations[i]->get_locale() + ".xl"; + String save_path = p_source_file.get_basename() + "." + translations[i]->get_locale() + ".translation"; ResourceSaver::save(save_path, xlt); if (r_gen_files) { diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index b65641956e4..1c5aa95ff1a 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -33,7 +33,6 @@ #include "os/file_access.h" #include "scene/resources/mesh.h" #include "scene/resources/surface_tool.h" -#include "scene/resources/surface_tool.h" String ResourceImporterOBJ::get_importer_name() const { @@ -244,7 +243,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s } */ - Error err = ResourceSaver::save(p_save_path + ".msh", mesh); + Error err = ResourceSaver::save(p_save_path + ".mesh", mesh); return err; } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index d2d2d45a478..2409f6707de 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -987,7 +987,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String if (!p_materials.has(mat)) { - String ext_name = p_base_path + "." + _make_extname(mat->get_name()) + ".mtl"; + String ext_name = p_base_path + "." + _make_extname(mat->get_name()) + ".material"; if (FileAccess::exists(ext_name)) { //if exists, use it Ref existing = ResourceLoader::load(ext_name); @@ -1015,7 +1015,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String if (!p_meshes.has(mesh)) { - String ext_name = p_base_path + "." + _make_extname(mesh->get_name()) + ".msh"; + String ext_name = p_base_path + "." + _make_extname(mesh->get_name()) + ".mesh"; if (FileAccess::exists(ext_name)) { //if exists, use it Ref existing = ResourceLoader::load(ext_name); @@ -1040,7 +1040,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String if (!p_materials.has(mat)) { - String ext_name = p_base_path + "." + _make_extname(mat->get_name()) + ".mtl"; + String ext_name = p_base_path + "." + _make_extname(mat->get_name()) + ".material"; if (FileAccess::exists(ext_name)) { //if exists, use it Ref existing = ResourceLoader::load(ext_name); diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index 6c590c4dc59..7841baa02e1 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -485,7 +485,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s sample->set_loop_end(loop_end); sample->set_stereo(format_channels == 2); - ResourceSaver::save(p_save_path + ".smp", sample); + ResourceSaver::save(p_save_path + ".sample", sample); return OK; } diff --git a/editor/io_plugins/editor_mesh_import_plugin.cpp b/editor/io_plugins/editor_mesh_import_plugin.cpp index a8ecc2f10e2..0c9f3a3f378 100644 --- a/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -262,7 +262,7 @@ public: imd->add_source(EditorImportPlugin::validate_source_path(meshes[i])); - String file_path = dst.plus_file(meshes[i].get_file().get_basename()+".msh"); + String file_path = dst.plus_file(meshes[i].get_file().get_basename()+".mesh"); plugin->import(file_path,imd); } diff --git a/editor/io_plugins/editor_sample_import_plugin.cpp b/editor/io_plugins/editor_sample_import_plugin.cpp index 7836b60fde1..0909b96cdcf 100644 --- a/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/editor/io_plugins/editor_sample_import_plugin.cpp @@ -299,7 +299,7 @@ public: error_dialog->popup_centered(Size2(200,100)*EDSCALE); } - dst = dst.plus_file(samples[i].get_file().get_basename()+".smp"); + dst = dst.plus_file(samples[i].get_file().get_basename()+".sample"); plugin->import(dst,imd); } @@ -910,13 +910,13 @@ Vector EditorSampleExportPlugin::custom_export(String& p_path,const Ref imd->set_option("edit/loop",false); imd->set_option("compress/mode",1); - String savepath = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/smpconv.smp"); + String savepath = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/smpconv.sample"); Error err = EditorSampleImportPlugin::singleton->import(savepath,imd); ERR_FAIL_COND_V(err!=OK,Vector()); - p_path=p_path.get_basename()+".converted.smp"; + p_path=p_path.get_basename()+".converted.sample"; return FileAccess::get_file_as_array(savepath); } diff --git a/editor/io_plugins/editor_texture_import_plugin.cpp b/editor/io_plugins/editor_texture_import_plugin.cpp index 5a5a71b6af4..d48675fa305 100644 --- a/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/editor/io_plugins/editor_texture_import_plugin.cpp @@ -1097,7 +1097,7 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Refget_option("large_cell_size"); ERR_FAIL_COND_V(cell_size<128 || cell_size>16384,ERR_CANT_OPEN); - EditorProgress pg("ltex",TTR("Import Large Texture"),3); + EditorProgress pg("largetex",TTR("Import Large Texture"),3); pg.step(TTR("Load Source Image"),0); Image img; @@ -1317,9 +1317,9 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Refget_source_path(E->get()).get_file(); if (p_external) { - apath = p_path.get_base_dir().plus_file(spath.get_basename()+"."+from->get_source_path(E->get()).md5_text()+".atex"); + apath = p_path.get_base_dir().plus_file(spath.get_basename()+"."+from->get_source_path(E->get()).md5_text()+".atlastex"); } else { - apath = p_path.get_base_dir().plus_file(spath.get_basename()+".atex"); + apath = p_path.get_base_dir().plus_file(spath.get_basename()+".atlastex"); } Ref at; diff --git a/editor/io_plugins/editor_translation_import_plugin.cpp b/editor/io_plugins/editor_translation_import_plugin.cpp index caa0659046d..5b15b94006e 100644 --- a/editor/io_plugins/editor_translation_import_plugin.cpp +++ b/editor/io_plugins/editor_translation_import_plugin.cpp @@ -258,7 +258,7 @@ public: imd->set_option("skip_first",ignore_first->is_pressed()); imd->set_option("compress",compress->is_pressed()); - String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+"."+locale+".xl"); + String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+"."+locale+".translation"); Error err = plugin->import(savefile,imd); if (err!=OK) { error_dialog->set_text(TTR("Couldn't import!")); diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp index e02c356ff9b..f0a7ee1ec6b 100644 --- a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp +++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp @@ -99,7 +99,7 @@ Error ResourceImporterOGGVorbis::import(const String &p_source_file, const Strin ogg_stream->set_data(data); ogg_stream->set_loop(loop); - return ResourceSaver::save(p_save_path + ".asogg", ogg_stream); + return ResourceSaver::save(p_save_path + ".oggstr", ogg_stream); } ResourceImporterOGGVorbis::ResourceImporterOGGVorbis() { diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 6cf49b63176..df3729c50bc 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -274,7 +274,7 @@ void register_scene_types() { String theme_path = GLOBAL_DEF("gui/theme/custom", ""); GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom", PropertyInfo(Variant::STRING, "gui/theme/custom", PROPERTY_HINT_FILE, "*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); String font_path = GLOBAL_DEF("gui/theme/custom_font", ""); - GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res,*.fnt", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); + GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res,*.font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); if (theme_path != String()) { Ref theme = ResourceLoader::load(theme_path);