From 8b190c8054c088f34f5f61c215e76bed0ace0332 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Tue, 9 May 2023 16:13:27 -0700 Subject: [PATCH] New bodies are added to UI when scanned! --- src/renderer.js | 12 +++++++++++- src/ui.js | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/renderer.js b/src/renderer.js index 3894723..d1cf327 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -69,6 +69,7 @@ journal.once('INIT_COMPLETE', () => { if (journal.location.bodies.length > 0) { journal.location.bodies.forEach((body) => { const row = createBodyRow(body) + // TODO APPRAISAL DATA $('#lowValueScans').appendChild(row) }) } @@ -91,8 +92,17 @@ journal.on('BODY_SCANNED', (body, DSS) => { if (DSS) { const bodyRow = $(`#${body.BodyID}`) - if (bodyRow.length > 0) { + if (bodyRow.length > 0) { // check just in case body was missed in earlier scans bodyRow.removeClass('highlighted uncharted').addClass('charted') + } else { + const row = createBodyRow(body) + // TODO APPRAISAL DATA + $('#lowValueScans').appendChild(row) } + + } else { // else it's an FSS/auto scan and won't be in the list yet + const row = createBodyRow(body) + // TODO APPRAISAL DATA + $('#lowValueScans').appendChild(row) } }) \ No newline at end of file diff --git a/src/ui.js b/src/ui.js index a0cae13..cc05031 100644 --- a/src/ui.js +++ b/src/ui.js @@ -44,7 +44,7 @@ const buildRings = (body) => { /* --------------------------------------------------------------------------- createBodyRow ---- */ export const createBodyRow = (body) => { - const chartedStyle = body.WasDiscovered ? 'charted' : 'uncharted' + const chartedStyle = body.WasDiscovered && !body.DSSDone ? 'charted' : 'uncharted' const row = $('
').addClass('row ms-1 me-1') row.attr('id', body.bodyID)