From 4328d3129989ced56bd1a4f3843c8fa33688b2bf Mon Sep 17 00:00:00 2001 From: Arturlang <24881678+Arturlang@users.noreply.github.com> Date: Sun, 4 May 2025 20:46:35 +0300 Subject: [PATCH] blinking is now config toggleable (#3703) ## About The Pull Request blinking is now config toggleable for perf reasons, may be chugging quite a bit, kept support to toggle it ingame as well ## Why It's Good For The Game lag fixes i hope ## Proof Of Testing
Screenshots/Videos
## Changelog :cl: config: added config options for toggling blinking /:cl: --- .../modules/surgery/organs/internal/eyes/_eyes.dm | 3 +++ config/bubbers/bubbers_config.txt | 3 +++ .../controllers/configuration/entries/blinking.dm | 15 +++++++++++++++ tgstation.dme | 1 + 4 files changed, 22 insertions(+) create mode 100644 modular_zubbers/code/controllers/configuration/entries/blinking.dm diff --git a/code/modules/surgery/organs/internal/eyes/_eyes.dm b/code/modules/surgery/organs/internal/eyes/_eyes.dm index 3e96ccb30ed..ce189def69a 100644 --- a/code/modules/surgery/organs/internal/eyes/_eyes.dm +++ b/code/modules/surgery/organs/internal/eyes/_eyes.dm @@ -461,6 +461,7 @@ /// Animates one eyelid at a time, thanks BYOND and thanks animation chains /obj/item/organ/eyes/proc/animate_eyelid(obj/effect/abstract/eyelid_effect/eyelid, mob/living/carbon/human/parent, sync_blinking = TRUE, list/anim_times = null) . = list() + var/prevent_loops = HAS_TRAIT(parent, TRAIT_PREVENT_BLINK_LOOPS) animate(eyelid, alpha = 0, time = 0, loop = (prevent_loops ? 0 : -1)) @@ -516,6 +517,8 @@ addtimer(CALLBACK(src, PROC_REF(animate_eyelids), owner), blink_delay + duration) /obj/item/organ/eyes/proc/animate_eyelids(mob/living/carbon/human/parent) + if(!CONFIG_GET(flag/blinking)) return // BUBBER EDIT - CONFIG BLINKING + var/sync_blinking = TRUE // synchronized_blinking && (parent.get_organ_loss(ORGAN_SLOT_BRAIN) < ASYNC_BLINKING_BRAIN_DAMAGE) // BUBBER EDIT - REMOVE ASYNC BLINKING UNTIL https://github.com/tgstation/tgstation/issues/90269 is fixed // Randomize order for unsynched animations if (sync_blinking || prob(50)) diff --git a/config/bubbers/bubbers_config.txt b/config/bubbers/bubbers_config.txt index 9626e2b805c..9ea0fa6133e 100644 --- a/config/bubbers/bubbers_config.txt +++ b/config/bubbers/bubbers_config.txt @@ -19,3 +19,6 @@ INTERN_THRESHOLD_COMMAND 20 ## Respawn grace period (deciseconds), which allows to return to the lobby some amount of time after the world loads - default 30 minutes RESPAWN_GRACE_PERIOD 18000 + +#If enabled, /human mobs will ocassionaly blink (somewhat expensive) +BLINKING diff --git a/modular_zubbers/code/controllers/configuration/entries/blinking.dm b/modular_zubbers/code/controllers/configuration/entries/blinking.dm new file mode 100644 index 00000000000..03e862e26ce --- /dev/null +++ b/modular_zubbers/code/controllers/configuration/entries/blinking.dm @@ -0,0 +1,15 @@ +/datum/config_entry/flag/blinking + default = TRUE + +// blinking won't update without re-running the animate +/datum/config_entry/flag/blinking/vv_edit_var(var_name, var_value) + . = ..() + if(var_name == NAMEOF(src, config_entry_value)) + INVOKE_ASYNC(src, PROC_REF(update_blinkers)) + + +/datum/config_entry/flag/blinking/proc/update_blinkers() + for(var/mob/living/carbon/human/blinker in GLOB.alive_mob_list) + var/obj/item/organ/eyes/eyes = blinker.get_organ_slot(ORGAN_SLOT_EYES) + eyes?.blink() + CHECK_TICK diff --git a/tgstation.dme b/tgstation.dme index 24851b2edd6..abfe370d448 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -8805,6 +8805,7 @@ #include "modular_zubbers\code\_globalvars\lists\~maintenance_loot.dm" #include "modular_zubbers\code\_onclick\hud\screen_objects\hud_timer.dm" #include "modular_zubbers\code\controllers\configuration\general.dm" +#include "modular_zubbers\code\controllers\configuration\entries\blinking.dm" #include "modular_zubbers\code\controllers\configuration\entries\nsfw.dm" #include "modular_zubbers\code\controllers\subsystem\air.dm" #include "modular_zubbers\code\controllers\subsystem\job.dm"