import React from 'react'; import PropTypes from 'prop-types'; import * as _ from 'lodash'; import TranslatedComponent from './TranslatedComponent'; import { stopCtxPropagation } from '../utils/UtilityFunctions'; import cn from 'classnames'; import { Modifications } from 'coriolis-data/dist'; import Modification from './Modification'; import { getBlueprint, blueprintTooltip, setPercent, getPercent, setRandom, specialToolTip } from '../utils/BlueprintFunctions'; const MODIFICATIONS_COMPARATOR = (mod1, mod2) => { return mod1.props.name.localeCompare(mod2.props.name); }; /** * Modifications menu */ export default class ModificationsMenu extends TranslatedComponent { static propTypes = { ship: PropTypes.object.isRequired, m: PropTypes.object.isRequired, marker: PropTypes.string.isRequired, onChange: PropTypes.func.isRequired, modButton:PropTypes.object }; /** * Constructor * @param {Object} props React Component properties * @param {Object} context React Component context */ constructor(props, context) { super(props); this._toggleBlueprintsMenu = this._toggleBlueprintsMenu.bind(this); this._toggleSpecialsMenu = this._toggleSpecialsMenu.bind(this); this._rollFifty = this._rollFifty.bind(this); this._rollRandom = this._rollRandom.bind(this); this._rollBest = this._rollBest.bind(this); this._rollWorst = this._rollWorst.bind(this); this._reset = this._reset.bind(this); this._keyDown = this._keyDown.bind(this); this.modItems = [];// Array to hold various element refs (
  • ,
    ,