diff --git a/src/app/Coriolis.jsx b/src/app/Coriolis.jsx index 0262c54c..4292d0ea 100644 --- a/src/app/Coriolis.jsx +++ b/src/app/Coriolis.jsx @@ -68,7 +68,8 @@ export default class Coriolis extends React.Component { this.state = { noTouch: !('ontouchstart' in window || navigator.msMaxTouchPoints || navigator.maxTouchPoints), page: null, - announcements: [{expiry: "31-08-2024", text: "25/08/2024: Type 8 Transporter added to the shipyard"}], + // Announcements must have an expiry date in format "YYYY-MM-DDTHH:MM:SSZ" + announcements: [{expiry: "2024-11-30T00:00:00Z", text: "Mandalay added"}, {expiry: "2024-12-06T00:00:00Z", text: "Concord Cannon added"}, {expiry: "2024-12-08T00:00:00Z", text: "Boost Interval Feature added"}], language: getLanguage(Persist.getLangCode()), route: {}, sizeRatio: Persist.getSizeRatio() diff --git a/src/app/components/Header.jsx b/src/app/components/Header.jsx index 18cca21a..4c892e5a 100644 --- a/src/app/components/Header.jsx +++ b/src/app/components/Header.jsx @@ -388,9 +388,11 @@ export default class Header extends TranslatedComponent { if (this.props.announcements) { announcements = []; for (let announce of this.props.announcements) { - if (announce.expiry < Date.now()) { + // Announcement has expired, skip it + if (Date.now() > Date.parse(announce.expiry)) { continue; } + // Add announcements which have not expired to the menu announcements.push(); announcements.push(
); } @@ -398,7 +400,6 @@ export default class Header extends TranslatedComponent { return (
e.stopPropagation() } style={{ whiteSpace: 'nowrap' }}> {announcements} -
); } diff --git a/src/app/components/ShipSummaryTable.jsx b/src/app/components/ShipSummaryTable.jsx index a98ad465..6f47b436 100644 --- a/src/app/components/ShipSummaryTable.jsx +++ b/src/app/components/ShipSummaryTable.jsx @@ -52,7 +52,8 @@ export default class ShipSummaryTable extends TranslatedComponent { const boostTooltip = canBoost ? 'TT_SUMMARY_BOOST' : canThrust ? 'TT_SUMMARY_BOOST_NONFUNCTIONAL' : 'TT_SUMMARY_SPEED_NONFUNCTIONAL'; const canJump = ship.getSlotStatus(ship.standard[2]) == 3; const sgMetrics = Calc.shieldMetrics(ship, pips.sys); - const shipBoost = canBoost ? Calc.calcBoost(ship) : 'No Boost'; + const distBoost = canBoost ? Calc.calcBoost(ship) : 'No Boost'; + //const shipBoost = ship.boostInterval(ship) const restingHeat = Math.sqrt(((ship.standard[0].m.pgen * ship.standard[0].m.eff) / ship.heatCapacity) / 0.2); const armourMetrics = Calc.armourMetrics(ship); let shieldColour = 'blue'; @@ -72,6 +73,7 @@ export default class ShipSummaryTable extends TranslatedComponent { {translate('speed')} {translate('boost')} + {translate('boost int')} {translate('jump range')} {translate('shield')} {translate('integrity')} @@ -86,10 +88,11 @@ export default class ShipSummaryTable extends TranslatedComponent { {translate('hrd')} {translate('crew')} {translate('MLF')} - {translate('boost interval')} {translate('resting heat (Beta)')} + {translate('distro')} + {translate('ship')} {translate('max')} {translate('unladen')} {translate('laden')} @@ -104,6 +107,8 @@ export default class ShipSummaryTable extends TranslatedComponent { { canThrust ? {int(ship.calcSpeed(4, ship.fuelCapacity, 0, false))}{u['m/s']} : 0 } { canBoost ? {int(ship.calcSpeed(4, ship.fuelCapacity, 0, true))}{u['m/s']} : 0 } + {distBoost !== 'No Boost' ? formats.time(distBoost) : 'No Boost'} + {ship.boostInt && ship.boostInt !== 'undefined' ? formats.time(ship.boostInt) : 0 } { canJump ? { f2(Calc.jumpRange(ship.unladenMass + ship.standard[2].m.getMaxFuelPerJump(), ship.standard[2].m, ship.standard[2].m.getMaxFuelPerJump(), ship))}{u.LY} : 0 } { canJump ? {f2(Calc.jumpRange(ship.unladenMass + ship.fuelCapacity, ship.standard[2].m, ship.fuelCapacity, ship))}{u.LY} : 0 } { canJump ? {f2(Calc.jumpRange(ship.unladenMass + ship.fuelCapacity + ship.cargoCapacity, ship.standard[2].m, ship.fuelCapacity, ship))}{u.LY} : 0 } @@ -124,7 +129,6 @@ export default class ShipSummaryTable extends TranslatedComponent { {int(ship.hardness)} {ship.crew} {ship.masslock} - {shipBoost !== 'No Boost' ? formats.time(shipBoost) : 'No Boost'} {formats.pct(restingHeat)} diff --git a/src/app/components/StandardSlotSection.jsx b/src/app/components/StandardSlotSection.jsx index 7ed5cb55..5dc77be8 100644 --- a/src/app/components/StandardSlotSection.jsx +++ b/src/app/components/StandardSlotSection.jsx @@ -209,7 +209,7 @@ export default class StandardSlotSection extends SlotSection { selected={currentMenu == st[4]} onChange={this.props.onChange} ship={ship} - warning={m => m instanceof Module ? m.getEnginesCapacity() <= ship.boostEnergy : m.engcap <= ship.boostEnergy} + warning={m => m instanceof Module ? m.getEnginesCapacity() < ship.boostEnergy : m.engcap < ship.boostEnergy} />; slots[6] = this.boostEnergy; // PD capacitor is sufficient for boost + this.standard[4].m.getEnginesCapacity() >= this.boostEnergy; // PD capacitor is sufficient for boost } /** diff --git a/src/app/utils/CompanionApiUtils.js b/src/app/utils/CompanionApiUtils.js index 56df0b07..de915299 100644 --- a/src/app/utils/CompanionApiUtils.js +++ b/src/app/utils/CompanionApiUtils.js @@ -31,6 +31,7 @@ export const SHIP_FD_NAME_TO_CORIOLIS_NAME = { 'Independant_Trader': 'keelback', 'Krait_MkII': 'krait_mkii', 'Mamba': 'mamba', + 'Mandalay': 'mandalay', 'Krait_Light': 'krait_phantom', 'Orca': 'orca', 'Python': 'python', diff --git a/src/less/app.less b/src/less/app.less index 75d60911..fc7373d4 100755 --- a/src/less/app.less +++ b/src/less/app.less @@ -183,4 +183,5 @@ footer { .announcement { border: 1px @secondary solid; padding: 10px; + margin: 5px; } \ No newline at end of file diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 7ca74423..f8553c4d 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -5,6 +5,7 @@ const path = require('path'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const { InjectManifest } = require('workbox-webpack-plugin'); +const { max } = require('lodash'); module.exports = merge(common, { // devtool: 'source-map', @@ -18,9 +19,9 @@ module.exports = merge(common, { plugins: [ new CopyWebpackPlugin({ patterns: [ - 'src/.htaccess', - 'src/iframe.html', - 'src/xdLocalStoragePostMessageApi.min.js', + 'src/.htaccess', + 'src/iframe.html', + 'src/xdLocalStoragePostMessageApi.min.js', { from: 'src/schemas', to: 'schemas' }, { from: 'src/images/logo/*', @@ -42,11 +43,11 @@ module.exports = merge(common, { // overwrite: true, // appVersion: `${pkgJson.version}-${buildDate.toISOString()}` // }), - + new InjectManifest({ swSrc: './src/sw.js', swDest: 'service-worker.js' }), - + ] });