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) animate(alert, transform = matrix(), time = 2.5, easing = CUBIC_EASING)
if(alert.timeout) if(alert.timeout)
spawn(alert.timeout) addtimer(CALLBACK(src, .proc/alert_timeout, alert, category), alert.timeout)
if(alert.timeout && alerts[category] == alert && world.time >= alert.timeout)
clear_alert(category)
alert.timeout = world.time + alert.timeout - world.tick_lag alert.timeout = world.time + alert.timeout - world.tick_lag
return alert 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. // Proc to clear an existing alert.
/mob/proc/clear_alert(category) /mob/proc/clear_alert(category)
var/obj/screen/alert/alert = alerts[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 return
var/paramslist = params2list(params) var/paramslist = params2list(params)
if(paramslist["shift"]) // screen objects don't do the normal Click() stuff so we'll cheat 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 return
if(master) if(master)
return usr.client.Click(master, location, control, params) return usr.client.Click(master, location, control, params)

View File

@@ -1652,6 +1652,11 @@
msg += get_display_species() msg += get_display_species()
return msg return msg
/mob/living/carbon/human/reduce_cuff_time()
if(istype(gloves, /obj/item/clothing/gloves/gauntlets/rig))
return 2
return ..()
/mob/living/carbon/human/pull_damage() /mob/living/carbon/human/pull_damage()
if(((health - halloss) <= config.health_threshold_softcrit)) if(((health - halloss) <= config.health_threshold_softcrit))
for(var/name in organs_by_name) for(var/name in organs_by_name)

View File

@@ -1229,12 +1229,14 @@
fat_alert = /obj/screen/alert/fat/synth fat_alert = /obj/screen/alert/fat/synth
hungry_alert = /obj/screen/alert/hungry/synth hungry_alert = /obj/screen/alert/hungry/synth
starving_alert = /obj/screen/alert/starving/synth starving_alert = /obj/screen/alert/starving/synth
//VOREStation Add - Vampire hunger alert
else if(get_species() == SPECIES_CUSTOM) else if(get_species() == SPECIES_CUSTOM)
var/datum/species/custom/C = species var/datum/species/custom/C = species
if(/datum/trait/bloodsucker in C.traits) if(/datum/trait/bloodsucker in C.traits)
fat_alert = /obj/screen/alert/fat/vampire fat_alert = /obj/screen/alert/fat/vampire
hungry_alert = /obj/screen/alert/hungry/vampire hungry_alert = /obj/screen/alert/hungry/vampire
starving_alert = /obj/screen/alert/starving/vampire starving_alert = /obj/screen/alert/starving/vampire
//VOREStation Add End
switch(nutrition) switch(nutrition)
if(450 to INFINITY) if(450 to INFINITY)

View File

@@ -158,6 +158,8 @@
healths.screen_loc = ui_health healths.screen_loc = ui_health
hud_elements |= healths hud_elements |= healths
pain = new /obj/screen( null ) pain = new /obj/screen( null )
zone_sel = new /obj/screen/zone_sel( null ) zone_sel = new /obj/screen/zone_sel( null )

View File

@@ -1383,5 +1383,5 @@ Note that amputating the affected organ does in fact remove the infection from t
. = 0 . = 0
for(var/obj/item/organ/external/L in organs) for(var/obj/item/organ/external/L in organs)
for(var/obj/item/I in L.implants) for(var/obj/item/I in L.implants)
if(!istype(I,/obj/item/weapon/implant) && !istype(I,/obj/item/device/nif)) if(!istype(I,/obj/item/weapon/implant) && !istype(I,/obj/item/device/nif)) //VOREStation Add - NIFs
return 1 return 1