Skip to content

Commit

Permalink
add validValues to prevent basics from having incorrect studio values,
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Dec 8, 2022
1 parent da0e8e3 commit 32ce986
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion js/real/RealMoleculesModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class RealMoleculesModel extends MoleculeShapesModel {
*/
constructor( isBasicsVersion, tandem ) {

const startingMoleculeShape = isBasicsVersion ? RealMoleculeShape.TAB_2_BASIC_MOLECULES[ 0 ] : RealMoleculeShape.TAB_2_MOLECULES[ 0 ];
const validMoleculeShapes = isBasicsVersion ? RealMoleculeShape.TAB_2_BASIC_MOLECULES : RealMoleculeShape.TAB_2_MOLECULES;
const startingMoleculeShape = validMoleculeShapes[ 0 ];
const startingMolecule = new RealMolecule( startingMoleculeShape );

super( isBasicsVersion, {
Expand All @@ -41,6 +42,7 @@ class RealMoleculesModel extends MoleculeShapesModel {
this.realMoleculeShapeProperty = new Property( startingMoleculeShape, {
tandem: tandem.createTandem( 'realMoleculeShapeProperty' ),
phetioValueType: RealMoleculeShape.RealMoleculeShapeIO,
validValues: validMoleculeShapes,
phetioState: false
} );

Expand Down
4 changes: 1 addition & 3 deletions js/real/RealMoleculesScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import PhetFont from '../../../scenery-phet/js/PhetFont.js';
import { AlignBox, FlowBox, Node, RichText, Text } from '../../../scenery/js/imports.js';
import AquaRadioButtonGroup from '../../../sun/js/AquaRadioButtonGroup.js';
import ComboBox from '../../../sun/js/ComboBox.js';
import RealMoleculeShape from '../common/model/RealMoleculeShape.js';
import MoleculeView from '../common/view/3d/MoleculeView.js';
import MoleculeShapesColors from '../common/view/MoleculeShapesColors.js';
import MoleculeShapesPanel from '../common/view/MoleculeShapesPanel.js';
Expand All @@ -36,8 +35,7 @@ class RealMoleculesScreenView extends MoleculeShapesScreenView {
const optionsPanelTandem = tandem.createTandem( 'optionsPanel' );

const comboBoxListContainer = new Node();
const comboBoxMolecules = model.isBasicsVersion ? RealMoleculeShape.TAB_2_BASIC_MOLECULES : RealMoleculeShape.TAB_2_MOLECULES;
const comboBoxItems = _.map( comboBoxMolecules, realMoleculeShape => {
const comboBoxItems = _.map( model.realMoleculeShapeProperty.validValues, realMoleculeShape => {
return {
value: realMoleculeShape,
node: new RichText( ChemUtils.toSubscript( realMoleculeShape.displayName ) ),
Expand Down

0 comments on commit 32ce986

Please sign in to comment.