Adds a lfwb-inspired orbiting pixel + flashing outline animation to the sprint and combat buttons (toggleable via prefs) (#11623)

* Adds a flashing effect to the sprint and combat mode toggles (toggleable via prefs)

* Adds the ability to change the color of the hud toggle flash as well
This commit is contained in:
deathride58
2020-03-26 11:51:48 -04:00
committed by GitHub
parent 9ab89ddcea
commit 0bf2cf0484
7 changed files with 50 additions and 3 deletions
@@ -12,6 +12,7 @@
name = "toggle combat mode"
icon = 'modular_citadel/icons/ui/screen_midnight.dmi'
icon_state = "combat_off"
var/mutable_appearance/flashy
/obj/screen/combattoggle/Click()
if(iscarbon(usr))
@@ -29,6 +30,19 @@
else
icon_state = "combat_off"
/obj/screen/combattoggle/update_overlays()
. = ..()
var/mob/living/carbon/user = hud?.mymob
if(!istype(user) || !user.client)
return
if((user.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) && user.client.prefs.hud_toggle_flash)
if(!flashy)
flashy = mutable_appearance('icons/mob/screen_gen.dmi', "togglefull_flash")
if(flashy.color != user.client.prefs.hud_toggle_color)
flashy.color = user.client.prefs.hud_toggle_color
. += flashy //TODO - beg lummox jr for the ability to force mutable appearances or images to be created rendering from their first frame of animation rather than being based entirely around the client's frame count
/obj/screen/voretoggle
name = "toggle vore mode"
icon = 'modular_citadel/icons/ui/screen_midnight.dmi'
@@ -6,6 +6,7 @@
icon = 'modular_citadel/icons/ui/screen_midnight.dmi'
icon_state = "act_sprint"
layer = ABOVE_HUD_LAYER - 0.1
var/mutable_appearance/flashy
/obj/screen/sprintbutton/Click()
if(ishuman(usr))
@@ -23,6 +24,19 @@
else
icon_state = "act_sprint"
/obj/screen/sprintbutton/update_overlays()
. = ..()
var/mob/living/carbon/user = hud?.mymob
if(!istype(user) || !user.client)
return
if((user.combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) && user.client.prefs.hud_toggle_flash)
if(!flashy)
flashy = mutable_appearance('icons/mob/screen_gen.dmi', "togglehalf_flash")
if(flashy.color != user.client.prefs.hud_toggle_color)
flashy.color = user.client.prefs.hud_toggle_color
. += flashy
//Sprint buffer onscreen code.
/datum/hud/var/obj/screen/sprint_buffer/sprint_buffer