-
Notifications
You must be signed in to change notification settings - Fork 54
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
Preferences System #1007
Preferences System #1007
Conversation
…and automatically configure them when spawned in
Access events from elsewhere by calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will definitely be shaped as it gets used more and more, but good for now
fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts
Outdated
Show resolved
Hide resolved
public constructor(mechanism: Mechanism, assemblyName: string) { | ||
super(mechanism); | ||
// Tracks the number of each specific mira file spawned | ||
public static numberRobotsSpawned: { [key: string]: number } = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this and robotsSpawned
be combined? Maybe a map from key to list of spawned robots? That might be a bit slower if we're iterating over robotsSpawned
a lot but it would also mean the information would only be stored in one place and we don't have to maintain two separate places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An issue I see with this is if you spawn two robots for example 'mean machine [0]' and 'mean machine [1]', then remove only 'mean machine [0]', it needs to know that the robot still around is index 1 not 0. I can't think of an easy way around this, but let me know if you do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it. Nice work!
Description
A system to save and load player preferences including settings from the settings modal, robot controls, robot game piece manipulation configuration, field scoring zone data, and color themes. There are default preferences that will be used if a preference is not yet configured by the user.
Objectives
Note
The goal of this PR is to build a system to load, modify, and save preferences, not to make the preferences themselves have an effect on gameplay. While you should be able to change like zoom sensitivity for example, it won't yet affect the actual camera movement. The only preferences that should fully work are robot controls and color themes.
Preferences List (all checked off have been implemented AND TESTED)
Global
Robot Specific
Field Specific
Testing Done
How to add a global preference
PreferencesSystem.setGlobalPreference<number>("MyPreference", 2)
PreferencesSystem.getGlobalPreference<number>("MyPreference")
Warning
Merge after #986
JIRA Issue