Implement project saving

This commit is contained in:
2024-03-02 22:35:58 +01:00
parent f552becc18
commit 164b71a0c3
2 changed files with 32 additions and 1 deletions

View File

@@ -25,5 +25,17 @@ class Project:
self.loaded=True
def save(self,path):
# save project data to file
with open(path, "w") as f:
json.dump({
"char_width": self.char_res[0],
"char_height": self.char_res[1],
"chars": self.chars
}, f, indent=4)
self.path=path
self.loaded=True
def does_char_exist(self,c):
return chr(c) in self.chars