mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
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 <details> <summary>Screenshots/Videos</summary> </details> ## Changelog 🆑 config: added config options for toggling blinking /🆑
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user