Skip to content

Commit

Permalink
Address TODO, see: #164
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed May 12, 2023
1 parent 8a62816 commit 7ab2d68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion js/common/CAVConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ const CAVConstants = {
MAX_KICKS_PROPERTY: new NumberProperty( CAVQueryParameters.maxKicks, {
validValues: [ 15, 20, 25, 30 ],
tandem: Tandem.PREFERENCES.createTandem( 'maxKicksProperty' )
} )
} ),

SCENE_VIEW_TANDEM: 'sceneView'
};

centerAndVariability.register( 'CAVConstants', CAVConstants );
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/CAVScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default class CAVScreenView extends ScreenView {
( soccerPlayer, sceneModel ) => this.getSoccerPlayerImageSet( soccerPlayer, sceneModel ),
modelViewTransform,
this.visibleBoundsProperty, {
tandem: options.tandem.createTandem( 'sceneView' + index )
tandem: options.tandem.createTandem( CAVConstants.SCENE_VIEW_TANDEM + index )
} ) );

const createToggleNode = ( pickLayer: ( sceneView: SceneView ) => Node ) => new ToggleNode( model.selectedSceneModelProperty, this.sceneViews.map( sceneView => {
Expand Down
6 changes: 4 additions & 2 deletions js/variability/view/VariabilityScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ export default class VariabilityScreenView extends CAVScreenView {

model.variabilitySceneModels.forEach( ( sceneModel, index ) => {

// TODO: https://github.com/phetsims/center-and-variability/issues/164 Do we really want to create 12 of these?
// The infoDialog only exists in the VariabilityScreen, so having CAVScreenView be in charge of creating custom subclasses
// of CAVSceneView is overcomplicated and unnecessary. Instead, we create an equivalent tandem, so that it will appear
// under the appropriate sceneView in the studio tree.
const infoDialog = new InfoDialog( model, sceneModel, {
tandem: options.tandem.createTandem( 'scene' + index ).createTandem( 'infoDialog' )
tandem: options.tandem.createTandem( CAVConstants.SCENE_VIEW_TANDEM + index ).createTandem( 'infoDialog' )
} );

Multilink.multilink( [ model.isInfoVisibleProperty, sceneModel.isVisibleProperty ],
Expand Down

0 comments on commit 7ab2d68

Please sign in to comment.