Skip to content

Commit

Permalink
add observer ui button for toggling huds
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdtalon committed Nov 10, 2023
1 parent 6b63944 commit 5aa6910
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions code/_onclick/hud/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
var/mob/dead/observer/G = usr
G.reenter_corpse()

/atom/movable/screen/ghost/toggle_huds
name = "Toggle HUDs"
icon_state = "ghost_hud_toggle"

/atom/movable/screen/ghost/toggle_huds/Click()
var/client/client = usr.client
client.toggle_ghost_hud()

/datum/hud/ghost/New(mob/owner, ui_style='icons/mob/hud/human_white.dmi', ui_color, ui_alpha = 230)
. = ..()
var/atom/movable/screen/using
Expand All @@ -68,6 +76,9 @@
using.screen_loc = ui_ghost_slot4
static_inventory += using

using = new /atom/movable/screen/ghost/toggle_huds()
using.screen_loc = ui_ghost_slot5
static_inventory += using

/datum/hud/ghost/show_hud(version = 0, mob/viewmob)
// don't show this HUD if observing; show the HUD of the observee
Expand Down
Binary file modified icons/mob/screen_ghost.dmi
Binary file not shown.

0 comments on commit 5aa6910

Please sign in to comment.