Migrate ed-forge API change

This commit is contained in:
Felix Linker
2020-12-29 13:18:57 +01:00
parent d987c08ac8
commit d3766d9e17
6 changed files with 18 additions and 18 deletions

View File

@@ -113,7 +113,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
// Can only be true if shieldgenmaximalmass is defined, i.e. this
// module must be a shield generator
let disabled = info.props.shieldgenmaximalmass < ship.getBaseProperty('hullmass');
let disabled = info.props.shieldgenmaximalmass < ship.readProp('hullmass');
if (meta.experimental && !mountedModule.readMeta('experimental')) {
disabled =
4 <=

View File

@@ -29,9 +29,9 @@ export default class EngineProfile extends TranslatedComponent {
const { code, ship, pips, boost } = this.props;
// Calculate bounds for our line chart
const minMass = ship.getBaseProperty('hullmass');
const minMass = ship.readProp('hullmass');
const maxMass = ship.getThrusters().get('enginemaximalmass');
const baseSpeed = ship.getBaseProperty('speed');
const baseSpeed = ship.readProp('speed');
const baseBoost = getBoostMultiplier(ship);
const cb = (eng, boost, mass) => {
const mult = getSpeedMultipliers(ship, mass)[(boost ? 4 : eng) / 0.5];

View File

@@ -39,7 +39,7 @@ export default class FSDProfile extends TranslatedComponent {
const { translate } = language;
const { code, ship } = this.props;
const minMass = ship.getBaseProperty('hullmass');
const minMass = ship.readProp('hullmass');
const maxMass = ship.getThrusters().get('enginemaximalmass');
const mass = ship.get(LADEN_MASS);
const cb = (mass) => calculateJumpRange(ship, mass, Infinity, true);

View File

@@ -183,16 +183,16 @@ export default class ShipSummaryTable extends TranslatedComponent {
<td>{round(ship.get(FUEL_CAPACITY))}{u.T}</td>
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_HULL_MASS', { cap: 0 })}
onMouseLeave={hide}
>{ship.getBaseProperty('hullmass')}{u.T}</td>
>{ship.readProp('hullmass')}{u.T}</td>
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_MASS', { cap: 0 })}
onMouseLeave={hide}
>{int(ship.get(UNLADEN_MASS))}{u.T}</td>
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_LADEN_MASS', { cap: 0 })}
onMouseLeave={hide}
>{int(ship.get(MAXIMUM_MASS))}{u.T}</td>
<td>{int(ship.getBaseProperty('hardness'))}</td>
<td>{int(ship.readProp('hardness'))}</td>
<td>{ship.readMeta('crew')}</td>
<td>{ship.getBaseProperty('masslock')}</td>
<td>{ship.readProp('masslock')}</td>
{/* TODO: boost intervall */}
<td>{NaN}</td>
{/* TODO: resting heat */}

View File

@@ -116,7 +116,7 @@ export default class StandardSlotSection extends SlotSection {
this._mkSlot(fsd),
this._mkSlot(
ship.getPowerDistributor(),
(m) => moduleGet(m, 'enginescapacity') <= ship.getBaseProperty('boostenergy'),
(m) => moduleGet(m, 'enginescapacity') <= ship.readProp('boostenergy'),
),
this._mkSlot(ship.getLifeSupport()),
this._mkSlot(ship.getSensors()),

View File

@@ -16,24 +16,24 @@ function shipSummary(shipId) {
let coreSizes = ship.readMeta('coreSizes');
let summary = {
baseArmour: ship.getBaseProperty('basearmour'),
baseShieldStrength: ship.getBaseProperty('baseshieldstrength'),
boost: ship.getBaseProperty('boost'),
baseArmour: ship.readProp('basearmour'),
baseShieldStrength: ship.readProp('baseshieldstrength'),
boost: ship.readProp('boost'),
class: ship.readMeta('class'),
crew: ship.readMeta('crew'),
id: shipId,
hardness: ship.getBaseProperty('hardness'),
hardness: ship.readProp('hardness'),
hpCount: 0,
hullMass: ship.getBaseProperty('hullmass'),
hullMass: ship.readProp('hullmass'),
intCount: 0,
manufacturer: ship.readMeta('manufacturer'),
masslock: ship.getBaseProperty('masslock'),
masslock: ship.readProp('masslock'),
maxCargo: 0,
maxPassengers: 0,
hp: [0, 0, 0, 0, 0], // Utility, Small, Medium, Large, Huge
int: [0, 0, 0, 0, 0, 0, 0, 0], // Sizes 1 - 8
retailCost: ship.readMeta('retailCost'),
speed: ship.getBaseProperty('speed'),
speed: ship.readProp('speed'),
standard: [
'powerplant',
'mainengines',
@@ -44,9 +44,9 @@ function shipSummary(shipId) {
'fueltank'
].map(k => coreSizes[k]),
agility:
ship.getBaseProperty('pitch') +
ship.getBaseProperty('yaw') +
ship.getBaseProperty('roll')
ship.readProp('pitch') +
ship.readProp('yaw') +
ship.readProp('roll')
};
// Count Hardpoints by class