Cleanups and tweaks observer code (#30250)

* observer cleanup

* this

* bit more

* Update tgui.bundle.js
This commit is contained in:
kyunkyunkyun
2025-09-05 05:54:22 +00:00
committed by GitHub
parent 8f98876b47
commit 10f2e67e65
66 changed files with 362 additions and 447 deletions
+1 -1
View File
@@ -43,7 +43,7 @@
AI.ai_actual_track(H)
if(isobserver(usr))
var/mob/dead/observer/ghost = usr
ghost.ManualFollow(H)
ghost.manual_follow(H)
if("switch_level")
if(!is_advanced)
return
+4 -7
View File
@@ -33,7 +33,7 @@ GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new)
data[hud] = (hud_type_lookup[hud] in ghost.data_hud_seen)
data["ahud"] = ghost.antagHUD
// Split radioactivity out as it isn't a true datahud
data["radioactivity"] = ghost.seerads
data["radioactivity"] = ghost.ghost_flags & GHOST_SEE_RADS
return data
/datum/ui_module/ghost_hud_panel/ui_act(action, list/params)
@@ -52,11 +52,8 @@ GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new)
var/hud_type = hud_type_lookup[params["hud_type"]]
ghost.remove_the_hud(hud_type)
if("rads_on")
ghost.set_radiation_view(TRUE)
if("rads_off")
ghost.set_radiation_view(FALSE)
if("toggle_rad")
ghost.toggle_rad_view()
if("ahud_on")
if(!GLOB.configuration.general.allow_antag_hud && !ghost.client.holder)
@@ -71,7 +68,7 @@ GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new)
if(response != "Yes")
return FALSE
ghost.can_reenter_corpse = FALSE
ghost.ghost_flags &= ~(GHOST_CAN_REENTER | GHOST_RESPAWNABLE)
REMOVE_TRAIT(ghost, TRAIT_RESPAWNABLE, GHOSTED)
log_admin("[key_name(ghost)] has enabled antaghud as an observer and forfeited respawnability.")
message_admins("[key_name(ghost)] has enabled antaghud as an observer and forfeited respawnability.")