Skip to content

Bevy Preferences API #13311

@viridia

Description

@viridia

What problem does this solve or what need does it fill?

Games and editors need a way to store user preferences: things like video options, keyboard/controller mappings and so on.

What solution would you like?

I proposal we add an API to Bevy for saving and loading of user preferences.

This should support at least the following features:

  • It should support serde serialization of preference data in some common format.
  • It should allow plugins and libraries to be able to define their own preferences that can be stored along with the app preferences.
  • For desktop platforms and mobile, it would know the correct directory for storing the preferences in the user's home directory.
  • For browser platforms, it should be able to store preference data in browser local storage.

The solution you propose for the problem presented.

What alternative(s) have you considered?

There are a number of existing Rust crates that provide preference-saving functionality. However, these don't necessarily conform to the requirements for a Bevy-based game. For example, some crates may assume that the preferences are stored in the filesystem, which may not be true in a browser-based game.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-FeatureA new feature, making something new possibleS-Needs-Design-DocThis issue or PR is particularly complex, and needs an approved design doc before it can be mergedX-Needs-SMEThis type of work requires an SME to approve it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions