<commit_before>// Copyright 2013-2015, University of Colorado Boulder

/**
 * Contains all nodes for single level. Shapes, strings, buttons.
 *
 * @author <NAME> (Mlearner)
 */

define( function( require ) {
  'use strict';

  // modules
  var cheerAudio = require( 'audio!VEGAS/cheer' );
  var Sound = require( 'VIBE/Sound' );
  var StarNode = require( 'SCENERY_PHET/StarNode' );
  var FaceNode = require( 'SCENERY_PHET/FaceNode' );
  var RewardNode = require( 'VEGAS/RewardNode' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Node = require( 'SCENERY/nodes/Node' );
  var Text = require( 'SCENERY/nodes/Text' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var ShapeNode = require( 'FRACTION_MATCHER/shapes/ShapeNode' );
  var TextPushButton = require( 'SUN/buttons/TextPushButton' );
  var FaceWithPointsNode = require( 'SCENERY_PHET/FaceWithPointsNode' );
  var ComparisonChartNode = require( 'FRACTION_MATCHER/view/ComparisonChartNode' );
  var LevelCompletedNode = require( 'VEGAS/LevelCompletedNode' );
  var Plane = require( 'SCENERY/nodes/Plane' );
  var VBox = require( 'SCENERY/nodes/VBox' );
  var StringUtils = require( 'PHETCOMMON/util/StringUtils' );
  var Util = require( 'DOT/Util' );
  var Vector2 = require( 'DOT/Vector2' );
  var SimpleDragHandler = require( 'SCENERY/input/SimpleDragHandler' );
  var platform = require( 'PHET_CORE/platform' );
  var LinearFunction = require( 'DOT/LinearFunction' );
  var NumericShape = require( 'FRACTION_MATCHER/shapes/NumericShape' );

  // strings
  var checkString = require( 'string!FRACTION_MATCHER/check' );
  var okString = require( 'string!FRACTION_MATCHER/ok' );
  var tryAgainString = require( 'string!FRACTION_MATCHER/tryAgain' );
  var levelNumberString = require( 'string!FRACTION_MATCHER/levelNumber' );
  var scoreNumberString = require( 'string!FRACTION_MATCHER/scoreNumber' );
  var timeNumberSecString = require( 'string!FRACTION_MATCHER/timeNumberSec' );
  var showAnswerString = require( 'string!FRACTION_MATCHER/showAnswer' );

  //Toggle this to true to make the rewards show after any shape comparison, for debugging
  var debugRewards = false;

  // audio
  var cheerSound = new Sound( cheerAudio );

  /**
   *
   * @param {LevelModel} model
   * @param levelsContainer
   * @param layoutBounds
   * @param {Events} stepSource used for animating the RewardNode
   * @param {Object} [options]
   * @constructor
   */
  function LevelNode( model, levelsContainer, layoutBounds, stepSource, options ) {
    var margin = 15;
    var thisNode = this;
    this.stepSource = stepSource;
    Node.call( this );

    this.levelsContainer = levelsContainer;
    this.model = model;

    //drawing labels at the right
    var levelLabel = new Text( StringUtils.format( levelNumberString, model.levelNumber ), {
      font: new PhetFont( {
        size: 12,
        weight: 'bold'
      } )
    } );
    var scoreLabel = new Text( StringUtils.format( scoreNumberString, 0 ), {
      font: new PhetFont( {
        size: 12,
        weight: 'bold'
      } )
    } );
    var timeLabel = new Text( StringUtils.format( scoreNumberString, 0 ), {
      font: new PhetFont( {
        size: 12,
        weight: 'bold'
      } )
    } );
    var vBox = new VBox( {
      children: [ levelLabel, scoreLabel, timeLabel ],
      spacing: 5,
      y: 90,
      right: model.gameModel.width - margin,
      align: 'right'
    } );
    thisNode.addChild( vBox );

    //drawing smile
    var smile = new FaceWithPointsNode( {
      spacing: 6,
      pointsAlignment: 'rightCenter',
      faceDiameter: 100,
      pointsFont: new PhetFont( { size: 20, weight: 'bold' } ),
      centerX: layoutBounds.right - 105,
      centerY: 205
    } );
    thisNode.addChild( smile );

    //drawing left part buttons: check, ok, tryAgain, showAnswer
    var commonButtonStyle = {
      font: new PhetFont( { size: 18, weight: 'bold' } ),
      centerX: smile.centerX,
      centerY: smile.bottom + 27
    };

    var buttonCheck = new TextPushButton(
      checkString,
      _.extend( commonButtonStyle, {
        baseColor: '#FFD63F',
        listener: function() {model.answerButton( 'check' );}
      } ) );
    thisNode.addChild( buttonCheck );

    var buttonOk = new TextPushButton(
      okString,
      _.extend( commonButtonStyle, {
        baseColor: '#44FF44',
        listener: function() {
          model.answerButton( 'ok' );
          //animate to answers area and remove listeners
          thisNode.moveShapesOnScalesToAnswer();
        }
      } ) );
    thisNode.addChild( buttonOk );

    var buttonTryAgain = new TextPushButton(
      tryAgainString,
      _.extend( commonButtonStyle, {
        baseColor: '#FF7C3B',<commit_msg>Set the maxTextWidth for the buttons, see #90<commit_after>// Copyright 2013-2015, University of Colorado Boulder

/**
 * Contains all nodes for single level. Shapes, strings, buttons.
 *
 * @author <NAME> (Mlearner)
 */

define( function( require ) {
  'use strict';

  // modules
  var cheerAudio = require( 'audio!VEGAS/cheer' );
  var Sound = require( 'VIBE/Sound' );
  var StarNode = require( 'SCENERY_PHET/StarNode' );
  var FaceNode = require( 'SCENERY_PHET/FaceNode' );
  var RewardNode = require( 'VEGAS/RewardNode' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Node = require( 'SCENERY/nodes/Node' );
  var Text = require( 'SCENERY/nodes/Text' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var ShapeNode = require( 'FRACTION_MATCHER/shapes/ShapeNode' );
  var TextPushButton = require( 'SUN/buttons/TextPushButton' );
  var FaceWithPointsNode = require( 'SCENERY_PHET/FaceWithPointsNode' );
  var ComparisonChartNode = require( 'FRACTION_MATCHER/view/ComparisonChartNode' );
  var LevelCompletedNode = require( 'VEGAS/LevelCompletedNode' );
  var Plane = require( 'SCENERY/nodes/Plane' );
  var VBox = require( 'SCENERY/nodes/VBox' );
  var StringUtils = require( 'PHETCOMMON/util/StringUtils' );
  var Util = require( 'DOT/Util' );
  var Vector2 = require( 'DOT/Vector2' );
  var SimpleDragHandler = require( 'SCENERY/input/SimpleDragHandler' );
  var platform = require( 'PHET_CORE/platform' );
  var LinearFunction = require( 'DOT/LinearFunction' );
  var NumericShape = require( 'FRACTION_MATCHER/shapes/NumericShape' );

  // strings
  var checkString = require( 'string!FRACTION_MATCHER/check' );
  var okString = require( 'string!FRACTION_MATCHER/ok' );
  var tryAgainString = require( 'string!FRACTION_MATCHER/tryAgain' );
  var levelNumberString = require( 'string!FRACTION_MATCHER/levelNumber' );
  var scoreNumberString = require( 'string!FRACTION_MATCHER/scoreNumber' );
  var timeNumberSecString = require( 'string!FRACTION_MATCHER/timeNumberSec' );
  var showAnswerString = require( 'string!FRACTION_MATCHER/showAnswer' );

  //Toggle this to true to make the rewards show after any shape comparison, for debugging
  var debugRewards = false;

  // audio
  var cheerSound = new Sound( cheerAudio );

  /**
   *
   * @param {LevelModel} model
   * @param levelsContainer
   * @param layoutBounds
   * @param {Events} stepSource used for animating the RewardNode
   * @param {Object} [options]
   * @constructor
   */
  function LevelNode( model, levelsContainer, layoutBounds, stepSource, options ) {
    var margin = 15;
    var thisNode = this;
    this.stepSource = stepSource;
    Node.call( this );

    this.levelsContainer = levelsContainer;
    this.model = model;

    //drawing labels at the right
    var levelLabel = new Text( StringUtils.format( levelNumberString, model.levelNumber ), {
      font: new PhetFont( {
        size: 12,
        weight: 'bold'
      } )
    } );
    var scoreLabel = new Text( StringUtils.format( scoreNumberString, 0 ), {
      font: new PhetFont( {
        size: 12,
        weight: 'bold'
      } )
    } );
    var timeLabel = new Text( StringUtils.format( scoreNumberString, 0 ), {
      font: new PhetFont( {
        size: 12,
        weight: 'bold'
      } )
    } );
    var vBox = new VBox( {
      children: [ levelLabel, scoreLabel, timeLabel ],
      spacing: 5,
      y: 90,
      right: model.gameModel.width - margin,
      align: 'right'
    } );
    thisNode.addChild( vBox );

    //drawing smile
    var smile = new FaceWithPointsNode( {
      spacing: 6,
      pointsAlignment: 'rightCenter',
      faceDiameter: 100,
      pointsFont: new PhetFont( { size: 20, weight: 'bold' } ),
      centerX: layoutBounds.right - 105,
      centerY: 205
    } );
    thisNode.addChild( smile );

    //drawing left part buttons: check, ok, tryAgain, showAnswer
    var commonButtonStyle = {
      font: new PhetFont( { size: 18, weight: 'bold' } ),
      centerX: smile.centerX,
      centerY: smile.bottom + 27,
      maxTextWidth: 120
    };

    var buttonCheck = new TextPushButton(
      checkString,
      _.extend( commonButtonStyle, {
        baseColor: '#FFD63F',
        listener: function() {model.answerButton( 'check' );}
      } ) );
    thisNode.addChild( buttonCheck );

    var buttonOk = new TextPushButton(
      okString,
      _.extend( commonButtonStyle, {
        baseColor: '#44FF44',
        listener: function() {
          model.answerButton( 'ok' );
          //animate to answers area and remove listeners
          thisNode.moveShapesOnScalesToAnswer();
        }
      } ) );
    thisNode.addChild( buttonOk );

    var buttonTryAgain = new TextPushButton(
      tryAgainString,
      _.extend( commonButtonStyle, {
        baseColor: '#FF7C3B',
{'fraction_non_alphanumeric': 0.11866371588154706, 'fraction_numerical': 0.010433133101485931, 'mean_word_length': 3.126086956521739, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1507867', 'n_tokens_mistral': 3118, 'n_tokens_neox': 2977, 'n_words': 750}