@@ -67,6 +68,7 @@ export default class HardpointSlot extends Slot {
{ m.getRange() ?
{translate('range')} {formats.f1(m.getRange() / 1000)}{u.km}
: null }
{ m.getShieldBoost() ?
+{formats.pct1(m.getShieldBoost())}
: null }
{ m.getAmmo() ?
{translate('ammunition')}: {formats.int(m.getClip())}/{formats.int(m.getAmmo())}
: null }
+ { m.getJitter() ?
{translate('jitter')}: {formats.f2(m.getJitter())}°
: null }
{ showModuleResistances && m.getExplosiveResistance() ?
{translate('explres')}: {formats.pct(m.getExplosiveResistance())}
: null }
{ showModuleResistances && m.getKineticResistance() ?
{translate('kinres')}: {formats.pct(m.getKineticResistance())}
: null }
{ showModuleResistances && m.getThermalResistance() ?
{translate('thermres')}: {formats.pct(m.getThermalResistance())}
: null }
diff --git a/src/app/components/Modification.jsx b/src/app/components/Modification.jsx
index b68d6e10..3d6ee9fa 100644
--- a/src/app/components/Modification.jsx
+++ b/src/app/components/Modification.jsx
@@ -7,7 +7,7 @@ import NumberEditor from 'react-number-editor';
/**
* Modification
*/
-export default class ModificationsMenu extends TranslatedComponent {
+export default class Modification extends TranslatedComponent {
static propTypes = {
ship: React.PropTypes.object.isRequired,
@@ -24,7 +24,7 @@ export default class ModificationsMenu extends TranslatedComponent {
constructor(props, context) {
super(props);
this.state = {};
- this.state.value = this.props.m.getModValue(this.props.name) / 100 || 0;
+ this.state.value = this.props.name === 'jitter' ? this.props.m.getModValue(this.props.name) / 10000 : this.props.m.getModValue(this.props.name) / 100 || 0;
}
/**
@@ -32,7 +32,9 @@ export default class ModificationsMenu extends TranslatedComponent {
* @param {Number} value The value to set
*/
_updateValue(value) {
- let scaledValue = Math.floor(Number(value) * 100);
+ const name = this.props.name;
+
+ let scaledValue = name === 'jitter' ? Math.floor(Number(value) * 10000) : Math.floor(Number(value) * 100);
// Limit to +1000% / -100%
if (scaledValue > 100000) {
scaledValue = 100000;
@@ -44,7 +46,6 @@ export default class ModificationsMenu extends TranslatedComponent {
}
let m = this.props.m;
- let name = this.props.name;
let ship = this.props.ship;
ship.setModification(m, name, scaledValue);
diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js
index b368115a..68efe34e 100755
--- a/src/app/shipyard/Module.js
+++ b/src/app/shipyard/Module.js
@@ -516,4 +516,11 @@ export default class Module {
return this._getModifiedValue('cells');
}
+ /**
+ * Get the jitter for this module, taking in to account modifications
+ * @return {Number} the jitter for this module
+ */
+ getJitter() {
+ return this._getModifiedValue('jitter', true);
+ }
}
diff --git a/src/app/utils/CompanionApiUtils.js b/src/app/utils/CompanionApiUtils.js
index 8de85bf7..7bc872d1 100644
--- a/src/app/utils/CompanionApiUtils.js
+++ b/src/app/utils/CompanionApiUtils.js
@@ -359,11 +359,6 @@ function _addModifications(module, modifiers) {
}
- // Jitter is in degrees not % so need to divide it by 100 to obtain the correct number
- if (module.getModValue('jitter')) {
- module.setModValue('jitter', module.getModValue('jitter') / 100);
- }
-
// FD uses interval between bursts internally, so we need to translate this to a real rate of fire
if (module.getModValue('rof')) {
module.setModValue('rof', ((1 / (1 + module.getModValue('rof') / 10000)) - 1) * 10000);