Skip to content

Commit c6a8e48

Browse files
committed
Merge branch 'release/23'
2 parents fac279d + f48af27 commit c6a8e48

71 files changed

Lines changed: 4212 additions & 2077 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ nginx.pid
66
.idea
77
/bin
88
env
9+
*.swp

ChangeLog.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
#2.3.0
2+
* Make scan time visible on scanners where available
3+
* Update power distributor able-to-boost calculation to take fractional MJ values in to account
4+
* Revert to floating header due to issues on iOS
5+
* Fix issue where new module added to a slot did not reset its enabled status
6+
* Show integrity value for relevant modules
7+
* Reset old modification values when a new roll is applied
8+
* Fix issue with miner role where refinery would not be present in ships with class 5 slots but no class 4
9+
* Ensure that boost value is set correctly when modifications to power distributor enable/disable boost
10+
* Ensure that hull reinforcement modifications take the inherent resistance in to account when calculating modification percentages
11+
* Add tooltip for blueprints providing details of the features they alter, the components required for the blueprint and the engineer(s) who cam craft them
12+
* Use opponent's saved pips if available
13+
* Ignore rounds per shot for EPS and HPS calculations; it's already factored in to the numbers
14+
* Ensure that clip size modification imports result in whole numbers
15+
* Rework of separate offence/defence/movement sections to a unified interface
16+
* Use cargo hatch information on import if available
17+
* Additional information of power distributor pips, boost, cargo and fuel loads added to build
18+
* Additional information of opponent and engagement range added to build
19+
* Reworking of offence, defence and movement information in to separate tabs as part of the outfitting screen:
20+
* Power and costs section provides the existing 'Power' and 'Costs' sections
21+
* Profiles section provides a number of graphs that show how various components of the build (top speed, sustained DPS against opponent's shields and armour etc) are affected by mass, range, etc.
22+
* Offence section provides details of your build's damage distribution and per-weapon effectiveness. It also gives summary information for how long it will take for your build to wear down your opponent's shields and armour
23+
* Defence section provides details of your build's defences against your selected opponent. It provides details of the effectiveness of your resistances of both shields and armour, and effective strength of each as a result. It also provides key metrics around shield longevity and recovery times, as well as module protection
24+
* Fix power band marker to show safe power limit at 40% rather than 50%
25+
* Restyle blueprint list to improve consistency with similar menus
26+
* Use coriolis-data 2.3.0:
27+
* Add Dolphin
28+
* Add turreted mining lasers
29+
* Add long range / wide angle / fast scan scanner blueprints
30+
* Fix EDDB IDs for class 5 and 7 fighter hangars for correct shopping list
31+
* Fix cost for rocket-propelled FSD disruptor
32+
* Add module names for blueprints
33+
* Fix erroneous value for grade 5 kinetic shield booster
34+
* Add missing integrity values for some modules
35+
* Update module reinforcement package integrity
36+
* Update specs of Beluga as per 2.3
37+
* Update specs of Asp Scout as per 2.3
38+
* Update specs of Diamondback Explorer as per 2.3
39+
* Add ED ID for Rocket Propelled FSD Disruptor
40+
* Fix ED name for target lock breaker special
41+
* Update scan range and angle information for sensors
42+
* Tidy up shield cell bank information to allow for accurate calculations with modifications
43+
* Update mine launcher stats
44+
* Add appropriate engineers to per-module blueprint information
45+
146
#2.2.19
247
* Power management panel now displays modules in descending order of power usage by default
348
* Shot speed can no longer be modified directly. Its value is derived from the range modifier for Long Range and Focused modifications

__tests__/fixtures/anaconda-test-detailed-export-v4.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@
320320
"shieldExplRes": 0.5,
321321
"shieldKinRes": 0.4,
322322
"shieldThermRes": -0.2,
323-
"timeToDrain": 7.04,
324323
"crew": 3
325324
}
326325
}

__tests__/fixtures/expected-builds.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"Test": "A4putkFklkdzsuf52c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04---0303326b.Iw18ZVA=.Aw18ZVA=."
3737
},
3838
"diamondback_explorer": {
39-
"Explorer": "A0p0tdFfldddsdf5---0202--320p432i2f.AwRj4zTI.AwiMIypI."
39+
"Explorer": "A0p0tdFfldddsdf5---0202--320p432i2f-.AwRj4zTYg===.AwiMIyoo."
4040
},
4141
"vulture": {
4242
"Bounty Hunter": "A3patcFalddksff31e1e0404-0l4a-5d27662j.AwRj4z2I.MwBhBYy6oJmAjLIA."

d3.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coriolis_shipyard",
3-
"version": "2.2.19",
3+
"version": "2.3.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/EDCD/coriolis"
@@ -76,7 +76,9 @@
7676
"json-loader": "^0.5.3",
7777
"less": "^2.5.3",
7878
"less-loader": "^2.2.1",
79+
"react-addons-perf": "^15.4.2",
7980
"react-addons-test-utils": "^15.0.1",
81+
"react-measure": "^1.4.6",
8082
"react-testutils-additions": "^15.1.0",
8183
"rimraf": "^2.4.3",
8284
"rollup": "0.36",
@@ -88,16 +90,17 @@
8890
},
8991
"dependencies": {
9092
"babel-polyfill": "*",
91-
"classnames": "^2.2.0",
9293
"browserify-zlib": "ipfs/browserify-zlib",
94+
"classnames": "^2.2.0",
9395
"coriolis-data": "EDCD/coriolis-data",
9496
"d3": "4.6.0",
9597
"fbemitter": "^2.0.0",
9698
"lodash": "^4.15.0",
9799
"lz-string": "^1.4.4",
98-
"react-number-editor": "Athanasius/react-number-editor.git#miggy",
99100
"react": "^15.0.1",
100101
"react-dom": "^15.0.1",
102+
"react-number-editor": "Athanasius/react-number-editor.git#miggy",
103+
"recharts": "^0.21.2",
101104
"superagent": "^1.4.0"
102105
}
103106
}

src/app/Coriolis.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,19 @@ export default class Coriolis extends React.Component {
241241
/**
242242
* Show the term tip
243243
* @param {string} term Term or Phrase
244-
* @param {Object} opts Options - dontCap, orientation (n,e,s,w)
244+
* @param {Object} opts Options - dontCap, orientation (n,e,s,w) (can also be the event if no options supplied)
245245
* @param {SyntheticEvent} event Event
246+
* @param {SyntheticEvent} e2 Alternative location for synthetic event from charts (where 'Event' is actually a chart index)
246247
*/
247-
_termtip(term, opts, event) {
248-
if (opts && opts.nativeEvent) { // Opts is a SyntheticEvent
248+
_termtip(term, opts, event, e2) {
249+
if (opts && opts.nativeEvent) { // Opts is the SyntheticEvent
249250
event = opts;
250251
opts = { cap: true };
251252
}
253+
if (e2 instanceof Object && e2.nativeEvent) { // E2 is the SyntheticEvent
254+
event = e2;
255+
}
256+
252257
this._tooltip(
253258
<div className={'cen' + (opts.cap ? ' cap' : '')}>{this.state.language.translate(term)}</div>,
254259
event.currentTarget.getBoundingClientRect(),

src/app/components/AvailableModulesMenu.jsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import * as ModuleUtils from '../shipyard/ModuleUtils';
23
import { findDOMNode } from 'react-dom';
34
import TranslatedComponent from './TranslatedComponent';
45
import { stopCtxPropagation } from '../utils/UtilityFunctions';
@@ -41,6 +42,8 @@ const GRPCAT = {
4142
'mr': 'ordnance',
4243
'tp': 'ordnance',
4344
'nl': 'ordnance',
45+
'sc': 'scanners',
46+
'ss': 'scanners',
4447
// Utilities
4548
'cs': 'scanners',
4649
'kw': 'scanners',
@@ -60,7 +63,6 @@ const CATEGORIES = {
6063
'limpet controllers': ['cc', 'fx', 'hb', 'pc'],
6164
'passenger cabins': ['pce', 'pci', 'pcm', 'pcq'],
6265
'rf': ['rf'],
63-
'sc': ['sc'],
6466
'shields': ['sg', 'bsg', 'psg', 'scb'],
6567
'structural reinforcement': ['hr', 'mrp'],
6668
'dc': ['dc'],
@@ -72,7 +74,7 @@ const CATEGORIES = {
7274
'sb': ['sb'],
7375
'hs': ['hs'],
7476
'defence': ['ch', 'po', 'ec'],
75-
'scanners': ['cs', 'kw', 'ws'],
77+
'scanners': ['sc', 'ss', 'cs', 'kw', 'ws'], // Overloaded with internal scanners
7678
};
7779

7880
/**
@@ -212,7 +214,14 @@ export default class AvailableModulesMenu extends TranslatedComponent {
212214
for (let i = 0; i < sortedModules.length; i++) {
213215
let m = sortedModules[i];
214216
let mount = null;
215-
let disabled = m.maxmass && (mass + (m.mass ? m.mass : 0)) > m.maxmass;
217+
let disabled = false;
218+
if (ModuleUtils.isShieldGenerator(m.grp)) {
219+
// Shield generators care about maximum hull mass
220+
disabled = mass > m.maxmass;
221+
} else if (m.maxmass) {
222+
// Thrusters care about total mass
223+
disabled = mass + m.mass > m.maxmass;
224+
}
216225
let active = mountedModule && mountedModule.id === m.id;
217226
let classes = cn(m.name ? 'lc' : 'c', {
218227
warning: !disabled && warningFunc && warningFunc(m),

src/app/components/BarChart.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class BarChart extends TranslatedComponent {
4444
unit: ''
4545
};
4646

47-
static PropTypes = {
47+
static propTypes = {
4848
colors: React.PropTypes.array,
4949
data: React.PropTypes.array.isRequired,
5050
desc: React.PropTypes.bool,

src/app/components/Boost.jsx

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import React from 'react';
2+
import TranslatedComponent from './TranslatedComponent';
3+
import { Ships } from 'coriolis-data/dist';
4+
import { nameComparator } from '../utils/SlotFunctions';
5+
import { Pip } from './SvgIcons';
6+
import LineChart from '../components/LineChart';
7+
import Slider from '../components/Slider';
8+
import * as ModuleUtils from '../shipyard/ModuleUtils';
9+
import Module from '../shipyard/Module';
10+
11+
/**
12+
* Boost displays a boost button that toggles bosot
13+
* Requires an onChange() function of the form onChange(boost) which is triggered whenever the boost changes.
14+
*/
15+
export default class Boost extends TranslatedComponent {
16+
static propTypes = {
17+
marker: React.PropTypes.string.isRequired,
18+
ship: React.PropTypes.object.isRequired,
19+
boost: React.PropTypes.bool.isRequired,
20+
onChange: React.PropTypes.func.isRequired
21+
};
22+
23+
/**
24+
* Constructor
25+
* @param {Object} props React Component properties
26+
* @param {Object} context React Component context
27+
*/
28+
constructor(props, context) {
29+
super(props);
30+
const { ship, boost } = props;
31+
32+
this._keyDown = this._keyDown.bind(this);
33+
this._toggleBoost = this._toggleBoost.bind(this);
34+
}
35+
36+
/**
37+
* Add listeners after mounting
38+
*/
39+
componentDidMount() {
40+
document.addEventListener('keydown', this._keyDown);
41+
}
42+
43+
/**
44+
* Remove listeners before unmounting
45+
*/
46+
componentWillUnmount() {
47+
document.removeEventListener('keydown', this._keyDown);
48+
}
49+
50+
/**
51+
* Handle Key Down
52+
* @param {Event} e Keyboard Event
53+
*/
54+
_keyDown(e) {
55+
if (e.ctrlKey || e.metaKey) { // CTRL/CMD
56+
switch (e.keyCode) {
57+
case 66: // b == boost
58+
if (this.props.ship.canBoost()) {
59+
e.preventDefault();
60+
this._toggleBoost();
61+
}
62+
break;
63+
}
64+
}
65+
}
66+
67+
/**
68+
* Toggle the boost feature
69+
*/
70+
_toggleBoost() {
71+
this.props.onChange(!this.props.boost);
72+
}
73+
74+
/**
75+
* Render boost
76+
* @return {React.Component} contents
77+
*/
78+
render() {
79+
const { formats, translate, units } = this.context.language;
80+
const { ship, boost } = this.props;
81+
82+
// TODO disable if ship cannot boost
83+
return (
84+
<span id='boost'>
85+
<button id='boost' className={boost ? 'selected' : null} onClick={this._toggleBoost}>{translate('boost')}</button>
86+
</span>
87+
);
88+
}
89+
}

0 commit comments

Comments
 (0)