Merge pull request #9201 from vnen/rename-extensions

Rename Godot-specific resource extensions
This commit is contained in:
Rémi Verschelde 2017-06-16 13:01:10 +02:00 committed by GitHub
commit 3fadbe2172
21 changed files with 31 additions and 31 deletions

View file

@ -36,7 +36,7 @@ class Translation : public Resource {
GDCLASS(Translation, Resource); GDCLASS(Translation, Resource);
OBJ_SAVE_TYPE(Translation); OBJ_SAVE_TYPE(Translation);
RES_BASE_EXTENSION("xl"); RES_BASE_EXTENSION("translation");
String locale; String locale;
Map<StringName, StringName> translation_map; Map<StringName, StringName> translation_map;

View file

@ -113,13 +113,13 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
extension_guess["png"] = get_icon("Texture", "EditorIcons"); extension_guess["png"] = get_icon("Texture", "EditorIcons");
extension_guess["jpg"] = get_icon("Texture", "EditorIcons"); extension_guess["jpg"] = get_icon("Texture", "EditorIcons");
extension_guess["tex"] = get_icon("Texture", "EditorIcons"); extension_guess["tex"] = get_icon("Texture", "EditorIcons");
extension_guess["atex"] = get_icon("Texture", "EditorIcons"); extension_guess["atlastex"] = get_icon("Texture", "EditorIcons");
extension_guess["dds"] = get_icon("Texture", "EditorIcons"); extension_guess["dds"] = get_icon("Texture", "EditorIcons");
extension_guess["scn"] = get_icon("PackedScene", "EditorIcons"); extension_guess["scn"] = get_icon("PackedScene", "EditorIcons");
extension_guess["tscn"] = get_icon("PackedScene", "EditorIcons"); extension_guess["tscn"] = get_icon("PackedScene", "EditorIcons");
extension_guess["xml"] = get_icon("PackedScene", "EditorIcons"); extension_guess["xml"] = get_icon("PackedScene", "EditorIcons");
extension_guess["xscn"] = get_icon("PackedScene", "EditorIcons"); extension_guess["xscn"] = get_icon("PackedScene", "EditorIcons");
extension_guess["mtl"] = get_icon("Material", "EditorIcons"); extension_guess["material"] = get_icon("Material", "EditorIcons");
extension_guess["shd"] = get_icon("Shader", "EditorIcons"); extension_guess["shd"] = get_icon("Shader", "EditorIcons");
extension_guess["gd"] = get_icon("GDScript", "EditorIcons"); extension_guess["gd"] = get_icon("GDScript", "EditorIcons");
} }

View file

@ -49,7 +49,7 @@ void ResourceImporterOBJ::get_recognized_extensions(List<String> *p_extensions)
p_extensions->push_back("obj"); p_extensions->push_back("obj");
} }
String ResourceImporterOBJ::get_save_extension() const { String ResourceImporterOBJ::get_save_extension() const {
return "msh"; return "mesh";
} }
String ResourceImporterOBJ::get_resource_type() const { String ResourceImporterOBJ::get_resource_type() const {

View file

@ -48,7 +48,7 @@ void ResourceImporterWAV::get_recognized_extensions(List<String> *p_extensions)
p_extensions->push_back("wav"); p_extensions->push_back("wav");
} }
String ResourceImporterWAV::get_save_extension() const { String ResourceImporterWAV::get_save_extension() const {
return "smp"; return "sample";
} }
String ResourceImporterWAV::get_resource_type() const { String ResourceImporterWAV::get_resource_type() const {

View file

@ -533,16 +533,16 @@ class EditorFontImportDialog : public ConfirmationDialog {
return; return;
} }
if (dest->get_line_edit()->get_text().get_file()==".fnt") { if (dest->get_line_edit()->get_text().get_file()==".font") {
dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().get_basename() + ".fnt" ); dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().get_basename() + ".font" );
} }
if (dest->get_line_edit()->get_text().get_extension() == dest->get_line_edit()->get_text()) { if (dest->get_line_edit()->get_text().get_extension() == dest->get_line_edit()->get_text()) {
dest->get_line_edit()->set_text(dest->get_line_edit()->get_text() + ".fnt"); dest->get_line_edit()->set_text(dest->get_line_edit()->get_text() + ".font");
} }
if (dest->get_line_edit()->get_text().get_extension().to_lower() != "fnt") { if (dest->get_line_edit()->get_text().get_extension().to_lower() != "font") {
error_dialog->set_text(TTR("Invalid file extension.\nPlease use .fnt.")); error_dialog->set_text(TTR("Invalid file extension.\nPlease use .font."));
error_dialog->popup_centered(Size2(200,100)); error_dialog->popup_centered(Size2(200,100));
return; return;
} }
@ -665,7 +665,7 @@ public:
// //
List<String> fl; List<String> fl;
Ref<BitmapFont> font= memnew(BitmapFont); Ref<BitmapFont> font= memnew(BitmapFont);
dest->get_file_dialog()->add_filter("*.fnt ; Font" ); dest->get_file_dialog()->add_filter("*.font ; Font" );
/* /*
ResourceSaver::get_recognized_extensions(font,&fl); ResourceSaver::get_recognized_extensions(font,&fl);
for(List<String>::Element *E=fl.front();E;E=E->next()) { for(List<String>::Element *E=fl.front();E;E=E->next()) {
@ -1690,7 +1690,7 @@ void EditorFontImportPlugin::import_from_drop(const Vector<String>& p_drop, cons
if (ext=="ttf" || ext=="otf" || ext=="fnt") { if (ext=="ttf" || ext=="otf" || ext=="fnt") {
import_dialog(); import_dialog();
dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.get_basename()+".fnt")); dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.get_basename()+".font"));
break; break;
} }
} }

View file

@ -596,7 +596,7 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) {
size->show(); size->show();
file_select->set_mode(EditorFileDialog::MODE_OPEN_FILE); file_select->set_mode(EditorFileDialog::MODE_OPEN_FILE);
save_file_select->add_filter("*.ltex;"+TTR("Large Texture")); save_file_select->add_filter("*.largetex;"+TTR("Large Texture"));
texture_options->set_flags(EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA|EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS|EditorTextureImportPlugin::IMAGE_FLAG_FILTER); texture_options->set_flags(EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA|EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS|EditorTextureImportPlugin::IMAGE_FLAG_FILTER);
texture_options->set_quality(0.7); texture_options->set_quality(0.7);

View file

@ -77,7 +77,7 @@ class AudioStreamOGGVorbis : public AudioStream {
GDCLASS(AudioStreamOGGVorbis, AudioStream) GDCLASS(AudioStreamOGGVorbis, AudioStream)
OBJ_SAVE_TYPE(AudioStream) //children are all saved as AudioStream, so they can be exchanged OBJ_SAVE_TYPE(AudioStream) //children are all saved as AudioStream, so they can be exchanged
RES_BASE_EXTENSION("asogg"); RES_BASE_EXTENSION("oggstr");
friend class AudioStreamPlaybackOGGVorbis; friend class AudioStreamPlaybackOGGVorbis;

View file

@ -48,7 +48,7 @@ void ResourceImporterOGGVorbis::get_recognized_extensions(List<String> *p_extens
} }
String ResourceImporterOGGVorbis::get_save_extension() const { String ResourceImporterOGGVorbis::get_save_extension() const {
return "asogg"; return "oggstr";
} }
String ResourceImporterOGGVorbis::get_resource_type() const { String ResourceImporterOGGVorbis::get_resource_type() const {

View file

@ -37,7 +37,7 @@
class Animation : public Resource { class Animation : public Resource {
GDCLASS(Animation, Resource); GDCLASS(Animation, Resource);
RES_BASE_EXTENSION("anm"); RES_BASE_EXTENSION("anim");
public: public:
enum TrackType { enum TrackType {

View file

@ -84,7 +84,7 @@ public:
class AudioStreamSample : public AudioStream { class AudioStreamSample : public AudioStream {
GDCLASS(AudioStreamSample, AudioStream) GDCLASS(AudioStreamSample, AudioStream)
RES_BASE_EXTENSION("smp") RES_BASE_EXTENSION("sample")
public: public:
enum Format { enum Format {

View file

@ -66,7 +66,7 @@ public:
class BitmapFont : public Font { class BitmapFont : public Font {
GDCLASS(BitmapFont, Font); GDCLASS(BitmapFont, Font);
RES_BASE_EXTENSION("fnt"); RES_BASE_EXTENSION("font");
Vector<Ref<Texture> > textures; Vector<Ref<Texture> > textures;

View file

@ -43,7 +43,7 @@
class Material : public Resource { class Material : public Resource {
GDCLASS(Material, Resource); GDCLASS(Material, Resource);
RES_BASE_EXTENSION("mtl"); RES_BASE_EXTENSION("material");
OBJ_SAVE_TYPE(Material); OBJ_SAVE_TYPE(Material);
RID material; RID material;

View file

@ -140,7 +140,7 @@ public:
class ArrayMesh : public Mesh { class ArrayMesh : public Mesh {
GDCLASS(ArrayMesh, Mesh); GDCLASS(ArrayMesh, Mesh);
RES_BASE_EXTENSION("msh"); RES_BASE_EXTENSION("mesh");
private: private:
struct Surface { struct Surface {

View file

@ -39,7 +39,7 @@
class MeshLibrary : public Resource { class MeshLibrary : public Resource {
GDCLASS(MeshLibrary, Resource); GDCLASS(MeshLibrary, Resource);
RES_BASE_EXTENSION("gt"); RES_BASE_EXTENSION("meshlib");
struct Item { struct Item {
String name; String name;

View file

@ -36,7 +36,7 @@
class MultiMesh : public Resource { class MultiMesh : public Resource {
GDCLASS(MultiMesh, Resource); GDCLASS(MultiMesh, Resource);
RES_BASE_EXTENSION("mmsh"); RES_BASE_EXTENSION("multimesh");
public: public:
enum TransformFormat { enum TransformFormat {

View file

@ -37,7 +37,7 @@
class ShaderGraph : public Shader { class ShaderGraph : public Shader {
GDCLASS( ShaderGraph, Shader ); GDCLASS( ShaderGraph, Shader );
RES_BASE_EXTENSION("sgp"); RES_BASE_EXTENSION("vshader");
public: public:

View file

@ -37,7 +37,7 @@ class Shape : public Resource {
GDCLASS(Shape, Resource); GDCLASS(Shape, Resource);
OBJ_SAVE_TYPE(Shape); OBJ_SAVE_TYPE(Shape);
RES_BASE_EXTENSION("shp"); RES_BASE_EXTENSION("shape");
RID shape; RID shape;
Ref<ArrayMesh> debug_mesh_cache; Ref<ArrayMesh> debug_mesh_cache;

View file

@ -39,7 +39,7 @@
class StyleBox : public Resource { class StyleBox : public Resource {
GDCLASS(StyleBox, Resource); GDCLASS(StyleBox, Resource);
RES_BASE_EXTENSION("sbx"); RES_BASE_EXTENSION("stylebox");
OBJ_SAVE_TYPE(StyleBox); OBJ_SAVE_TYPE(StyleBox);
float margin[4]; float margin[4];

View file

@ -226,7 +226,7 @@ VARIANT_ENUM_CAST(ImageTexture::Storage);
class AtlasTexture : public Texture { class AtlasTexture : public Texture {
GDCLASS(AtlasTexture, Texture); GDCLASS(AtlasTexture, Texture);
RES_BASE_EXTENSION("atex"); RES_BASE_EXTENSION("atlastex");
protected: protected:
Ref<Texture> atlas; Ref<Texture> atlas;
@ -265,7 +265,7 @@ public:
class LargeTexture : public Texture { class LargeTexture : public Texture {
GDCLASS(LargeTexture, Texture); GDCLASS(LargeTexture, Texture);
RES_BASE_EXTENSION("ltex"); RES_BASE_EXTENSION("largetex");
protected: protected:
struct Piece { struct Piece {
@ -312,7 +312,7 @@ public:
class CubeMap : public Resource { class CubeMap : public Resource {
GDCLASS(CubeMap, Resource); GDCLASS(CubeMap, Resource);
RES_BASE_EXTENSION("cbm"); RES_BASE_EXTENSION("cubemap");
public: public:
enum Storage { enum Storage {
@ -393,7 +393,7 @@ VARIANT_ENUM_CAST(CubeMap::Storage);
class CurveTexture : public Texture { class CurveTexture : public Texture {
GDCLASS(CurveTexture, Texture); GDCLASS(CurveTexture, Texture);
RES_BASE_EXTENSION("cvtex"); RES_BASE_EXTENSION("curvetex");
private: private:
RID texture; RID texture;

View file

@ -43,7 +43,7 @@
class Theme : public Resource { class Theme : public Resource {
GDCLASS(Theme, Resource); GDCLASS(Theme, Resource);
RES_BASE_EXTENSION("thm"); RES_BASE_EXTENSION("theme");
static Ref<Theme> default_theme; static Ref<Theme> default_theme;

View file

@ -41,7 +41,7 @@ class VisibilityNotifier;
class World : public Resource { class World : public Resource {
GDCLASS(World, Resource); GDCLASS(World, Resource);
RES_BASE_EXTENSION("wrd"); RES_BASE_EXTENSION("world");
private: private:
RID space; RID space;