diff --git a/src/app/Coriolis.jsx b/src/app/Coriolis.jsx index 88921586..5e2f7afd 100644 --- a/src/app/Coriolis.jsx +++ b/src/app/Coriolis.jsx @@ -27,7 +27,6 @@ const zlib = require('pako'); * Coriolis App */ export default class Coriolis extends React.Component { - static childContextTypes = { closeMenu: PropTypes.func.isRequired, hideModal: PropTypes.func.isRequired, @@ -394,7 +393,7 @@ export default class Coriolis extends React.Component { let currentMenu = this.state.currentMenu; return
+ className={this.state.noTouch ? 'no-touch' : null}>
{this.state.error ? this.state.error : this.state.page ? React.createElement(this.state.page, { currentMenu }) : } @@ -403,7 +402,7 @@ export default class Coriolis extends React.Component {
+
+

{translate('shield sources')}

+ +
+
+

{translate('damage taken')}(%)

+ +
+
+

{translate('effective shield')}(MJ)

+ +
: null }
diff --git a/src/app/components/FSDProfile.jsx b/src/app/components/FSDProfile.jsx index bd12fc10..ae041a43 100644 --- a/src/app/components/FSDProfile.jsx +++ b/src/app/components/FSDProfile.jsx @@ -69,7 +69,7 @@ export default class FSDProfile extends TranslatedComponent { const { formats, translate, units } = language; const { ship, cargo, fuel } = this.props; - + // Calculate bounds for our line chart - use thruster info for X const thrusters = ship.standard[1].m; const fsd = ship.standard[2].m; diff --git a/src/app/components/ModalDeleteAll.jsx b/src/app/components/ModalDeleteAll.jsx index fd0eb948..8edc1b2d 100644 --- a/src/app/components/ModalDeleteAll.jsx +++ b/src/app/components/ModalDeleteAll.jsx @@ -6,7 +6,6 @@ import Persist from '../stores/Persist'; * Delete All saved data modal */ export default class ModalDeleteAll extends TranslatedComponent { - /** * Delete everything and hide the modal */ diff --git a/src/app/components/Modification.jsx b/src/app/components/Modification.jsx index b2979bb7..69ac3f8e 100644 --- a/src/app/components/Modification.jsx +++ b/src/app/components/Modification.jsx @@ -9,7 +9,6 @@ import { isValueBeneficial } from '../utils/BlueprintFunctions'; * Modification */ export default class Modification extends TranslatedComponent { - static propTypes = { ship: PropTypes.object.isRequired, m: PropTypes.object.isRequired, @@ -98,15 +97,15 @@ export default class Modification extends TranslatedComponent { style={{ textAlign: 'right', cursor: 'inherit' }}/> } - {units[m.getStoredUnitFor(name)]} + {units[m.getStoredUnitFor(name)]} + modValue ? + isValueBeneficial(name, modValue) ? 'secondary' : 'warning' : + '' + }> {formats.f2(modValue / 100) || 0}% diff --git a/src/app/components/ModificationsMenu.jsx b/src/app/components/ModificationsMenu.jsx index b68bf004..803226a9 100644 --- a/src/app/components/ModificationsMenu.jsx +++ b/src/app/components/ModificationsMenu.jsx @@ -23,7 +23,6 @@ const MODIFICATIONS_COMPARATOR = (mod1, mod2) => { * Modifications menu */ export default class ModificationsMenu extends TranslatedComponent { - static propTypes = { ship: PropTypes.object.isRequired, m: PropTypes.object.isRequired, @@ -461,10 +460,10 @@ export default class ModificationsMenu extends TranslatedComponent { } return (
e.stopPropagation() } - onContextMenu={stopCtxPropagation} - ref={modItem => this.modItems['modMainDiv'] = modItem} + className={cn('select', this.props.className)} + onClick={(e) => e.stopPropagation() } + onContextMenu={stopCtxPropagation} + ref={modItem => this.modItems['modMainDiv'] = modItem} > { showBlueprintsMenu | showSpecialsMenu ? '' : haveBlueprint ?
this.modItems[this.firstBPLabel] = modItems}>{blueprintLabel}
: @@ -473,11 +472,11 @@ export default class ModificationsMenu extends TranslatedComponent { { showSpecial & !showSpecialsMenu ?
{specialLabel}
: null } { showSpecialsMenu ? specials : null } { showReset ?
{ translate('reset') }
: null } - { showRolls ? + { showRolls ? - - - { showRolls ? +
+ + { showRolls ? @@ -485,7 +484,7 @@ export default class ModificationsMenu extends TranslatedComponent { : null } - +
{ translate('roll') }: { translate('0%') } { translate('100%') } { translate('random') }
: null } { showMods ?
: null } { showMods ? diff --git a/src/app/components/Movement.jsx b/src/app/components/Movement.jsx index 65b3582e..42dca8b5 100644 --- a/src/app/components/Movement.jsx +++ b/src/app/components/Movement.jsx @@ -35,13 +35,13 @@ export default class Movement extends TranslatedComponent { return ( - // Axes + {/* Axes */} - // End Arrow + {/* End Arrow */} - // Axes arcs and arrows + {/* Axes arcs and arrows */} @@ -57,13 +57,13 @@ export default class Movement extends TranslatedComponent { - // Speed + {/* Speed */} {ship.canThrust(cargo, fuel) ? formats.int(ship.calcSpeed(eng, fuel, cargo, boost)) + 'm/s' : '-'} - // Pitch + {/* Pitch */} {ship.canThrust(cargo, fuel) ? formats.int(ship.calcPitch(eng, fuel, cargo, boost)) + '°/s' : '-'} - // Roll + {/* Roll */} {ship.canThrust(cargo, fuel) ? formats.int(ship.calcRoll(eng, fuel, cargo, boost)) + '°/s' : '-'} - // Yaw + {/* Yaw */} {ship.canThrust(cargo, fuel) ? formats.int(ship.calcYaw(eng, fuel, cargo, boost)) + '°/s' : '-'} ); diff --git a/src/app/components/Offence.jsx b/src/app/components/Offence.jsx index 83450bdf..524c40a7 100644 --- a/src/app/components/Offence.jsx +++ b/src/app/components/Offence.jsx @@ -203,9 +203,9 @@ export default class Offence extends TranslatedComponent { let totalSEps = 0; - let totalSDpsObject = {'absolute': 0, 'explosive': 0, 'kinetic': 0, 'thermal': 0}; - let shieldsSDpsObject = {'absolute': 0, 'explosive': 0, 'kinetic': 0, 'thermal': 0}; - let armourSDpsObject = {'absolute': 0, 'explosive': 0, 'kinetic': 0, 'thermal': 0}; + let totalSDpsObject = { 'absolute': 0, 'explosive': 0, 'kinetic': 0, 'thermal': 0 }; + let shieldsSDpsObject = { 'absolute': 0, 'explosive': 0, 'kinetic': 0, 'thermal': 0 }; + let armourSDpsObject = { 'absolute': 0, 'explosive': 0, 'kinetic': 0, 'thermal': 0 }; const rows = []; for (let i = 0; i < damage.length; i++) { @@ -267,22 +267,22 @@ export default class Offence extends TranslatedComponent { return (
- - - - - - - - - - - - - - - - +
{translate('weapon')}{translate('overall')}{translate('opponent\'s shields')}{translate('opponent\'s armour')}
{'sdps'}{'sdps'}{'eft'}{'sdps'}{'eft'}
+ + + + + + + + + + + + + + + {rows} {rows.length > 0 && @@ -296,7 +296,7 @@ export default class Offence extends TranslatedComponent { } -
{translate('weapon')}{translate('overall')}{translate('opponent\'s shields')}{translate('opponent\'s armour')}
{'sdps'}{'sdps'}{'eft'}{'sdps'}{'eft'}
+

{translate('offence metrics')}

diff --git a/src/app/components/PowerBands.jsx b/src/app/components/PowerBands.jsx index 8d3d2c24..c66dfa07 100644 --- a/src/app/components/PowerBands.jsx +++ b/src/app/components/PowerBands.jsx @@ -32,7 +32,6 @@ function bandText(val, index, wattScale) { * Renders the SVG to simulate in-game power bands */ export default class PowerBands extends TranslatedComponent { - static propTypes = { bands: PropTypes.array.isRequired, available: PropTypes.number.isRequired, diff --git a/src/app/components/Slot.jsx b/src/app/components/Slot.jsx index a7db217d..63f7e8a4 100644 --- a/src/app/components/Slot.jsx +++ b/src/app/components/Slot.jsx @@ -88,7 +88,7 @@ export default class Slot extends TranslatedComponent { if(event.target.className == 'r') { this._toggleModifications(); } - this.props.onOpen(event); + this.props.onOpen(event); } } /** diff --git a/src/app/components/UtilitySlotSection.jsx b/src/app/components/UtilitySlotSection.jsx index 83f65afe..9857bc38 100644 --- a/src/app/components/UtilitySlotSection.jsx +++ b/src/app/components/UtilitySlotSection.jsx @@ -8,7 +8,6 @@ import { stopCtxPropagation } from '../utils/UtilityFunctions'; * Utility Slot Section */ export default class UtilitySlotSection extends SlotSection { - /** * Constructor * @param {Object} props React Component properties @@ -133,5 +132,4 @@ export default class UtilitySlotSection extends SlotSection {
; } - } diff --git a/src/app/components/VerticalBarChart.jsx b/src/app/components/VerticalBarChart.jsx index 52774ef9..98304041 100644 --- a/src/app/components/VerticalBarChart.jsx +++ b/src/app/components/VerticalBarChart.jsx @@ -17,7 +17,6 @@ const merge = function(one, two) { * A vertical bar chart */ export default class VerticalBarChart extends TranslatedComponent { - static propTypes = { data : PropTypes.array.isRequired, yMax : PropTypes.number diff --git a/src/app/shipyard/Modification.js b/src/app/shipyard/Modification.js index 5c2d4566..44531429 100755 --- a/src/app/shipyard/Modification.js +++ b/src/app/shipyard/Modification.js @@ -2,7 +2,6 @@ * Modification - a modification and its value */ export default class Modification { - /** * @param {String} id Unique modification ID * @param {Number} value Value of the modification @@ -11,5 +10,4 @@ export default class Modification { this.id = id; this.value = value; } - } diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index 8c0a5a9f..d03202a4 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -7,7 +7,6 @@ import { STATS_FORMATTING, SI_PREFIXES } from './StatsFormatting'; * Module - active module in a ship's buildout */ export default class Module { - /** * Construct a new module * @param {Object} params Module parameters. Either grp/id or template @@ -1091,5 +1090,4 @@ export default class Module { getHackTime(modified = true) { return this.get('hacktime', modified); } - } diff --git a/src/app/shipyard/ModuleSet.js b/src/app/shipyard/ModuleSet.js index d1bc3c90..129ee019 100755 --- a/src/app/shipyard/ModuleSet.js +++ b/src/app/shipyard/ModuleSet.js @@ -17,7 +17,6 @@ function filter(arr, maxClass, minClass, mass) { * The available module set for a specific ship */ export default class ModuleSet { - /** * Instantiate the module set * @param {Object} modules All Modules diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 4c5313ff..b6db1b53 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -71,7 +71,6 @@ function reduceToIDs(idArray, slot, slotIndex) { * Ship Model - Encapsulates and models in-game ship behavior */ export default class Ship { - /** * @param {String} id Unique ship Id / Key * @param {Object} properties Basic ship properties such as name, manufacturer, mass, etc @@ -416,16 +415,16 @@ export default class Ship { clearModifications(m) { m.mods = {}; this.updatePowerGenerated() - .updatePowerUsed() - .recalculateMass() - .updateJumpStats() - .recalculateShield() - .recalculateShieldCells() - .recalculateArmour() - .recalculateDps() - .recalculateEps() - .recalculateHps() - .updateMovement(); + .updatePowerUsed() + .recalculateMass() + .updateJumpStats() + .recalculateShield() + .recalculateShieldCells() + .recalculateArmour() + .recalculateDps() + .recalculateEps() + .recalculateHps() + .updateMovement(); } /** @@ -696,16 +695,16 @@ export default class Ship { // Update aggragated stats if (comps) { this.updatePowerGenerated() - .updatePowerUsed() - .recalculateMass() - .updateJumpStats() - .recalculateShield() - .recalculateShieldCells() - .recalculateArmour() - .recalculateDps() - .recalculateEps() - .recalculateHps() - .updateMovement(); + .updatePowerUsed() + .recalculateMass() + .updateJumpStats() + .recalculateShield() + .recalculateShieldCells() + .recalculateArmour() + .recalculateDps() + .recalculateEps() + .recalculateHps() + .updateMovement(); } return this.updatePowerPrioritesString().updatePowerEnabledString().updateModificationsString(); @@ -1205,7 +1204,7 @@ export default class Ship { .reduce((sum, cargo) => sum + cargo) .value(); - // handle passenger capacity + // handle passenger capacity passengerCapacity += chain(slots) .map(slot => slot.m ? slot.m.get('passengers') : null) .map(passengers => passengers || 0) @@ -1683,11 +1682,11 @@ export default class Ship { updated; this.useBulkhead(0) - .use(standard[2], fsd) // FSD - .use(standard[3], ls) // Life Support - .use(standard[5], s) // Sensors - .use(standard[4], pd) // Power Distributor - .use(standard[6], ft); // Fuel Tank + .use(standard[2], fsd) // FSD + .use(standard[3], ls) // Life Support + .use(standard[5], s) // Sensors + .use(standard[4], pd) // Power Distributor + .use(standard[6], ft); // Fuel Tank // Turn off nearly everything if (m.fsdDisabled) this.setSlotEnabled(this.standard[2], false); diff --git a/src/app/stores/Persist.js b/src/app/stores/Persist.js index e2724dbd..d0be7ef9 100644 --- a/src/app/stores/Persist.js +++ b/src/app/stores/Persist.js @@ -70,7 +70,6 @@ function _delete(key) { * export is an instance (see end of this file). */ export class Persist extends EventEmitter { - /** * Create an instance */ diff --git a/src/app/utils/BlueprintFunctions.js b/src/app/utils/BlueprintFunctions.js index e71efb25..2c38449d 100644 --- a/src/app/utils/BlueprintFunctions.js +++ b/src/app/utils/BlueprintFunctions.js @@ -19,7 +19,7 @@ export function specialToolTip(translate, blueprint, grp, m, specialName) { // We also add in any benefits from specials that aren't covered above if (m.blueprint) { for (const feature in Modifications.modifierActions[specialName]) { - // if (!blueprint.features[feature] && !m.mods.feature) { + // if (!blueprint.features[feature] && !m.mods.feature) { const featureDef = Modifications.modifications[feature]; if (featureDef && !featureDef.hidden) { let symbol = ''; @@ -37,14 +37,14 @@ export function specialToolTip(translate, blueprint, grp, m, specialName) { const currentIsBeneficial = isValueBeneficial(feature, current); effects.push( - - {translate(feature, grp)} -   - {current}{symbol} -   - - ); + + {translate(feature, grp)} +   + {current}{symbol} +   + + ); } } } @@ -54,7 +54,7 @@ export function specialToolTip(translate, blueprint, grp, m, specialName) {
- {effects} + {effects}
@@ -215,12 +215,12 @@ export function blueprintTooltip(translate, blueprint, engineers, grp, m) {
- - - + + + {m ? : null } - - + + {effects} @@ -228,10 +228,10 @@ export function blueprintTooltip(translate, blueprint, engineers, grp, m) {
{translate('feature')}{translate('worst')}
{translate('feature')}{translate('worst')}{translate('current')}{translate('best')}
{translate('best')}
{ components ? - - - - + + + + {components} @@ -239,9 +239,9 @@ export function blueprintTooltip(translate, blueprint, engineers, grp, m) {
{translate('component')}{translate('amount')}
{translate('component')}{translate('amount')}
: null } { engineersList ? - - - + + + {engineersList}
{translate('engineers')}
{translate('engineers')}