mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
POLARIS: Communicator small refactor
This commit is contained in:
@@ -134,11 +134,7 @@
|
||||
if(href_list["rename"])
|
||||
var/new_name = sanitizeSafe(input(usr,"Please enter your name.","Communicator",usr.name) )
|
||||
if(new_name)
|
||||
owner = new_name
|
||||
name = "[owner]'s [initial(name)]"
|
||||
if(camera)
|
||||
camera.name = name
|
||||
camera.c_tag = name
|
||||
register_device(new_name)
|
||||
|
||||
if(href_list["toggle_visibility"])
|
||||
switch(network_visibility)
|
||||
|
||||
@@ -75,12 +75,12 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
|
||||
//This is a pretty terrible way of doing this.
|
||||
spawn(5 SECONDS) //Wait for our mob to finish spawning.
|
||||
if(ismob(loc))
|
||||
register_device(loc)
|
||||
register_device(loc.name)
|
||||
initialize_exonet(loc)
|
||||
else if(istype(loc, /obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = loc
|
||||
if(ismob(S.loc))
|
||||
register_device(S.loc)
|
||||
register_device(S.loc.name)
|
||||
initialize_exonet(S.loc)
|
||||
|
||||
// Proc: examine()
|
||||
@@ -268,12 +268,12 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
|
||||
// Proc: register_device()
|
||||
// Parameters: 1 (user - the person to use their name for)
|
||||
// Description: Updates the owner's name and the device's name.
|
||||
/obj/item/device/communicator/proc/register_device(mob/user)
|
||||
if(!user)
|
||||
/obj/item/device/communicator/proc/register_device(new_name)
|
||||
if(!new_name)
|
||||
return
|
||||
owner = user.name
|
||||
owner = new_name
|
||||
|
||||
name = "[owner]'s [initial(name)]"
|
||||
name = "[new_name]'s [initial(name)]"
|
||||
if(camera)
|
||||
camera.name = name
|
||||
camera.c_tag = name
|
||||
|
||||
@@ -258,7 +258,7 @@ var/list/ai_verbs_default = list(
|
||||
aiPDA.name = pickedName + " (" + aiPDA.ownjob + ")"
|
||||
|
||||
if(aiCommunicator)
|
||||
aiCommunicator.register_device(src)
|
||||
aiCommunicator.register_device(src.name)
|
||||
|
||||
/*
|
||||
The AI Power supply is a dummy object used for powering the AI since only machinery should be using power.
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
/mob/living/silicon/robot/proc/setup_communicator()
|
||||
if (!communicator)
|
||||
communicator = new/obj/item/device/communicator/integrated(src)
|
||||
communicator.register_device(src, "[modtype] [braintype]")
|
||||
communicator.register_device(src.name, "[modtype] [braintype]")
|
||||
|
||||
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
|
||||
//Improved /N
|
||||
|
||||
Reference in New Issue
Block a user