kpreid / all-is-cubes

Yet another block/voxel game; in this one the blocks are made out of blocks. Runs in browsers on WebGL+WebAssembly.
https://kpreid.dreamwidth.org/tag/all+is+cubes
Apache License 2.0
164 stars 8 forks source link

Preferences system #304

Open kpreid opened 1 year ago

kpreid commented 1 year ago

We need a preferences system; an abstraction which persists, to config directory or browser storage, all the usual things:

Note that it is not sufficient to just serialize the GraphicsOptions and so on, because GraphicsOptions contains several enums which have numeric parameters (such as ExposureOption::Fixed) which should be remembered in a preferences system even if they're not currently active. The GraphicsOptions schema is optimized for unambiguously telling the renderer what to do, which is not aligned with editability. I expect that non-graphics options will have similar considerations.

(Despite this consideration, all-is-cubes-desktop currently does serialize GraphicsOptions. But it also doesn't persist edits yet — just creates a config file you can edit on disk. And web has no corresponding feature.)

kpreid commented 1 year ago

A thought: perhaps extensibility of what kinds of settings can be passed around should work via Provider? — oh, never mind, still unstable.