Preference toggle for eyes visibility (#5449)

## About The Pull Request
Ye Olde title. Adds a preference to modify the opacity of your
character's eyeballs. Mostly made this for my yet-unmerged port of
cybernetics from Eris, some of which are not intended to have eyes
visible and instead use the head sprite to represent them.

Thank you to Statykyr and Artur for helping a lot love you mwah
## Why It's Good For The Game

Not having two very obvious pixels blocking a cool animated robot head
is nice. Also Astrum wants it.
## Proof Of Testing

<img width="943" height="523" alt="image"
src="https://github.com/user-attachments/assets/f1099599-9841-4e44-9095-2badde842d0c"
/>
<details>
<summary>Screenshots/Videos</summary>

</details>

## Changelog
🆑
add: Preference toggle for eyes opacity. Have no eyes (visually) or
anywhere in between.
/🆑
This commit is contained in:
MrGloopy
2026-04-18 17:01:48 -04:00
committed by GitHub
parent 35d658c9b4
commit afb8768493
4 changed files with 37 additions and 9 deletions
@@ -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"