Ported /tg/ style screen alerts, replacing the hunger icon with them

This commit is contained in:
Atermonera
2020-05-30 21:17:50 -07:00
committed by Aronai Sieyes
parent 30cf26ba8e
commit 619e8b1b94
7 changed files with 903 additions and 892 deletions

View File

@@ -52,12 +52,14 @@
animate(alert, transform = matrix(), time = 2.5, easing = CUBIC_EASING)
if(alert.timeout)
spawn(alert.timeout)
if(alert.timeout && alerts[category] == alert && world.time >= alert.timeout)
clear_alert(category)
addtimer(CALLBACK(src, .proc/alert_timeout, alert, category), alert.timeout)
alert.timeout = world.time + alert.timeout - world.tick_lag
return alert
/mob/proc/alert_timeout(obj/screen/alert/alert, category)
if(alert.timeout && alerts[category] == alert && world.time >= alert.timeout)
clear_alert(category)
// Proc to clear an existing alert.
/mob/proc/clear_alert(category)
var/obj/screen/alert/alert = alerts[category]
@@ -455,7 +457,7 @@ so as to remain in compliance with the most up-to-date laws."
return
var/paramslist = params2list(params)
if(paramslist["shift"]) // screen objects don't do the normal Click() stuff so we'll cheat
usr << "<span class='boldnotice'>[name]</span> - <span class='info'>[desc]</span>"
to_chat(usr,"<span class='boldnotice'>[name]</span> - <span class='info'>[desc]</span>")
return
if(master)
return usr.client.Click(master, location, control, params)