summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-04-05 23:52:35 +0200
committerAki <please@ignore.pl>2021-04-05 23:52:35 +0200
commit9306261368878626ec1520dcbf8295f1b99e341a (patch)
tree074182daa92b1d3360cd069533e4d91887ec72e4
parent926cc5d1751314a18c0e3056243c0a12e804d81c (diff)
downloadderelict-prototype-9306261368878626ec1520dcbf8295f1b99e341a.zip
derelict-prototype-9306261368878626ec1520dcbf8295f1b99e341a.tar.gz
derelict-prototype-9306261368878626ec1520dcbf8295f1b99e341a.tar.bz2
Added ship type id resolution for labels
-rw-r--r--derelict.js5
-rw-r--r--style.css1
2 files changed, 5 insertions, 1 deletions
diff --git a/derelict.js b/derelict.js
index 2471104..abe960c 100644
--- a/derelict.js
+++ b/derelict.js
@@ -54,7 +54,10 @@ class Wreck {
this.killmail = killmail
this.domElement.className = 'wreck'
- this.domElement.dataset.label = `${this.killmail.killmail_id}`
+ const shipTypeId = this.killmail.victim.ship_type_id
+ fetch(`https://esi.evetech.net/latest/universe/types/${shipTypeId}/?datasource=tranquility`) // TODO: Cache it.
+ .then(response => response.json())
+ .then(typeId => this.domElement.dataset.label = typeId.name)
this.domElement.appendChild(iconElement)
this.point.position.copy(position)
this.point.add(object2d)
diff --git a/style.css b/style.css
index 472cbd8..0c793b3 100644
--- a/style.css
+++ b/style.css
@@ -32,6 +32,7 @@ body {
background: #000a;
border-radius: 0.5em;
pointer-events: none;
+ width: max-content;
}
#wrapper {