Files
Bubberstation/code/modules/client/preferences/skin_tone.dm
T
ChungusGamer666andGitHub 9e8f8dc877 SPECIES NUKING 2023 EXTRA: Makes skin tones a trait instead of a species variable (#76410)
## About The Pull Request

very similar to https://github.com/tgstation/tgstation/pull/76297, much
simpler though
removes the uses_skintones variable for similar reasons

## Why It's Good For The Game

Species variables are less useful and modular than traits. 
If for some reason we ever add a mechanic that for some reason makes
your character use skin tones instead of whatever their original color
is, it will be much simpler to be handled.

## Changelog

not player facing
2023-07-03 20:44:46 +02:00

31 lines
827 B
Plaintext

/datum/preference/choiced/skin_tone
savefile_key = "skin_tone"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
relevant_inherent_trait = TRAIT_USES_SKINTONES
/datum/preference/choiced/skin_tone/init_possible_values()
return GLOB.skin_tones
/datum/preference/choiced/skin_tone/compile_constant_data()
var/list/data = ..()
data[CHOICED_PREFERENCE_DISPLAY_NAMES] = GLOB.skin_tone_names
var/list/to_hex = list()
for (var/choice in get_choices())
var/hex_value = skintone2hex(choice)
var/list/hsl = rgb2num(hex_value, COLORSPACE_HSL)
to_hex[choice] = list(
"lightness" = hsl[3],
"value" = hex_value,
)
data["to_hex"] = to_hex
return data
/datum/preference/choiced/skin_tone/apply_to_human(mob/living/carbon/human/target, value)
target.skin_tone = value