Add disabling footstep sounds and parallax to the lag switch panel (#62999)

At the last Toolbox Tournament, @MrStonedOne pointed out some big performance consumers. Some are disablable through easy means, but others were not. This adds two easy ones to the mix.
This commit is contained in:
Mothblocks
2021-11-22 23:19:33 -08:00
committed by GitHub
parent 96e85e0ff8
commit 6ea8b19eb9
5 changed files with 49 additions and 10 deletions
+14 -1
View File
@@ -10,7 +10,7 @@ SUBSYSTEM_DEF(lag_switch)
/// List of bools corresponding to code/__DEFINES/lag_switch.dm
var/static/list/measures[MEASURES_AMOUNT]
/// List of measures that toggle automatically
var/list/auto_measures = list(DISABLE_GHOST_ZOOM_TRAY, DISABLE_RUNECHAT, DISABLE_USR_ICON2HTML)
var/list/auto_measures = list(DISABLE_GHOST_ZOOM_TRAY, DISABLE_RUNECHAT, DISABLE_USR_ICON2HTML, DISABLE_PARALLAX, DISABLE_FOOTSTEPS)
/// Timer ID for the automatic veto period
var/veto_timer_id
/// Cooldown between say verb uses when slowmode is enabled
@@ -111,6 +111,19 @@ SUBSYSTEM_DEF(lag_switch)
to_chat(world, span_boldannounce("Slowmode for IC/dead chat has been disabled by an admin."))
if(DISABLE_NON_OBSJOBS)
world.update_status()
if(DISABLE_PARALLAX)
if (state)
to_chat(world, span_boldannounce("Parallax has been disabled for performance concerns."))
else
to_chat(world, span_boldannounce("Parallax has been re-enabled."))
for (var/mob/mob as anything in GLOB.mob_list)
mob.hud_used?.update_parallax_pref()
if (DISABLE_FOOTSTEPS)
if (state)
to_chat(world, span_boldannounce("Footstep sounds have been disabled for performance concerns."))
else
to_chat(world, span_boldannounce("Footstep sounds have been re-enabled."))
return TRUE