Fix buckled/item based alerts

This commit is contained in:
Aronai Sieyes
2020-05-15 13:43:35 -04:00
parent 6873a3238d
commit 2d590505c1
2 changed files with 7 additions and 2 deletions

View File

@@ -36,8 +36,9 @@
alert = new type alert = new type
if(new_master) if(new_master)
alert.icon_state = "template" // blank, so our icon is presented alert.icon_state = "itembased"
var/image/I = image(icon = new_master.icon, icon_state = new_master.icon_state, dir = SOUTH) var/image/I = image(icon = new_master.icon, icon_state = new_master.icon_state, dir = SOUTH)
I.plane = PLANE_PLAYER_HUD_ABOVE
alert.add_overlay(I) alert.add_overlay(I)
alert.master = new_master alert.master = new_master
else else
@@ -317,12 +318,14 @@ Recharging stations are available in robotics, the dormitory bathrooms, and the
name = "Hacked" name = "Hacked"
desc = "Hazardous non-standard equipment detected. Please ensure any usage of this equipment is in line with unit's laws, if any." desc = "Hazardous non-standard equipment detected. Please ensure any usage of this equipment is in line with unit's laws, if any."
icon_state = "hacked" icon_state = "hacked"
no_underlay = TRUE
/obj/screen/alert/locked /obj/screen/alert/locked
name = "Locked Down" name = "Locked Down"
desc = "Unit has been remotely locked down. Usage of a Robotics Control Console like the one in the Research Director's \ desc = "Unit has been remotely locked down. Usage of a Robotics Control Console like the one in the Research Director's \
office by your AI master or any qualified human may resolve this matter. Robotics may provide further assistance if necessary." office by your AI master or any qualified human may resolve this matter. Robotics may provide further assistance if necessary."
icon_state = "locked" icon_state = "locked"
no_underlay = TRUE
/obj/screen/alert/newlaw /obj/screen/alert/newlaw
name = "Law Update" name = "Law Update"
@@ -330,6 +333,7 @@ office by your AI master or any qualified human may resolve this matter. Robotic
so as to remain in compliance with the most up-to-date laws." so as to remain in compliance with the most up-to-date laws."
icon_state = "newlaw" icon_state = "newlaw"
timeout = 300 timeout = 300
no_underlay = TRUE
//MECHS //MECHS
@@ -402,12 +406,13 @@ so as to remain in compliance with the most up-to-date laws."
for(var/i = 1, i <= alerts.len, i++) for(var/i = 1, i <= alerts.len, i++)
var/obj/screen/alert/alert = alerts[alerts[i]] var/obj/screen/alert/alert = alerts[alerts[i]]
if(alert.icon_state in cached_icon_states(ui_style)) // prevents "" state from attempting matches if(alert.icon_state in cached_icon_states(ui_style))
alert.icon = ui_style alert.icon = ui_style
else if(!alert.no_underlay) else if(!alert.no_underlay)
var/image/I = image(icon = ui_style, icon_state = "template") var/image/I = image(icon = ui_style, icon_state = "template")
I.color = ui_color I.color = ui_color
I.alpha = ui_alpha
alert.underlays = list(I) alert.underlays = list(I)
switch(i) switch(i)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 109 KiB