Skip to content

Commit 05cb7f0

Browse files
[kit] Added hdr to texture extensions, added custom file extensions override
1 parent ba538b3 commit 05cb7f0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hide/kit/File.hx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ class File extends Widget<String> {
66

77
public var type : String = "file";
88

9+
/**
10+
Override type with a custom list of extensions (without the ".")
11+
**/
12+
public var exts : Array<String> = null;
13+
914
#if js
1015
var file: hide.comp.FileSelect2;
1116
var element: hide.Element;
1217
#end
1318

1419
function makeInput():NativeElement {
1520
#if js
16-
file = new hide.comp.FileSelect2(types.get(type), element, null, true);
21+
file = new hide.comp.FileSelect2(exts ?? types.get(type), element, null, true);
1722

1823
file.onChange = () -> {
1924
value = file.path;
@@ -52,7 +57,7 @@ class File extends Widget<String> {
5257
"file" => ["*"],
5358
"prefab" => ["prefab", "l3d", "fx"],
5459
"fx" => ["fx"],
55-
"texture" => ["png", "dds", "jpeg", "jpg"],
60+
"texture" => ["png", "dds", "jpeg", "jpg", "hdr"],
5661
"model" => ["fbx", "hmd"],
5762
"atlas" => ["atlas"],
5863
"font" => ["fnt"],

0 commit comments

Comments
 (0)