Open grady404 opened 8 years ago
By hiding the .json
from the names of the files in the open menu, I used files.replace('.')[0]
which would make any levels that have a .
in their name not work.
Why don't you just do something like this (I know this is Python, but I'm sure there's a similar way to do it in JS):
if filename[-5:] == ".json": filename = filename[:-5]
That way even if the file name doesn't end in .json
, the level can still be displayed and loaded normally.
Or actually, forget what I said above. If you wanted support for all file extensions, you could just find the last .
in the file name, and then cut it off from there, but if you don't find a .
don't do anything. That way if the file name is something like grady.level.json
it will display it as grady.level
.
Yeah, but there was also a glitch that happened where there is a blank level selectable, not sure what is causing it though
What? Explain
ill try to re-create
Add it to the issue tracker
If I save a level that has spaces in its name (or apostrophes, and other characters I'm sure), the level does not load properly upon reopening, and causes the game to display a blank level and then freeze, forcing the game to be closed. Something to do with escape characters, shouldn't be a hard fix.