Merge pull request #7850 from VOREStation/aro-alerttweak
Further add on to the alert system
@@ -36,14 +36,10 @@
|
||||
alert = new type
|
||||
|
||||
if(new_master)
|
||||
var/old_layer = new_master.layer
|
||||
var/old_plane = new_master.plane
|
||||
new_master.layer = LAYER_HUD_ABOVE
|
||||
new_master.plane = PLANE_PLAYER_HUD_ABOVE
|
||||
alert.overlays += new_master
|
||||
new_master.layer = old_layer
|
||||
new_master.plane = old_plane
|
||||
alert.icon_state = "template" // We'll set the icon to the client's ui pref in reorganize_alerts()
|
||||
var/mutable_appearance/itemMA = new (new_master)
|
||||
itemMA.layer = LAYER_HUD_ABOVE
|
||||
itemMA.plane = PLANE_PLAYER_HUD_ABOVE
|
||||
alert.add_overlay(itemMA)
|
||||
alert.master = new_master
|
||||
else
|
||||
alert.icon_state = "[initial(alert.icon_state)][severity]"
|
||||
@@ -83,6 +79,7 @@
|
||||
var/timeout = 0 //If set to a number, this alert will clear itself after that many deciseconds
|
||||
var/severity = 0
|
||||
var/alerttooltipstyle = ""
|
||||
var/no_underlay // Don't underlay the UI style's blank template icon under this
|
||||
|
||||
|
||||
/obj/screen/alert/MouseEntered(location,control,params)
|
||||
@@ -394,17 +391,16 @@ so as to remain in compliance with the most up-to-date laws."
|
||||
// Re-render all alerts - also called in /datum/hud/show_hud() because it's needed there
|
||||
/datum/hud/proc/reorganize_alerts()
|
||||
var/list/alerts = mymob.alerts
|
||||
var/icon_pref
|
||||
if(!hud_shown)
|
||||
for(var/i = 1, i <= alerts.len, i++)
|
||||
mymob.client.screen -= alerts[alerts[i]]
|
||||
return 1
|
||||
for(var/i = 1, i <= alerts.len, i++)
|
||||
var/obj/screen/alert/alert = alerts[alerts[i]]
|
||||
if(alert.icon_state == "template")
|
||||
if(!icon_pref)
|
||||
icon_pref = ui_style2icon(mymob.client.prefs.UI_style)
|
||||
alert.icon = icon_pref
|
||||
if(alert.icon_state in cached_icon_states(ui_style))
|
||||
alert.icon = ui_style
|
||||
else if(!alert.no_underlay)
|
||||
alert.underlays = list(image(icon = ui_style, icon_state = "template"))
|
||||
switch(i)
|
||||
if(1)
|
||||
. = ui_alert1
|
||||
@@ -419,7 +415,7 @@ so as to remain in compliance with the most up-to-date laws."
|
||||
else
|
||||
. = ""
|
||||
alert.screen_loc = .
|
||||
mymob.client.screen |= alert
|
||||
mymob?.client?.screen |= alert
|
||||
return 1
|
||||
|
||||
/mob
|
||||
|
||||
@@ -190,6 +190,8 @@ var/list/global_huds = list(
|
||||
var/action_buttons_hidden = 0
|
||||
var/list/slot_info
|
||||
|
||||
var/icon/ui_style
|
||||
|
||||
datum/hud/New(mob/owner)
|
||||
mymob = owner
|
||||
instantiate()
|
||||
@@ -305,7 +307,8 @@ datum/hud/New(mob/owner)
|
||||
/datum/hud/proc/instantiate()
|
||||
if(!ismob(mymob)) return 0
|
||||
if(!mymob.client) return 0
|
||||
var/ui_style = ui_style2icon(mymob.client.prefs.UI_style)
|
||||
|
||||
ui_style = ui_style2icon(mymob.client.prefs.UI_style)
|
||||
var/ui_color = mymob.client.prefs.UI_style_color
|
||||
var/ui_alpha = mymob.client.prefs.UI_style_alpha
|
||||
|
||||
|
||||
@@ -837,15 +837,7 @@ mob/observer/dead/MayRespawn(var/feedback = 0)
|
||||
if(message)
|
||||
to_chat(src, "<span class='ghostalert'><font size=4>[message]</font></span>")
|
||||
if(source)
|
||||
var/obj/screen/alert/A = throw_alert("\ref[source]_notify_revive", /obj/screen/alert/notify_cloning)
|
||||
if(A)
|
||||
if(client && client.prefs && client.prefs.UI_style)
|
||||
A.icon = ui_style2icon(client.prefs.UI_style)
|
||||
A.desc = message
|
||||
var/old_layer = source.layer
|
||||
source.layer = FLOAT_LAYER
|
||||
A.overlays += source
|
||||
source.layer = old_layer
|
||||
throw_alert("\ref[source]_notify_revive", /obj/screen/alert/notify_cloning, new_master = source)
|
||||
to_chat(src, "<span class='ghostalert'><a href=?src=[REF(src)];reenter=1>(Click to re-enter)</a></span>")
|
||||
if(sound)
|
||||
SEND_SOUND(src, sound(sound))
|
||||
|
||||
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 108 KiB |