Godot-proposals: Allow use of native system file picker dialog

Created on 26 Jun 2020  路  5Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:

Describe the problem or limitation you are having in your project:

  1. godot file picker does not allow filesystem access from godot in web browser
  2. godot file picker does not allow filesystem access in sandboxed macOS apps
  3. godot file picker does not offer capabilities and conveniences of the system file picker

Describe the feature / enhancement and how it helps to overcome the problem or limitation:

regarding the above issues, allowing use of system file picker:

  • is required for 1
  • would alleviate 2

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

similar to these existing libraries, but cross platform and in core:

If this enhancement will not be used often, can it be worked around with a few lines of script?:

Sadly not, core provides no mechanism for accessing native file pickers.

See https://github.com/godotengine/godot/issues/13177 for more history

The ongoing effort of creating a better file picker https://github.com/godotengine/godot/pull/36053 will still not help this issue.

Is there a reason why this should be core and not an add-on in the asset library?:

  • it is required for sandboxed macOS apps, so core requirement is the only real solution
gui porting

Most helpful comment

This is also necessary for the HTML5 platform, as you can't access the native file system of the device with the FileDialog when running a game/app on browser.

All 5 comments

This is also necessary for the HTML5 platform, as you can't access the native file system of the device with the FileDialog when running a game/app on browser.

@OverloadedOrama I've added that to the above proposal, thanks!

For those interested in implementing this it seems like this is a good resource for implementing it on windows: https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ifiledialog

Although I see no reason why https://github.com/mlabbe/nativefiledialog cannot be pulled into third party

Was this page helpful?
0 / 5 - 0 ratings