phetsims / natural-selection

"Natural Selection" is an educational simulation in HTML5, by PhET Interactive Simulations
GNU General Public License v3.0
3 stars 7 forks source link

Review inputEnabledProperty #261

Closed pixelzoom closed 3 years ago

pixelzoom commented 3 years ago

https://github.com/phetsims/scenery/issues/1158 changed pickableProperty to inputEnabledProperty. Review this sim's use of inputEnbledProperty. Locate candidates by searching for addInputListener.

pixelzoom commented 3 years ago

These sim-specific candidates are candidates for inputEnabledProperty:

@amanda-phet @kathy-phet questions:

  1. Do you want to instrument any of these elements?
  2. Does the look of any of these elements need to change when inputEnabledProperty is false? (For example, do we need to hide the sphere at the bottom of the data probe?)
kathy-phet commented 3 years ago

I would favor adding it to this node: naturalSelection.introScreen.view.environmentNode.sprites - so that if you decide to remove the pedigree chart option, you can also turn off the bunny selection entirely.

The other two I would not add it to at this point as I cannot think of a condition you would want this behavior. If a client has a reason to want it that we cannot think of right now, then we can add it later.

pixelzoom commented 3 years ago

Sounds good to me. @amanda-phet do you agree?

amanda-phet commented 3 years ago

Yes that sounds good.

I was starting to write a case for instrumenting naturalSelection.introScreen.view.environmentNode but I changed my mind in the process. I also don't think it's useful to make the data probe not pickable.

pixelzoom commented 3 years ago

*.view.environmentNode.sprites.inputEnabledProperty has been instrumented. If there is a selected bunny, the selection is cleared when inputEnabledProperty is set to false.

@amanda-phet please review in master.

amanda-phet commented 3 years ago

Looks like it is working just fine.