From 2200c690f76bf9bf22bb992e23e7d259dad96261 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Thu, 16 Apr 2020 18:44:05 +0200 Subject: [PATCH] configs --- code/controllers/configuration/entries/game_options.dm | 4 ++++ code/game/objects/structures/mirror.dm | 5 ++++- code/modules/client/preferences.dm | 4 +++- code/modules/client/preferences_savefile.dm | 2 +- config/game_options.txt | 5 ++++- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index f11093cba7..cb18d37f21 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -473,3 +473,7 @@ /datum/config_entry/number/body_size_slowdown_multiplier config_entry_value = 0.25 min_val = 0.1 //To encourage folks to disable the slowdown through the above config instead. + +//Allows players to set a hexadecimal color of their choice as skin tone, on top of the standard ones. +/datum/config_entry/number/allow_custom_skintones + config_entry_value = 1 diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 5892574711..be783f387e 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -158,7 +158,10 @@ H.set_species(newrace, icon_update=0) if(H.dna.species.use_skintones) - var/new_s_tone = input(H, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones + "custom" + var/list/choices = GLOB.skin_tones + if(CONFIG_GET(number/allow_custom_skintones)) + choices += "custom" + var/new_s_tone = input(H, "Choose your skin tone:", "Race change") as null|anything in choices if(new_s_tone) if(new_s_tone == "custom") var/default = H.dna.skin_tone_override || null diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 45c10b6633..d44b2ffa04 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1836,7 +1836,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) features["insect_markings"] = new_insect_markings if("s_tone") - var/list/choices = GLOB.skin_tones - GLOB.nonstandard_skin_tones + "custom" + var/list/choices = GLOB.skin_tones - GLOB.nonstandard_skin_tones + if(CONFIG_GET(number/allow_custom_skintones)) + choices += "custom" var/new_s_tone = input(user, "Choose your character's skin tone:", "Character Preference") as null|anything in choices if(new_s_tone) if(new_s_tone == "custom") diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 06f2559722..6d99ef63aa 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -550,7 +550,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car facial_hair_color = sanitize_hexcolor(facial_hair_color, 3, 0) eye_color = sanitize_hexcolor(eye_color, 3, 0) use_custom_skin_tone = sanitize_integer(use_custom_skin_tone, FALSE, TRUE, initial(use_custom_skin_tone)) - if(use_custom_skin_tone) + if(use_custom_skin_tone && CONFIG_GET(number/allow_custom_skintones)) skin_tone = sanitize_hexcolor(skin_tone, 6, TRUE, "#FFFFFF") else skin_tone = sanitize_inlist(skin_tone, GLOB.skin_tones - GLOB.nonstandard_skin_tones, initial(skin_tone)) diff --git a/config/game_options.txt b/config/game_options.txt index 8c48ac6ede..3253e37a8e 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -632,4 +632,7 @@ THRESHOLD_BODY_SIZE_SLOWDOWN 0.85 ## Multiplier used in the smaller strides slowdown calculation. ## Doesn't apply to floating or crawling mobs. -BODY_SIZE_SLOWDOWN_MULTIPLIER 0.25 \ No newline at end of file +BODY_SIZE_SLOWDOWN_MULTIPLIER 0.25 + +## Allows players to set a hexadecimal color of their choice as skin tone, on top of the standard ones. +ALLOW_CUSTOM_SKINTONES \ No newline at end of file