Replaces the Space Suit stat panel entry (#95463)

## About The Pull Request

When you put on a space suit, it gives you stat panel entries for
whether the thermal regulator is on, and the charge in the cell.
This replaces it with the already-existing HUD element, and improves
upon it.

1. Re-uses mod's "very low" icon for the HUD, now "max" charge is
100-60%, "mid" is 60-40%, "low" is 40-20% and under that is "very low"
2. The icon now displays "OFF" when the thermal regulator isn't running
3. You can click on the HUD element to turn the thermal regulator on
4. You can hover over the HUD element to see the exact percentage your
space suit is at



https://github.com/user-attachments/assets/3a6cc33d-25d1-479d-99d5-f8160316c230


Maybe in the future we could remove the action button as well if the HUD
element is preferable, as we already seem to have an excess amount of
action buttons. Alternatively we can remove the HUD element entirely and
move the behaviour to the action button, like what we did with the
internals HUD. I'll leave that up to future discussion though I lean
more on it being a HUD element.

## Why It's Good For The Game

Helps me kill the stat panel as part of
https://hackmd.io/443_dE5lRWeEAp9bjGcKYw?view

Space suits is one of the larger parts of this issue as people are
typically expected to wear a space suit, so I think it's pretty
important we get this one done sooner rather than later. Same as my
other recent PRs, this one is also a complement of
https://github.com/tgstation/tgstation/pull/95383

## Changelog

🆑
qol: The stat panel entry for space suits has been replaced with the HUD
element. You can now hover over it to see exact cell percentage, and
click it to turn the regulator on, while it'll also display when it's
off.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
John Willard
2026-03-28 09:42:49 +01:00
committed by GitHub
co-authored by MrMelbert
parent 96ab2c2cb3
commit d08cd9dbee
9 changed files with 122 additions and 63 deletions
+4 -4
View File
@@ -524,7 +524,7 @@
module.on_unequip()
UnregisterSignal(wearer, list(COMSIG_ATOM_EXITED, COMSIG_SPECIES_GAIN, COMSIG_MOB_CLICKON))
SEND_SIGNAL(src, COMSIG_MOD_WEARER_UNSET, wearer)
wearer.update_spacesuit_hud_icon("0")
wearer.hud_used?.spacesuit_hud.update_spacesuit_hud_icon()
wearer = null
/obj/item/mod/control/proc/get_sealed_slots(list/parts)
@@ -715,17 +715,17 @@
* Updates the wearer's hud according to the current state of the MODsuit
*/
/obj/item/mod/control/proc/update_charge_alert()
if(isnull(wearer))
if(isnull(wearer) || isnull(wearer.client))
return
var/state_to_use
if(!active)
state_to_use = "0"
state_to_use = SPACESUIT_NO_ICON
else if(isnull(core))
state_to_use = "coreless"
else
state_to_use = core.get_charge_icon_state()
wearer.update_spacesuit_hud_icon(state_to_use || "0")
wearer.hud_used.spacesuit_hud.update_spacesuit_hud_icon(state_to_use || SPACESUIT_NO_ICON)
/obj/item/mod/control/proc/update_speed()
var/total_slowdown = 0
+19 -19
View File
@@ -52,7 +52,7 @@
/// Returns what icon state to display on the HUD for the charge level of this core
/obj/item/mod/core/proc/get_charge_icon_state()
return "0"
return SPACESUIT_NO_ICON
/// Gets what the UI should use for the charge bar color.
/obj/item/mod/core/proc/get_chargebar_color()
@@ -90,7 +90,7 @@
return TRUE
/obj/item/mod/core/infinite/get_charge_icon_state()
return "high"
return SPACESUIT_CELL_HIGH
/obj/item/mod/core/infinite/get_chargebar_color()
return "teal"
@@ -171,19 +171,19 @@
/obj/item/mod/core/standard/get_charge_icon_state()
if(isnull(charge_source()))
return "missing"
return SPACESUIT_CELL_MISSING
switch(round(charge_amount() / max_charge_amount(), 0.01))
if(0.75 to INFINITY)
return "high"
return SPACESUIT_CELL_HIGH
if(0.5 to 0.75)
return "mid"
return SPACESUIT_CELL_MID
if(0.25 to 0.5)
return "low"
return SPACESUIT_CELL_LOW
if(0.02 to 0.25)
return "very_low"
return SPACESUIT_CELL_VERY_LOW
return "empty"
return SPACESUIT_CELL_EMPTY
/obj/item/mod/core/standard/get_chargebar_color()
if(isnull(charge_source()))
@@ -335,7 +335,7 @@
return charge_amount() >= amount * charge_modifier
/obj/item/mod/core/ethereal/get_charge_icon_state()
return isnull(charge_source()) ? "missing" : "0"
return isnull(charge_source()) ? SPACESUIT_CELL_MISSING : SPACESUIT_NO_ICON
/obj/item/mod/core/ethereal/get_chargebar_color()
if(isnull(charge_source()))
@@ -405,15 +405,15 @@
/obj/item/mod/core/plasma/get_charge_icon_state()
switch(round(charge_amount() / max_charge_amount(), 0.01))
if(0.75 to INFINITY)
return "high"
return SPACESUIT_CELL_HIGH
if(0.5 to 0.75)
return "mid"
return SPACESUIT_CELL_MID
if(0.25 to 0.5)
return "low"
return SPACESUIT_CELL_LOW
if(0.02 to 0.25)
return "very_low"
return SPACESUIT_CELL_VERY_LOW
return "empty"
return SPACESUIT_CELL_EMPTY
/obj/item/mod/core/plasma/get_chargebar_color()
switch(round(charge_amount() / max_charge_amount(), 0.01))
@@ -648,15 +648,15 @@
/obj/item/mod/core/soul/get_charge_icon_state()
switch(round(charge_amount() / max_charge_amount(), 0.01))
if(0.75 to INFINITY)
return "high"
return SPACESUIT_CELL_HIGH
if(0.5 to 0.75)
return "mid"
return SPACESUIT_CELL_MID
if(0.25 to 0.5)
return "low"
return SPACESUIT_CELL_LOW
if(0.02 to 0.25)
return "very_low"
return SPACESUIT_CELL_VERY_LOW
return "empty"
return SPACESUIT_CELL_EMPTY
/obj/item/mod/core/soul/vv_edit_var(vname, vval)
. = ..()