Skip to content

Commit

Permalink
create common help content and add slider and time control sections, #93
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Mar 17, 2023
1 parent 2129d88 commit 7ebbaf5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
28 changes: 28 additions & 0 deletions js/common/view/MySolarSystemKeyboardHelpContent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2023, University of Colorado Boulder

/**
* Keyboard help content for My Solar System.
*
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

import mySolarSystem from '../../mySolarSystem.js';
import TwoColumnKeyboardHelpContent from '../../../../scenery-phet/js/keyboard/help/TwoColumnKeyboardHelpContent.js';
import BasicActionsKeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/BasicActionsKeyboardHelpSection.js';
import SliderControlsKeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/SliderControlsKeyboardHelpSection.js';
import TimeControlKeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/TimeControlKeyboardHelpSection.js';

export default class MySolarSystemKeyboardHelpContent extends TwoColumnKeyboardHelpContent {
public constructor() {
const sliderHelpSection = new SliderControlsKeyboardHelpSection();
const timeControlsHelpSection = new TimeControlKeyboardHelpSection();
const basicActionsHelpSection = new BasicActionsKeyboardHelpSection( {
withCheckboxContent: true,
withKeypadContent: true
} );

super( [ timeControlsHelpSection, sliderHelpSection ], [ basicActionsHelpSection ] );
}
}

mySolarSystem.register( 'MySolarSystemKeyboardHelpContent', MySolarSystemKeyboardHelpContent );
9 changes: 2 additions & 7 deletions js/intro/IntroScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import IntroModel from './model/IntroModel.js';
import IntroScreenView from './view/IntroScreenView.js';
import IntroScreenIcon from './view/IntroScreenIcon.js';
import MySolarSystemStrings from '../MySolarSystemStrings.js';
import BasicActionsKeyboardHelpSection from '../../../scenery-phet/js/keyboard/help/BasicActionsKeyboardHelpSection.js';
import MySolarSystemKeyboardHelpContent from '../common/view/MySolarSystemKeyboardHelpContent.js';

export default class IntroScreen extends Screen<IntroModel, IntroScreenView> {

Expand All @@ -25,12 +25,7 @@ export default class IntroScreen extends Screen<IntroModel, IntroScreenView> {
backgroundColorProperty: SolarSystemCommonColors.backgroundProperty,
tandem: tandem,
name: MySolarSystemStrings.screen.introStringProperty,
createKeyboardHelpNode: () => {
return new BasicActionsKeyboardHelpSection( {
withCheckboxContent: true,
withKeypadContent: true
} );
}
createKeyboardHelpNode: () => new MySolarSystemKeyboardHelpContent()
};

super(
Expand Down
9 changes: 2 additions & 7 deletions js/lab/LabScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import LabModel from './model/LabModel.js';
import LabScreenView from './view/LabScreenView.js';
import LabScreenIcon from './view/LabScreenIcon.js';
import MySolarSystemStrings from '../MySolarSystemStrings.js';
import BasicActionsKeyboardHelpSection from '../../../scenery-phet/js/keyboard/help/BasicActionsKeyboardHelpSection.js';
import MySolarSystemKeyboardHelpContent from '../common/view/MySolarSystemKeyboardHelpContent.js';

export default class LabScreen extends Screen<LabModel, LabScreenView> {

Expand All @@ -25,12 +25,7 @@ export default class LabScreen extends Screen<LabModel, LabScreenView> {
backgroundColorProperty: SolarSystemCommonColors.backgroundProperty,
tandem: tandem,
name: MySolarSystemStrings.screen.labStringProperty,
createKeyboardHelpNode: () => {
return new BasicActionsKeyboardHelpSection( {
withCheckboxContent: true,
withKeypadContent: true
} );
}
createKeyboardHelpNode: () => new MySolarSystemKeyboardHelpContent()
};

super(
Expand Down

0 comments on commit 7ebbaf5

Please sign in to comment.