Adds a cooldown progress bar to Cryocells (#20328)

* Add a cooldown progress bar to cryocells

* Color the progress bar warningly while no beaker loaded

* Give 'No beaker loaded' message a unique color

* Give the progress bar a label
This commit is contained in:
Nathan Winters
2023-02-16 21:14:12 +01:00
committed by GitHub
parent b8c12bbbf7
commit 6bcf0c41ee
3 changed files with 20 additions and 6 deletions
@@ -216,7 +216,7 @@
/obj/machinery/atmospherics/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "Cryo", "Cryo Cell", 520, 490)
ui = new(user, src, ui_key, "Cryo", "Cryo Cell", 520, 500)
ui.open()
/obj/machinery/atmospherics/unary/cryo_cell/ui_data(mob/user)
@@ -253,6 +253,7 @@
if(beaker.reagents && beaker.reagents.reagent_list.len)
for(var/datum/reagent/R in beaker.reagents.reagent_list)
data["beakerVolume"] += R.volume
data["cooldownProgress"] = round(clamp((world.time - last_injection) / injection_cooldown, 0, 1) * 100)
data["auto_eject_healthy"] = (auto_eject_prefs & AUTO_EJECT_HEALTHY) ? TRUE : FALSE
data["auto_eject_dead"] = (auto_eject_prefs & AUTO_EJECT_DEAD) ? TRUE : FALSE