98teg / NativeDialogs

Native Dialogs is a plugin for Godot that allows you to interact with OS-specific dialogs, such as notifications, messages and file dialogs.
MIT License
156 stars 8 forks source link

Support for web dialogs #30

Closed shafnaz closed 6 months ago

shafnaz commented 6 months ago

Very nice addon!

Would it be possible to create native dialogs for web export?

98teg commented 6 months ago

Hi! Thank you for your kind words!

The web is a very different platform compared to a native OS. For example, on a desktop application, you use a file dialog to get a file path, and then you use that file path to write or read a file. On the web that's not possible, you ask a user for the data of a file, not the file path. Or you provide data to the browser to start a download.

It is because of these fundamental differences that you must consider both platforms differently, and my addon can not provide the same API for both. Here is a plugin that helps you upload a file in the browser:

https://github.com/Scrawach/godot-file-access-web

shafnaz commented 6 months ago

I understand. looks like a server would have to come into play

98teg commented 6 months ago

No, not really. You can ask the user to upload a file, then manipulate it in the browser, and finally download it. You need to use the JavaScriptBridge or find an addon that uses it like the one above.