Update UI when FSDJump is detected.
This commit is contained in:
parent
d68ae26032
commit
32d5919778
3 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
})
|
|
@ -3,6 +3,7 @@
|
|||
const buildRings = (body) => {
|
||||
const rings = $('<span>')
|
||||
const seperator = $('<span>').text(' ) ')
|
||||
rings.appendChild(seperator)
|
||||
|
||||
body.Rings.forEach((ring) => {
|
||||
const ringClass = ring.RingClass.replace('eRingClass_', '')
|
||||
|
|
Loading…
Reference in a new issue