Open tomayac opened 1 year ago
Thanks for opening this issue! I think the proper Trello card is this one - I've updated your post with: https://trello.com/c/MEAeScbO/457-allow-opening-saving-locally-a-project-and-use-local-resources-from-the-web-app-chrome-edge-safari
For GDevelop, there are two things important to handle when it comes to files:
So there are different level of integration which could be created:
browser-fs-access
to improve the UX by saving always to the same file.The 1. is the easiest. For 2. and 3., it requires greater care because it needs to support loading the project, but also ensure resources can be read, and then used in previews (probably work with blobs).
EDIT: in other words, where Construct 3 is storing everything in a zip file, projects in GDevelop are a collection of the project json files + the resources which can be relative files (desktop app) or a mix of public URLs+private URLs (for cloud projects, on the web or desktop app).
Thanks a lot for the better Trello link! If this allows you to move off Electron, I think it'd be great for many users saving them a large download and you having to build for that many OS combinations. Especially since your PWA is really neat and makes great use of Window Controls Overlay:
For 2., yes, this would be a new feature, I didn't see a way to import an existing game, so didn't mention it. The corresponding browser-fs-access
method would be fileOpen()
. It falls back to <input type=file>
on non-supporting browsers.
A cool feature enabled by the API is command/ctrl + s saving, see this write-up for more background.
Especially since your PWA is really neat and makes great use of Window Controls Overlay
Thank you! I was also very happy with the result we got here 👍
I'm marking this as a Good First Issue as I think solution 1 (getting the download as a copy adapted) is totally doable. Solution 2/3 are more involved (but would allow to do almost everything locally, so the web-app would be almost equivalent to the Electron app) - though in the longer term it would be interesting to have (...would be perfect for a GSoC project but seems we've not been accepted this year 🥲)
A cool feature enabled by the API is command/ctrl + s saving, see this write-up for more background.
Yes getting the Cmd/Ctrl+S to "just work" would be perfect!
[S]o the web-app would be almost equivalent to the Electron app)
One missing piece is an App Menu API, which would be really nice for following macOS guidelines. If you'd be interested, feel free to chime in on the bug as a potential user of such an API would it exist.
Hello, I was wondering if implementing solution 2/3 as described in this ticket would also allow working with local files using the iOS app, or if that would need to be implemented separately. For example, if I wanted to use the GDevelop app with Working Copy on iOS.
Thanks!
Until iOS supports the picker methods of the File System Access API (tracked as https://bugs.webkit.org/show_bug.cgi?id=231706), you need to fall back to downloading. I maintain browser-fs-access that makes this relatively painless.
Description
Rather than downloading, allow for true saving of games. See the Trello request.
Solution suggested
Describe the solution
Replace calls to
openBlobDownloadUrl()
with afileSave()
call from thebrowser-fs-access
library. (Full disclosure: I'm its author.) This would use the same<a download>
fallback on non-supporting browsers, but properly use the File System Access API on supporting browsers. The advantage is that saves will not be downloads (so users don't end up with chains ofgdevelop game.zip
,gdevelop game (1).zip
,gdevelop game (2).zip
), but oneAdd any other context or screenshots about the feature request here.
Construct 3 uses this API successfully.
Explain if you can help to implement the solution.
Happy to make changes to
browser-fs-access
should you require them.Alternatives considered
browser-fs-access
.