Sleepers now show blood level and type for occupants.

https://i.imgur.com/RaMjgt2.png

https://i.imgur.com/qkaBggM.png

Also updated TGUI package.json.

_This has been properly resigned with the correct key._
This commit is contained in:
Carlen White
2019-05-20 17:55:25 -04:00
parent 8200e09fa2
commit ccef9c326a
5 changed files with 1422 additions and 112 deletions
+16
View File
@@ -151,6 +151,22 @@
if(mob_occupant.reagents && mob_occupant.reagents.reagent_list.len)
for(var/datum/reagent/R in mob_occupant.reagents.reagent_list)
data["occupant"]["reagents"] += list(list("name" = R.name, "volume" = R.volume))
if(mob_occupant.has_dna()) // Blood-stuff is mostly a copy-paste from the healthscanner.
var/mob/living/carbon/C = mob_occupant
var/blood_id = C.get_blood_id()
if(blood_id)
data["occupant"]["blood"] = list() // We can start populating this list.
var/blood_type = C.dna.blood_type
if(blood_id != "blood") // special blood substance
var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id]
if(R)
blood_type = R.name
else
blood_type = blood_id
data["occupant"]["blood"]["maxBloodVolume"] = BLOOD_VOLUME_NORMAL
data["occupant"]["blood"]["currentBloodVolume"] = C.blood_volume
data["occupant"]["blood"]["dangerBloodVolume"] = BLOOD_VOLUME_SAFE
data["occupant"]["blood"]["bloodType"] = blood_type
return data
/obj/machinery/sleeper/ui_act(action, params)
+3 -3
View File
File diff suppressed because one or more lines are too long
+1391 -107
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -23,7 +23,7 @@
"fontfaceobserver": "1.6.3",
"gulp": "git://github.com/gulpjs/gulp.git#v4.0.0-alpha.3",
"gulp-bytediff": "1.0.0",
"gulp-cssnano": "2.1.2",
"gulp-cssnano": "^2.1.3",
"gulp-if": "2.0.0",
"gulp-load-plugins": "1.5.0",
"gulp-postcss": "6.1.0",
@@ -50,7 +50,7 @@
"stylus": "0.54.5",
"vinyl-buffer": "1.0.1",
"vinyl-source-stream": "2.0.0",
"watchify": "3.7.0"
"watchify": "^3.11.1"
},
"browser": {
"ractive": "ractive/ractive-legacy.runtime"
+10
View File
@@ -15,6 +15,16 @@
<ui-bar min='0' max='{{data.occupant.maxHealth}}' value='{{data.occupant[type]}}' state='bad'>{{Math.round(adata.occupant[type])}}</ui-bar>
</ui-section>
{{/each}}
{{#if data.occupant.blood}}
<ui-section label='Blood'>
<ui-section label='Volume'>
<ui-bar min='0' max='{{data.occupant.blood.maxBloodVolume}}' value='{{data.occupant.blood.currentBloodVolume}}' state='{{data.occupant.blood.currentBloodVolume <= data.occupant.blood.dangerBloodVolume ? "bad" : "good"}}'>{{& data.occupant.blood.currentBloodVolume <= data.occupant.blood.dangerBloodVolume ? "<b>LOW</b>" : "OK"}} - {{Math.round(data.occupant.blood.currentBloodVolume)}} cl</ui-bar>
</ui-section>
<ui-section label='Type'>
<span class='highlight'>{{data.occupant.blood.bloodType}}</span>
</ui-section>
</ui-section>
{{/if}}
<ui-section label='Cells'>
<span class='{{data.occupant.cloneLoss ? "bad" : "good"}}'>{{data.occupant.cloneLoss ? "Damaged" : "Healthy"}}</span>
</ui-section>