File tree Expand file tree Collapse file tree 1 file changed +38
-1
lines changed
Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -331,9 +331,11 @@ export class Apps extends System {
331331 if ( ! isArray ( entity . fields ) ) {
332332 entity . fields = [ ]
333333 }
334- // apply any initial values
335334 const props = entity . blueprint . props
336335 for ( const field of entity . fields ) {
336+ // apply file shortcuts
337+ fileRemaps [ field . type ] ?. ( field )
338+ // apply any initial values
337339 if ( field . initial !== undefined && props [ field . key ] === undefined ) {
338340 props [ field . key ] = field . initial
339341 }
@@ -378,3 +380,38 @@ export class Apps extends System {
378380 }
379381 }
380382}
383+
384+ export const fileRemaps = {
385+ avatar : field => {
386+ field . type = 'file'
387+ field . kind = 'avatar'
388+ } ,
389+ emote : field => {
390+ field . type = 'file'
391+ field . kind = 'emote'
392+ } ,
393+ model : field => {
394+ field . type = 'file'
395+ field . kind = 'model'
396+ } ,
397+ texture : field => {
398+ field . type = 'file'
399+ field . kind = 'texture'
400+ } ,
401+ image : field => {
402+ field . type = 'file'
403+ field . kind = 'image'
404+ } ,
405+ video : field => {
406+ field . type = 'file'
407+ field . kind = 'video'
408+ } ,
409+ hdr : field => {
410+ field . type = 'file'
411+ field . kind = 'hdr'
412+ } ,
413+ audio : field => {
414+ field . type = 'file'
415+ field . kind = 'audio'
416+ } ,
417+ }
You can’t perform that action at this time.
0 commit comments