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.
|
// CMDR jumped to new system, so update current location.
|
||||||
case 'FSDJump': {
|
case 'FSDJump': {
|
||||||
this.location = new System(line.StarSystem)
|
this.location = new System(line.StarSystem)
|
||||||
|
log(`FSD Jump detected, current location updated to ${this.location.name}.`)
|
||||||
this.emit('ENTERED_NEW_SYSTEM')
|
this.emit('ENTERED_NEW_SYSTEM')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,8 @@ if (journal.journalDir === null) {
|
||||||
journal.watchDirectory()
|
journal.watchDirectory()
|
||||||
journal.watchJournal()
|
journal.watchJournal()
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------- init complete ---- */
|
||||||
|
|
||||||
journal.once('INIT_COMPLETE', () => {
|
journal.once('INIT_COMPLETE', () => {
|
||||||
if (journal.location !== null) {
|
if (journal.location !== null) {
|
||||||
$('#currentSystem')
|
$('#currentSystem')
|
||||||
|
@ -70,4 +72,13 @@ journal.once('INIT_COMPLETE', () => {
|
||||||
$('#lowValueScans').appendChild(row)
|
$('#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 buildRings = (body) => {
|
||||||
const rings = $('<span>')
|
const rings = $('<span>')
|
||||||
const seperator = $('<span>').text(' ) ')
|
const seperator = $('<span>').text(' ) ')
|
||||||
|
rings.appendChild(seperator)
|
||||||
|
|
||||||
body.Rings.forEach((ring) => {
|
body.Rings.forEach((ring) => {
|
||||||
const ringClass = ring.RingClass.replace('eRingClass_', '')
|
const ringClass = ring.RingClass.replace('eRingClass_', '')
|
||||||
|
|
Loading…
Reference in a new issue