mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Updaes
This commit is contained in:
225
__tests__/fixtures/companion_api_import-4.json
Normal file
225
__tests__/fixtures/companion_api_import-4.json
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
{
|
||||||
|
"free": false,
|
||||||
|
"id": 2,
|
||||||
|
"modules": {
|
||||||
|
"Armour": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128049280,
|
||||||
|
"name": "CobraMkIII_Armour_Grade1",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"FrameShiftDrive": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128064117,
|
||||||
|
"name": "Int_Hyperdrive_Size4_Class5",
|
||||||
|
"on": true,
|
||||||
|
"priority": 4,
|
||||||
|
"value": 1610080
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"FuelTank": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128064349,
|
||||||
|
"name": "Int_FuelTank_Size4_Class3",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 24734
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"LifeSupport": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128064149,
|
||||||
|
"name": "Int_LifeSupport_Size3_Class2",
|
||||||
|
"on": true,
|
||||||
|
"priority": 0,
|
||||||
|
"value": 10133
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MainEngines": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128064079,
|
||||||
|
"name": "Int_Engine_Size4_Class2",
|
||||||
|
"on": true,
|
||||||
|
"priority": 0,
|
||||||
|
"value": 59633
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PaintJob": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128741033,
|
||||||
|
"name": "PaintJob_CobraMKIII_Corrosive_05",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PlanetaryApproachSuite": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128672317,
|
||||||
|
"name": "Int_PlanetApproachSuite",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 500
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PowerDistributor": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128064179,
|
||||||
|
"name": "Int_PowerDistributor_Size1_Class2",
|
||||||
|
"on": true,
|
||||||
|
"priority": 2,
|
||||||
|
"value": 1293
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PowerPlant": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128064037,
|
||||||
|
"name": "Int_Powerplant_Size2_Class5",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 160224
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Radar": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128064229,
|
||||||
|
"name": "Int_Sensors_Size3_Class2",
|
||||||
|
"on": true,
|
||||||
|
"priority": 0,
|
||||||
|
"value": 10133
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ShipID0": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128758976,
|
||||||
|
"name": "Nameplate_ShipID_Black",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ShipID1": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128758976,
|
||||||
|
"name": "Nameplate_ShipID_Black",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ShipKitBumper": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128740698,
|
||||||
|
"name": "CobraMkIII_ShipkitRaider1_Bumper1",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ShipKitSpoiler": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128740701,
|
||||||
|
"name": "CobraMkIII_ShipkitRaider1_Spoiler1",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ShipKitTail": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128740705,
|
||||||
|
"name": "CobraMkIII_ShipkitRaider1_Tail2",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ShipKitWings": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128740707,
|
||||||
|
"name": "CobraMkIII_ShipkitRaider1_Wings1",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ShipName0": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128758944,
|
||||||
|
"name": "Nameplate_Explorer01_Black",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ShipName1": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128758944,
|
||||||
|
"name": "Nameplate_Explorer01_Black",
|
||||||
|
"on": true,
|
||||||
|
"priority": 1,
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Slot01_Size4": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128666663,
|
||||||
|
"name": "Int_FuelScoop_Size4_Class3",
|
||||||
|
"on": true,
|
||||||
|
"priority": 2,
|
||||||
|
"value": 178898
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Slot02_Size4": [],
|
||||||
|
"Slot03_Size4": [],
|
||||||
|
"Slot04_Size2": [],
|
||||||
|
"Slot05_Size2": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128663561,
|
||||||
|
"name": "Int_StellarBodyDiscoveryScanner_Advanced",
|
||||||
|
"on": true,
|
||||||
|
"priority": 2,
|
||||||
|
"value": 1545000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Slot06_Size2": {
|
||||||
|
"module": {
|
||||||
|
"free": false,
|
||||||
|
"id": 128666634,
|
||||||
|
"name": "Int_DetailedSurfaceScanner_Tiny",
|
||||||
|
"on": true,
|
||||||
|
"priority": 2,
|
||||||
|
"value": 250000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "CobraMkIII",
|
||||||
|
"value": {
|
||||||
|
"hull": 205287,
|
||||||
|
"modules": 3850628,
|
||||||
|
"unloaned": 1751109
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -264,6 +264,18 @@ describe('Import Modal', function() {
|
|||||||
expect(MockRouter.go.mock.calls.length).toBe(1);
|
expect(MockRouter.go.mock.calls.length).toBe(1);
|
||||||
expect(MockRouter.go.mock.calls[0][0]).toBe('/outfit/type_7_transport?code=A0patfFflidasdf5----0404040005050504044d2402.AwRj4yrI.CwRgDBlVK7EiA%3D%3D%3D.&bn=Imported%20Type-7%20Transporter');
|
expect(MockRouter.go.mock.calls[0][0]).toBe('/outfit/type_7_transport?code=A0patfFflidasdf5----0404040005050504044d2402.AwRj4yrI.CwRgDBlVK7EiA%3D%3D%3D.&bn=Imported%20Type-7%20Transporter');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('imports a valid companion API build', function() {
|
||||||
|
const importData = require('./fixtures/companion-api-import-4');
|
||||||
|
pasteText(JSON.stringify(importData));
|
||||||
|
|
||||||
|
expect(modal.state.importValid).toBeTruthy();
|
||||||
|
expect(modal.state.errorMsg).toEqual(null);
|
||||||
|
expect(modal.state.singleBuild).toBe(true);
|
||||||
|
clickProceed();
|
||||||
|
expect(MockRouter.go.mock.calls.length).toBe(1);
|
||||||
|
expect(MockRouter.go.mock.calls[0][0]).toBe('outfit/cobra_mk_iii?code=A0p0tdFaldd3sdf4------34---2f2i.AwRj4yKA.CwRgDMYExre1Rcg%3D..EweloBhBGA2EoFMCGBzANokMK6A%3D');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Import E:D Shipyard Builds', function() {
|
describe('Import E:D Shipyard Builds', function() {
|
||||||
|
|||||||
15
package.json
15
package.json
@@ -24,7 +24,7 @@
|
|||||||
"deploy": "npm run lint && npm test && npm run build && npm run rsync"
|
"deploy": "npm run lint && npm test && npm run build && npm run rsync"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
|
"transform": {".*": "<rootDir>/node_modules/babel-jest"},
|
||||||
"testRegex": "(/__tests__/test-.*|\\.(test|spec))\\.js$",
|
"testRegex": "(/__tests__/test-.*|\\.(test|spec))\\.js$",
|
||||||
"moduleFileExtensions": [
|
"moduleFileExtensions": [
|
||||||
"js",
|
"js",
|
||||||
@@ -37,7 +37,6 @@
|
|||||||
"<rootDir>/node_modules/lodash",
|
"<rootDir>/node_modules/lodash",
|
||||||
"<rootDir>/node_modules/react",
|
"<rootDir>/node_modules/react",
|
||||||
"<rootDir>/node_modules/react-dom",
|
"<rootDir>/node_modules/react-dom",
|
||||||
"<rootDir>/node_modules/react-addons-test-utils",
|
|
||||||
"<rootDir>/node_modules/react-testutils-additions",
|
"<rootDir>/node_modules/react-testutils-additions",
|
||||||
"<rootDir>/node_modules/fbjs",
|
"<rootDir>/node_modules/fbjs",
|
||||||
"<rootDir>/node_modules/fbemitter",
|
"<rootDir>/node_modules/fbemitter",
|
||||||
@@ -64,28 +63,27 @@
|
|||||||
"babel-preset-stage-0": "*",
|
"babel-preset-stage-0": "*",
|
||||||
"css-loader": "^0.23.0",
|
"css-loader": "^0.23.0",
|
||||||
"d3-selection": "1",
|
"d3-selection": "1",
|
||||||
"eslint": "2.2.0",
|
"eslint": "3.19.0",
|
||||||
"eslint-plugin-react": "^4.0.0",
|
"eslint-plugin-react": "^6.10.3",
|
||||||
"expose-loader": "^0.7.1",
|
"expose-loader": "^0.7.1",
|
||||||
"express": "^4.13.3",
|
"express": "^4.13.3",
|
||||||
"extract-text-webpack-plugin": "2.0.0",
|
"extract-text-webpack-plugin": "2.0.0",
|
||||||
"file-loader": "^0.8.4",
|
"file-loader": "^0.8.4",
|
||||||
"html-webpack-plugin": "^2.28.0",
|
"html-webpack-plugin": "^2.28.0",
|
||||||
"jest-cli": "^16.0.1",
|
"jest-cli": "^19.0.2",
|
||||||
"jsen": "^0.6.0",
|
"jsen": "^0.6.0",
|
||||||
"json-loader": "^0.5.3",
|
"json-loader": "^0.5.3",
|
||||||
"less": "^2.5.3",
|
"less": "^2.5.3",
|
||||||
"less-loader": "^2.2.1",
|
"less-loader": "^2.2.1",
|
||||||
"react-addons-perf": "^15.4.2",
|
"react-addons-perf": "^15.4.2",
|
||||||
"react-addons-test-utils": "^15.0.1",
|
|
||||||
"react-measure": "^1.4.6",
|
"react-measure": "^1.4.6",
|
||||||
"react-testutils-additions": "^15.1.0",
|
"react-testutils-additions": "^15.2.0",
|
||||||
"rimraf": "^2.4.3",
|
"rimraf": "^2.4.3",
|
||||||
"rollup": "0.36",
|
"rollup": "0.36",
|
||||||
"rollup-plugin-node-resolve": "2",
|
"rollup-plugin-node-resolve": "2",
|
||||||
"style-loader": "^0.13.0",
|
"style-loader": "^0.13.0",
|
||||||
"url-loader": "^0.5.6",
|
"url-loader": "^0.5.6",
|
||||||
"webpack": "^2.2.1",
|
"webpack": "^2.4.1",
|
||||||
"webpack-dev-server": "^2.4.1"
|
"webpack-dev-server": "^2.4.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -94,6 +92,7 @@
|
|||||||
"classnames": "^2.2.0",
|
"classnames": "^2.2.0",
|
||||||
"coriolis-data": "EDCD/coriolis-data",
|
"coriolis-data": "EDCD/coriolis-data",
|
||||||
"d3": "4.6.0",
|
"d3": "4.6.0",
|
||||||
|
"detect-browser": "^1.7.0",
|
||||||
"fbemitter": "^2.0.0",
|
"fbemitter": "^2.0.0",
|
||||||
"lodash": "^4.15.0",
|
"lodash": "^4.15.0",
|
||||||
"lz-string": "^1.4.4",
|
"lz-string": "^1.4.4",
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default class JumpRange extends TranslatedComponent {
|
|||||||
componentWillReceiveProps(nextProps, nextContext) {
|
componentWillReceiveProps(nextProps, nextContext) {
|
||||||
if (nextProps.code != this.props.code) {
|
if (nextProps.code != this.props.code) {
|
||||||
this.setState({ fuelLevel: 1,
|
this.setState({ fuelLevel: 1,
|
||||||
calcJumpRangeFunc: this._calcJumpRange.bind(this, nextProps.ship) });
|
calcJumpRangeFunc: this._calcJumpRange.bind(this, nextProps.ship) });
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { wrapCtxMenu } from '../utils/UtilityFunctions';
|
|||||||
import { canMount } from '../utils/SlotFunctions';
|
import { canMount } from '../utils/SlotFunctions';
|
||||||
import { Equalizer } from '../components/SvgIcons';
|
import { Equalizer } from '../components/SvgIcons';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
const browser = require('detect-browser');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract Slot Section
|
* Abstract Slot Section
|
||||||
@@ -76,8 +77,10 @@ export default class SlotSection extends TranslatedComponent {
|
|||||||
* @param {Event} e Drag Event
|
* @param {Event} e Drag Event
|
||||||
*/
|
*/
|
||||||
_drag(originSlot, e) {
|
_drag(originSlot, e) {
|
||||||
e.dataTransfer.setData('text/html', e.currentTarget);
|
if (!browser || (browser.name !== 'edge' && browser.name !== 'ie')) {
|
||||||
e.dataTransfer.effectAllowed = 'all';
|
e.dataTransfer.setData('text/html', e.currentTarget);
|
||||||
|
}
|
||||||
|
e.dataTransfer.effectAllowed = 'copyMove';
|
||||||
this.setState({ originSlot, copy: e.getModifierState('Alt') });
|
this.setState({ originSlot, copy: e.getModifierState('Alt') });
|
||||||
this._close();
|
this._close();
|
||||||
}
|
}
|
||||||
@@ -94,10 +97,14 @@ export default class SlotSection extends TranslatedComponent {
|
|||||||
if (os) {
|
if (os) {
|
||||||
// Show correct icon
|
// Show correct icon
|
||||||
const effect = this.state.copy ? 'copy' : 'move';
|
const effect = this.state.copy ? 'copy' : 'move';
|
||||||
e.dataTransfer.dropEffect = os != targetSlot && canMount(this.props.ship, targetSlot, os.m.grp, os.m.class) ? effect : 'none';
|
if (!browser || (browser.name !== 'edge' && browser.name !== 'ie')) {
|
||||||
|
e.dataTransfer.dropEffect = os != targetSlot && canMount(this.props.ship, targetSlot, os.m.grp, os.m.class) ? effect : 'none';
|
||||||
|
}
|
||||||
this.setState({ targetSlot });
|
this.setState({ targetSlot });
|
||||||
} else {
|
} else {
|
||||||
e.dataTransfer.dropEffect = 'none';
|
if (!browser || (browser.name !== 'edge' && browser.name !== 'ie')) {
|
||||||
|
e.dataTransfer.dropEffect = 'none';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +114,9 @@ export default class SlotSection extends TranslatedComponent {
|
|||||||
*/
|
*/
|
||||||
_dragOverNone(e) {
|
_dragOverNone(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.dataTransfer.dropEffect = 'none';
|
if (!browser || (browser.name !== 'edge' && browser.name !== 'ie')) {
|
||||||
|
e.dataTransfer.dropEffect = 'none';
|
||||||
|
}
|
||||||
this.setState({ targetSlot: null });
|
this.setState({ targetSlot: null });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,10 @@ class ValueLabel extends React.Component {
|
|||||||
value: PropTypes.number
|
value: PropTypes.number
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render offence
|
||||||
|
* @return {React.Component} contents
|
||||||
|
*/
|
||||||
render() {
|
render() {
|
||||||
const { x, y, payload, value } = this.props;
|
const { x, y, payload, value } = this.props;
|
||||||
|
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ export default class WeaponDamageChart extends TranslatedComponent {
|
|||||||
const maxRange = this._calcMaxRange(nextProps.ship);
|
const maxRange = this._calcMaxRange(nextProps.ship);
|
||||||
const maxDps = this._calcMaxSDps(nextProps.ship, nextProps.opponent, opponentShields, opponentArmour);
|
const maxDps = this._calcMaxSDps(nextProps.ship, nextProps.opponent, opponentShields, opponentArmour);
|
||||||
this.setState({ weaponNames,
|
this.setState({ weaponNames,
|
||||||
opponentShields,
|
opponentShields,
|
||||||
opponentArmour,
|
opponentArmour,
|
||||||
maxRange,
|
maxRange,
|
||||||
maxDps,
|
maxDps,
|
||||||
calcSDpsFunc: this._calcSDps.bind(this, nextProps.ship, weaponNames, nextProps.opponent, opponentShields, opponentArmour, nextProps.hull)
|
calcSDpsFunc: this._calcSDps.bind(this, nextProps.ship, weaponNames, nextProps.opponent, opponentShields, opponentArmour, nextProps.hull)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import ModalImport from '../components/ModalImport';
|
|||||||
import { FloppyDisk, Bin, Download, Embed, Rocket, LinkIcon } from '../components/SvgIcons';
|
import { FloppyDisk, Bin, Download, Embed, Rocket, LinkIcon } from '../components/SvgIcons';
|
||||||
import ShortenUrl from '../utils/ShortenUrl';
|
import ShortenUrl from '../utils/ShortenUrl';
|
||||||
import { comparisonBBCode } from '../utils/BBCode';
|
import { comparisonBBCode } from '../utils/BBCode';
|
||||||
|
const browser = require('detect-browser');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a comparator based on the specified predicate
|
* Creates a comparator based on the specified predicate
|
||||||
@@ -228,8 +228,10 @@ export default class ComparisonPage extends Page {
|
|||||||
let placeholder = this.placeholder = document.createElement('li');
|
let placeholder = this.placeholder = document.createElement('li');
|
||||||
placeholder.style.width = Math.round(this.dragged.offsetWidth) + 'px';
|
placeholder.style.width = Math.round(this.dragged.offsetWidth) + 'px';
|
||||||
placeholder.className = 'facet-placeholder';
|
placeholder.className = 'facet-placeholder';
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
if (!browser || (browser.name !== 'edge' && browser.name !== 'ie')) {
|
||||||
e.dataTransfer.setData('text/html', e.currentTarget);
|
e.dataTransfer.effectAllowed = 'move';
|
||||||
|
e.dataTransfer.setData('text/html', e.currentTarget);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ function shipSummary(shipId, shipData) {
|
|||||||
th = ship.standard[1].maxClass + 'A';
|
th = ship.standard[1].maxClass + 'A';
|
||||||
}
|
}
|
||||||
|
|
||||||
ship.optimizeMass({ th: th, fsd: '2D', ft: '1C' }); // Optmize mass with Max Thrusters
|
ship.optimizeMass({ th, fsd: '2D', ft: '1C' }); // Optmize mass with Max Thrusters
|
||||||
summary.topSpeed = ship.topSpeed;
|
summary.topSpeed = ship.topSpeed;
|
||||||
summary.topBoost = ship.topBoost;
|
summary.topBoost = ship.topBoost;
|
||||||
summary.baseArmour = ship.armour;
|
summary.baseArmour = ship.armour;
|
||||||
|
|||||||
@@ -168,10 +168,10 @@ function normValues(minMass, optMass, maxMass, minMul, optMul, maxMul, mass, bas
|
|||||||
const res = base * mul;
|
const res = base * mul;
|
||||||
|
|
||||||
return [res * (1 - (engpip * 4)),
|
return [res * (1 - (engpip * 4)),
|
||||||
res * (1 - (engpip * 3)),
|
res * (1 - (engpip * 3)),
|
||||||
res * (1 - (engpip * 2)),
|
res * (1 - (engpip * 2)),
|
||||||
res * (1 - (engpip * 1)),
|
res * (1 - (engpip * 1)),
|
||||||
res];
|
res];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -105,115 +105,115 @@ export const BulkheadNames = [
|
|||||||
* @type {Array}
|
* @type {Array}
|
||||||
*/
|
*/
|
||||||
export const ShipFacets = [
|
export const ShipFacets = [
|
||||||
{ // 0
|
{ // 0
|
||||||
title: 'agility',
|
title: 'agility',
|
||||||
props: ['topPitch', 'topRoll', 'topYaw'],
|
props: ['topPitch', 'topRoll', 'topYaw'],
|
||||||
lbls: ['pitch', 'roll', 'yaw'],
|
lbls: ['pitch', 'roll', 'yaw'],
|
||||||
fmt: 'f1',
|
fmt: 'f1',
|
||||||
i: 0
|
i: 0
|
||||||
},
|
},
|
||||||
{ // 1
|
{ // 1
|
||||||
title: 'speed',
|
title: 'speed',
|
||||||
props: ['topSpeed', 'topBoost'],
|
props: ['topSpeed', 'topBoost'],
|
||||||
lbls: ['thrusters', 'boost'],
|
lbls: ['thrusters', 'boost'],
|
||||||
unit: 'm/s',
|
unit: 'm/s',
|
||||||
fmt: 'int',
|
fmt: 'int',
|
||||||
i: 1
|
i: 1
|
||||||
},
|
},
|
||||||
{ // 2
|
{ // 2
|
||||||
title: 'armour',
|
title: 'armour',
|
||||||
props: ['armour'],
|
props: ['armour'],
|
||||||
fmt: 'int',
|
fmt: 'int',
|
||||||
i: 2
|
i: 2
|
||||||
},
|
},
|
||||||
{ // 3
|
{ // 3
|
||||||
title: 'shields',
|
title: 'shields',
|
||||||
props: ['shield'],
|
props: ['shield'],
|
||||||
unit: 'MJ',
|
unit: 'MJ',
|
||||||
fmt: 'int',
|
fmt: 'int',
|
||||||
i: 3
|
i: 3
|
||||||
},
|
},
|
||||||
{ // 4
|
{ // 4
|
||||||
title: 'jump range',
|
title: 'jump range',
|
||||||
props: ['unladenRange', 'fullTankRange', 'ladenRange'],
|
props: ['unladenRange', 'fullTankRange', 'ladenRange'],
|
||||||
lbls: ['max', 'full tank', 'laden'],
|
lbls: ['max', 'full tank', 'laden'],
|
||||||
unit: 'LY',
|
unit: 'LY',
|
||||||
fmt: 'round',
|
fmt: 'round',
|
||||||
i: 4
|
i: 4
|
||||||
},
|
},
|
||||||
{ // 5
|
{ // 5
|
||||||
title: 'mass',
|
title: 'mass',
|
||||||
props: ['unladenMass', 'ladenMass'],
|
props: ['unladenMass', 'ladenMass'],
|
||||||
lbls: ['unladen', 'laden'],
|
lbls: ['unladen', 'laden'],
|
||||||
unit: 'T',
|
unit: 'T',
|
||||||
fmt: 'round',
|
fmt: 'round',
|
||||||
i: 5
|
i: 5
|
||||||
},
|
},
|
||||||
{ // 6
|
{ // 6
|
||||||
title: 'cargo',
|
title: 'cargo',
|
||||||
props: ['cargoCapacity'],
|
props: ['cargoCapacity'],
|
||||||
unit: 'T',
|
unit: 'T',
|
||||||
fmt: 'int',
|
fmt: 'int',
|
||||||
i: 6
|
i: 6
|
||||||
},
|
},
|
||||||
{ // 7
|
{ // 7
|
||||||
title: 'fuel',
|
title: 'fuel',
|
||||||
props: ['fuelCapacity'],
|
props: ['fuelCapacity'],
|
||||||
unit: 'T',
|
unit: 'T',
|
||||||
fmt: 'int',
|
fmt: 'int',
|
||||||
i: 7
|
i: 7
|
||||||
},
|
},
|
||||||
{ // 8
|
{ // 8
|
||||||
title: 'power',
|
title: 'power',
|
||||||
props: ['powerRetracted', 'powerDeployed', 'powerAvailable'],
|
props: ['powerRetracted', 'powerDeployed', 'powerAvailable'],
|
||||||
lbls: ['retracted', 'deployed', 'available'],
|
lbls: ['retracted', 'deployed', 'available'],
|
||||||
unit: 'MW',
|
unit: 'MW',
|
||||||
fmt: 'f2',
|
fmt: 'f2',
|
||||||
i: 8
|
i: 8
|
||||||
},
|
},
|
||||||
{ // 9
|
{ // 9
|
||||||
title: 'cost',
|
title: 'cost',
|
||||||
props: ['totalCost'],
|
props: ['totalCost'],
|
||||||
unit: 'CR',
|
unit: 'CR',
|
||||||
fmt: 'int',
|
fmt: 'int',
|
||||||
i: 9
|
i: 9
|
||||||
},
|
},
|
||||||
{ // 10
|
{ // 10
|
||||||
title: 'fastest range',
|
title: 'fastest range',
|
||||||
props: ['unladenFastestRange', 'ladenFastestRange'],
|
props: ['unladenFastestRange', 'ladenFastestRange'],
|
||||||
lbls: ['unladen', 'laden'],
|
lbls: ['unladen', 'laden'],
|
||||||
unit: 'LY',
|
unit: 'LY',
|
||||||
fmt: 'round',
|
fmt: 'round',
|
||||||
i: 10
|
i: 10
|
||||||
},
|
},
|
||||||
{ // 11
|
{ // 11
|
||||||
title: 'DPS',
|
title: 'DPS',
|
||||||
props: ['totalDps', 'totalExplDps', 'totalKinDps', 'totalThermDps'],
|
props: ['totalDps', 'totalExplDps', 'totalKinDps', 'totalThermDps'],
|
||||||
lbls: ['total', 'explosive', 'kinetic', 'thermal'],
|
lbls: ['total', 'explosive', 'kinetic', 'thermal'],
|
||||||
fmt: 'round',
|
fmt: 'round',
|
||||||
i: 11
|
i: 11
|
||||||
},
|
},
|
||||||
{ // 14
|
{ // 14
|
||||||
title: 'Sustained DPS',
|
title: 'Sustained DPS',
|
||||||
props: ['totalSDps', 'totalExplSDps', 'totalKinSDps', 'totalThermSDps'],
|
props: ['totalSDps', 'totalExplSDps', 'totalKinSDps', 'totalThermSDps'],
|
||||||
lbls: ['total', 'explosive', 'kinetic', 'thermal'],
|
lbls: ['total', 'explosive', 'kinetic', 'thermal'],
|
||||||
fmt: 'round',
|
fmt: 'round',
|
||||||
i: 14
|
i: 14
|
||||||
},
|
},
|
||||||
{ // 12
|
{ // 12
|
||||||
title: 'EPS',
|
title: 'EPS',
|
||||||
props: ['totalEps'],
|
props: ['totalEps'],
|
||||||
lbls: ['EPS'],
|
lbls: ['EPS'],
|
||||||
fmt: 'round',
|
fmt: 'round',
|
||||||
i: 12
|
i: 12
|
||||||
},
|
},
|
||||||
{ // 13
|
{ // 13
|
||||||
title: 'HPS',
|
title: 'HPS',
|
||||||
props: ['totalHps'],
|
props: ['totalHps'],
|
||||||
lbls: ['HPS'],
|
lbls: ['HPS'],
|
||||||
fmt: 'round',
|
fmt: 'round',
|
||||||
i: 13
|
i: 13
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ CopyDirPlugin.prototype.apply = function(compiler) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
cache: true,
|
||||||
entry: {
|
entry: {
|
||||||
app: ['babel-polyfill', path.resolve(__dirname, 'src/app/index')],
|
app: ['babel-polyfill', path.resolve(__dirname, 'src/app/index')],
|
||||||
lib: ['d3', 'react', 'react-dom', 'classnames', 'fbemitter', 'lz-string']
|
lib: ['d3', 'react', 'react-dom', 'classnames', 'fbemitter', 'lz-string']
|
||||||
@@ -76,7 +77,7 @@ module.exports = {
|
|||||||
rules: [
|
rules: [
|
||||||
{ test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader'}) },
|
{ test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader'}) },
|
||||||
{ test: /\.less$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader',use: 'css-loader!less-loader'}) },
|
{ test: /\.less$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader',use: 'css-loader!less-loader'}) },
|
||||||
{ test: /\.(js|jsx)$/, loaders: [ 'babel-loader' ], include: path.join(__dirname, 'src') },
|
{ test: /\.(js|jsx)$/, loader: 'babel-loader?cacheDirectory=true', include: path.join(__dirname, 'src') },
|
||||||
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
|
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
|
||||||
{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
|
{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
|
||||||
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/octet-stream' },
|
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/octet-stream' },
|
||||||
|
|||||||
Reference in New Issue
Block a user