Alzter / TuxBuilder

A Godot re-implementation of SuperTux
GNU General Public License v3.0
212 stars 28 forks source link

Edits always reverted when using HTML5 version #28

Closed qwertychouskie closed 5 years ago

qwertychouskie commented 5 years ago

https://jacobspctuneup.tk/TuxBuilder/HTML5/

Editing the level reverts the changes as soon as the editor is exited.

TuxBuilder built from https://github.com/Alzter/TuxBuilder/commit/13d29c0d7e837a72e09939a8ef654b1013bd22cc.

Alzter commented 5 years ago

Odd, this isn't a bug in my version. The current edited level is supposed to save into Levels/EditedLevel.tscn but maybe compiling Tux Builder messes with that.

tobbi commented 5 years ago

I think the problem is that the html5 page has no write access to the res:// path.

Calinou commented 5 years ago

I think the problem is that the html5 page has no write access to the res:// path.

This is correct, res:// isn't guaranteed to be writable to on all platforms. (If you install the game to a system-wide location on Windows or Linux, the same issue will occur.)

User data should be saved to user:// instead. (On HTML5, this will use localStorage, as you can't manipulate the user's filesystem directly.)

qwertychouskie commented 5 years ago

Fixed on my HTML5 build: https://jacobspctuneup.tk/TuxBuilder/HTML5/

Modified Gameplay.gd: Gameplay.gd.txt

Feel free to commit if you think it's good.

qwertychouskie commented 5 years ago

@Alzter / @tobbi Can one of you check if the above code is correct and commit it if it is? Thanks

skyace65 commented 5 years ago

The code seems good to me so I'm going to merge a PR with the changes.