From 35538f971a1af6a1ca95165d1f709c81e24caf86 Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Wed, 2 Nov 2016 10:47:10 +0000 Subject: [PATCH] Tidy-ups --- src/app/components/InternalSlotSection.jsx | 2 +- src/app/components/ModificationsMenu.jsx | 4 ---- src/app/components/Slot.jsx | 4 +--- src/app/components/StandardSlot.jsx | 2 +- src/app/components/StandardSlotSection.jsx | 2 -- src/app/shipyard/Module.js | 1 - src/app/shipyard/Ship.js | 2 +- 7 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/app/components/InternalSlotSection.jsx b/src/app/components/InternalSlotSection.jsx index 90e2ca73..5a59a069 100644 --- a/src/app/components/InternalSlotSection.jsx +++ b/src/app/components/InternalSlotSection.jsx @@ -99,7 +99,7 @@ export default class InternalSlotSection extends SlotSection { let slots = []; let { currentMenu, ship } = this.props; let { originSlot, targetSlot } = this.state; - let { internal, fuelCapacity, ladenMass } = ship; + let { internal, fuelCapacity } = ship; let availableModules = ship.getAvailableModules(); for (let i = 0, l = internal.length; i < l; i++) { diff --git a/src/app/components/ModificationsMenu.jsx b/src/app/components/ModificationsMenu.jsx index 871b6a08..bdf633d3 100644 --- a/src/app/components/ModificationsMenu.jsx +++ b/src/app/components/ModificationsMenu.jsx @@ -7,8 +7,6 @@ import { MountFixed, MountGimballed, MountTurret } from './SvgIcons'; import { Modifications } from 'coriolis-data/dist'; import Modification from './Modification'; -const PRESS_THRESHOLD = 500; // mouse/touch down threshold - /** * Modifications menu */ @@ -37,8 +35,6 @@ export default class ModificationsMenu extends TranslatedComponent { * @return {Object} list: Array of React Components */ _initState(props, context) { - let translate = context.language.translate; - let formats = context.language.formats; let { m, onChange, ship } = props; let list = []; diff --git a/src/app/components/Slot.jsx b/src/app/components/Slot.jsx index f15bfaf4..b1c66ba1 100644 --- a/src/app/components/Slot.jsx +++ b/src/app/components/Slot.jsx @@ -79,11 +79,9 @@ export default class Slot extends TranslatedComponent { */ render() { let language = this.context.language; - let { termtip, tooltip } = this.context; let translate = language.translate; - let { ship, m, dropClass, dragOver, onOpen, onChange, selected, eligible, onSelect, warning, shipMass, availableModules } = this.props; + let { ship, m, dropClass, dragOver, onOpen, onChange, selected, eligible, onSelect, warning, availableModules } = this.props; let slotDetails, menu; - let validMods = m == null ? [] : (Modifications.validity[m.grp] || []); if (!selected) { // If not selected then sure that modifications flag is unset diff --git a/src/app/components/StandardSlot.jsx b/src/app/components/StandardSlot.jsx index 335df054..1073e548 100644 --- a/src/app/components/StandardSlot.jsx +++ b/src/app/components/StandardSlot.jsx @@ -41,7 +41,7 @@ export default class StandardSlot extends TranslatedComponent { render() { let { termtip, tooltip } = this.context; let { translate, formats, units } = this.context.language; - let { modules, slot, selected, warning, onSelect, onChange, ladenMass, ship } = this.props; + let { modules, slot, selected, warning, onSelect, onChange, ship } = this.props; let m = slot.m; let classRating = m.class + m.rating; let menu; diff --git a/src/app/components/StandardSlotSection.jsx b/src/app/components/StandardSlotSection.jsx index af99ce43..24b25926 100644 --- a/src/app/components/StandardSlotSection.jsx +++ b/src/app/components/StandardSlotSection.jsx @@ -86,12 +86,10 @@ export default class StandardSlotSection extends SlotSection { * @return {Array} Array of Slots */ _getSlots() { - let { translate, units, formats } = this.context.language; let { ship, currentMenu } = this.props; let slots = new Array(8); let open = this._openMenu; let select = this._selectModule; - let selBulkhead = this._selectBulkhead; let st = ship.standard; let avail = ship.getAvailableModules().standard; let bh = ship.bulkheads; diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index a8074409..dca61b1e 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -151,7 +151,6 @@ export default class Module { */ getHeatPerSecond() { // Modifier for hps is thermload - return this._getModifiedValue('hps'); let result = 0; if (this['hps']) { result = this['hps']; diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 123efe3c..bd2c8fec 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -888,7 +888,7 @@ export default class Ship { */ updateJumpStats() { let fsd = this.standard[2].m; // Frame Shift Drive; - let { unladenMass, ladenMass, fuelCapacity } = this; + let { unladenMass, fuelCapacity } = this; this.unladenRange = this.calcUnladenRange(); // Includes fuel weight for jump this.fullTankRange = Calc.jumpRange(unladenMass + fuelCapacity, fsd); // Full Tank this.ladenRange = this.calcLadenRange(); // Includes full tank and caro