Skip to content

Commit

Permalink
any audio preferences will show the dialog, #868
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 6, 2022
1 parent 0f26686 commit 6487f35
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions js/preferences/PreferencesModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,17 +440,12 @@ export default class PreferencesModel extends PhetioObject {

/**
* Returns true if the AudioModel has any preferences that can be changed.
* @param [checkSupportsSound] - If true, audioModel.supportsSound is included in the check for whether the model
* supports any audio preferences. There are cases where that needs to be excluded
* (see shouldShowDialog()).
*/
public supportsAudioPreferences( checkSupportsSound = true ): boolean {
let supportsAudioPreferences = this.audioModel.supportsVoicing ||
this.audioModel.supportsExtraSound ||
this.preferenceModelHasCustom( this.audioModel );

supportsAudioPreferences = checkSupportsSound ? ( supportsAudioPreferences || this.audioModel.supportsSound ) : supportsAudioPreferences;
return supportsAudioPreferences;
public supportsAudioPreferences(): boolean {
return this.audioModel.supportsSound ||
this.audioModel.supportsExtraSound ||
this.audioModel.supportsVoicing ||
this.preferenceModelHasCustom( this.audioModel );
}

/**
Expand All @@ -477,7 +472,7 @@ export default class PreferencesModel extends PhetioObject {
public shouldShowDialog(): boolean {
return this.supportsSimulationPreferences() || this.supportsVisualPreferences() ||
this.supportsInputPreferences() || this.supportsLocalizationPreferences() ||
this.supportsAudioPreferences( false );
this.supportsAudioPreferences();
}

public static PreferencesModelIO = new IOType( 'PreferencesModelIO', {
Expand Down

0 comments on commit 6487f35

Please sign in to comment.