mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Fix Tongue Based Speech Modifiers Being Applied To Users Native Languages (#84952)
## About The Pull Request This change allows tongue based speech modifications to be ignored if the user is speaking in a native language or using hand signs, putting it back to where it was functionally before moving to speechmod components. ## Why It's Good For The Game This is correcting some of the speaking code to how it was working prior to speechmods, meaning lizard people won't be elongating there s's in draconic. Fly people are the other species with a tongue based speech modifier and receive the same fix. This also corrects tongue based speech mods getting applied to sign language. Speech modifiers are still applied if the user is talking in a non-native language, same as it was pre speechmod. Before:  After:  ## Changelog 🆑 fix: fixing speech modifiers being applied to a tongue's native languages. /🆑 --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
co-authored by
Ghom
parent
18bac0aaf2
commit
e78ab9e59a
@@ -13,8 +13,10 @@
|
||||
var/slots
|
||||
/// If set to true, turns all text to uppercase
|
||||
var/uppercase = FALSE
|
||||
/// Any additional checks that we should do before applying the speech modification
|
||||
var/datum/callback/should_modify_speech = null
|
||||
|
||||
/datum/component/speechmod/Initialize(replacements = list(), end_string = "", end_string_chance = 100, slots, uppercase = FALSE)
|
||||
/datum/component/speechmod/Initialize(replacements = list(), end_string = "", end_string_chance = 100, slots, uppercase = FALSE, should_modify_speech)
|
||||
if (!ismob(parent) && !isitem(parent) && !istype(parent, /datum/mutation/human))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
@@ -23,6 +25,7 @@
|
||||
src.end_string_chance = end_string_chance
|
||||
src.slots = slots
|
||||
src.uppercase = uppercase
|
||||
src.should_modify_speech = should_modify_speech
|
||||
|
||||
if (istype(parent, /datum/mutation/human))
|
||||
RegisterSignal(parent, COMSIG_MUTATION_GAINED, PROC_REF(on_mutation_gained))
|
||||
@@ -51,6 +54,8 @@
|
||||
var/message = speech_args[SPEECH_MESSAGE]
|
||||
if(message[1] == "*")
|
||||
return
|
||||
if(!isnull(should_modify_speech) && !should_modify_speech.Invoke(source, speech_args))
|
||||
return
|
||||
|
||||
for (var/to_replace in replacements)
|
||||
var/replacement = replacements[to_replace]
|
||||
@@ -123,3 +128,7 @@
|
||||
return
|
||||
UnregisterSignal(targeted, COMSIG_MOB_SAY)
|
||||
targeted = null
|
||||
|
||||
/datum/component/speechmod/Destroy()
|
||||
should_modify_speech = null
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user