mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 14:33:22 +00:00
Merge pull request #797 from Brighter-Applications/develop
Develop update with mandalay, type8, concord, new boost int feature (…
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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(<Announcement text={announce.text} />);
|
||||
announcements.push(<hr/>);
|
||||
}
|
||||
@@ -398,7 +400,6 @@ export default class Header extends TranslatedComponent {
|
||||
return (
|
||||
<div className='menu-list' onClick={ (e) => e.stopPropagation() } style={{ whiteSpace: 'nowrap' }}>
|
||||
{announcements}
|
||||
<hr />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
<tr className='main'>
|
||||
<th rowSpan={2} className={ cn({ 'bg-warning-disabled': !canThrust }) }>{translate('speed')}</th>
|
||||
<th rowSpan={2} className={ cn({ 'bg-warning-disabled': !canBoost }) }>{translate('boost')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'TT_SUMMARY_BOOST_INTERVALS', { cap: 0 })}colSpan={2} className={ cn({ 'bg-warning-disabled': !canBoost }) }>{translate('boost int')}</th>
|
||||
<th colSpan={5} className={ cn({ 'bg-warning-disabled': !canJump }) }>{translate('jump range')}</th>
|
||||
<th rowSpan={2}>{translate('shield')}</th>
|
||||
<th rowSpan={2}>{translate('integrity')}</th>
|
||||
@@ -86,10 +88,11 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
||||
<th onMouseEnter={termtip.bind(null, 'hull hardness', { cap: 0 })} onMouseLeave={hide} rowSpan={2}>{translate('hrd')}</th>
|
||||
<th rowSpan={2}>{translate('crew')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'mass lock factor', { cap: 0 })} onMouseLeave={hide} rowSpan={2}>{translate('MLF')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'TT_SUMMARY_BOOST_INTERVAL', { cap: 0 })} onMouseLeave={hide} rowSpan={2}>{translate('boost interval')}</th>
|
||||
<th rowSpan={2}>{translate('resting heat (Beta)')}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th onMouseEnter={termtip.bind(null, 'TT_SUMMARY_BOOST_INTERVAL', { cap: 0 })} onMouseLeave={hide}>{translate('distro')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'TT_SUMMARY_SHIP_BOOST_INTERVAL', { cap: 0 })} onMouseLeave={hide}>{translate('ship')}</th>
|
||||
<th className={ cn({ 'lft': true, 'bg-warning-disabled': !canJump }) }>{translate('max')}</th>
|
||||
<th className={ cn({ 'bg-warning-disabled': !canJump }) }>{translate('unladen')}</th>
|
||||
<th className={ cn({ 'bg-warning-disabled': !canJump }) }>{translate('laden')}</th>
|
||||
@@ -104,6 +107,8 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
||||
<tr>
|
||||
<td onMouseEnter={termtip.bind(null, speedTooltip, { cap: 0 })} onMouseLeave={hide}>{ canThrust ? <span>{int(ship.calcSpeed(4, ship.fuelCapacity, 0, false))}{u['m/s']}</span> : <span className='warning'>0 <Warning/></span> }</td>
|
||||
<td onMouseEnter={termtip.bind(null, boostTooltip, { cap: 0 })} onMouseLeave={hide}>{ canBoost ? <span>{int(ship.calcSpeed(4, ship.fuelCapacity, 0, true))}{u['m/s']}</span> : <span className='warning'>0 <Warning/></span> }</td>
|
||||
<td>{distBoost !== 'No Boost' ? formats.time(distBoost) : 'No Boost'}</td>
|
||||
<td>{ship.boostInt && ship.boostInt !== 'undefined' ? formats.time(ship.boostInt) : 0 }</td>
|
||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_MAX_SINGLE_JUMP', { cap: 0 })} onMouseLeave={hide}>{ canJump ? <span>{ f2(Calc.jumpRange(ship.unladenMass + ship.standard[2].m.getMaxFuelPerJump(), ship.standard[2].m, ship.standard[2].m.getMaxFuelPerJump(), ship))}{u.LY}</span> : <span className='warning'>0 <Warning/></span> }</td>
|
||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_SINGLE_JUMP', { cap: 0 })} onMouseLeave={hide}>{ canJump ? <span>{f2(Calc.jumpRange(ship.unladenMass + ship.fuelCapacity, ship.standard[2].m, ship.fuelCapacity, ship))}{u.LY}</span> : <span className='warning'>0 <Warning/></span> }</td>
|
||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_LADEN_SINGLE_JUMP', { cap: 0 })} onMouseLeave={hide}>{ canJump ? <span>{f2(Calc.jumpRange(ship.unladenMass + ship.fuelCapacity + ship.cargoCapacity, ship.standard[2].m, ship.fuelCapacity, ship))}{u.LY}</span> : <span className='warning'>0 <Warning/></span> }</td>
|
||||
@@ -124,7 +129,6 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
||||
<td>{int(ship.hardness)}</td>
|
||||
<td>{ship.crew}</td>
|
||||
<td>{ship.masslock}</td>
|
||||
<td>{shipBoost !== 'No Boost' ? formats.time(shipBoost) : 'No Boost'}</td>
|
||||
<td>{formats.pct(restingHeat)}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -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] = <StandardSlot
|
||||
|
||||
@@ -66,7 +66,9 @@
|
||||
"TT_SUMMARY_SPEED": "With full fuel tank and 4 pips to ENG",
|
||||
"TT_SUMMARY_SPEED_NONFUNCTIONAL": "Thrusters powered off or over maximum mass with full fuel and cargo loads",
|
||||
"TT_SUMMARY_BOOST": "With full fuel tank and 4 pips to ENG",
|
||||
"TT_SUMMARY_BOOST_INTERVAL": "Time between each boost with 4 pips to ENG",
|
||||
"TT_SUMMARY_SHIP_BOOST_INTERVAL": "Time each boost lasts on this ship",
|
||||
"TT_SUMMARY_BOOST_INTERVAL": "Time between boosts with 4 pips to ENG",
|
||||
"TT_SUMMARY_BOOST_INTERVALS": "If DISTRO is less than or equal to SHIP, the ship can boost continuously",
|
||||
"TT_SUMMARY_BOOST_NONFUNCTIONAL": "Power distributor not able to supply enough power to boost",
|
||||
"TT_SUMMARY_SHIELDS": "Raw shield strength, including boosters",
|
||||
"TT_SUMMARY_SHIELDS_SCB": "Raw shield strength, including boosters and SCBs",
|
||||
|
||||
@@ -140,7 +140,7 @@ export default class Ship {
|
||||
*/
|
||||
canBoost(cargo, fuel) {
|
||||
return this.canThrust(cargo, fuel) && // Thrusters operational
|
||||
this.standard[4].m.getEnginesCapacity() > this.boostEnergy; // PD capacitor is sufficient for boost
|
||||
this.standard[4].m.getEnginesCapacity() >= this.boostEnergy; // PD capacitor is sufficient for boost
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -183,4 +183,5 @@ footer {
|
||||
.announcement {
|
||||
border: 1px @secondary solid;
|
||||
padding: 10px;
|
||||
margin: 5px;
|
||||
}
|
||||
@@ -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'
|
||||
}),
|
||||
|
||||
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user