Skip to content

Commit

Permalink
add contextIncludesObjectResponse, #1214
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Apr 28, 2021
1 parent ccd74fa commit 79ff85d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/accessibility/speaker/voicingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* @author Jesse Greenberg (PhET Interactive Simulations)
*/

import BooleanProperty from '../../../../axon/js/BooleanProperty.js';
import merge from '../../../../phet-core/js/merge.js';
import scenery from '../../scenery.js';
import BooleanProperty from '../../../../axon/js/BooleanProperty.js';

class VoicingManager {
constructor() {
Expand Down Expand Up @@ -58,7 +58,11 @@ class VoicingManager {

// {string|null} - If this is provided, it is the ONLY spoken string, and it is always spoken regardless of
// speech output levels selected by the user as long as speech is enabled.
overrideResponse: null
overrideResponse: null,

// {boolean} When true and context changes are emitting, then ignore the objectResponse provided (because it is
// covered by the context response). This is a common case while developing voicing strings.
contextIncludesObjectResponse: false
}, options );

const objectChanges = this.objectChangesProperty.get();
Expand Down Expand Up @@ -87,7 +91,7 @@ class VoicingManager {
outputString = options.overrideResponse;
}
else {
if ( usedObjectString ) {
if ( usedObjectString && !( options.contextIncludesObjectResponse && contextChanges ) ) {
outputString += usedObjectString;
}
if ( usedContextString ) {
Expand Down

0 comments on commit 79ff85d

Please sign in to comment.