mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-18 22:22:09 +00:00
* Port ParadiseSS13/Paradise#2100 - Saycode refactor * Removed unused old carbon slimes code * Port ParadiseSS13/Paradise#5099 - Saycode part 2 * Ported ParadiseSS13/Paradise#7170's /datum/browser Check Known Languages * Port ParadiseSS13/Paradise#9240 - Get rid of alt_name in favor of GetAltName() * Port ParadiseSS13/Paradise#10330 - You can now use multiple languages in one message * Addressed Atermonera's review. Translators now print the full message if they find any languages within the message that the user doesn't understand, minus languages it cannot translate. Additionally, the combine_message proc has been significantly simplified by eliminating an ugly tree structure with the help of a little helper proc. The removal of the extra span inside each piece doesn't seem to have visually changed the messages in any other way than changing where the wordwrap happens, strangely enough. Must be something in IE's code being picky about invisible elements. On the bright side, it splits *later* than it did before, thus reducing the lines a message will take up by a tiny amount. Also, a bunch of things now have the 'filter_say' class from PolarisSS13/Polaris#6998. Since span classes with no definition are totally valid and just don't do anything, this PR does **not** depend on that PR being merged first. * Always gotta be one
37 lines
1.6 KiB
Plaintext
37 lines
1.6 KiB
Plaintext
/mob/living
|
|
var/datum/language/default_language
|
|
|
|
/mob/living/verb/set_default_language(language as null|anything in languages)
|
|
set name = "Set Default Language"
|
|
set category = "IC"
|
|
|
|
if (only_species_language && language != GLOB.all_languages[src.species_language])
|
|
to_chat(src, "<span class='notice'>You can only speak your species language, [src.species_language].</span>")
|
|
return 0
|
|
|
|
if(language == GLOB.all_languages[src.species_language])
|
|
to_chat(src, "<span class='notice'>You will now speak your standard default language, [language ? language : "common"], if you do not specify a language when speaking.</span>")
|
|
else if (language)
|
|
|
|
if(language && !can_speak(language))
|
|
to_chat(src, "<span class='notice'>You are unable to speak that language.</span>")
|
|
return
|
|
|
|
to_chat(src, "<span class='notice'>You will now speak [language] if you do not specify a language when speaking.</span>")
|
|
else
|
|
to_chat(src, "<span class='notice'>You will now speak whatever your standard default language is if you do not specify one when speaking.</span>")
|
|
default_language = language
|
|
|
|
// Silicons can't neccessarily speak everything in their languages list
|
|
/mob/living/silicon/set_default_language(language as null|anything in speech_synthesizer_langs)
|
|
..()
|
|
|
|
/mob/living/verb/check_default_language()
|
|
set name = "Check Default Language"
|
|
set category = "IC"
|
|
|
|
if(default_language)
|
|
to_chat(src, "<span class='notice'>You are currently speaking [default_language] by default.</span>")
|
|
else
|
|
to_chat(src, "<span class='notice'>Your current default language is your species or mob type default.</span>")
|