From d3766d9e17b413c996c227b3044c9ad696a4777b Mon Sep 17 00:00:00 2001 From: Felix Linker Date: Tue, 29 Dec 2020 13:18:57 +0100 Subject: [PATCH] Migrate ed-forge API change --- src/app/components/AvailableModulesMenu.jsx | 2 +- src/app/components/EngineProfile.jsx | 4 ++-- src/app/components/FSDProfile.jsx | 2 +- src/app/components/ShipSummaryTable.jsx | 6 +++--- src/app/components/StandardSlotSection.jsx | 2 +- src/app/pages/ShipyardPage.jsx | 20 ++++++++++---------- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index 9eaaa714..fb8e94ff 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -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 <= diff --git a/src/app/components/EngineProfile.jsx b/src/app/components/EngineProfile.jsx index 42a8bccc..491a2ee2 100644 --- a/src/app/components/EngineProfile.jsx +++ b/src/app/components/EngineProfile.jsx @@ -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]; diff --git a/src/app/components/FSDProfile.jsx b/src/app/components/FSDProfile.jsx index f31f9db3..90761382 100644 --- a/src/app/components/FSDProfile.jsx +++ b/src/app/components/FSDProfile.jsx @@ -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); diff --git a/src/app/components/ShipSummaryTable.jsx b/src/app/components/ShipSummaryTable.jsx index 189015da..00a3d711 100644 --- a/src/app/components/ShipSummaryTable.jsx +++ b/src/app/components/ShipSummaryTable.jsx @@ -183,16 +183,16 @@ export default class ShipSummaryTable extends TranslatedComponent { {round(ship.get(FUEL_CAPACITY))}{u.T} {ship.getBaseProperty('hullmass')}{u.T} + >{ship.readProp('hullmass')}{u.T} {int(ship.get(UNLADEN_MASS))}{u.T} {int(ship.get(MAXIMUM_MASS))}{u.T} - {int(ship.getBaseProperty('hardness'))} + {int(ship.readProp('hardness'))} {ship.readMeta('crew')} - {ship.getBaseProperty('masslock')} + {ship.readProp('masslock')} {/* TODO: boost intervall */} {NaN} {/* TODO: resting heat */} diff --git a/src/app/components/StandardSlotSection.jsx b/src/app/components/StandardSlotSection.jsx index b92c9f7c..847ca18a 100644 --- a/src/app/components/StandardSlotSection.jsx +++ b/src/app/components/StandardSlotSection.jsx @@ -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()), diff --git a/src/app/pages/ShipyardPage.jsx b/src/app/pages/ShipyardPage.jsx index 106b8c3f..6a16480c 100644 --- a/src/app/pages/ShipyardPage.jsx +++ b/src/app/pages/ShipyardPage.jsx @@ -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