diff --git a/src/app/components/HardpointSlot.jsx b/src/app/components/HardpointSlot.jsx deleted file mode 100644 index c077bec1..00000000 --- a/src/app/components/HardpointSlot.jsx +++ /dev/null @@ -1,147 +0,0 @@ -import React from 'react'; -import cn from 'classnames'; -import Slot from './Slot'; -import Persist from '../stores/Persist'; -import { - DamageAbsolute, - DamageKinetic, - DamageThermal, - DamageExplosive, - MountFixed, - MountGimballed, - MountTurret, - ListModifications, - Modified -} from './SvgIcons'; -import { Modifications } from 'coriolis-data/dist'; -import { stopCtxPropagation } from '../utils/UtilityFunctions'; -import { blueprintTooltip } from '../utils/BlueprintFunctions'; - -/** - * Hardpoint / Utility Slot - */ -export default class HardpointSlot extends Slot { - /** - * Get the CSS class name for the slot. - * @return {string} CSS Class name - */ - _getClassNames() { - return this.props.maxClass > 0 ? 'hardpoint' : null; - } - - /** - * Get the label for the slot - * @param {Function} translate Translate function - * @return {string} Label - */ - _getMaxClassLabel(translate) { - return translate(['U', 'S', 'M', 'L', 'H'][this.props.maxClass]); - } - - /** - * Generate the slot contents - * @param {Object} m Mounted Module - * @param {Function} translate Translate function - * @param {Object} formats Localized Formats map - * @param {Object} u Localized Units Map - * @return {React.Component} Slot contents - */ - _getSlotDetails(m, translate, formats, u) { - if (m) { - let classRating = `${m.class}${m.rating}${m.missile ? '/' + m.missile : ''}`; - let { drag, drop } = this.props; - let { termtip, tooltip } = this.context; - let showModuleResistances = Persist.showModuleResistances(); - - // Modifications tooltip shows blueprint and grade, if available - let modTT = translate('modified'); - if (m && m.blueprint && m.blueprint.name) { - // modTT = translate(m.blueprint.name) + ' ' + translate('grade') + ' ' + m.blueprint.grade; - // if (m.blueprint.special && m.blueprint.special.id >= 0) { - // modTT += ', ' + translate(m.blueprint.special.name); - // } - // modTT = ( - //
- //
{modTT}
- // {blueprintTooltip(translate, m.blueprint.grades[m.blueprint.grade], m)} - //
- // ); - } - - const className = cn('details', m.isEnabled() ? '' : 'disabled'); - return
-
-
- {/* {m.mount && m.mount == 'F' ? : ''} - {m.mount && m.mount == 'G' ? : ''} - {m.mount && m.mount == 'T' ? : ''} - {m.getDamageDist() && m.getDamageDist().K ? : ''} - {m.getDamageDist() && m.getDamageDist().T ? : ''} - {m.getDamageDist() && m.getDamageDist().E ? : ''} - {m.getDamageDist() && m.getDamageDist().A ? : ''} - {classRating} {translate(m.name || m.grp)}{m.mods && Object.keys(m.mods).length > 0 ? : null} */} -
- -
{formats.round(m.get('mass'))}{u.T}
-
-
- {/* {m.getDps() ?
{translate('DPS')}: {formats.round1(m.getDps())} {m.getClip() ? - ({formats.round1(m.getSDps())}) : null}
: null} - {m.getDamage() ?
{translate('shotdmg')}: {formats.round1(m.getDamage())}
: null} - {m.getEps() ?
{translate('EPS')}: {formats.round1(m.getEps())}{u.MW} {m.getClip() ? - ({formats.round1(m.getEps() * m.getSustainedFactor())}{u.MW}) : null}
: null} - {m.getHps() ?
{translate('HPS')}: {formats.round1(m.getHps())} {m.getClip() ? - ({formats.round1(m.getHps() * m.getSustainedFactor())}) : null}
: null} - {m.getDps() && m.getEps() ?
{translate('DPE')}: {formats.f1(m.getDps() / m.getEps())}
: null} - {m.getRoF() ?
{translate('ROF')}: {formats.f1(m.getRoF())}{u.ps}
: null} - {m.getRange() ?
{translate('range', m.grp)} {formats.f1(m.getRange() / 1000)}{u.km}
: null} - {m.getScanTime() ?
{translate('scantime')} {formats.f1(m.getScanTime())}{u.s}
: null} - {m.getFalloff() ?
{translate('falloff')} {formats.round(m.getFalloff() / 1000)}{u.km}
: null} - {m.getShieldBoost() ?
+{formats.pct1(m.getShieldBoost())}
: null} - {m.getAmmo() ?
{translate('ammunition')}: {formats.int(m.getClip())}/{formats.int(m.getAmmo())}
: null} - {m.getReload() ?
{translate('wep_reload')}: {formats.round(m.getReload())}{u.s}
: null} - {m.getShotSpeed() ?
{translate('shotspeed')}: {formats.int(m.getShotSpeed())}{u.mps}
: null} - {m.getPiercing() ?
{translate('piercing')}: {formats.int(m.getPiercing())}
: null} - {m.getJitter() ?
{translate('jitter')}: {formats.f2(m.getJitter())}°
: null} - {m.getScanAngle() ?
{translate('scan angle')}: {formats.f2(m.getScanAngle())}°
: null} - {m.getScanRange() ?
{translate('scan range')}: {formats.int(m.getScanRange())}{u.m}
: null} - {m.getMaxAngle() ?
{translate('max angle')}: {formats.f2(m.getMaxAngle())}°
: null} - {showModuleResistances && m.getExplosiveResistance() ?
{translate('explres')}: {formats.pct(m.getExplosiveResistance())}
: null} - {showModuleResistances && m.getKineticResistance() ?
{translate('kinres')}: {formats.pct(m.getKineticResistance())}
: null} - {showModuleResistances && m.getThermalResistance() ?
{translate('thermres')}: {formats.pct(m.getThermalResistance())}
: null} - {m.getIntegrity() ?
{translate('integrity')}: {formats.int(m.getIntegrity())}
: null} - {m && validMods.length > 0 ?
this.modButton = modButton}> - -
: null} */} -
-
; - } else { - return
{translate('empty')}
; - } - } -} diff --git a/src/app/components/HardpointSlotSection.jsx b/src/app/components/HardpointSlotSection.jsx index 18b48e39..5f152f5d 100644 --- a/src/app/components/HardpointSlotSection.jsx +++ b/src/app/components/HardpointSlotSection.jsx @@ -1,6 +1,6 @@ import React from 'react'; import SlotSection from './SlotSection'; -import HardpointSlot from './HardpointSlot'; +import InternalSlot from './InternalSlot'; import { MountFixed, MountGimballed, MountTurret } from '../components/SvgIcons'; import { stopCtxPropagation } from '../utils/UtilityFunctions'; @@ -70,7 +70,7 @@ export default class HardpointSlotSection extends SlotSection { let slots = []; for (let h of ship.getHardpoints(undefined, true)) { - slots.push(