Ghost alerts now resize to 32x32, if larger (#66352)

This commit is contained in:
Fikou
2022-04-21 13:56:10 -05:00
committed by GitHub
parent cbf63a5970
commit 538e7b3a9a
+11
View File
@@ -240,6 +240,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)