Skip to content

Commit

Permalink
Improve display of gravity in inspector panel
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Apr 17, 2023
1 parent 4a7b070 commit d970da6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export default function NavigationInspectorPanel ({ systemObject, setSystemObjec
SURFACE_PORTS.includes(base.type) ? surfacePorts.push(base) : settlements.push(base)
)

console.log(systemObject)

return (
<div className='inspector navigation-panel__inspector fx-fade-in'>
<div className='inspector__title' onClick={() => { setSystemObjectByName(null) }}>
Expand Down Expand Up @@ -99,7 +101,11 @@ export default function NavigationInspectorPanel ({ systemObject, setSystemObjec
<div className='navigation-panel__inspector-section'>
<h4 className='text-primary'>Environment</h4>
{isLandable ? <p className='text-info'>Landable</p> : <p className='text-muted'>Not Landable</p>}
{systemObject.gravity ? <p className='text-info'>Gravity {systemObject.gravity.toFixed(1)}g</p> : null}
{systemObject.gravity ?
<p className='text-info'>Gravity {Math.max(0.01, Number(systemObject.gravity.toFixed(2)))}g
{systemObject.gravity < .5 && ' (Low)'}
{systemObject.gravity > 1.5 && ' (High)'}
</p> : null}
{systemObject.radius && <p className='text-info'>Radius {systemObject.radius.toLocaleString(undefined, { maximumFractionDigits: 0 })} Km</p>}
{systemObject.surfaceTemperature &&
<p className='text-info'>
Expand Down

0 comments on commit d970da6

Please sign in to comment.