From 6c668c7c7bf313be3742d3e052bedd2d7ea11b63 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Apr 2014 21:15:22 +0200 Subject: [PATCH] Generalised PDA naming --- code/__HELPERS/unsorted.dm | 2 +- code/game/jobs/job_controller.dm | 7 ++----- code/game/objects/items/devices/PDA/PDA.dm | 9 ++++++--- code/modules/admin/verbs/debug.dm | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 46b419a0474..bc1668f242b 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -286,7 +286,7 @@ Turf and target are seperate in case you want to teleport some distance from a t var/obj/item/device/pda/PDA = A if(PDA.owner == oldname) PDA.owner = newname - PDA.name = "PDA-[newname] ([PDA.ownjob])" + PDA.update_label() if(!search_id) break search_pda = 0 diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 95a42432d83..9b262f419d9 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -366,16 +366,13 @@ var/global/datum/controller/occupations/job_master C.assignment = rank C.name = "[C.registered_name]'s ID Card ([C.assignment])" H.equip_to_slot_or_del(C, slot_wear_id) - /* if(prob(50)) - H.equip_to_slot_or_del(new /obj/item/weapon/pen(H), slot_r_store) - else - H.equip_to_slot_or_del(new /obj/item/weapon/pen/blue(H), slot_r_store)*/ + H.equip_to_slot_or_del(new /obj/item/device/pda(H), slot_belt) if(locate(/obj/item/device/pda,H))//I bet this could just use locate. It can --SkyMarshal var/obj/item/device/pda/pda = locate(/obj/item/device/pda,H) pda.owner = H.real_name pda.ownjob = C.assignment - pda.name = "PDA-[H.real_name] ([pda.ownjob])" + pda.update_label() return 1 diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 3d18e1a5f17..7694275849a 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -14,7 +14,7 @@ var/global/list/obj/item/device/pda/PDAs = list() slot_flags = SLOT_ID | SLOT_BELT //Main variables - var/owner = null + var/owner = null // String name of owner var/default_cartridge = 0 // Access level defined by cartridge var/obj/item/weapon/cartridge/cartridge = null //current cartridge var/mode = 0 //Controls what menu the PDA will display. 0 is hub; the rest are either built in or based on cartridge. @@ -216,6 +216,9 @@ var/global/list/obj/item/device/pda/PDAs = list() cartridge = new default_cartridge(src) new /obj/item/weapon/pen(src) +/obj/item/device/pda/proc/update_label() + name = "PDA-[owner] ([ownjob])" //Name generalisation + /obj/item/device/pda/proc/can_use(mob/user) if(user && ismob(user)) if(user.stat || user.restrained() || user.paralysis || user.stunned || user.weakened) @@ -472,7 +475,7 @@ var/global/list/obj/item/device/pda/PDAs = list() id_check(U, 1) if("UpdateInfo") ownjob = id.assignment - name = "PDA-[owner] ([ownjob])" + update_label() if("Eject")//Ejects the cart, only done from hub. if (!isnull(cartridge)) var/turf/T = loc @@ -848,7 +851,7 @@ var/global/list/obj/item/device/pda/PDAs = list() if(!owner) owner = idcard.registered_name ownjob = idcard.assignment - name = "PDA-[owner] ([ownjob])" + update_label() user << "Card scanned." else //Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand. diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 4b842ef4db6..2496300ba66 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -672,7 +672,7 @@ var/global/list/g_fancy_list_of_safe_types = null var/obj/item/device/pda/P = new(M) P.owner = M.real_name P.ownjob = "Assistant" - P.name = "PDA-[M.real_name] (Assistant)" + P.update_label() M.equip_to_slot_or_del(P, slot_belt) @@ -856,7 +856,7 @@ var/global/list/g_fancy_list_of_safe_types = null var/obj/item/device/pda/heads/pda = new(M) pda.owner = M.real_name pda.ownjob = "Reaper" - pda.name = "PDA-[M.real_name] ([pda.ownjob])" + pda.update_label() M.equip_to_slot_or_del(pda, slot_belt) @@ -927,7 +927,7 @@ var/global/list/g_fancy_list_of_safe_types = null var/obj/item/device/pda/heads/pda = new(M) pda.owner = M.real_name pda.ownjob = "Centcom Official" - pda.name = "PDA-[M.real_name] ([pda.ownjob])" + pda.update_label() M.equip_to_slot_or_del(pda, slot_r_store)