diff --git a/src/interfaces/JournalInterface.js b/src/interfaces/JournalInterface.js index 927bef6..e7aba85 100644 --- a/src/interfaces/JournalInterface.js +++ b/src/interfaces/JournalInterface.js @@ -205,6 +205,7 @@ export class JournalInterface extends EventEmitter { // CMDR jumped to new system, so update current location. case 'FSDJump': { this.location = new System(line.StarSystem) + log(`FSD Jump detected, current location updated to ${this.location.name}.`) this.emit('ENTERED_NEW_SYSTEM') break } diff --git a/src/renderer.js b/src/renderer.js index d5fb5b5..0da3adc 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -53,6 +53,8 @@ if (journal.journalDir === null) { journal.watchDirectory() journal.watchJournal() +/* --------------------------------------------------------------------------- init complete ---- */ + journal.once('INIT_COMPLETE', () => { if (journal.location !== null) { $('#currentSystem') @@ -70,4 +72,13 @@ journal.once('INIT_COMPLETE', () => { $('#lowValueScans').appendChild(row) }) } +}) + +/* ---------------------------------------------------------------------- entered new system ---- */ + +journal.on('ENTERED_NEW_SYSTEM', () => { + $('#highValueScans').children().remove() + $('#lowValueScans').children().remove() + + $('#currentSystemName').text(journal.location.name) }) \ No newline at end of file diff --git a/src/ui.js b/src/ui.js index 2e1344e..9be5e9a 100644 --- a/src/ui.js +++ b/src/ui.js @@ -3,6 +3,7 @@ const buildRings = (body) => { const rings = $('') const seperator = $('').text(' ) ') + rings.appendChild(seperator) body.Rings.forEach((ring) => { const ringClass = ring.RingClass.replace('eRingClass_', '')