Skip to content

Commit

Permalink
Merge branch 'release/23'
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdrmcdonald committed Apr 13, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents fac279d + f48af27 commit c6a8e48
Showing 71 changed files with 4,212 additions and 2,077 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@ nginx.pid
.idea
/bin
env
*.swp
45 changes: 45 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
#2.3.0
* Make scan time visible on scanners where available
* Update power distributor able-to-boost calculation to take fractional MJ values in to account
* Revert to floating header due to issues on iOS
* Fix issue where new module added to a slot did not reset its enabled status
* Show integrity value for relevant modules
* Reset old modification values when a new roll is applied
* Fix issue with miner role where refinery would not be present in ships with class 5 slots but no class 4
* Ensure that boost value is set correctly when modifications to power distributor enable/disable boost
* Ensure that hull reinforcement modifications take the inherent resistance in to account when calculating modification percentages
* 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
* Use opponent's saved pips if available
* Ignore rounds per shot for EPS and HPS calculations; it's already factored in to the numbers
* Ensure that clip size modification imports result in whole numbers
* Rework of separate offence/defence/movement sections to a unified interface
* Use cargo hatch information on import if available
* Additional information of power distributor pips, boost, cargo and fuel loads added to build
* Additional information of opponent and engagement range added to build
* Reworking of offence, defence and movement information in to separate tabs as part of the outfitting screen:
* Power and costs section provides the existing 'Power' and 'Costs' sections
* 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.
* 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
* 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
* Fix power band marker to show safe power limit at 40% rather than 50%
* Restyle blueprint list to improve consistency with similar menus
* Use coriolis-data 2.3.0:
* Add Dolphin
* Add turreted mining lasers
* Add long range / wide angle / fast scan scanner blueprints
* Fix EDDB IDs for class 5 and 7 fighter hangars for correct shopping list
* Fix cost for rocket-propelled FSD disruptor
* Add module names for blueprints
* Fix erroneous value for grade 5 kinetic shield booster
* Add missing integrity values for some modules
* Update module reinforcement package integrity
* Update specs of Beluga as per 2.3
* Update specs of Asp Scout as per 2.3
* Update specs of Diamondback Explorer as per 2.3
* Add ED ID for Rocket Propelled FSD Disruptor
* Fix ED name for target lock breaker special
* Update scan range and angle information for sensors
* Tidy up shield cell bank information to allow for accurate calculations with modifications
* Update mine launcher stats
* Add appropriate engineers to per-module blueprint information

#2.2.19
* Power management panel now displays modules in descending order of power usage by default
* Shot speed can no longer be modified directly. Its value is derived from the range modifier for Long Range and Focused modifications
1 change: 0 additions & 1 deletion __tests__/fixtures/anaconda-test-detailed-export-v4.json
Original file line number Diff line number Diff line change
@@ -320,7 +320,6 @@
"shieldExplRes": 0.5,
"shieldKinRes": 0.4,
"shieldThermRes": -0.2,
"timeToDrain": 7.04,
"crew": 3
}
}
2 changes: 1 addition & 1 deletion __tests__/fixtures/expected-builds.json
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
"Test": "A4putkFklkdzsuf52c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04---0303326b.Iw18ZVA=.Aw18ZVA=."
},
"diamondback_explorer": {
"Explorer": "A0p0tdFfldddsdf5---0202--320p432i2f.AwRj4zTI.AwiMIypI."
"Explorer": "A0p0tdFfldddsdf5---0202--320p432i2f-.AwRj4zTYg===.AwiMIyoo."
},
"vulture": {
"Bounty Hunter": "A3patcFalddksff31e1e0404-0l4a-5d27662j.AwRj4z2I.MwBhBYy6oJmAjLIA."
8 changes: 4 additions & 4 deletions d3.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coriolis_shipyard",
"version": "2.2.19",
"version": "2.3.0",
"repository": {
"type": "git",
"url": "https://github.com/EDCD/coriolis"
@@ -76,7 +76,9 @@
"json-loader": "^0.5.3",
"less": "^2.5.3",
"less-loader": "^2.2.1",
"react-addons-perf": "^15.4.2",
"react-addons-test-utils": "^15.0.1",
"react-measure": "^1.4.6",
"react-testutils-additions": "^15.1.0",
"rimraf": "^2.4.3",
"rollup": "0.36",
@@ -88,16 +90,17 @@
},
"dependencies": {
"babel-polyfill": "*",
"classnames": "^2.2.0",
"browserify-zlib": "ipfs/browserify-zlib",
"classnames": "^2.2.0",
"coriolis-data": "EDCD/coriolis-data",
"d3": "4.6.0",
"fbemitter": "^2.0.0",
"lodash": "^4.15.0",
"lz-string": "^1.4.4",
"react-number-editor": "Athanasius/react-number-editor.git#miggy",
"react": "^15.0.1",
"react-dom": "^15.0.1",
"react-number-editor": "Athanasius/react-number-editor.git#miggy",
"recharts": "^0.21.2",
"superagent": "^1.4.0"
}
}
11 changes: 8 additions & 3 deletions src/app/Coriolis.jsx
Original file line number Diff line number Diff line change
@@ -241,14 +241,19 @@ export default class Coriolis extends React.Component {
/**
* Show the term tip
* @param {string} term Term or Phrase
* @param {Object} opts Options - dontCap, orientation (n,e,s,w)
* @param {Object} opts Options - dontCap, orientation (n,e,s,w) (can also be the event if no options supplied)
* @param {SyntheticEvent} event Event
* @param {SyntheticEvent} e2 Alternative location for synthetic event from charts (where 'Event' is actually a chart index)
*/
_termtip(term, opts, event) {
if (opts && opts.nativeEvent) { // Opts is a SyntheticEvent
_termtip(term, opts, event, e2) {
if (opts && opts.nativeEvent) { // Opts is the SyntheticEvent
event = opts;
opts = { cap: true };
}
if (e2 instanceof Object && e2.nativeEvent) { // E2 is the SyntheticEvent
event = e2;
}

this._tooltip(
<div className={'cen' + (opts.cap ? ' cap' : '')}>{this.state.language.translate(term)}</div>,
event.currentTarget.getBoundingClientRect(),
15 changes: 12 additions & 3 deletions src/app/components/AvailableModulesMenu.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import * as ModuleUtils from '../shipyard/ModuleUtils';
import { findDOMNode } from 'react-dom';
import TranslatedComponent from './TranslatedComponent';
import { stopCtxPropagation } from '../utils/UtilityFunctions';
@@ -41,6 +42,8 @@ const GRPCAT = {
'mr': 'ordnance',
'tp': 'ordnance',
'nl': 'ordnance',
'sc': 'scanners',
'ss': 'scanners',
// Utilities
'cs': 'scanners',
'kw': 'scanners',
@@ -60,7 +63,6 @@ const CATEGORIES = {
'limpet controllers': ['cc', 'fx', 'hb', 'pc'],
'passenger cabins': ['pce', 'pci', 'pcm', 'pcq'],
'rf': ['rf'],
'sc': ['sc'],
'shields': ['sg', 'bsg', 'psg', 'scb'],
'structural reinforcement': ['hr', 'mrp'],
'dc': ['dc'],
@@ -72,7 +74,7 @@ const CATEGORIES = {
'sb': ['sb'],
'hs': ['hs'],
'defence': ['ch', 'po', 'ec'],
'scanners': ['cs', 'kw', 'ws'],
'scanners': ['sc', 'ss', 'cs', 'kw', 'ws'], // Overloaded with internal scanners
};

/**
@@ -212,7 +214,14 @@ export default class AvailableModulesMenu extends TranslatedComponent {
for (let i = 0; i < sortedModules.length; i++) {
let m = sortedModules[i];
let mount = null;
let disabled = m.maxmass && (mass + (m.mass ? m.mass : 0)) > m.maxmass;
let disabled = false;
if (ModuleUtils.isShieldGenerator(m.grp)) {
// Shield generators care about maximum hull mass
disabled = mass > m.maxmass;
} else if (m.maxmass) {
// Thrusters care about total mass
disabled = mass + m.mass > m.maxmass;
}
let active = mountedModule && mountedModule.id === m.id;
let classes = cn(m.name ? 'lc' : 'c', {
warning: !disabled && warningFunc && warningFunc(m),
2 changes: 1 addition & 1 deletion src/app/components/BarChart.jsx
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ export default class BarChart extends TranslatedComponent {
unit: ''
};

static PropTypes = {
static propTypes = {
colors: React.PropTypes.array,
data: React.PropTypes.array.isRequired,
desc: React.PropTypes.bool,
89 changes: 89 additions & 0 deletions src/app/components/Boost.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import React from 'react';
import TranslatedComponent from './TranslatedComponent';
import { Ships } from 'coriolis-data/dist';
import { nameComparator } from '../utils/SlotFunctions';
import { Pip } from './SvgIcons';
import LineChart from '../components/LineChart';
import Slider from '../components/Slider';
import * as ModuleUtils from '../shipyard/ModuleUtils';
import Module from '../shipyard/Module';

/**
* Boost displays a boost button that toggles bosot
* Requires an onChange() function of the form onChange(boost) which is triggered whenever the boost changes.
*/
export default class Boost extends TranslatedComponent {
static propTypes = {
marker: React.PropTypes.string.isRequired,
ship: React.PropTypes.object.isRequired,
boost: React.PropTypes.bool.isRequired,
onChange: React.PropTypes.func.isRequired
};

/**
* Constructor
* @param {Object} props React Component properties
* @param {Object} context React Component context
*/
constructor(props, context) {
super(props);
const { ship, boost } = props;

this._keyDown = this._keyDown.bind(this);
this._toggleBoost = this._toggleBoost.bind(this);
}

/**
* Add listeners after mounting
*/
componentDidMount() {
document.addEventListener('keydown', this._keyDown);
}

/**
* Remove listeners before unmounting
*/
componentWillUnmount() {
document.removeEventListener('keydown', this._keyDown);
}

/**
* Handle Key Down
* @param {Event} e Keyboard Event
*/
_keyDown(e) {
if (e.ctrlKey || e.metaKey) { // CTRL/CMD
switch (e.keyCode) {
case 66: // b == boost
if (this.props.ship.canBoost()) {
e.preventDefault();
this._toggleBoost();
}
break;
}
}
}

/**
* Toggle the boost feature
*/
_toggleBoost() {
this.props.onChange(!this.props.boost);
}

/**
* Render boost
* @return {React.Component} contents
*/
render() {
const { formats, translate, units } = this.context.language;
const { ship, boost } = this.props;

// TODO disable if ship cannot boost
return (
<span id='boost'>
<button id='boost' className={boost ? 'selected' : null} onClick={this._toggleBoost}>{translate('boost')}</button>
</span>
);
}
}
75 changes: 75 additions & 0 deletions src/app/components/Cargo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import React from 'react';
import TranslatedComponent from './TranslatedComponent';
import { Ships } from 'coriolis-data/dist';
import Slider from '../components/Slider';

/**
* Cargo slider
* Requires an onChange() function of the form onChange(cargo), providing the cargo in tonnes, which is triggered on cargo level change
*/
export default class Cargo extends TranslatedComponent {
static propTypes = {
cargo: React.PropTypes.number.isRequired,
cargoCapacity: React.PropTypes.number.isRequired,
onChange: React.PropTypes.func.isRequired
};

/**
* Constructor
* @param {Object} props React Component properties
* @param {Object} context React Component context
*/
constructor(props, context) {
super(props);

this._cargoChange = this._cargoChange.bind(this);
}

/**
* Update cargo level
* @param {number} cargoLevel percentage level from 0 to 1
*/
_cargoChange(cargoLevel) {
const { cargo, cargoCapacity } = this.props;
if (cargoCapacity > 0) {
// We round the cargo to whole number of tonnes
const newCargo = Math.round(cargoLevel * cargoCapacity);
if (newCargo != cargo) {
this.props.onChange(newCargo);
}
}
}

/**
* Render cargo slider
* @return {React.Component} contents
*/
render() {
const { language, onWindowResize, sizeRatio, tooltip, termtip } = this.context;
const { formats, translate, units } = language;
const { cargo, cargoCapacity } = this.props;

return (
<span>
<h3>{translate('cargo carried')}: {formats.int(cargo)}{units.T}</h3>
<table style={{ width: '100%', lineHeight: '1em', backgroundColor: 'transparent' }}>
<tbody >
<tr>
<td>
<Slider
axis={true}
onChange={this._cargoChange}
axisUnit={translate('T')}
percent={cargo / cargoCapacity}
max={cargoCapacity}
scale={sizeRatio}
onResize={onWindowResize}
/>
</td>
</tr>
</tbody>
</table>
</span>
);
}
}
4 changes: 2 additions & 2 deletions src/app/components/CostSection.jsx
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ import TranslatedComponent from './TranslatedComponent';
*/
export default class CostSection extends TranslatedComponent {

static PropTypes = {
static propTypes = {
ship: React.PropTypes.object.isRequired,
code: React.PropTypes.string.isRequired,
buildName: React.PropTypes.string
@@ -507,7 +507,7 @@ export default class CostSection extends TranslatedComponent {
scoop = true;
break;
case 'scb':
q = slotGroup[i].m.getCells();
q = slotGroup[i].m.getAmmo() + 1;
break;
case 'am':
q = slotGroup[i].m.getAmmo();
Loading

0 comments on commit c6a8e48

Please sign in to comment.