From bbdb9344bc15f5cf4f6ff1266cbcd4a76b58bd97 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 1 Aug 2023 02:02:19 +0200 Subject: [PATCH] [MIRROR] ghost notifs now set the pixel x/y properly with scaling [MDB IGNORE] (#22798) * ghost notifs now set the pixel x/y properly with scaling (#77239) ## About The Pull Request ghost notifs set pixel x y to 0 (so wallmounts for example are centered) and then large stuff like space dragons or singularities is properly brought down by calculations before ![image](https://github.com/tgstation/tgstation/assets/23585223/73b198a1-3a5f-4d00-94b1-ae9690c9d948) after ![image](https://github.com/tgstation/tgstation/assets/23585223/7a4bb949-36a6-4ba4-9339-d36ed56c6695) ## Changelog :cl: fix: ghost notification icons are now centered properly /:cl: * ghost notifs now set the pixel x/y properly with scaling --------- Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> --- code/modules/mob/mob_helpers.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 20a4c14996f..3e561c75341 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -274,17 +274,23 @@ alert.target = source if(!alert_overlay) alert_overlay = new(source) + alert_overlay.pixel_x = 0 + alert_overlay.pixel_y = 0 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) + alert_overlay.pixel_x = -(world.icon_size / 2) * ((width - world.icon_size) / world.icon_size) + if(height > world.icon_size) + alert_overlay.pixel_y = -(world.icon_size / 2) * ((height - world.icon_size) / world.icon_size) 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.appearance_flags |= TILE_BOUND alert_overlay.layer = FLOAT_LAYER alert_overlay.plane = FLOAT_PLANE alert.add_overlay(alert_overlay)