Skip to content

Commit

Permalink
[MIRROR] More standardization for ghost notifications (READY) [MDB IG…
Browse files Browse the repository at this point in the history
…NORE] (#25104)

* More standardization for ghost notifications (READY) (#79596)

## About The Pull Request
I'm still not satisfied with how ghost notifications work. This gives
every notification with a source (99% of all notifications, in other
words) a link to jump/orbit. Currently, notifications with "play"
interactions would only get the interact link, so jumping to the source
was pretty annoying.

It removes posting the entire message in the alert tooltip, as some got
pretty lengthy and it didn't seem to fit. To replace this, they will
always use headers

After:

![image](https://github.com/tgstation/tgstation/assets/42397676/debfce52-3627-4a43-8663-33d61d893161)

![image](https://github.com/tgstation/tgstation/assets/42397676/01f299ae-dc6a-45f8-a97a-cb2c815088b2)

![image](https://github.com/tgstation/tgstation/assets/42397676/99567376-063e-458e-af2a-2dd4306747cc)

NOTIFY_JUMP and NOTIFY_ORBIT have been merged, since the only difference
seems to be whether it's a turf. The result shaves off some redundant
lines of code, since most-every usage of notify_ghosts uses
NOTIFY_ORBIT.
## Why It's Good For The Game
More standardization for the ghost notification system. Adds a few alert
headers that never had them. All in all, makes it easier for creators to
throw alerts at ghosts
## Changelog
:cl:
qol: Nearly every ghost alert should now feature a "VIEW" button, even
those with click interaction.
del: Ghost alerts no longer show the entire message in the tooltip,
instead have been replaced with titles.
/:cl:

* More standardization for ghost notifications (READY)

* Modular

* Update outpost_of_cogs.dm

---------

Co-authored-by: Jeremiah <[email protected]>
Co-authored-by: Giz <[email protected]>
  • Loading branch information
3 people authored and FFMirrorBot committed Nov 19, 2023
1 parent 8bc6cad commit c48f925
Show file tree
Hide file tree
Showing 64 changed files with 98 additions and 159 deletions.
6 changes: 0 additions & 6 deletions code/__DEFINES/atom_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,9 @@
#define DATA_HUD_PERMIT 11 //SKYRAT EDIT
#define DATA_HUD_DNR 12 // SKYRAT EDIT

// Notification action types
#define NOTIFY_JUMP "jump"
#define NOTIFY_PLAY "play"
#define NOTIFY_ORBIT "orbit"

/// cooldown for being shown the images for any particular data hud
#define ADD_HUD_TO_COOLDOWN 20


// Security HUD icon_state defines

#define SECHUD_NO_ID "hudno_id"
Expand Down
21 changes: 8 additions & 13 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -784,28 +784,23 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
timeout = 30 SECONDS
/// Weakref to the target atom to use the action on
var/datum/weakref/target_ref
/// Which on click action to use
var/action = NOTIFY_JUMP
/// If we want to interact on click rather than jump/orbit
var/click_interact = FALSE

/atom/movable/screen/alert/notify_action/Click()
. = ..()

var/atom/target = target_ref?.resolve()
if(isnull(target))
if(isnull(target) || !isobserver(owner) || target == owner)
return

var/mob/dead/observer/ghost_owner = owner
if(!istype(ghost_owner))

if(click_interact)
ghost_owner.jump_to_interact(target)
return

switch(action)
if(NOTIFY_PLAY)
target.attack_ghost(ghost_owner)
if(NOTIFY_JUMP)
var/turf/target_turf = get_turf(target)
if(target_turf && isturf(target_turf))
ghost_owner.abstract_move(target_turf)
if(NOTIFY_ORBIT)
ghost_owner.ManualFollow(target)
ghost_owner.observer_view(target)

//OBJECT-BASED

Expand Down
3 changes: 1 addition & 2 deletions code/datums/brain_damage/split_personality.dm
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,8 @@
notify_ghosts(
"[owner] is blacking out!",
source = owner,
action = NOTIFY_ORBIT,
notify_flags = NOTIFY_CATEGORY_NOFLASH,
header = "Bro I'm not even drunk right now",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
)

/datum/brain_trauma/severe/split_personality/blackout/on_lose()
Expand Down
1 change: 0 additions & 1 deletion code/datums/components/cult_ritual_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@
notify_ghosts(
"[cultist] has begun scribing a Nar'Sie rune!",
source = cultist,
action = NOTIFY_ORBIT,
header = "Maranax Infirmux!",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
)
Expand Down
3 changes: 1 addition & 2 deletions code/datums/components/deadchat_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
notify_ghosts(
"[parent] is now deadchat controllable!",
source = parent,
action = NOTIFY_ORBIT,
header = "Something Interesting!",
header = "Ghost Possession!",
)
if(!ismob(parent) && !SSpoints_of_interest.is_valid_poi(parent))
SSpoints_of_interest.make_point_of_interest(parent)
Expand Down
1 change: 0 additions & 1 deletion code/datums/components/energized.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
notify_ghosts(
"[future_tram_victim] has fallen in the path of an oncoming tram!",
source = future_tram_victim,
action = NOTIFY_ORBIT,
header = "Electrifying!",
)
do_sparks(4, FALSE, source)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/food/ghost_edible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
notify_ghosts(
"[parent] is edible by ghosts!",
source = parent,
action = NOTIFY_ORBIT,
header="Something Tasty!",
header = "Something Tasty!",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
)

/datum/component/ghost_edible/RegisterWithParent()
Expand Down
7 changes: 3 additions & 4 deletions code/datums/components/orbit_poll.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@

notify_ghosts(
"[message]. An orbiter will be chosen in [DisplayTimeText(timeout)].\n",
action = NOTIFY_ORBIT,
enter_link = "<a href='?src=[REF(src)];ignore=[ignore_key]'>(Ignore)</a>",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
source = parent,
header = "Volunteers requested",
custom_link = " <a href='?src=[REF(src)];ignore=[ignore_key]'>(Ignore)</a>",
ignore_key = ignore_key,
source = parent,
notify_flags = NOTIFY_CATEGORY_NOFLASH,
)

addtimer(CALLBACK(src, PROC_REF(end_poll)), timeout, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_DELETE_ME)
Expand Down
1 change: 0 additions & 1 deletion code/datums/components/supermatter_crystal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@
"[consumed_mob] has been dusted by [atom_source]!",
source = atom_source,
header = "Polytechnical Difficulties",
notify_flags = NOTIFY_CATEGORY_DEFAULT,
)
consumed_mob.dust(force = TRUE)
matter_increase += 100 * object_size
Expand Down
2 changes: 0 additions & 2 deletions code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@
notify_ghosts(
"[applicant.name] has been picked for the ruleset [name]!",
source = new_character,
action = NOTIFY_ORBIT,
header = "Something Interesting!",
)

/datum/dynamic_ruleset/midround/from_ghosts/proc/generate_ruleset_body(mob/applicant)
Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/harvester.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"[occupant] is about to be ground up by a malfunctioning organ harvester!",
source = src,
header = "Gruesome!",
action = NOTIFY_ORBIT,
)

operation_order = reverseList(carbon_occupant.bodyparts) //Chest and head are first in bodyparts, so we invert it to make them suffer more
Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/syndicatebomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@
notify_ghosts(
"\A [src] has been activated at [get_area(src)]!",
source = src,
action = NOTIFY_ORBIT,
header = "Bomb Planted",
)
user.add_mob_memory(/datum/memory/bomb_planted/syndicate, antagonist = src)
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/items/devices/reverse_bear_trap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@
notify_ghosts(
"[user] put a reverse bear trap on [target]!",
source = src,
action = NOTIFY_ORBIT,
header = "Reverse bear trap armed",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
ghost_sound = 'sound/machines/beep.ogg',
notify_volume = 75,
header = "Reverse bear trap armed",
)

/obj/item/reverse_bear_trap/proc/snap()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/eightball.dm
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
notify_ghosts(
"[user] is shaking [src], hoping to get an answer to \"[selected_message]\"",
source = src,
action = NOTIFY_PLAY,
header = "Magic eightball",
click_interact = TRUE,
)

/obj/item/toy/eightball/haunted/get_answer()
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/items/grenades/plastic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@
notify_ghosts(
"[user] has planted \a [src] on [target] with a [det_time] second fuse!",
source = bomb_target,
action = (isturf(target) ? NOTIFY_JUMP : NOTIFY_ORBIT),
notify_flags = NOTIFY_CATEGORY_NOFLASH,
header = "Explosive Planted",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
)

moveToNullspace() //Yep
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/items/his_grace.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
notify_ghosts(
"[user] has awoken His Grace!",
source = src,
action = NOTIFY_ORBIT,
header = "All Hail His Grace!",
)
playsound(user, 'sound/effects/pope_entry.ogg', 100)
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/items/hot_potato.dm
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@
notify_ghosts(
"[user] has primed a Hot Potato!",
source = src,
action = NOTIFY_ORBIT,
header = "Hot Hot Hot!",
)

Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/items/implants/implant_explosive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,9 @@
notify_ghosts(
"[imp_in] is about to detonate their explosive implant!",
source = src,
action = NOTIFY_ORBIT,
header = "Tick Tick Tick...",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
ghost_sound = 'sound/machines/warning-buzzer.ogg',
header = "Tick Tick Tick...",
notify_volume = 75,
)

Expand Down
2 changes: 0 additions & 2 deletions code/modules/antagonists/blob/blob_antag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@
notify_ghosts(
"A Blob host has burst in [get_area_name(blob_cam.blob_core)]",
source = blob_cam.blob_core,
action = NOTIFY_ORBIT,
ghost_sound = 'sound/ambience/antag/blobalert.ogg',
header = "Blob Awakening!",
notify_volume = 75,
notify_flags = NOTIFY_CATEGORY_DEFAULT,
)

/datum/antagonist/blob/antag_listing_status()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,9 @@ GLOBAL_VAR_INIT(narsie_summon_count, 0)
return list()
notify_ghosts(
"Manifest rune invoked in [get_area(src)].",
'sound/effects/ghost2.ogg',
source = src,
header = "Manifest rune",
ghost_sound = 'sound/effects/ghost2.ogg',
)
var/list/ghosts_on_rune = list()
for(var/mob/dead/observer/O in T)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/antagonists/heretic/heretic_knowledge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,7 @@
notify_ghosts(
"[user] has completed an ascension ritual!",
source = user,
action = NOTIFY_ORBIT,
header = "A Heretic is Ascending!",
notify_flags = NOTIFY_CATEGORY_DEFAULT,
)
return TRUE

Expand Down
1 change: 0 additions & 1 deletion code/modules/antagonists/malf_ai/malf_ai_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
"[owner_AI] has activated a Doomsday Device!",
source = owner_AI,
header = "DOOOOOOM!!!",
action = NOTIFY_ORBIT,
)

qdel(src)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ GLOBAL_VAR(station_nuke_source)
"A nuclear device has been armed in [get_area_name(src)]!",
source = src,
header = "Nuke Armed",
action = NOTIFY_ORBIT,
notify_flags = NOTIFY_CATEGORY_DEFAULT,
)
update_appearance()

Expand Down
2 changes: 0 additions & 2 deletions code/modules/antagonists/pirate/pirate_event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,12 @@
notify_ghosts(
"The [chosen_gang.ship_name] has an object of interest: [spawned_mob]!",
source = spawned_mob,
action = NOTIFY_ORBIT,
header = "Pirates!",
)
else
notify_ghosts(
"The [chosen_gang.ship_name] has an object of interest: [spawner]!",
source = spawner,
action = NOTIFY_ORBIT,
header = "Pirate Spawn Here!",
)

Expand Down
6 changes: 2 additions & 4 deletions code/modules/antagonists/space_dragon/carp_rift.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@
notify_ghosts(
"The Space Dragon has opened a rift!",
source = new_rift,
action = NOTIFY_ORBIT,
notify_flags = NOTIFY_CATEGORY_NOFLASH,
header = "Carp Rift Opened",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
)
ASSERT(dragon.rift_ability == src) // Badmin protection.
QDEL_NULL(dragon.rift_ability) // Deletes this action when used successfully, we re-gain a new one on success later.
Expand Down Expand Up @@ -198,9 +197,8 @@
notify_ghosts(
"The carp rift can summon an additional carp!",
source = src,
action = NOTIFY_ORBIT,
notify_flags = NOTIFY_CATEGORY_NOFLASH,
header = "Carp Spawn Available",
notify_flags = NOTIFY_CATEGORY_NOFLASH,
)
last_carp_inc -= carp_interval

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
notify_ghosts(
"[target] has just had their eyes snatched!",
source = target,
action = NOTIFY_ORBIT,
header = "Ouch!",
)
target.emote("scream")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,8 @@
"The [src] has begun melting down!",
source = src,
header = "Meltdown Incoming",
action = NOTIFY_ORBIT,
ghost_sound = 'sound/machines/warning-buzzer.ogg',
notify_volume = 75,
notify_flags = NOTIFY_CATEGORY_DEFAULT,
)

for(var/i in HYPERTORUS_COUNTDOWN_TIME to 0 step -10)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/basketball/controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ GLOBAL_VAR(basketball_game)
header = "Basketball Minigame",
ghost_sound = 'sound/effects/ghost2.ogg',
notify_volume = 75,
action = NOTIFY_ORBIT,
notify_flags = NOTIFY_CATEGORY_DEFAULT,
)

create_bodies(ready_players)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/capture_the_flag/ctf_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
notify_ghosts(
"[spawner.name] has been activated!",
source = spawner,
action = NOTIFY_ORBIT,
header = "CTF has been activated",
notify_flags = NOTIFY_CATEGORY_DEFAULT,
)

/datum/ctf_controller/proc/stop_ctf()
Expand Down
6 changes: 4 additions & 2 deletions code/modules/capture_the_flag/ctf_game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,16 @@
message_admins("CTF has finished a round and automatically restarted.")
notify_ghosts(
"CTF has automatically restarted after a round finished in [initial(ctf_area.name)]!",
'sound/effects/ghost2.ogg',
ghost_sound = 'sound/effects/ghost2.ogg',
header = "CTF Restarted"
)
else
message_admins("The players have spoken! Voting has enabled CTF!")
if(!automated)
notify_ghosts(
"CTF has been [ctf_enabled? "enabled" : "disabled"] in [initial(ctf_area.name)]!",
'sound/effects/ghost2.ogg',
ghost_sound = 'sound/effects/ghost2.ogg',
header = "CTF [ctf_enabled? "Enabled" : "Disabled"]"
)

#undef CTF_LOADING_UNLOADED
Expand Down
1 change: 0 additions & 1 deletion code/modules/cards/deck/tarot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
header = "Haunted Tarot Deck",
ghost_sound = 'sound/effects/ghost2.ogg',
notify_volume = 75,
action = NOTIFY_ORBIT,
)

/obj/item/toy/cards/deck/tarot/haunted/proc/on_unwield(obj/item/source, mob/living/carbon/user)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/events/_event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ Runs the event
notify_ghosts(
"[control.name] has an object of interest: [atom_of_interest]!",
source = atom_of_interest,
action = NOTIFY_ORBIT,
header = "Something's Interesting!",
)
return

Expand Down
2 changes: 0 additions & 2 deletions code/modules/events/ghost_role/fugitive_event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,12 @@
notify_ghosts(
"[spawner.prompt_name] has awoken: [spawned_mob]!",
source = spawned_mob,
action = NOTIFY_ORBIT,
header = "Come look!",
)
else
notify_ghosts(
"[spawner.prompt_name] spawner has been created!",
source = spawner,
action = NOTIFY_ORBIT,
header = "Spawn Here!",
)

Expand Down
Loading

0 comments on commit c48f925

Please sign in to comment.