Merge pull request #8722 from Spookerton/spkrtn/sys/sstyping

Adds SSTyping
This commit is contained in:
Atermonera
2022-10-02 10:16:01 -08:00
committed by GitHub
9 changed files with 251 additions and 106 deletions
@@ -43,23 +43,3 @@
/mob/living/carbon/brain/isSynthetic()
return istype(loc, /obj/item/mmi)
/mob/living/carbon/brain/set_typing_indicator(var/state)
if(isturf(loc))
return ..()
if(!is_preference_enabled(/datum/client_preference/show_typing_indicator))
loc.cut_overlay(typing_indicator, TRUE)
return
if(!typing_indicator)
init_typing_indicator("[speech_bubble_appearance()]_typing")
if(state && !typing)
loc.add_overlay(typing_indicator, TRUE)
typing = TRUE
else if(typing)
loc.cut_overlay(typing_indicator, TRUE)
typing = FALSE
return state
+1 -4
View File
@@ -212,9 +212,6 @@
var/get_rig_stats = 0 //Moved from computer.dm
var/typing
var/obj/effect/decal/typing_indicator
var/low_priority = FALSE //Skip processing life() if there's just no players on this Z-level
var/default_pixel_x = 0 //For offsetting mobs
@@ -225,4 +222,4 @@
var/registered_z
var/in_enclosed_vehicle = 0 //For mechs and fighters ambiance. Can be used in other cases.
var/in_enclosed_vehicle = 0 //For mechs and fighters ambiance. Can be used in other cases.
+5 -8
View File
@@ -1,35 +1,32 @@
/mob/proc/say(var/message, var/datum/language/speaking = null, var/whispering = 0)
return
/mob/verb/whisper(message as text)
set name = "Whisper"
set category = "IC"
usr.say(message, whispering = TRUE)
usr.say(message,whispering=1)
/mob/verb/say_verb(message as text)
set name = "Say"
set category = "IC"
set_typing_indicator(FALSE)
usr.say(message)
/mob/verb/me_verb(message as message)
set name = "Me"
set category = "IC"
if(say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<font color='red'>Speech is currently admin-disabled.</font>")
to_chat(usr, SPAN_WARNING("Speech is currently admin-disabled."))
return
message = sanitize(message)
set_typing_indicator(FALSE)
if(use_me)
custom_emote(usr.emote_type, message)
else
usr.emote(message)
/mob/proc/say_dead(var/message)
if(say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
-59
View File
@@ -1,59 +0,0 @@
/proc/generate_speech_bubble(var/bubble_loc, var/speech_state, var/set_layer = FLOAT_LAYER)
var/image/I = image('icons/mob/talk.dmi', bubble_loc, speech_state, set_layer)
I.appearance_flags |= (KEEP_APART|RESET_COLOR|PIXEL_SCALE)
if(istype(bubble_loc, /atom/movable))
var/atom/movable/AM = bubble_loc
var/x_scale = AM.get_icon_scale_x()
if(abs(x_scale) < 2) // reset transform on bubbles, except for the Very Large
I.pixel_z = (AM.icon_expected_height * (x_scale-1))
I.appearance_flags |= RESET_TRANSFORM
return I
/mob/proc/init_typing_indicator(var/set_state = "typing")
typing_indicator = new
typing_indicator.appearance = generate_speech_bubble(null, set_state)
typing_indicator.appearance_flags |= (KEEP_APART|RESET_COLOR|RESET_TRANSFORM|PIXEL_SCALE)
/mob/proc/set_typing_indicator(var/state) //Leaving this here for mobs.
if(!is_preference_enabled(/datum/client_preference/show_typing_indicator))
if(typing_indicator)
cut_overlay(typing_indicator, TRUE)
return
if(!typing_indicator)
init_typing_indicator("[speech_bubble_appearance()]_typing")
if(state && !typing)
add_overlay(typing_indicator, TRUE)
typing = TRUE
else if(typing)
cut_overlay(typing_indicator, TRUE)
typing = FALSE
if(shadow) //Multi-Z above-me shadows
shadow.set_typing_indicator(state)
return state
/mob/verb/say_wrapper()
set name = ".Say"
set hidden = 1
set_typing_indicator(TRUE)
var/message = input("","say (text)") as text
set_typing_indicator(FALSE)
if(message)
say_verb(message)
/mob/verb/me_wrapper()
set name = ".Me"
set hidden = 1
set_typing_indicator(TRUE)
var/message = input("","me (text)") as text
set_typing_indicator(FALSE)
if(message)
me_verb(message)