mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
* SPECIES NUKING 2023 EXTRA: Makes skin tones a trait instead of a species variable (#76410) very similar to https://github.com/tgstation/tgstation/pull/76297, much simpler though removes the uses_skintones variable for similar reasons 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. not player facing * Fixes all of the remaining issues --------- Co-authored-by: ChungusGamer666 <82850673+ChungusGamer666@users.noreply.github.com>
31 lines
827 B
Plaintext
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
|