Converts some notify_ghosts args to bitflags, multilines all notify_ghosts calls (#79320)

## About The Pull Request

This helps clean up my favorite helper proc in the whole codebase,
`notify_ghosts()`.

The notify_suiciders, ignore_mapload, and flashwindow args are GONE.
They have been replaced with the notify_flags bitflag argument. This was
intended to make deadchat announcements a bitflag argument too, but
those got reverted right before I originally wanted to submit this PR.

The on-screen popup now shows the notification body when you hover it
with your mouse again. The format is now `[notify_ghosts message] --
[click action (orbit/jump/play)]`

Every single `notify_ghosts()` call has been changed to multiline format
and has been given trailing commas. Pretty!
## Why It's Good For The Game

Cleans up a proc that is very popular and going through a lot of changes
at the time.

Allows for further flexibility when this proc inevitably gets tweaked or
improved. 12 -> 10 args is an improvement, and it doesn't impact the
helper's flexibility at all.
## Changelog
🆑 Rhials
code: The notify_ghosts proc has been cleaned up. Please report any
abnormal changes in deadchat notification behavior.
qol: The on-screen deadchat popups now contain the notification blurb
when hovered with your mouse again.
/🆑
This commit is contained in:
Rhials
2023-11-05 15:26:50 -08:00
committed by GitHub
parent 4851087fc1
commit 3c7005a37c
56 changed files with 365 additions and 79 deletions
@@ -23,7 +23,13 @@
. = ..()
var/area/init_area = get_area(src)
if(!mapload && init_area)
notify_ghosts("\A golem shell has been completed in \the [init_area.name].", source = src, action = NOTIFY_PLAY, flashwindow = FALSE, ignore_key = POLL_IGNORE_GOLEM)
notify_ghosts(
"\A golem shell has been completed in \the [init_area.name].",
source = src,
action = NOTIFY_PLAY,
notify_flags = NOTIFY_CATEGORY_NOFLASH,
ignore_key = POLL_IGNORE_GOLEM,
)
/obj/effect/mob_spawn/ghost_role/human/golem/name_mob(mob/living/spawned_mob, forced_name)
if(forced_name || !iscarbon(spawned_mob))
@@ -253,7 +253,13 @@
eggshell.egg = src
src.forceMove(eggshell)
if(spawner_area)
notify_ghosts("An ash walker egg is ready to hatch in \the [spawner_area.name].", source = src, action = NOTIFY_PLAY, flashwindow = FALSE, ignore_key = POLL_IGNORE_ASHWALKER)
notify_ghosts(
"An ash walker egg is ready to hatch in \the [spawner_area.name].",
source = src,
action = NOTIFY_PLAY,
notify_flags = NOTIFY_CATEGORY_NOFLASH,
ignore_key = POLL_IGNORE_ASHWALKER,
)
/datum/outfit/ashwalker
name = "Ash Walker"
@@ -107,7 +107,16 @@
amount_grown += rand(5, 15) * seconds_per_tick
if(amount_grown >= 100 && !ready)
ready = TRUE
notify_ghosts("[src] is ready to hatch!", null, enter_link = "<a href=?src=[REF(src)];activate=1>(Click to play)</a>", source = src, action = NOTIFY_ORBIT, ignore_key = POLL_IGNORE_SPIDER, flashwindow = flash_window)
var/notify_flags_to_pass = NOTIFY_CATEGORY_NOFLASH
if(flash_window)
notify_flags_to_pass &= GHOST_NOTIFY_FLASH_WINDOW
notify_ghosts(
"[src] is ready to hatch!",
source = src,
action = NOTIFY_PLAY,
ignore_key = POLL_IGNORE_SPIDER,
notify_flags = notify_flags_to_pass,
)
STOP_PROCESSING(SSobj, src)
/obj/effect/mob_spawn/ghost_role/spider/Topic(href, href_list)
@@ -33,7 +33,12 @@
/// Called when the attached flower bud has borne fruit (ie. is ready)
/obj/effect/mob_spawn/ghost_role/venus_human_trap/proc/bear_fruit()
ready = TRUE
notify_ghosts("[src] has borne fruit!", source = src, action = NOTIFY_PLAY, ignore_key = POLL_IGNORE_VENUSHUMANTRAP)
notify_ghosts(
"[src] has borne fruit!",
source = src,
action = NOTIFY_PLAY,
ignore_key = POLL_IGNORE_VENUSHUMANTRAP,
)
/obj/effect/mob_spawn/ghost_role/venus_human_trap/allow_spawn(mob/user, silent = FALSE)
. = ..()