mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Don't show mass twice and allow to disable showing mass
This commit is contained in:
@@ -124,15 +124,18 @@ export default class Slot extends TranslatedComponent {
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className={'r'}>
|
||||
{formats.round(mass)}
|
||||
{units.T}
|
||||
</div>
|
||||
{propsToShow.mass ?
|
||||
<div className={'r'}>
|
||||
{formats.round(mass)}
|
||||
{units.T}
|
||||
</div> : null}
|
||||
</div>
|
||||
<div className={'cb'}>
|
||||
{toPairs(propsToShow).sort().map(([prop, show]) => {
|
||||
const { unit, value } = m.getFormatted(prop, true);
|
||||
if (!show || isNaN(value)) {
|
||||
// Don't show mass again; it's already shown on the top right
|
||||
// corner of a slot
|
||||
if (!show || isNaN(value) || prop == 'mass') {
|
||||
return null;
|
||||
} else {
|
||||
return (<div className='l'>
|
||||
|
||||
@@ -108,6 +108,7 @@ const SHOW_BY_DEFAULT = {
|
||||
'scannerrange': true,
|
||||
'scannertimetoscan': true,
|
||||
'maxangle': true,
|
||||
'mass': true,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user