mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Tidy-ups for modification
This commit is contained in:
@@ -37,7 +37,7 @@ export default class Modification extends TranslatedComponent {
|
|||||||
const name = this.props.name;
|
const name = this.props.name;
|
||||||
|
|
||||||
let scaledValue = Math.round(Number(value) * 100);
|
let scaledValue = Math.round(Number(value) * 100);
|
||||||
// Limit to +1000% / -100%
|
// Limit to +1000% / -99.99%
|
||||||
if (scaledValue > 100000) {
|
if (scaledValue > 100000) {
|
||||||
scaledValue = 100000;
|
scaledValue = 100000;
|
||||||
value = 1000;
|
value = 1000;
|
||||||
@@ -52,6 +52,9 @@ export default class Modification extends TranslatedComponent {
|
|||||||
ship.setModification(m, name, scaledValue, true);
|
ship.setModification(m, name, scaledValue, true);
|
||||||
|
|
||||||
this.setState({ value });
|
this.setState({ value });
|
||||||
|
}
|
||||||
|
|
||||||
|
_updateFinished() {
|
||||||
this.props.onChange();
|
this.props.onChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +82,7 @@ export default class Modification extends TranslatedComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'cb'} key={name}>
|
<div onBlur={this._updateFinished.bind(this)} className={'cb'} key={name}>
|
||||||
<div className={'cb'}>{translate(name, m.grp)}{symbol}</div>
|
<div className={'cb'}>{translate(name, m.grp)}{symbol}</div>
|
||||||
<NumberEditor className={'cb'} style={{ width: '90%', textAlign: 'center' }} step={0.01} stepModifier={1} decimals={2} value={this.state.value} onValueChange={this._updateValue.bind(this)} />
|
<NumberEditor className={'cb'} style={{ width: '90%', textAlign: 'center' }} step={0.01} stepModifier={1} decimals={2} value={this.state.value} onValueChange={this._updateValue.bind(this)} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -254,6 +254,18 @@ export const terms = {
|
|||||||
minmul_sg: 'Minimum strength',
|
minmul_sg: 'Minimum strength',
|
||||||
optmul_sg: 'Optimal strength',
|
optmul_sg: 'Optimal strength',
|
||||||
maxmul_sg: 'Minimum strength',
|
maxmul_sg: 'Minimum strength',
|
||||||
|
minmass_psg: 'Minimum hull mass',
|
||||||
|
optmass_psg: 'Optimal hull mass',
|
||||||
|
maxmass_psg: 'Maximum hull mass',
|
||||||
|
minmul_psg: 'Minimum strength',
|
||||||
|
optmul_psg: 'Optimal strength',
|
||||||
|
maxmul_psg: 'Minimum strength',
|
||||||
|
minmass_bsg: 'Minimum hull mass',
|
||||||
|
optmass_bsg: 'Optimal hull mass',
|
||||||
|
maxmass_bsg: 'Maximum hull mass',
|
||||||
|
minmul_bsg: 'Minimum strength',
|
||||||
|
optmul_bsg: 'Optimal strength',
|
||||||
|
maxmul_bsg: 'Minimum strength',
|
||||||
|
|
||||||
range_s: 'Typical emission range',
|
range_s: 'Typical emission range',
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user