diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm index 47358b5868c..c12d842f86a 100644 --- a/code/_onclick/hud/ghost.dm +++ b/code/_onclick/hud/ghost.dm @@ -38,7 +38,7 @@ /datum/hud/proc/ghost_hud() var/mob/dead/observer/G = mymob - if(!G.ghost_hud_enabled) + if(!G.client.prefs.ghost_hud) mymob.client.screen -= adding return diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 29dbb61db30..6ecd2f7f27f 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -32,6 +32,7 @@ var/list/preferences_datums = list() var/chat_toggles = TOGGLES_DEFAULT_CHAT var/ghost_form = "ghost" var/ghost_orbit = GHOST_ORBIT_CIRCLE + var/ghost_hud = 1 var/allow_midround_antag = 1 var/preferred_map = null diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index b5d4f5c11f3..728bdd65a2c 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -181,6 +181,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["ghost_orbit"] >> ghost_orbit S["preferred_map"] >> preferred_map S["ignoring"] >> ignoring + S["ghost_hud"] >> ghost_hud //try to fix any outdated data if necessary if(needs_update >= 0) @@ -220,6 +221,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["ghost_orbit"] << ghost_orbit S["preferred_map"] << preferred_map S["ignoring"] << ignoring + S["ghost_hud"] << ghost_hud return 1 diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 0b62d0a289d..c09b28f4d5f 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -253,3 +253,14 @@ var/global/list/ghost_orbits = list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS set desc = "Allows you to access the Setup Character screen. Changes to your character won't take effect until next round, but other changes will." prefs.current_tab = 1 prefs.ShowChoices(usr) + +/client/verb/toggle_ghost_hud_pref() + set name = "Toggle Ghost HUD" + set category = "Preferences" + set desc = "Hide/Show Ghost HUD" + + prefs.ghost_hud = !prefs.ghost_hud + src << "Ghost HUD will now be [prefs.ghost_hud ? "visible" : "hidden"]." + prefs.save_preferences() + if(istype(mob,/mob/dead/observer)) + mob.hud_used.ghost_hud() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 413ea9a4ae7..39e38cf30a6 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -405,13 +405,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/mind_initialize() return -/mob/dead/observer/verb/toggle_ghosthud() - set name = "Toggle Ghost HUD" - set desc = "Toggles your ghost's on-screen HUD" - set category = "Ghost" - ghost_hud_enabled = !ghost_hud_enabled - hud_used.ghost_hud() - /mob/dead/observer/proc/show_me_the_hud(hud_index) var/datum/atom_hud/H = huds[hud_index] H.add_hud_to(src)