Make attack anims a preference

This commit is contained in:
Arokha Sieyes
2018-02-15 17:26:58 -06:00
parent ba8c2a3447
commit a88dfd0d20
2 changed files with 14 additions and 1 deletions

View File

@@ -111,6 +111,12 @@ var/list/_client_preferences_by_type
enabled_description = "Show"
disabled_description = "Hide"
/datum/client_preference/attack_icons
description ="Attack icons"
key = "ATTACK_ICONS"
enabled_description = "Show"
disabled_description = "Hide"
/datum/client_preference/show_typing_indicator
description ="Typing indicator"
key = "SHOW_TYPING"

View File

@@ -196,7 +196,14 @@ note dizziness decrements automatically in the mob's Life() proc.
I = image(attack_icon, A, attack_icon_state, A.layer + 1)
I.dir = dir
flick_overlay_view(I, A, 5, TRUE) // 5 ticks/half a second
//Check for clients with pref enabled
var/list/viewing = list()
for(var/m in viewers(A))
var/mob/M = m
var/client/C = M.client
if(C && C.is_preference_enabled(/datum/client_preference/attack_icons))
viewing += M.client
flick_overlay(I, viewing, 5, TRUE) // 5 ticks/half a second
// Set the direction of the icon animation.
var/direction = get_dir(src, A)