mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
@@ -323,3 +323,49 @@
|
||||
else //There wasn't anyone to send the message to, pred or prey, so let's just emote it instead and correct our psay just in case.
|
||||
M.forced_psay = FALSE
|
||||
M.me_verb(message)
|
||||
|
||||
/mob/living/verb/player_narrate(message as text|null)
|
||||
set category = "IC"
|
||||
set name = "Narrate (Player)"
|
||||
set desc = "Narrate an action or event! An alternative to emoting, for when your emote shouldn't start with your name!"
|
||||
|
||||
if(src.client)
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
to_chat(src, "<span class='warning'>You cannot speak in IC (muted).</span>")
|
||||
return
|
||||
if(!message)
|
||||
message = tgui_input_text(usr, "Type a message to narrate.","Narrate")
|
||||
message = sanitize_or_reflect(message,src)
|
||||
if(!message)
|
||||
return
|
||||
if(stat == DEAD)
|
||||
return say_dead(message)
|
||||
if(stat)
|
||||
to_chat(src, "<span class= 'warning'>You need to be concious to narrate: [message]</span>")
|
||||
return
|
||||
message = "<span class='name'>([name])</span> <span class='pnarrate'>[message]</span>"
|
||||
|
||||
//Below here stolen from emotes
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
if(!T) return
|
||||
|
||||
var/ourfreq = null
|
||||
if(voice_freq > 0 )
|
||||
ourfreq = voice_freq
|
||||
|
||||
if(client)
|
||||
playsound(T, pick(emote_sound), 25, TRUE, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/client_preference/emote_sounds)
|
||||
|
||||
var/list/in_range = get_mobs_and_objs_in_view_fast(T,world.view,2,remote_ghosts = client ? TRUE : FALSE)
|
||||
var/list/m_viewers = in_range["mobs"]
|
||||
|
||||
for(var/mob/M as anything in m_viewers)
|
||||
spawn(0) // It's possible that it could be deleted in the meantime, or that it runtimes.
|
||||
if(M)
|
||||
if(isobserver(M))
|
||||
message = "[message] ([ghost_follow_link(src, M)])"
|
||||
if(M.stat == UNCONSCIOUS || M.sleeping > 0)
|
||||
continue
|
||||
to_chat(M, message)
|
||||
log_emote(message, src)
|
||||
|
||||
@@ -200,6 +200,8 @@ h1.alert, h2.alert {color: #000000;}
|
||||
.inverted .blue {color: #6666FF;}
|
||||
.inverted .green {color: #44FF44;}
|
||||
|
||||
.pnarrate {color: #009AB2;}
|
||||
|
||||
/*BIG IMG.icon {width: 32px; height: 32px;}*/
|
||||
img.icon {vertical-align: middle; max-height: 1em;}
|
||||
img.icon.bigicon {max-height: 32px;}
|
||||
|
||||
@@ -141,5 +141,7 @@ BIG IMG.icon {width: 32px; height: 32px;}
|
||||
.blue {color: #0000FF;}
|
||||
.green {color: #00DD00;}
|
||||
|
||||
.pnarrate {color: #009AB2;}
|
||||
|
||||
|
||||
</style>"}
|
||||
|
||||
Reference in New Issue
Block a user