Save Point: Profiles, Levels and Unlocks Kit
README.md
SaveHost
Runs saveKit for the local player. saveKit.save spawns it on a local, temporary entity the first time a game uses the kit in play, so a game never places it and it has no fields to set.
While it exists it:
- loads the player's save when play starts and saves what changed when play stops;
- calls
Save._tickevery frame (play time, autosave timer, coalesced saves, screen animations); - draws the HUD (XP bar, level-up banner, toasts, saved indicator) and the open panel (unlocks, profile card, slot picker), redrawing only when something changed or the screen size did;
- handles the panels' clicks (slot actions, close) and opens the slot picker by itself in the slots style until a slot is chosen;
- connects the other kits the game passed in with
Save.setup({ kits = ... })(Trapline, scoreKit, pickupsKit), and disconnects them when destroyed. It never looks a kit up by itself.