diff --git a/code/modules/surgery/organs/internal/eyes/_eyes.dm b/code/modules/surgery/organs/internal/eyes/_eyes.dm index 76f336aa184..3dab5ef3190 100644 --- a/code/modules/surgery/organs/internal/eyes/_eyes.dm +++ b/code/modules/surgery/organs/internal/eyes/_eyes.dm @@ -68,6 +68,11 @@ /// do these eyes have pupils (or equivalent) that react to light when penlighted. var/light_reactive = TRUE + //BUBBER EDIT BEGIN + ///This enables alpha values for eyes, adjusted using preferences + var/eyes_opacity = 255 + //BUBBER EDIT END + /obj/item/organ/eyes/Initialize(mapload) . = ..() if (blink_animation) @@ -130,9 +135,11 @@ if(CONFIG_GET(flag/native_fov) && native_fov) affected_human.add_fov_trait(type, native_fov) - // BUBBER EDIT ADDITION - EMISSIVES + // BUBBER EDIT ADDITION - EMISSIVES AND OPACITY if (affected_human.emissive_eyes) is_emissive = TRUE + if(affected_human.client && affected_human.client.prefs) + eyes_opacity = affected_human.client.prefs.read_preference(/datum/preference/numeric/eyes_opacity) // BUBBER EDIT END if(call_update) @@ -298,9 +305,9 @@ if(isnull(eye_icon_state)) return list() - - var/mutable_appearance/eye_left = mutable_appearance(eye_icon, "[eye_icon_state]_l", -EYES_LAYER, parent) - var/mutable_appearance/eye_right = mutable_appearance(eye_icon, "[eye_icon_state]_r", -EYES_LAYER, parent) + //BUBBER EDIT BEGIN - EYES OPACITY + var/mutable_appearance/eye_left = mutable_appearance(eye_icon, "[eye_icon_state]_l", -EYES_LAYER, parent, alpha = eyes_opacity) + var/mutable_appearance/eye_right = mutable_appearance(eye_icon, "[eye_icon_state]_r", -EYES_LAYER, parent, alpha = eyes_opacity) var/list/overlays = list(eye_left, eye_right) if(!(parent.obscured_slots & HIDEEYES)) @@ -319,23 +326,23 @@ overlays += eyelids if (scarring & RIGHT_EYE_SCAR) - var/mutable_appearance/right_scar = mutable_appearance('icons/mob/human/human_eyes.dmi', "eye_scar_right", -EYES_LAYER, parent) + var/mutable_appearance/right_scar = mutable_appearance('icons/mob/human/human_eyes.dmi', "eye_scar_right", -EYES_LAYER, parent, alpha = eyes_opacity) right_scar.color = my_head.draw_color overlays += right_scar if (scarring & LEFT_EYE_SCAR) - var/mutable_appearance/left_scar = mutable_appearance('icons/mob/human/human_eyes.dmi', "eye_scar_left", -EYES_LAYER, parent) + var/mutable_appearance/left_scar = mutable_appearance('icons/mob/human/human_eyes.dmi', "eye_scar_left", -EYES_LAYER, parent, alpha = eyes_opacity) left_scar.color = my_head.draw_color overlays += left_scar - - // BUBBER EDIT START - Customization Emissives + //BUBBER EDIT END - EYES OPACITY + // BUBBER EDIT START - Customization Emissives and eyes opacity if(is_emissive) var/mutable_appearance/emissive_left = emissive_appearance_copy(eye_left, owner) var/mutable_appearance/emissive_right = emissive_appearance_copy(eye_right, owner) overlays += emissive_left overlays += emissive_right - // BUBBER EDIT END - Customization Emissives + // BUBBER EDIT END - Customization Emissives and eyes opacity if(my_head.worn_face_offset) for (var/mutable_appearance/overlay as anything in overlays) @@ -1222,3 +1229,4 @@ desc = "A pair of highly reflective eyes with slit pupils, like those of a cat." pupils_name = "slit pupils" penlight_message = "shine under the pearly light" + diff --git a/modular_zubbers/code/modules/customization/eyes_opacity/eyes_opacity.dm b/modular_zubbers/code/modules/customization/eyes_opacity/eyes_opacity.dm new file mode 100644 index 00000000000..0cb60af228d --- /dev/null +++ b/modular_zubbers/code/modules/customization/eyes_opacity/eyes_opacity.dm @@ -0,0 +1,14 @@ +/datum/preference/numeric/eyes_opacity + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "eyes_opacity" + maximum = 255 + minimum = 0 + +/datum/preference/numeric/eyes_opacity/create_default_value() + return maximum + + +/datum/preference/numeric/eyes_opacity/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + var/obj/item/organ/eyes/eyes = target.get_organ_slot(ORGAN_SLOT_EYES) + eyes.refresh() diff --git a/tgstation.dme b/tgstation.dme index 9b6cca4dd61..6ebdd23dce1 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -9436,6 +9436,7 @@ #include "modular_zubbers\code\modules\cooking_additions\recipes_misc.dm" #include "modular_zubbers\code\modules\credits\credits.dm" #include "modular_zubbers\code\modules\customization\datums\robotic_styles\robotic_styles.dm" +#include "modular_zubbers\code\modules\customization\eyes_opacity\eyes_opacity.dm" #include "modular_zubbers\code\modules\customization\height_scaling\icons.dm" #include "modular_zubbers\code\modules\customization\height_scaling\preferences.dm" #include "modular_zubbers\code\modules\customization\modules\client\augment\limbs.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx index 09963c10f14..5d1b123687f 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx @@ -142,6 +142,11 @@ export const eye_emissives: FeatureToggle = { component: CheckboxInput, }; +export const eyes_opacity: Feature = { + name: 'Eyes Opacity', + component: FeatureNumberInput, +}; + export const mutant_colors_color: Feature = { name: 'Mutant Colors', component: FeatureTriColorInput,