Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2657 create settingsjs file #2659

Closed
wants to merge 8 commits into from
Closed

2657 create settingsjs file #2659

wants to merge 8 commits into from

Conversation

0reo
Copy link
Contributor

@0reo 0reo commented Mar 24, 2022

This PR adds and event driven settings manager to handle getting/setting user settings to local storage.

  • set function is private, can only add settings using event
  • access to the settings manager is done via metaversefile-api, as VRM totum apps will need to be able to load graphics settings
  • current handles GfxSettings, ControlsSettings, AiSettings, AudioSettings
  • this is needed to continue on the quality settings tasks

@0reo 0reo requested a review from avaer March 26, 2022 22:02
constructor() {
super();

this.addEventListener('gfxSettingsChanged', e => {
Copy link
Contributor

@avaer avaer Apr 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The casing between event names and data is inconsistent. Also, we generally do not camelcase in event names, which is the standard for the web platform; it's usually all lowercase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted


this.addEventListener('gfxSettingsChanged', e => {
const settings = e.data;
this.#setSettings('GfxSettings', settings);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to separate these events at all?

Is there ever a case, besides the settings panel itself, where we are generally interested in a page of settings as opposed to a setting itself? What would be the purpose of such a notification/categorizing it this way for users of this API, other than confusion?

IMO it makes more sense to emit that a specific setting value changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll change it to a single event.

I also agree that a single value makes more sense. It's currently accepting the full set of perameters because of how the saveSettings functions are written in the settings tabs, But I'll adjust accordingly

@0reo 0reo marked this pull request as draft April 2, 2022 19:28
@avaer
Copy link
Contributor

avaer commented Apr 11, 2022

Doesn't look like this will make it in.

@avaer avaer closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create settings.js file
2 participants