Skip to content

Commit

Permalink
pnarrate
Browse files Browse the repository at this point in the history
/me but uhhhhh idk
  • Loading branch information
MosleyTheMalO committed Nov 1, 2022
1 parent 6bb94b8 commit 66f74e6
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions interface/stylesheet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,5 @@ h1.alert, h2.alert {color: #000000;}

.monkeyhive {color: #774704;}
.monkeylead {color: #774704; font-size: 2;}
.pnarrate {color: #009AB2;}
</style>"}
50 changes: 50 additions & 0 deletions modular_splurt/code/modules/mob/say_vr.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/datum/emote/living/narrate
key = "narrate"
key_third_person = "narrates"
message = null
mob_type_blacklist_typecache = list(/mob/living/brain)
emote_type = EMOTE_OMNI

/datum/emote/living/narrate/proc/check_invalid(mob/user, input)
if(stop_bad_mime.Find(input, 1, 1))
to_chat(user, "<span class='danger'>Invalid emote.</span>")
return TRUE
return FALSE

/datum/emote/living/narrate/run_emote(mob/user, params, type_override, intentional)
. = TRUE
if(jobban_isbanned(user, "emote"))
to_chat(user, "You cannot send narrates (banned).")
return FALSE
if(user.client && user.client.prefs.muted & MUTE_IC)
to_chat(user, "You cannot send IC messages (muted).")
return FALSE
if(!params)
return FALSE
message = params
if(type_override)
emote_type = type_override
if(!can_run_emote(user) || check_invalid(user, message))
return FALSE

user.log_message(message, LOG_EMOTE)
message = "<span class='name'>([user])</span> <span class='pnarrate'>[message]</span>"

for(var/mob/M in GLOB.dead_mob_list)
if(!M.client || isnewplayer(M))
continue
var/T = get_turf(src)
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)) && (user.client))
M.show_message("[FOLLOW_LINK(M, user)] " + message)

user.visible_message(message = message, self_message = message, omni = TRUE)

/mob/living/verb/player_narrate(message as message)
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(GLOB.say_disabled)
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
return
message = trim(html_encode(message), MAX_MESSAGE_LEN)
emote("narrate", message=message)
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4622,6 +4622,7 @@
#include "modular_splurt\code\modules\mob\emote.dm"
#include "modular_splurt\code\modules\mob\mob.dm"
#include "modular_splurt\code\modules\mob\mob_defines.dm"
#include "modular_splurt\code\modules\mob\say_vr.dm"
#include "modular_splurt\code\modules\mob\splurt_emotes.dm"
#include "modular_splurt\code\modules\mob\dead\crew_manifest.dm"
#include "modular_splurt\code\modules\mob\dead\dead.dm"
Expand Down
4 changes: 4 additions & 0 deletions tgui/packages/tgui-panel/styles/goon/chat-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,10 @@ blockquote.brass {
font-size: 80%;
}

.pnarrate {
color: #009AB2;
}

.connectionClosed, .fatalError {
background: red;
color: white;
Expand Down
4 changes: 4 additions & 0 deletions tgui/packages/tgui-panel/styles/goon/chat-light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,10 @@ blockquote.brass {
font-size: 80%;
}

.pnarrate {
color: #009AB2;
}

.connectionClosed,
.fatalError {
background: red;
Expand Down

0 comments on commit 66f74e6

Please sign in to comment.