New bodies are added to UI when scanned!
This commit is contained in:
parent
9d5042cc05
commit
8b190c8054
2 changed files with 12 additions and 2 deletions
|
@ -69,6 +69,7 @@ journal.once('INIT_COMPLETE', () => {
|
||||||
if (journal.location.bodies.length > 0) {
|
if (journal.location.bodies.length > 0) {
|
||||||
journal.location.bodies.forEach((body) => {
|
journal.location.bodies.forEach((body) => {
|
||||||
const row = createBodyRow(body)
|
const row = createBodyRow(body)
|
||||||
|
// TODO APPRAISAL DATA
|
||||||
$('#lowValueScans').appendChild(row)
|
$('#lowValueScans').appendChild(row)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -91,8 +92,17 @@ journal.on('BODY_SCANNED', (body, DSS) => {
|
||||||
if (DSS) {
|
if (DSS) {
|
||||||
const bodyRow = $(`#${body.BodyID}`)
|
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')
|
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)
|
||||||
}
|
}
|
||||||
})
|
})
|
|
@ -44,7 +44,7 @@ const buildRings = (body) => {
|
||||||
/* --------------------------------------------------------------------------- createBodyRow ---- */
|
/* --------------------------------------------------------------------------- createBodyRow ---- */
|
||||||
|
|
||||||
export const createBodyRow = (body) => {
|
export const createBodyRow = (body) => {
|
||||||
const chartedStyle = body.WasDiscovered ? 'charted' : 'uncharted'
|
const chartedStyle = body.WasDiscovered && !body.DSSDone ? 'charted' : 'uncharted'
|
||||||
const row = $('<div>').addClass('row ms-1 me-1')
|
const row = $('<div>').addClass('row ms-1 me-1')
|
||||||
row.attr('id', body.bodyID)
|
row.attr('id', body.bodyID)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue