mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Ghost "Toggle Darkness" value is now remembered (#17206)
This commit is contained in:
@@ -89,10 +89,12 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
|
||||
//starts ghosts off with all HUDs.
|
||||
toggle_all_huds_on(body)
|
||||
RegisterSignal(src, COMSIG_MOB_HUD_CREATED, .proc/set_ghost_darkness_level) //something something don't call this until we have a HUD
|
||||
..()
|
||||
|
||||
/mob/dead/observer/Destroy()
|
||||
toggle_all_huds_off()
|
||||
UnregisterSignal(src, COMSIG_MOB_HUD_CREATED)
|
||||
if(ghostimage)
|
||||
GLOB.ghost_images -= ghostimage
|
||||
QDEL_NULL(ghostimage)
|
||||
@@ -100,7 +102,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
if(orbit_menu)
|
||||
SStgui.close_uis(orbit_menu)
|
||||
QDEL_NULL(orbit_menu)
|
||||
if (seerads)
|
||||
if(seerads)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
@@ -113,6 +115,13 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
if(seerads)
|
||||
show_rads(5)
|
||||
|
||||
/mob/dead/observer/proc/set_ghost_darkness_level()
|
||||
if(!client)
|
||||
return
|
||||
UnregisterSignal(src, COMSIG_MOB_HUD_CREATED)
|
||||
lighting_alpha = client.prefs.ghost_darkness_level //Remembers ghost lighting pref
|
||||
update_sight()
|
||||
|
||||
// This seems stupid, but it's the easiest way to avoid absolutely ridiculous shit from happening
|
||||
// Copying an appearance directly from a mob includes it's verb list, it's invisibility, it's alpha, and it's density
|
||||
// You might recognize these things as "fucking ridiculous to put in an appearance"
|
||||
@@ -663,19 +672,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
update_sight()
|
||||
to_chat(usr, "You [(ghostvision?"now":"no longer")] have ghost vision.")
|
||||
|
||||
/mob/dead/observer/verb/toggle_darkness()
|
||||
set name = "Toggle Darkness"
|
||||
/mob/dead/observer/verb/pick_darkness()
|
||||
set name = "Pick Darkness"
|
||||
set category = "Ghost"
|
||||
switch(lighting_alpha)
|
||||
if (LIGHTING_PLANE_ALPHA_VISIBLE)
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
|
||||
if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
|
||||
else
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
|
||||
|
||||
var/desired_dark = input(src, "Choose how much darkness you want to see, (0 - 255). Higher numbers being darker.", "Pick Darkness", null) as null|num
|
||||
if(isnull(desired_dark))
|
||||
return
|
||||
if(!client)
|
||||
return
|
||||
client.prefs.ghost_darkness_level = clamp(desired_dark, 0, 255)
|
||||
client.prefs.save_preferences(src)
|
||||
lighting_alpha = client.prefs.ghost_darkness_level
|
||||
update_sight()
|
||||
|
||||
/mob/dead/observer/update_sight()
|
||||
|
||||
Reference in New Issue
Block a user