Keith1039 / Pygame-RPG

A repository of me trying to make an RPG with a custom game engine with Pygame added in as support.
0 stars 0 forks source link

Pygame-RPG 19.6 Housekeeping and bugfixing #69

Closed Keith1039 closed 3 months ago

Keith1039 commented 3 months ago

Pygame-RPG 19.6 Housekeeping and bugfixing

Due to some, really dumb past decisions, I made the Event class to basically act as a struct of sorts. The issue is, that's completely unnecessary since the dictionary is already structured and the class has no unique methods. As such, I'm retroactively deleting the Event class and replacing it with dictionaries instead. This way, I can save and load events easily from a master list. These event dictionaries can then be easily saved and loaded instead of having to do a cumbersome process of decompiling the object into a dictionary and recompiling it into an object with the said dictionary.

Another benefit of doing this is that I can easily create a script to retroactively add more keys to the event dictionary and have everything work as intended.

To help with this, I also created a function in SaveManager called Tuplefy2 which turns all lists in the dictionary back into a tuple for ScreenManager.

PR checklist