Closed musjj closed 2 years ago
what's your code? currently trying to recreate this issue without making an entire game lol
what's your code? currently trying to recreate this issue without making an entire game lol
As I understand it, you should be able to reproduce this by running pyxel edit unexistent/folder/resource.pyxres
(like @musjj said above), and click on the save button (or press Ctrl(Command)+S
).
I tried it, using the latest Pyxel version, and found the following error:
ah, yes that did it. thanks
im noticing i cant find a good way to create the file if its not found, tried using WB and just W:
(sorry this is shitcode, im new to more complicated on this)
def __on_save_button_press(self):
print("Saving...")
if not os.path.exists(self._resource_file):
parts = self._resource_file.split("/")
new = parts[-1].removesuffix(".pyxres")
new = new+".pyxres" # make sure the file has .pyxres
open(new, "wb").close() # save to CWD
pyxel.save(new)
else:
pyxel.save(self._resource_file)
In Pyxel 1.8.6. The directory of the specified file is checked when the file is opened.
When creating a new resource file with
pyxel edit D:/dir/test.pyxres
, if the parent directory (dir
in this case) doesn't exist, the resource editor will crash if you try to save:This can potentially make a user lose all their progress so far (like I just did 😞).