|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
ictbram |
I am using the fileDialog to load in an image.
The file list is always empty when I show it with $FileDialog.show() (
)
The user has to press the refresh button to make the files appear (
)
Is there a way to do this by code?
|
|
|
|
Reply From: |
hilfazer |
There is: overload _draw()
of FileDialog
func _draw():
set_current_dir( path )
ok, can this be done with gdscript? That’s c++ probably? I meant, is there a way to do this by code with gdscript…
ictbram | 2018-05-24 16:53
Sry, i meant “override”. Actually, it is GDScript
hilfazer | 2018-05-24 17:18
aha thx, got it with a refresh function in extends FileDialog
func refresh():
self._draw()
func _draw():
set_current_dir( "res://" )
ictbram | 2018-05-24 17:49
I am not sure if this was the correct answer a while back but in 3.2 this does not work for me. use fileDialog.invalidate() instead.
system
3
|
|
|
|
Reply From: |
Cevantime |
Just in case anyone still wonders : the correct of displaying a FileDialog (like any popup) is to call the popup()
function :
in this case, instead of $FileDialog.show()
, just call $FileDialog.popup()
While you are correct about the popup(), it does not solve the problem off having to click on refresh.
Actually it does, for me
rocket 007 | 2023-06-11 07:47