From bd52b3de3232f21bcee79e6bf0faa509626da787 Mon Sep 17 00:00:00 2001 From: jupotter Date: Mon, 8 Apr 2013 14:07:13 +0200 Subject: [PATCH 1/3] Fix medical status change text from medical hud --- code/modules/mob/living/carbon/human/human.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 440ddc4bbe4..2b78063d6d2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -594,7 +594,7 @@ for (var/datum/data/record/R in data_core.general) if (R.fields["id"] == E.fields["id"]) - var/setmedical = input(usr, "Specify a new criminal status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*Deceased*", "*Unconscious*", "Physically Unfit", "Active", "Cancel") + var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*Deceased*", "*Unconscious*", "Physically Unfit", "Active", "Cancel") if(istype(H.glasses, /obj/item/clothing/glasses/hud/health)) if(setmedical != "Cancel") From 4b9d14b564b4eae650bcc52d64c1f90a0863e454 Mon Sep 17 00:00:00 2001 From: jupotter Date: Mon, 8 Apr 2013 14:12:57 +0200 Subject: [PATCH 2/3] Allow medical hud to add comment to medical record Add a direct [Add comment] link in the examine text Add a comment in the record comment list, signed with the current authentication of the HUD wearer Add a [View comments log] link in the medical record view from the Medical Hud This list all the comments as on the medical record computer --- .../mob/living/carbon/human/examine.dm | 1 + code/modules/mob/living/carbon/human/human.dm | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index f1e9108e0b8..9f74dd6447d 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -440,6 +440,7 @@ msg += "Physical status: \[[medical]\]\n" msg += "Medical records: \[View\]\n" + msg += "Medical records: \[View\] \[Add comment\]\n" if(print_flavor_text()) msg += "[print_flavor_text()]\n" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 2b78063d6d2..9accc05da9f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -634,10 +634,69 @@ usr << "Major Disabilities: [R.fields["ma_dis"]]" usr << "Details: [R.fields["ma_dis_d"]]" usr << "Notes: [R.fields["notes"]]" + usr << "\[View Comment Log\]" read = 1 if(!read) usr << "\red Unable to locate a data core entry for this person." + + if (href_list["medrecordComment"]) + if(istype(usr, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = usr + if(istype(H.glasses, /obj/item/clothing/glasses/hud/health)) + var/perpname = "wot" + var/read = 0 + + if(wear_id) + if(istype(wear_id,/obj/item/weapon/card/id)) + perpname = wear_id:registered_name + else if(istype(wear_id,/obj/item/device/pda)) + var/obj/item/device/pda/tempPda = wear_id + perpname = tempPda.owner + else + perpname = src.name + for (var/datum/data/record/E in data_core.general) + if (E.fields["name"] == perpname) + for (var/datum/data/record/R in data_core.medical) + if (R.fields["id"] == E.fields["id"]) + if(istype(H.glasses, /obj/item/clothing/glasses/hud/health)) + read = 1 + var/counter = 1 + while(R.fields[text("com_[]", counter)]) + usr << text("[]", R.fields[text("com_[]", counter)]) + counter++ + if (counter == 1) + usr << "No comment found" + usr << "\[Add comment\]" + + if(!read) + usr << "\red Unable to locate a data core entry for this person." + + if (href_list["medrecordadd"]) + if(istype(usr, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = usr + if(istype(H.glasses, /obj/item/clothing/glasses/hud/health)) + var/perpname = "wot" + if(wear_id) + if(istype(wear_id,/obj/item/weapon/card/id)) + perpname = wear_id:registered_name + else if(istype(wear_id,/obj/item/device/pda)) + var/obj/item/device/pda/tempPda = wear_id + perpname = tempPda.owner + else + perpname = src.name + for (var/datum/data/record/E in data_core.general) + if (E.fields["name"] == perpname) + for (var/datum/data/record/R in data_core.medical) + if (R.fields["id"] == E.fields["id"]) + if(istype(H.glasses, /obj/item/clothing/glasses/hud/health)) + var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN) + if ((!( t1 ) || src.stat || src.restrained() || !(istype(H.glasses, /obj/item/clothing/glasses/hud/health)))) + return + var/counter = 1 + while(R.fields[text("com_[]", counter)]) + counter++ + R.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053
[]",H.get_authentification_name(), H.get_assignment(), time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1) ..() return From 12c7cfc88a51d433cb9a392a6f0bedad744da6e8 Mon Sep 17 00:00:00 2001 From: jupotter Date: Mon, 8 Apr 2013 14:13:58 +0200 Subject: [PATCH 3/3] Allow sec hud to add comment to sec record Add a direct [Add comment] link in the examine text Add a comment in the record comment list, signed with the current authentication of the HUD wearer Add a [View comments log] link in the security record view from the Security Hud This list all the comments as on the security record computer --- .../mob/living/carbon/human/examine.dm | 3 +- code/modules/mob/living/carbon/human/human.dm | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 9f74dd6447d..6c8c7d40bc7 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -413,7 +413,7 @@ msg += "Criminal status: \[[criminal]\]\n" - msg += "Security records: \[View\]\n" + msg += "Security records: \[View\] \[Add comment\]\n" //msg += "\[Set Hostile Identification\]\n" if(istype(usr, /mob/living/carbon/human)) @@ -439,7 +439,6 @@ msg += "Physical status: \[[medical]\]\n" - msg += "Medical records: \[View\]\n" msg += "Medical records: \[View\] \[Add comment\]\n" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 9accc05da9f..a388aaf0ecd 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -568,11 +568,70 @@ usr << "Major Crimes: [R.fields["ma_crim"]]" usr << "Details: [R.fields["ma_crim_d"]]" usr << "Notes: [R.fields["notes"]]" + usr << "\[View Comment Log\]" read = 1 if(!read) usr << "\red Unable to locate a data core entry for this person." + if (href_list["secrecordComment"]) + if(istype(usr, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = usr + if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud)) + var/perpname = "wot" + var/read = 0 + + if(wear_id) + if(istype(wear_id,/obj/item/weapon/card/id)) + perpname = wear_id:registered_name + else if(istype(wear_id,/obj/item/device/pda)) + var/obj/item/device/pda/tempPda = wear_id + perpname = tempPda.owner + else + perpname = src.name + for (var/datum/data/record/E in data_core.general) + if (E.fields["name"] == perpname) + for (var/datum/data/record/R in data_core.security) + if (R.fields["id"] == E.fields["id"]) + if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud)) + read = 1 + var/counter = 1 + while(R.fields[text("com_[]", counter)]) + usr << text("[]", R.fields[text("com_[]", counter)]) + counter++ + if (counter == 1) + usr << "No comment found" + usr << "\[Add comment\]" + + if(!read) + usr << "\red Unable to locate a data core entry for this person." + + if (href_list["secrecordadd"]) + if(istype(usr, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = usr + if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud)) + var/perpname = "wot" + if(wear_id) + if(istype(wear_id,/obj/item/weapon/card/id)) + perpname = wear_id:registered_name + else if(istype(wear_id,/obj/item/device/pda)) + var/obj/item/device/pda/tempPda = wear_id + perpname = tempPda.owner + else + perpname = src.name + for (var/datum/data/record/E in data_core.general) + if (E.fields["name"] == perpname) + for (var/datum/data/record/R in data_core.security) + if (R.fields["id"] == E.fields["id"]) + if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud)) + var/t1 = copytext(sanitize(input("Add Comment:", "Sec. records", null, null) as message),1,MAX_MESSAGE_LEN) + if ((!( t1 ) || src.stat || src.restrained() || !(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud)))) + return + var/counter = 1 + while(R.fields[text("com_[]", counter)]) + counter++ + R.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053
[]",H.get_authentification_name(), H.get_assignment(), time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1) + if (href_list["medical"]) if(istype(usr, /mob/living/carbon/human)) var/mob/living/carbon/human/H = usr