mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 22:55:35 +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>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={'r'}>
|
{propsToShow.mass ?
|
||||||
{formats.round(mass)}
|
<div className={'r'}>
|
||||||
{units.T}
|
{formats.round(mass)}
|
||||||
</div>
|
{units.T}
|
||||||
|
</div> : null}
|
||||||
</div>
|
</div>
|
||||||
<div className={'cb'}>
|
<div className={'cb'}>
|
||||||
{toPairs(propsToShow).sort().map(([prop, show]) => {
|
{toPairs(propsToShow).sort().map(([prop, show]) => {
|
||||||
const { unit, value } = m.getFormatted(prop, true);
|
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;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return (<div className='l'>
|
return (<div className='l'>
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ const SHOW_BY_DEFAULT = {
|
|||||||
'scannerrange': true,
|
'scannerrange': true,
|
||||||
'scannertimetoscan': true,
|
'scannertimetoscan': true,
|
||||||
'maxangle': true,
|
'maxangle': true,
|
||||||
|
'mass': true,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user