Add support for loading additional image formats

This also makes it possible to load JPEG images if they have a
`.jpeg` extension.
This commit is contained in:
Hugo Locurcio 2019-10-20 19:00:11 +02:00
parent 80f8071d7b
commit a15ed1cf04
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
2 changed files with 8 additions and 4 deletions

View File

@ -196,7 +196,7 @@ func load_material():
dialog.rect_min_size = Vector2(500, 500)
dialog.access = FileDialog.ACCESS_FILESYSTEM
dialog.mode = FileDialog.MODE_OPEN_FILES
dialog.add_filter("*.ptex;Procedural textures file")
dialog.add_filter("*.ptex;Procedural Textures File")
dialog.connect("files_selected", self, "do_load_materials")
dialog.popup_centered()
@ -235,7 +235,7 @@ func save_material_as():
dialog.rect_min_size = Vector2(500, 500)
dialog.access = FileDialog.ACCESS_FILESYSTEM
dialog.mode = FileDialog.MODE_SAVE_FILE
dialog.add_filter("*.ptex;Procedural textures file")
dialog.add_filter("*.ptex;Procedural Textures File")
dialog.connect("file_selected", graph_edit, "save_file")
dialog.popup_centered()

View File

@ -24,7 +24,11 @@ func _on_TextureButton_pressed():
dialog.rect_min_size = Vector2(500, 500)
dialog.access = FileDialog.ACCESS_FILESYSTEM
dialog.mode = FileDialog.MODE_OPEN_FILE
dialog.add_filter("*.png;PNG image")
dialog.add_filter("*.jpg;JPG image")
dialog.add_filter("*.bmp;BMP Image")
dialog.add_filter("*.hdr;Radiance HDR Image")
dialog.add_filter("*.jpg,*.jpeg;JPEG Image")
dialog.add_filter("*.png;PNG Image")
dialog.add_filter("*.tga;TGA Image")
dialog.add_filter("*.webp;WebP Image")
dialog.connect("file_selected", self, "set_texture")
dialog.popup_centered()