mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
Fixes balloon alert positioning on wide mobs (#89921)
## About The Pull Request We don't care about bound_width, only about base offset. If a mob wants to be offset, let them be offset.   Been bugging me for ages. ## Changelog 🆑 fix: Fixed balloon alert positioning on wide mobs /🆑
This commit is contained in:
@@ -44,17 +44,12 @@
|
||||
if (isnull(viewer_client))
|
||||
return
|
||||
|
||||
var/bound_width = ICON_SIZE_X
|
||||
if (ismovable(src))
|
||||
var/atom/movable/movable_source = src
|
||||
bound_width = movable_source.bound_width
|
||||
|
||||
var/image/balloon_alert = image(loc = isturf(src) ? src : get_atom_on_turf(src), layer = ABOVE_MOB_LAYER)
|
||||
SET_PLANE_EXPLICIT(balloon_alert, BALLOON_CHAT_PLANE, src)
|
||||
balloon_alert.alpha = 0
|
||||
balloon_alert.appearance_flags = RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM
|
||||
balloon_alert.maptext = MAPTEXT("<span style='text-align: center; -dm-text-outline: 1px #0005'>[text]</span>")
|
||||
balloon_alert.maptext_x = (BALLOON_TEXT_WIDTH - bound_width) * -0.5
|
||||
balloon_alert.maptext_x = (BALLOON_TEXT_WIDTH - ICON_SIZE_X) * -0.5 - base_pixel_x
|
||||
WXH_TO_HEIGHT(viewer_client?.MeasureText(text, null, BALLOON_TEXT_WIDTH), balloon_alert.maptext_height)
|
||||
balloon_alert.maptext_width = BALLOON_TEXT_WIDTH
|
||||
|
||||
|
||||
Reference in New Issue
Block a user