mirror of
https://github.com/Skyrat-SS13/Skyrat-tg.git
synced 2026-08-23 12:59:21 +01:00
3591 individual conflicts Update build.js Update install_node.sh Update byond.js oh my fucking god hat slow huh holy shit we all fall down 2 more I missed 2900 individual conflicts 2700 Individual conflicts replaces yarn file with tg version, bumping us down to 2200-ish Down to 2000 individual conflicts 140 down mmm aaaaaaaaaaaaaaaaaaa not yt 575 soon 900 individual conflicts 600 individual conflicts, 121 file conflicts im not okay 160 across 19 files 29 in 4 files 0 conflicts, compiletime fix time some minor incap stuff missed ticks weird dupe definition stuff missed ticks 2 incap fixes undefs and pie fix Radio update and some extra minor stuff returns a single override no more dupe definitions, 175 compiletime errors Unticked file fix sound and emote stuff honk and more radio stuff
105 lines
3.0 KiB
Plaintext
105 lines
3.0 KiB
Plaintext
/**
|
|
* Alters text when players are injured.
|
|
* Adds text, trims left and right side
|
|
*
|
|
* Arguments:
|
|
* payload - a string list containing entry & channel
|
|
* Returns:
|
|
* string - the altered entry
|
|
*/
|
|
/datum/tgui_say/proc/alter_entry(payload)
|
|
var/entry = payload["entry"]
|
|
/// No OOC leaks
|
|
if(!entry || payload["channel"] == OOC_CHANNEL || payload["channel"] == ME_CHANNEL || payload["channel"] == LOOC_CHANNEL) // SKYRAT EDIT CHANGE - CUSTOMIZATION
|
|
return pick(hurt_phrases)
|
|
/// Random trimming for larger sentences
|
|
if(length(entry) > 50)
|
|
entry = trim(entry, rand(40, 50))
|
|
else
|
|
/// Otherwise limit trim to just last letter
|
|
if(length(entry) > 1)
|
|
entry = trim(entry, length(entry))
|
|
return entry + "-" + pick(hurt_phrases)
|
|
|
|
/**
|
|
* Delegates the speech to the proper channel.
|
|
*
|
|
* Arguments:
|
|
* entry - the text to broadcast
|
|
* channel - the channel to broadcast in
|
|
* Returns:
|
|
* boolean - on success or failure
|
|
*/
|
|
/datum/tgui_say/proc/delegate_speech(entry, channel)
|
|
switch(channel)
|
|
if(SAY_CHANNEL)
|
|
client.mob.say_verb(entry)
|
|
return TRUE
|
|
if(RADIO_CHANNEL)
|
|
client.mob.say_verb(";" + entry)
|
|
return TRUE
|
|
if(ME_CHANNEL)
|
|
client.mob.me_verb(entry)
|
|
return TRUE
|
|
if(OOC_CHANNEL)
|
|
client.ooc(entry)
|
|
return TRUE
|
|
if(ADMIN_CHANNEL)
|
|
SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/cmd_admin_say, entry)
|
|
return TRUE
|
|
// SKYRAT EDIT ADDITION START - CUSTOMIZATION
|
|
if(LOOC_CHANNEL)
|
|
client.looc(entry)
|
|
return TRUE
|
|
if(WHIS_CHANNEL)
|
|
client.mob.whisper_verb(entry)
|
|
return TRUE
|
|
// SKYRAT EDIT ADDITION END
|
|
return FALSE
|
|
|
|
/**
|
|
* Force say handler.
|
|
* Sends a message to the say modal to send its current value.
|
|
*/
|
|
/datum/tgui_say/proc/force_say()
|
|
window.send_message("force")
|
|
stop_typing()
|
|
|
|
/**
|
|
* Makes the player force say what's in their current input box.
|
|
*/
|
|
/mob/living/carbon/human/proc/force_say()
|
|
if(stat != CONSCIOUS || !client?.tgui_say?.window_open)
|
|
return FALSE
|
|
client.tgui_say.force_say()
|
|
if(client.typing_indicators)
|
|
log_speech_indicators("[key_name(client)] FORCED to stop typing, indicators enabled.")
|
|
else
|
|
log_speech_indicators("[key_name(client)] FORCED to stop typing, indicators DISABLED.")
|
|
SEND_SIGNAL(src, COMSIG_HUMAN_FORCESAY)
|
|
|
|
/**
|
|
* Handles text entry and forced speech.
|
|
*
|
|
* Arguments:
|
|
* type - a string "entry" or "force" based on how this function is called
|
|
* payload - a string list containing entry & channel
|
|
* Returns:
|
|
* boolean - success or failure
|
|
*/
|
|
/datum/tgui_say/proc/handle_entry(type, payload)
|
|
if(!payload?["channel"] || !payload["entry"])
|
|
CRASH("[usr] entered in a null payload to the chat window.")
|
|
if(length(payload["entry"]) > max_length)
|
|
CRASH("[usr] has entered more characters than allowed into a TGUI-Say")
|
|
if(type == "entry")
|
|
delegate_speech(payload["entry"], payload["channel"])
|
|
return TRUE
|
|
if(type == "force")
|
|
var/target_channel = payload["channel"]
|
|
if(target_channel == ME_CHANNEL || target_channel == OOC_CHANNEL)
|
|
target_channel = SAY_CHANNEL // No ooc leaks
|
|
delegate_speech(alter_entry(payload), target_channel)
|
|
return TRUE
|
|
return FALSE
|