Skip to content

Commit

Permalink
only show Input tab of Preferences when connected to external device,…
Browse files Browse the repository at this point in the history
… see #315
  • Loading branch information
jessegreenberg committed Jan 7, 2023
1 parent 8d01391 commit d9d7b09
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions js/quadrilateral-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ import QuadrilateralInputPreferencesNode from './quadrilateral/view/Quadrilatera
const quadrilateralTitleStringProperty = QuadrilateralStrings.quadrilateral.titleStringProperty;
const preferencesModel = new QuadrilateralPreferencesModel();

// "Input" options are related to connection to a tangible device, this tab should only be shown when running
// while connected to some external device.
const inputPreferencesOptions = QuadrilateralQueryParameters.deviceConnection ? {
customPreferences: [ {
createContent: () => new QuadrilateralInputPreferencesNode( preferencesModel )
} ]
} : undefined;

const simOptions: SimOptions = {

//TODO fill in credits, all of these fields are optional, see joist.CreditsNode
Expand All @@ -38,11 +46,7 @@ const simOptions: SimOptions = {

// preferences configuration with defaults from package.json
preferencesModel: new PreferencesModel( {
inputOptions: {
customPreferences: [ {
createContent: tandem => new QuadrilateralInputPreferencesNode( preferencesModel )
} ]
},
inputOptions: inputPreferencesOptions,
localizationOptions: {

// Dynamic locales are not supported for initial publication of this sim.
Expand Down

0 comments on commit d9d7b09

Please sign in to comment.