From 9fb18f8b9f21eb6d70458604e52367b0f294365a Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Tue, 6 Oct 2020 22:34:17 +0100 Subject: [PATCH 1/9] language tab --- code/_globalvars/lists/flavor_misc.dm | 11 ++++ code/modules/client/preferences.dm | 61 ++++++++++++++++----- code/modules/client/preferences_savefile.dm | 3 + code/modules/language/draconic.dm | 1 + code/modules/language/dwarven.dm | 3 +- code/modules/language/language.dm | 2 + code/modules/language/monkey.dm | 1 + code/modules/language/mushroom.dm | 1 + code/modules/language/slime.dm | 1 + code/modules/language/sylvan.dm | 1 + code/modules/language/voltaic.dm | 1 + 11 files changed, 72 insertions(+), 14 deletions(-) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index ae0f5201f9..ab1379956d 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -271,6 +271,17 @@ GLOBAL_LIST_INIT(speech_verbs, list("default","says","gibbers", "states", "chitt GLOBAL_LIST_INIT(roundstart_tongues, list("default","human tongue" = /obj/item/organ/tongue, "lizard tongue" = /obj/item/organ/tongue/lizard, "skeleton tongue" = /obj/item/organ/tongue/bone, "fly tongue" = /obj/item/organ/tongue/fly, "ipc tongue" = /obj/item/organ/tongue/robot/ipc)) +/proc/get_roundstart_languages() + var/list/languages = subtypesof(/datum/language) + var/list/roundstart_languages = list("None") //default option for the list + for(var/some_language in languages) + var/datum/language/language = some_language + if(initial(language.chooseable_roundstart)) + roundstart_languages[initial(language.name)] = some_language + return roundstart_languages + +GLOBAL_LIST_INIT(roundstart_languages, get_roundstart_languages()) + //locked parts are those that your picked species requires to have //unlocked parts are those that anyone can choose on customisation regardless //parts not in unlocked, but in all, are thus locked diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 9eae46c1f3..01ad5757da 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -166,6 +166,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) ) var/custom_speech_verb = "default" //if your say_mod is to be something other than your races var/custom_tongue = "default" //if your tongue is to be something other than your races + var/additional_language = "None" //additional language your character has var/modified_limbs = list() //prosthetic/amputated limbs var/chosen_limb_id //body sprite selected to load for the users limbs, null means default, is sanitized when loaded @@ -292,10 +293,11 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Character Settings" dat += "Character Appearance" - dat += "Loadout" + dat += "Character Speech" + dat += "Loadout" dat += "Game Preferences" - dat += "Content Preferences" - dat += "Keybindings" + dat += "Content Preferences" + dat += "Keybindings" if(!path) dat += "
"
+ dat += "Speech preferences" + dat += "Custom Speech Verb:" + dat += "[custom_speech_verb] " + dat += "Custom Tongue: " + dat += "[custom_tongue] " + dat += "Additional Language " + dat += "[additional_language] " + dat += " | "
+ dat += "
"
dat += "General Settings" @@ -795,7 +820,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "" - if(3) + if(4) dat += "
" - if(5) // Custom keybindings + if(6) // Custom keybindings dat += "Keybindings: [(hotkeys) ? "Hotkeys" : "Input"] " dat += "Keybindings mode controls how the game behaves with tab and map/input focus. If it is on Hotkeys, the game will always attempt to force you to map focus, meaning keypresses are sent \ directly to the map instead of the input. You will still be able to use the command bar, but you need to tab to do it every time you click on the game map. \ @@ -2191,11 +2216,17 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/selected_custom_tongue = input(user, "Choose your desired tongue (none means your species tongue)", "Character Preference") as null|anything in GLOB.roundstart_tongues if(selected_custom_tongue) custom_tongue = selected_custom_tongue + if("speech_verb") var/selected_custom_speech_verb = input(user, "Choose your desired speech verb (none means your species speech verb)", "Character Preference") as null|anything in GLOB.speech_verbs if(selected_custom_speech_verb) custom_speech_verb = selected_custom_speech_verb + if("language") + var/selected_language = input(user, "Choose your desired additional language", "Character Preference") as null|anything in GLOB.roundstart_languages + if(selected_language) + additional_language = selected_language + if("bodysprite") var/selected_body_sprite = input(user, "Choose your desired body sprite", "Character Preference") as null|anything in pref_species.allowed_limb_ids if(selected_body_sprite) @@ -2636,6 +2667,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) new_custom_tongue.Insert(character) if(custom_speech_verb != "default") character.dna.species.say_mod = custom_speech_verb + if(additional_language && additional_language != "None") + var/language_entry = GLOB.roundstart_languages[additional_language] + if(language_entry) + character.grant_language(language_entry, TRUE, TRUE) //limb stuff, only done when initially spawning in if(initial_spawn) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index fb1178fd8e..4ab81555e4 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -526,6 +526,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["uplink_loc"] >> uplink_spawn_loc S["custom_speech_verb"] >> custom_speech_verb S["custom_tongue"] >> custom_tongue + S["additional_language"] >> additional_language S["feature_mcolor"] >> features["mcolor"] S["feature_lizard_tail"] >> features["tail_lizard"] S["feature_lizard_snout"] >> features["snout"] @@ -764,6 +765,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car custom_speech_verb = sanitize_inlist(custom_speech_verb, GLOB.speech_verbs, "default") custom_tongue = sanitize_inlist(custom_tongue, GLOB.roundstart_tongues, "default") + additional_language = sanitize_inlist(additional_language, GLOB.roundstart_languages, "None") security_records = copytext(security_records, 1, MAX_FLAVOR_LEN) medical_records = copytext(medical_records, 1, MAX_FLAVOR_LEN) @@ -840,6 +842,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["species"] , pref_species.id) WRITE_FILE(S["custom_speech_verb"] , custom_speech_verb) WRITE_FILE(S["custom_tongue"] , custom_tongue) + WRITE_FILE(S["additional_language"] , additional_language) // records WRITE_FILE(S["security_records"] , security_records) diff --git a/code/modules/language/draconic.dm b/code/modules/language/draconic.dm index aaa998c2c0..ed72252773 100644 --- a/code/modules/language/draconic.dm +++ b/code/modules/language/draconic.dm @@ -18,3 +18,4 @@ ) icon_state = "lizard" default_priority = 90 + chooseable_roundstart = TRUE diff --git a/code/modules/language/dwarven.dm b/code/modules/language/dwarven.dm index fe2df478f9..aded22cd6f 100644 --- a/code/modules/language/dwarven.dm +++ b/code/modules/language/dwarven.dm @@ -10,4 +10,5 @@ syllables = list("kulet", "alak", "bidok", "nicol", "anam", "gatal", "mabdug", "zustash", "sedil", "ustos", "emr", "izeg", "beming", "gost", "ntak", "tosid", "feb", "berim", "ibruk", "ermis", "thoth", "thatthil", "gistang", "libash", "lakish", "asdos", "roder", "nel", "biban", "ugog", "ish", "robek", "olmul", "nokzam", "emuth", "fer", "uvel", "dolush", "ag^k", "ucat", "ng rak", "enir", "ugath", "lisig", "etg", "erong", "osed", "lanlar", "udir", "tarmid", "s krith", "nural", "bugsud", "okag", "nazush", "nashon", "ftrid", "en''r", "dstik", "kogan", "ingish", "dudgoth", "stalk*b", "themor", "murak", "altth", "osod", "thcekut", "cog", "selsten", "egdoth", "othsin", "idek", "st", "suthmam", "im", "okab", "onlnl", "gasol", "tegir", "nam...sh", "noval", "shalig", "shin", "lek", ",,kim", "kfkdal", "stum,,m", "alud", "olom", "%lot", "rozsed", "thos", "okon", "n " dat += "Age: [age] " - dat += "Language: [choselanguage] " dat += "Special Names: " var/old_group @@ -2347,28 +2344,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) features["body_model"] = chosengender gender = chosengender - if("language") - choselanguage = input(user, "Select a language.", "Language", language) as null|anything in list("Beachtongue","Draconic","Dwarven", - "Chimpanzee","Space Sign Language","Random") - if(!choselanguage) - return - switch(choselanguage) - if("Rachidian") - language = /datum/language/arachnid - if("Beachtongue") - language = /datum/language/beachbum - if("Draconic") - language = /datum/language/draconic - if("Dwarven") - language = /datum/language/dwarf - if("Chimpanzee") - language = /datum/language/monkey - if("Space Sign Language") - language = /datum/language/signlanguage - if("Random") - language = pick(list("Rachidian", "Beachtongue","Draconic","Dwarven", - "Chimpanzee","Space Sign Language")) - if("body_size") var/new_body_size = input(user, "Choose your desired sprite size: (90-125%)\nWarning: This may make your character look distorted. Additionally, any size under 100% takes a 10% maximum health penalty", "Character Preference", features["body_size"]*100) as num|null if(new_body_size) From fa765ec4c33ef461b65f9f9d9bd349796747dca8 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Mon, 1 Mar 2021 20:58:21 +0000 Subject: [PATCH 6/9] nope --- code/datums/traits/good.dm | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm index 659149a123..23fd75f982 100644 --- a/code/datums/traits/good.dm +++ b/code/datums/traits/good.dm @@ -219,19 +219,3 @@ /datum/quirk/night_vision/on_spawn() var/mob/living/carbon/human/H = quirk_holder H.update_sight() - -/datum/quirk/multilingual - name = "Multi-Lingual" - desc = "You spent a portion of your life learning to understand an additional language. You may or may not be able to speak it based on your anatomy." - value = 1 - mob_trait = TRAIT_MULTILINGUAL - gain_text = "You've learned an extra language!" - lose_text = "You've forgotten your extra language." - -/datum/quirk/multilingual/post_add() - var/mob/living/carbon/human/H = quirk_holder - H.grant_language(H.client.prefs.language, TRUE, TRUE, LANGUAGE_MULTILINGUAL) - -/datum/quirk/multilingual/remove() - var/mob/living/carbon/human/H = quirk_holder - H.remove_language(H.client.prefs.language, TRUE, TRUE, LANGUAGE_MULTILINGUAL) From 9c3f7cbad6443c571d9de6c4f786050d23a12a1a Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Mon, 1 Mar 2021 21:05:32 +0000 Subject: [PATCH 7/9] no --- code/modules/client/preferences_savefile.dm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 2babebdf36..812e8c4821 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -604,8 +604,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["body_model"] >> features["body_model"] S["body_size"] >> features["body_size"] S["age"] >> age - S["language"] >> language - S["choselanguage"] >> choselanguage S["hair_color"] >> hair_color S["facial_hair_color"] >> facial_hair_color S["eye_type"] >> eye_type @@ -966,8 +964,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["body_model"] , features["body_model"]) WRITE_FILE(S["body_size"] , features["body_size"]) WRITE_FILE(S["age"] , age) - WRITE_FILE(S["language"] , language) - WRITE_FILE(S["choselanguage"] , choselanguage) WRITE_FILE(S["hair_color"] , hair_color) WRITE_FILE(S["facial_hair_color"] , facial_hair_color) WRITE_FILE(S["eye_type"] , eye_type) From 03883183adf0bfd67f343718697ae46b64d9e12a Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Mon, 1 Mar 2021 21:12:08 +0000 Subject: [PATCH 8/9] make arachnid available roundstart --- code/modules/language/arachnid.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/language/arachnid.dm b/code/modules/language/arachnid.dm index 92ea47781e..d021e5a35b 100644 --- a/code/modules/language/arachnid.dm +++ b/code/modules/language/arachnid.dm @@ -9,6 +9,7 @@ flags = NO_STUTTER | LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD icon_state = "arachnid" + chooseable_roundstart = TRUE /datum/language/arachnid/scramble(input) . = prob(65) ? "wiff" : "thump" From 818d1cbec6170890b3b867da5752f039e1bb26c5 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Sun, 14 Mar 2021 22:43:48 +0000 Subject: [PATCH 9/9] forgive me linters for i have sinned --- code/modules/language/mushroom.dm | 2 +- code/modules/language/slime.dm | 2 +- code/modules/language/sylvan.dm | 2 +- code/modules/language/voltaic.dm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/language/mushroom.dm b/code/modules/language/mushroom.dm index 5b07b96503..038ee0f905 100644 --- a/code/modules/language/mushroom.dm +++ b/code/modules/language/mushroom.dm @@ -9,4 +9,4 @@ sentence_chance = 0 default_priority = 80 syllables = list("poof", "pff", "pFfF", "piff", "puff", "pooof", "pfffff", "piffpiff", "puffpuff", "poofpoof", "pifpafpofpuf") - chooseable_roundstart = TRUE \ No newline at end of file + chooseable_roundstart = TRUE diff --git a/code/modules/language/slime.dm b/code/modules/language/slime.dm index 1daa27f667..6b7b1c366d 100644 --- a/code/modules/language/slime.dm +++ b/code/modules/language/slime.dm @@ -10,4 +10,4 @@ default_priority = 70 icon_state = "slime" - chooseable_roundstart = TRUE \ No newline at end of file + chooseable_roundstart = TRUE diff --git a/code/modules/language/sylvan.dm b/code/modules/language/sylvan.dm index b1ecd31bd8..a1ac6725b9 100644 --- a/code/modules/language/sylvan.dm +++ b/code/modules/language/sylvan.dm @@ -16,4 +16,4 @@ ) icon_state = "plant" default_priority = 90 - chooseable_roundstart = TRUE \ No newline at end of file + chooseable_roundstart = TRUE diff --git a/code/modules/language/voltaic.dm b/code/modules/language/voltaic.dm index c48b270f16..9a64f56889 100644 --- a/code/modules/language/voltaic.dm +++ b/code/modules/language/voltaic.dm @@ -12,4 +12,4 @@ ) icon_state = "volt" default_priority = 90 - chooseable_roundstart = TRUE \ No newline at end of file + chooseable_roundstart = TRUE | ||||||||||