The SaveSlotController manages the visual aspects in a restrictive way, requiring users to alter it if they want a more custom look for their SaveSlots. This violates the Open-Closed Principle of software design.
What is the new behavior?
The SaveSlotController has been refactored to delegate the visual display aspects to subclasses of a new class this PR adds: SaveSlotView. This way, if the user wants to do something like display a chapter title on a slot, they can just add to the slot prefab, and add (let's say...) a SaveSlotChapterView component.
This removes the Open-Closed Principle violation, while making the design cleaner and more extensible.
Important Notes
For organization, I moved a lot of the save-system-related classes to their own folders.
In SaveController.cs, I renamed smc to saveManager for better variable naming
In SaveController.cs, I fixed a bug that made the Save button useless. See the comments in the Update function
Refactored SaveSlotController to function more as a hub of sorts, where SaveSlotViews (components that display things based on save data) are what handle most of the visual aspects.
To go with the above, I created SaveSlotView subclasses to display the save slot's number, date, and description. The prefab was also altered to use them
My change require modifications or additions to documentation
My change modifies the runtime execution/behaviour of SaveSlotControllers
To help see how these changes make the slots more extensible, look at the SaveSlotNumberView and SaveDateView components
Especially of note is how SaveDateView lets the user choose how the date is rendered in string format, as opposed to how the SaveGameMetaData class forces it to be in the O format
Description
An improvement to how SaveSlots work.
What is the current behavior?
The SaveSlotController manages the visual aspects in a restrictive way, requiring users to alter it if they want a more custom look for their SaveSlots. This violates the Open-Closed Principle of software design.
What is the new behavior?
The SaveSlotController has been refactored to delegate the visual display aspects to subclasses of a new class this PR adds: SaveSlotView. This way, if the user wants to do something like display a chapter title on a slot, they can just add to the slot prefab, and add (let's say...) a SaveSlotChapterView component.
This removes the Open-Closed Principle violation, while making the design cleaner and more extensible.
Important Notes
Other information