From a8342e241bf0dc2b2b65282fc6ec6e8e29a024f7 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:12:50 +0200 Subject: [PATCH] [MIRROR] ghost alerts now resize to 32x32 if larger [MDB IGNORE] (#12970) * Ghost alerts now resize to 32x32, if larger (#66352) * ghost alerts now resize to 32x32 if larger Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> --- code/modules/mob/mob_helpers.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 787cf1c33c7..55d81b09007 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -242,6 +242,17 @@ A.target = source if(!alert_overlay) alert_overlay = new(source) + var/icon/size_check = icon(source.icon, source.icon_state) + var/scale = 1 + var/width = size_check.Width() + var/height = size_check.Height() + if(width > world.icon_size || height > world.icon_size) + if(width >= height) + scale = world.icon_size / width + else + scale = world.icon_size / height + alert_overlay.transform = alert_overlay.transform.Scale(scale) + alert_overlay.appearance_flags |= TILE_BOUND alert_overlay.layer = FLOAT_LAYER alert_overlay.plane = FLOAT_PLANE A.add_overlay(alert_overlay)