Skip to content

Commit

Permalink
Add 'Magic Numbers' checkbox. See #87.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed Jul 21, 2023
1 parent 4557bdb commit 58bf983
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions build-a-nucleus-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,8 @@
},
"percentageInParenthesesPattern": {
"value": "({{decayLikelihoodPercent}}%)"
},
"magicNumbers": {
"value": "Magic Numbers"
}
}
1 change: 1 addition & 0 deletions js/BuildANucleusStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type StringsType = {
};
'mostLikelyDecayStringProperty': LocalizedStringProperty;
'percentageInParenthesesPatternStringProperty': LocalizedStringProperty;
'magicNumbersStringProperty': LocalizedStringProperty;
};

const BuildANucleusStrings = getStringModule( 'BUILD_A_NUCLEUS' ) as StringsType;
Expand Down
13 changes: 12 additions & 1 deletion js/chart-intro/view/ChartIntroScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import ParticleAtom from '../../../../shred/js/model/ParticleAtom.js';
import Multilink from '../../../../axon/js/Multilink.js';
import PeriodicTableAndIsotopeSymbol from './PeriodicTableAndIsotopeSymbol.js';
import BuildANucleusStrings from '../../BuildANucleusStrings.js';
import { Line, Node, Rectangle, RichText } from '../../../../scenery/js/imports.js';
import { Line, Node, Rectangle, RichText, Text } from '../../../../scenery/js/imports.js';
import BANConstants from '../../common/BANConstants.js';
import ArrowNode from '../../../../scenery-phet/js/ArrowNode.js';
import BANColors from '../../common/BANColors.js';
Expand All @@ -31,6 +31,8 @@ import ZoomInNuclideChartIconNode from './ZoomInNuclideChartIconNode.js';
import Animation from '../../../../twixt/js/Animation.js';
import Easing from '../../../../twixt/js/Easing.js';
import DecayType from '../../common/model/DecayType.js';
import Checkbox from '../../../../sun/js/Checkbox.js';
import BooleanProperty from '../../../../axon/js/BooleanProperty.js';

// types
export type NuclideChartIntroScreenViewOptions = BANScreenViewOptions;
Expand Down Expand Up @@ -195,6 +197,15 @@ class ChartIntroScreenView extends BANScreenView<ChartIntroModel> {
} );
this.addChild( partialChartRadioButton );

const showMagicNumbersCheckbox = new Checkbox( new BooleanProperty( false ),
new Text( BuildANucleusStrings.magicNumbersStringProperty, { font: BANConstants.LEGEND_FONT, maxWidth: 145 } ),
{
boxWidth: 15
} );
showMagicNumbersCheckbox.left = partialChartRadioButton.right + CHART_VERTICAL_MARGINS;
showMagicNumbersCheckbox.top = nuclideChartAccordionBox.bottom + CHART_VERTICAL_MARGINS;
this.addChild( showMagicNumbersCheckbox );

// add the particleViewLayerNode after everything else so particles are in the top layer
this.addChild( this.particleAtomNode );
this.addChild( this.energyLevelLayer );
Expand Down

0 comments on commit 58bf983

Please sign in to comment.