Playdate Portable Options Class

Hey everyone, I just open-sourced the options class we use in Sparrow Solitaire to manage all of the game's customizeable settings. GitHub - macvogelsang/pd-options: A portable and robust options class for the Playdate Lua SDK

This is a single class you can install by copying into your source manually or via toybox, and all the options are defined with an easy declarative syntax. Even if your game doesn't need all the complex customizability features, it works well as a debug menu too! The class originated from an older version @matt used in Daily Driver, and it evolved significantly from there for Sparrow Solitaire. A version of it from last year is also featured in Gravity Express.

Feel free to submit any PRs or suggestions, and let me know if you use it in any projects!

demo

8 Likes

Super full-featured! Thanks!

Great!

Thanks for letting me use this. I had a long list of todos and was happy to not have to implement this myself..

The single class is nice and portable, and probably best for the general Lua audience. Personally, I would have it split up in a view, viewmodel and datastore class or something like that. For maintainability / readability; but also to optimize game boot time. I would only initialize the data store at boot time, because I need the settings to decide on which control scheme to use for example. But the code to render the settings and interact with it is only needed if players open the settings, which will not be the case for most play sessions. I do realize that the boot time improvement only applies if you use my modular code loading approach; where the default for Lua games is to load the entire game at boot

But overall I was very happy with it, it is well written and allows for some adjustments to your own needs. My own additions where conditionals where one option disables /enables other options, and hidden settings

Ooo, I love this.
Would come in handy for many thingies and thunkimicks.