mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
I accidentally a memory leak.
Anyhow, HUDs' memory leak fixed, also security HUD added (only shows current ID assignment for now, gotta figure out why it doesn't want to show the arrest/prisoner status). git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1569 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -59,11 +59,21 @@
|
||||
icon_state = "thermoncle"
|
||||
flags = null //doesn't protect eyes because it's a monocle, duh
|
||||
|
||||
/obj/item/clothing/glasses/healthscanner
|
||||
/obj/item/clothing/glasses/hud
|
||||
name = "HUD"
|
||||
desc = "A heads-up display that provides important info in (almost) real time."
|
||||
flags = null //doesn't protect eyes because it's a monocle, duh
|
||||
|
||||
/obj/item/clothing/glasses/hud/health
|
||||
name = "Health Scanner HUD"
|
||||
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status."
|
||||
icon_state = "healthscanner"
|
||||
flags = null //doesn't protect eyes because it's a monocle, duh
|
||||
icon_state = "healthhud"
|
||||
var/list/icon/current = list() //the current hud icons
|
||||
|
||||
/obj/item/clothing/glasses/hud/security
|
||||
name = "Security HUD"
|
||||
desc = "A heads-up display that scans the humans in view and provides accurate data about their ID status."
|
||||
icon_state = "securityhud"
|
||||
var/list/icon/current = list() //the current hud icons
|
||||
|
||||
/proc/RoundHealth(health)
|
||||
|
||||
@@ -364,4 +364,21 @@
|
||||
return list("Assistant", "Station Engineer", "Shaft Miner", "Detective", "Medical Doctor", "Captain", "Security Officer", "Warden",
|
||||
"Geneticist", "Scientist", "Head of Security", "Head of Personnel", "Atmospheric Technician",
|
||||
"Chaplain", "Barman", "Chemist", "Janitor", "Clown", "Mime", "Chef", "Roboticist", "Quartermaster",
|
||||
"Chief Engineer", "Research Director", "Botanist", "Librarian", "Lawyer", "Virologist", "Cargo Technician", "Chief Medical Officer")
|
||||
"Chief Engineer", "Research Director", "Botanist", "Librarian", "Lawyer", "Virologist", "Cargo Technician", "Chief Medical Officer")
|
||||
|
||||
/obj/proc/GetJobName()
|
||||
if (!istype(src, /obj/item/device/pda) && !istype(src,/obj/item/weapon/card/id))
|
||||
return
|
||||
|
||||
var/jobName
|
||||
|
||||
if(istype(src, /obj/item/device/pda))
|
||||
if(src:id)
|
||||
jobName = src:id:assignment
|
||||
if(istype(src, /obj/item/weapon/card/id))
|
||||
jobName = src:assignment
|
||||
|
||||
if(jobName in get_all_jobs())
|
||||
return jobName
|
||||
else
|
||||
return "Unknown"
|
||||
|
||||
@@ -746,7 +746,7 @@
|
||||
|
||||
if(client)
|
||||
for(var/image/hud in client.images)
|
||||
if(copytext(hud.icon_state,6) == "health") //ugly, but icon comparison is worse, I believe
|
||||
if(copytext(hud.icon_state,4) == "hud") //ugly, but icon comparison is worse, I believe
|
||||
del(hud)
|
||||
|
||||
if (src.stat == 2 || src.mutations & XRAY)
|
||||
@@ -795,19 +795,45 @@
|
||||
src.sight |= SEE_OBJS
|
||||
if (!src.druggy)
|
||||
src.see_invisible = 0
|
||||
else if (istype(glasses, /obj/item/clothing/glasses/healthscanner))
|
||||
else if (istype(glasses, /obj/item/clothing/glasses/hud/security))
|
||||
if(client)
|
||||
var/icon/tempHud = 'hud.dmi'
|
||||
for(var/mob/living/carbon/human/perp in view(src))
|
||||
if(perp.wear_id)
|
||||
client.images += image(tempHud,perp,"hud[ckey(perp:wear_id:GetJobName())]")
|
||||
for (var/datum/data/record/E in data_core.general)
|
||||
var/perpname = "wot"
|
||||
if(istype(perp.wear_id,/obj/item/weapon/card/id))
|
||||
perpname = perp.wear_id:registered
|
||||
else if(istype(perp.wear_id,/obj/item/device/pda))
|
||||
var/obj/item/device/pda/tempPda = perp.wear_id
|
||||
perpname = tempPda.owner
|
||||
world << "[perpname]"
|
||||
if (E.fields["name"] == perpname)
|
||||
for (var/datum/data/record/R in data_core.security)
|
||||
if ((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "*Arrest*"))
|
||||
client.images += image(tempHud,perp,"hudwanted")
|
||||
break
|
||||
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Incarcerated"))
|
||||
client.images += image(tempHud,perp,"hudprisoner")
|
||||
break
|
||||
else
|
||||
client.images += image(tempHud,perp,"hudunknown")
|
||||
if (!src.druggy)
|
||||
src.see_invisible = 0
|
||||
else if (istype(glasses, /obj/item/clothing/glasses/hud/health))
|
||||
if(client)
|
||||
var/icon/tempHud = 'hud.dmi'
|
||||
for(var/mob/living/carbon/human/patient in view(src))
|
||||
client.images += image(tempHud,patient,RoundHealth(patient.health))
|
||||
client.images += image(tempHud,patient,"hud[RoundHealth(patient.health)]")
|
||||
if(patient.stat == 2)
|
||||
client.images += image(tempHud,patient,"healthdead")
|
||||
client.images += image(tempHud,patient,"huddead")
|
||||
else if(patient.alien_egg_flag)
|
||||
client.images += image(tempHud,patient,"healthxeno")
|
||||
client.images += image(tempHud,patient,"hudxeno")
|
||||
else if(patient.virus)
|
||||
client.images += image(tempHud,patient,"healthill")
|
||||
client.images += image(tempHud,patient,"hudill")
|
||||
else
|
||||
client.images += image(tempHud,patient,"healthy")
|
||||
client.images += image(tempHud,patient,"hudhealthy")
|
||||
if (!src.druggy)
|
||||
src.see_invisible = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user