Skip to content

Commit

Permalink
Attempt 1 fix for #325
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Apr 9, 2020
1 parent f219bf5 commit ab786b1
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions js/intro/view/EFACIntroScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Dimension2 from '../../../../dot/js/Dimension2.js';
import Utils from '../../../../dot/js/Utils.js';
import Vector2 from '../../../../dot/js/Vector2.js';
import ScreenView from '../../../../joist/js/ScreenView.js';
import merge from '../../../../phet-core/js/merge.js';
import ModelViewTransform2 from '../../../../phetcommon/js/view/ModelViewTransform2.js';
import flameImage from '../../../../scenery-phet/images/flame_png.js';
import ResetAllButton from '../../../../scenery-phet/js/buttons/ResetAllButton.js';
Expand Down Expand Up @@ -53,8 +54,8 @@ import EFACTemperatureAndColorSensorNode from '../../common/view/EFACTemperature
import EnergyChunkLayer from '../../common/view/EnergyChunkLayer.js';
import EnergyChunkNode from '../../common/view/EnergyChunkNode.js';
import SkyNode from '../../common/view/SkyNode.js';
import energyFormsAndChangesStrings from '../../energyFormsAndChangesStrings.js';
import energyFormsAndChanges from '../../energyFormsAndChanges.js';
import energyFormsAndChangesStrings from '../../energyFormsAndChangesStrings.js';
import efacPositionConstrainer from '../model/efacPositionConstrainer.js';
import AirNode from './AirNode.js';
import BeakerContainerView from './BeakerContainerView.js';
Expand All @@ -63,7 +64,6 @@ import BlockNode from './BlockNode.js';
const energySymbolsString = energyFormsAndChangesStrings.energySymbols;
const linkHeatersString = energyFormsAndChangesStrings.linkHeaters;
const oliveOilString = energyFormsAndChangesStrings.oliveOil;
const waterString = energyFormsAndChangesStrings.water;

// constants
const EDGE_INSET = 10; // screen edge padding, in screen coordinates
Expand Down Expand Up @@ -432,16 +432,22 @@ class EFACIntroScreenView extends ScreenView {

// @private {PhetioGroup.<BeakerContainerView>}
this.beakerViews = new PhetioGroup( ( tandem, beaker ) => {
const label = beaker.beakerType === BeakerType.WATER ? waterString : oliveOilString;
let options = {
tandem: tandem,
phetioDynamicElement: true
};
if ( beaker.beakerType === BeakerType.OLIVE_OIL ) {
options = merge( {
label: oliveOilString
}, options );
}

return new BeakerContainerView(
beaker,
model,
modelViewTransform,
constrainMovableElementMotion, {
label: label,
tandem: tandem,
phetioDynamicElement: true
}
constrainMovableElementMotion,
options
);
},
[ model.beakers.archetype ], {
Expand All @@ -450,6 +456,8 @@ class EFACIntroScreenView extends ScreenView {
supportsDynamicState: false
} );

console.log( 'Trying using water\'s default option' );

const beakerListener = addedBeaker => {
const beakerView = this.beakerViews.createCorrespondingGroupMember( addedBeaker, addedBeaker );

Expand Down

0 comments on commit ab786b1

Please sign in to comment.