@@ -119,8 +119,10 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se
119119 if ( f == "" || char_at ( f , 0 ) == "." ) {
120120 continue ; // Skip hidden
121121 }
122- if ( string_index_of ( f , "." ) > 0 && ! path_is_known ( f ) ) {
123- continue ; // Skip unknown extensions
122+ if ( ! is_cloud && string_index_of ( f , "." ) > 0 ) {
123+ if ( ! iron_is_directory ( path_join ( dir_path , f ) ) && ! path_is_known ( f ) ) {
124+ continue ; // Skip unknown extensions
125+ }
124126 }
125127 if ( is_cloud && string_index_of ( f , "_icon." ) >= 0 ) {
126128 continue ; // Skip thumbnails
@@ -163,12 +165,12 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se
163165
164166 let f : string = ui_files_files [ i ] ;
165167 let _x : f32 = ui . _x ;
166-
167- let rect : rect_t = string_index_of ( f , "." ) > 0 ? file : folder ;
168+ let is_folder : bool = iron_is_directory ( path_join ( handle . text , f ) ) ;
169+ let rect : rect_t = is_folder ? folder : file ;
168170 if ( rect == file && is_cloud ) {
169171 rect = downloading ;
170172 }
171- let col : i32 = rect == file ? ui . ops . theme . LABEL_COL : ui . ops . theme . LABEL_COL - 0x00202020 ;
173+ let col : i32 = rect == file ? ui . ops . theme . LABEL_COL : ui . ops . theme . LABEL_COL - 0x00202020 ;
172174 if ( ui_files_selected == i )
173175 col = ui . ops . theme . HIGHLIGHT_COL ;
174176
@@ -254,7 +256,7 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se
254256 }
255257 }
256258
257- if ( ends_with ( f , ".arm" ) && ! is_cloud ) {
259+ if ( ! is_folder && ends_with ( f , ".arm" ) && ! is_cloud ) {
258260 if ( ui_files_icon_map == null ) {
259261 ui_files_icon_map = map_create ( ) ;
260262 }
@@ -318,7 +320,7 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se
318320 }
319321 }
320322
321- if ( path_is_texture ( f ) && ! is_cloud ) {
323+ if ( ! is_folder && path_is_texture ( f ) && ! is_cloud ) {
322324 let w : i32 = 50 ;
323325 if ( ui_files_icon_map == null ) {
324326 ui_files_icon_map = map_create ( ) ;
@@ -392,7 +394,7 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se
392394 // Label
393395 ui . _x = _x ;
394396 ui . _y += slotw * 0.75 ;
395- let label0 : string = ( ui_files_show_extensions || string_index_of ( f , "." ) <= 0 ) ? f : substring ( f , 0 , string_last_index_of ( f , "." ) ) ;
397+ let label0 : string = ( is_folder || ui_files_show_extensions || string_index_of ( f , "." ) <= 0 ) ? f : substring ( f , 0 , string_last_index_of ( f , "." ) ) ;
396398 let label1 : string = "" ;
397399 while ( label0 . length > 0 && draw_string_width ( ui . ops . font , ui . font_size , label0 ) > ui . _w - 6 ) { // 2 line split
398400 label1 = char_at ( label0 , label0 . length - 1 ) + label1 ;
0 commit comments