From 591b1bcf1c57ae9ae36e7e60d8fd514dfa475c7f Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 7 Jun 2024 07:02:06 +0200 Subject: [PATCH] [MIRROR] Blindfold Color Preference (#28032) * Blindfold Color Preference (#83670) ## About The Pull Request When selecting the Blindness quirk, you now have the option to choose a specific color for the blindfold much like how the tagger quirk handles spray can color preference. The blindfolds used to always take a blend RGB of both eye colors and apply it to the blindfold, now it _should_ only do that if you have the blind-personnel blindfold directly spawned on your eyes. If not, then it just handles it like how it did before this PR was submitted, and mobs generally shouldn't have the blind-personnel blindfold if they aren't blind anyways. ![IFcWtAQ](https://github.com/tgstation/tgstation/assets/125638858/0320edb0-2963-4e94-8da1-2136dadd6d14) ## Why It's Good For The Game While it isn't a big deal if your eye color matches the blindfold, some players (like a certain someone I know) would rather have their eye color be distinct, as such if you have a blue eye color on both eyes but want a purple or red blindfold, you don't have to go out of your way to paint it, which generally wouldn't work the way you'd want it to. In other words, it allows you to customize your character with more freedom, but only applies to those who willingly choose to suffer in the game. Being blind is fun! =) ## Changelog :cl: add: You may choose a color preference for your blindfold with the blindness quirk. /:cl: * Blindfold Color Preference --------- Co-authored-by: IsaacExists <125638858+IsaacExists@users.noreply.github.com> --- code/datums/quirks/negative_quirks/blindness.dm | 9 ++++++++- code/modules/client/preferences/blindfold_color.dm | 14 ++++++++++++++ tgstation.dme | 1 + .../character_preferences/blindfold_color.tsx | 6 ++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 code/modules/client/preferences/blindfold_color.dm create mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/blindfold_color.tsx diff --git a/code/datums/quirks/negative_quirks/blindness.dm b/code/datums/quirks/negative_quirks/blindness.dm index ce57e946fe9..d0af915dc32 100644 --- a/code/datums/quirks/negative_quirks/blindness.dm +++ b/code/datums/quirks/negative_quirks/blindness.dm @@ -10,8 +10,15 @@ quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_CHANGES_APPEARANCE mail_goodies = list(/obj/item/clothing/glasses/sunglasses, /obj/item/cane/white) +/datum/quirk_constant_data/blindfoldcolor + associated_typepath = /datum/quirk/item_quirk/blindness + customization_options = list(/datum/preference/color/blindfold_color) + /datum/quirk/item_quirk/blindness/add_unique(client/client_source) - give_item_to_holder(/obj/item/clothing/glasses/blindfold/white, list(LOCATION_EYES = ITEM_SLOT_EYES, LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS)) + var/obj/item/clothing/glasses/blindfold/white/blindfold = new + blindfold.add_atom_colour(client_source?.prefs.read_preference(/datum/preference/color/blindfold_color), FIXED_COLOUR_PRIORITY) + blindfold.colored_before = TRUE + give_item_to_holder(blindfold, list(LOCATION_EYES = ITEM_SLOT_EYES, LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS)) /datum/quirk/item_quirk/blindness/add(client/client_source) quirk_holder.become_blind(QUIRK_TRAIT) diff --git a/code/modules/client/preferences/blindfold_color.dm b/code/modules/client/preferences/blindfold_color.dm new file mode 100644 index 00000000000..9e6504579ac --- /dev/null +++ b/code/modules/client/preferences/blindfold_color.dm @@ -0,0 +1,14 @@ +/// Preference for the roundstart color of the blindfold given by the Blindness quirk. +/datum/preference/color/blindfold_color + category = PREFERENCE_CATEGORY_MANUALLY_RENDERED + savefile_key = "blindfold_color" + savefile_identifier = PREFERENCE_CHARACTER + +/datum/preference/color/blindfold_color/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + return /datum/quirk/item_quirk/blindness::name in preferences.all_quirks + +/datum/preference/color/blindfold_color/apply_to_human(mob/living/carbon/human/target, value) + return diff --git a/tgstation.dme b/tgstation.dme index 16f42519197..ab7fc8ab729 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3759,6 +3759,7 @@ #include "code\modules\client\preferences\ambient_occlusion.dm" #include "code\modules\client\preferences\assets.dm" #include "code\modules\client\preferences\auto_fit_viewport.dm" +#include "code\modules\client\preferences\blindfold_color.dm" #include "code\modules\client\preferences\body_type.dm" #include "code\modules\client\preferences\broadcast_login_logout.dm" #include "code\modules\client\preferences\clothing.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/blindfold_color.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/blindfold_color.tsx new file mode 100644 index 00000000000..8a59ced57a8 --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/blindfold_color.tsx @@ -0,0 +1,6 @@ +import { Feature, FeatureColorInput } from '../base'; + +export const blindfold_color: Feature = { + name: 'Blindfold color', + component: FeatureColorInput, +};