[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>
This commit is contained in:
SkyratBot
2022-04-21 21:12:50 +01:00
committed by GitHub
co-authored by Fikou
parent ea2bdd75de
commit a8342e241b
+11
View File
@@ -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)