Skip to content

Commit

Permalink
Adding screen icons and converting to ES6, see phetsims/fractions-com…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Dec 27, 2018
1 parent 2967992 commit 6eaf3cc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 43 deletions.
25 changes: 12 additions & 13 deletions js/fractions-equality-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
*
* @author Jonathan Olson <[email protected]>
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var EqualityLabScreen = require( 'FRACTIONS_EQUALITY/view/EqualityLabScreen' );
var FractionsScreen = require( 'FRACTION_MATCHER/view/FractionsScreen' );
var Sim = require( 'JOIST/Sim' );
var SimLauncher = require( 'JOIST/SimLauncher' );
var Tandem = require( 'TANDEM/Tandem' );
const EqualityLabScreen = require( 'FRACTIONS_EQUALITY/view/EqualityLabScreen' );
const FractionsScreen = require( 'FRACTION_MATCHER/view/FractionsScreen' );
const Sim = require( 'JOIST/Sim' );
const SimLauncher = require( 'JOIST/SimLauncher' );
const Tandem = require( 'TANDEM/Tandem' );

// strings
var fractionsEqualityTitleString = require( 'string!FRACTIONS_EQUALITY/fractions-equality.title' );
var screenGameString = require( 'string!FRACTIONS_EQUALITY/screen.game' );
const fractionsEqualityTitleString = require( 'string!FRACTIONS_EQUALITY/fractions-equality.title' );
const screenGameString = require( 'string!FRACTIONS_EQUALITY/screen.game' );

// constants
var tandem = Tandem.rootTandem;
const tandem = Tandem.rootTandem;

var simOptions = {
const simOptions = {
credits: {
//TODO fill in proper credits, all of these fields are optional, see joist.AboutDialog
leadDesign: '',
Expand All @@ -34,11 +34,10 @@ define( function( require ) {
}
};

SimLauncher.launch( function() {
var sim = new Sim( fractionsEqualityTitleString, [
SimLauncher.launch( () => {
const sim = new Sim( fractionsEqualityTitleString, [
new EqualityLabScreen(),
new FractionsScreen( tandem.createTandem( 'fractionsScreen' ), {
// TODO: don't hack like this
name: screenGameString
} )
], simOptions );
Expand Down
4 changes: 2 additions & 2 deletions js/fractionsEquality.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*
* @author Jonathan Olson <[email protected]>
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var Namespace = require( 'PHET_CORE/Namespace' );
const Namespace = require( 'PHET_CORE/Namespace' );

return new Namespace( 'fractionsEquality' );
} );
50 changes: 22 additions & 28 deletions js/view/EqualityLabScreen.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
// Copyright 2018, University of Colorado Boulder

/**
* TODO: doc
* Equality Lab screen for Fractions: Equality
*
* @author Jonathan Olson <[email protected]>
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var EqualityLabModel = require( 'FRACTIONS_COMMON/intro/model/EqualityLabModel' );
var EqualityLabScreenView = require( 'FRACTIONS_COMMON/intro/view/EqualityLabScreenView' );
var FractionsCommonColorProfile = require( 'FRACTIONS_COMMON/common/view/FractionsCommonColorProfile' );
var fractionsEquality = require( 'FRACTIONS_EQUALITY/fractionsEquality' );
var inherit = require( 'PHET_CORE/inherit' );
var Screen = require( 'JOIST/Screen' );
const EqualityLabModel = require( 'FRACTIONS_COMMON/intro/model/EqualityLabModel' );
const EqualityLabScreenView = require( 'FRACTIONS_COMMON/intro/view/EqualityLabScreenView' );
const FractionsCommonColorProfile = require( 'FRACTIONS_COMMON/common/view/FractionsCommonColorProfile' );
const fractionsEquality = require( 'FRACTIONS_EQUALITY/fractionsEquality' );
const Screen = require( 'JOIST/Screen' );

// strings
var screenEqualityLabString = require( 'string!FRACTIONS_EQUALITY/screen.equalityLab' );

/**
* @constructor
*/
function EqualityLabScreen() {

var options = {
name: screenEqualityLabString,
backgroundColorProperty: FractionsCommonColorProfile.introScreenBackgroundProperty
};

Screen.call( this,
function() { return new EqualityLabModel(); },
function( model ) { return new EqualityLabScreenView( model ); },
options
);
const screenEqualityLabString = require( 'string!FRACTIONS_EQUALITY/screen.equalityLab' );

class EqualityLabScreen extends Screen {
constructor() {
super(
() => new EqualityLabModel(),
model => new EqualityLabScreenView( model ),
{
name: screenEqualityLabString,
backgroundColorProperty: FractionsCommonColorProfile.introScreenBackgroundProperty,
homeScreenIcon: EqualityLabScreenView.createScreenIcon()
}
);
}
}

fractionsEquality.register( 'EqualityLabScreen', EqualityLabScreen );

return inherit( Screen, EqualityLabScreen );
return fractionsEquality.register( 'EqualityLabScreen', EqualityLabScreen );
} );

0 comments on commit 6eaf3cc

Please sign in to comment.