Skip to content

Commit

Permalink
Fix overlay lighting messing up alert overlays (#3908)
Browse files Browse the repository at this point in the history
* [NO GBP] Fix overlay lighting messing up alert overlays (#87362)

Closes tgstation/tgstation#87357

Adds a `IS_LIGHTING_UNDERLAY` define, and a `strip_light_underlays`
helper that uses it (thanks @Kapu1178 for the code)

![2024-10-21 (1729553782) ~
dreamseeker](https://github.com/user-attachments/assets/da2778f9-40e0-4760-85aa-a17a7d05f01c)

![2024-10-21 (1729553540) ~
dreamseeker](https://github.com/user-attachments/assets/dd240c83-faf9-4e55-b913-58743aa764f0)

:cl: Absolucy, Kapu
fix: Fix overlay lighting (such as lanterns) messing up alert overlays,
i.e the rod of asclepius alert.
/:cl:

* Apply fixes to heretic living heart, too.
  • Loading branch information
Absolucy authored Oct 23, 2024
1 parent f66136a commit 0c5fe90
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
7 changes: 7 additions & 0 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1503,3 +1503,10 @@ GLOBAL_LIST_EMPTY(icon_dimensions)
var/icon/my_icon = icon(icon_path)
GLOB.icon_dimensions[icon_path] = list("width" = my_icon.Width(), "height" = my_icon.Height())
return GLOB.icon_dimensions[icon_path]

/proc/strip_appearance_underlays(mutable_appearance/appearance)
var/base_plane = PLANE_TO_TRUE(appearance.plane)
for(var/mutable_appearance/underlay as anything in appearance.underlays)
if(PLANE_TO_TRUE(underlay.plane) != base_plane)
appearance.underlays -= underlay
return appearance
2 changes: 1 addition & 1 deletion code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
master_appearance.pixel_x = new_master.base_pixel_x
master_appearance.pixel_y = new_master.base_pixel_y
master_appearance.pixel_z = 0 /* new_master.base_pixel_z */
thealert.add_overlay(master_appearance)
thealert.add_overlay(strip_appearance_underlays(master_appearance))
thealert.icon_state = "template" // We'll set the icon to the client's ui pref in reorganize_alerts()
thealert.master = new_master
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
continue
var/sac_name = trimtext(target_mind.name || living_target.real_name || living_target.name)
living_targets[sac_name] = living_target
var/mutable_appearance/target_appearance = new
target_appearance.appearance = living_target.appearance
target_appearance.setDir(SOUTH)
target_appearance.pixel_x = 0
target_appearance.pixel_y = 0
target_appearance.pixel_z = 0
targets_to_choose[sac_name] = target_appearance
var/mutable_appearance/target_appearance = new(living_target)
target_appearance.appearance_flags = KEEP_TOGETHER
target_appearance.layer = FLOAT_LAYER
target_appearance.plane = FLOAT_PLANE
target_appearance.dir = SOUTH
target_appearance.pixel_x = living_target.base_pixel_x
target_appearance.pixel_y = living_target.base_pixel_y
target_appearance.pixel_z = 0 /* living_target.base_pixel_z */
targets_to_choose[sac_name] = strip_appearance_underlays(target_appearance)

// If we don't have a last tracked name, open a radial to set one.
// If we DO have a last tracked name, we skip the radial if they right click the action.
Expand Down

0 comments on commit 0c5fe90

Please sign in to comment.