ID console fixes and other tweaks.

This commit is contained in:
Ghommie
2019-11-11 17:10:14 +01:00
parent c4849ead74
commit 63da5ffb13
24 changed files with 309 additions and 246 deletions

View File

@@ -203,6 +203,9 @@
/obj/item/card/id/GetID()
return src
/obj/item/card/id/RemoveID()
return src
/*
Usage:
update_label()

View File

@@ -200,6 +200,18 @@ GLOBAL_LIST_EMPTY(PDAs)
/obj/item/pda/GetID()
return id
/obj/item/pda/RemoveID()
return do_remove_id()
/obj/item/pda/InsertID(obj/item/inserting_item)
var/obj/item/card/inserting_id = inserting_item.RemoveID()
if(!inserting_id)
return
insert_id(inserting_id)
if(id == inserting_id)
return TRUE
return FALSE
/obj/item/pda/update_icon(alert = FALSE, new_overlays = FALSE)
if(new_overlays)
set_new_overlays()
@@ -688,15 +700,27 @@ GLOBAL_LIST_EMPTY(PDAs)
return
/obj/item/pda/proc/remove_id()
if(issilicon(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
do_remove_id(usr)
if (id)
usr.put_in_hands(id)
to_chat(usr, "<span class='notice'>You remove the ID from the [name].</span>")
id = null
update_icon()
/obj/item/pda/proc/do_remove_id(mob/user)
if(!id)
return
if(user)
user.put_in_hands(id)
to_chat(user, "<span class='notice'>You remove the ID from the [name].</span>")
else
id.forceMove(get_turf(src))
. = id
id = null
update_icon()
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.wear_id == src)
H.sec_hud_set_ID()
/obj/item/pda/proc/msg_input(mob/living/U = usr)
var/t = stripped_input(U, "Please enter message", name)
@@ -878,17 +902,25 @@ GLOBAL_LIST_EMPTY(PDAs)
if(istype(C))
I = C
if(I && I.registered_name)
if(!user.transferItemToLoc(I, src))
return FALSE
var/obj/old_id = id
id = I
if(old_id)
user.put_in_hands(old_id)
if(I?.registered_name)
insert_id(I, user)
update_icon()
playsound(src, 'sound/machines/button.ogg', 50, 1)
return TRUE
/obj/item/pda/proc/insert_id(obj/item/card/id/inserting_id, mob/user)
var/obj/old_id = id
id = inserting_id
if(ishuman(loc))
var/mob/living/carbon/human/human_wearer = loc
if(human_wearer.wear_id == src)
human_wearer.sec_hud_set_ID()
if(old_id)
if(user)
user.put_in_hands(old_id)
else
old_id.forceMove(get_turf(src))
// access to status display signals
/obj/item/pda/attackby(obj/item/C, mob/user, params)
if(istype(C, /obj/item/cartridge) && !cartridge)

View File

@@ -68,6 +68,21 @@
/obj/item/storage/wallet/GetID()
return front_id
/obj/item/storage/wallet/RemoveID()
if(!front_id)
return
. = front_id
front_id.forceMove(get_turf(src))
/obj/item/storage/wallet/InsertID(obj/item/inserting_item)
var/obj/item/card/inserting_id = inserting_item.RemoveID()
if(!inserting_id)
return FALSE
attackby(inserting_id)
if(inserting_id in contents)
return TRUE
return FALSE
/obj/item/storage/wallet/GetAccess()
if(LAZYLEN(combined_access))
return combined_access