Silicons can now be easily renamed.

Moves the AI SetName proc down silicon level.
This commit is contained in:
PsiOmega
2015-02-04 09:48:30 +01:00
parent 1eaf311b25
commit 1a1bf4a718
5 changed files with 22 additions and 10 deletions

View File

@@ -46,7 +46,7 @@ var/list/admin_verbs_admin = list(
/client/proc/cmd_admin_create_centcom_report, /client/proc/cmd_admin_create_centcom_report,
/client/proc/check_words, /*displays cult-words*/ /client/proc/check_words, /*displays cult-words*/
/client/proc/check_ai_laws, /*shows AI and borg laws*/ /client/proc/check_ai_laws, /*shows AI and borg laws*/
/client/proc/rename_ai, /*properly renames the AI*/ /client/proc/rename_silicon, /*properly renames silicons*/
/client/proc/check_antagonists, /client/proc/check_antagonists,
/client/proc/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/ /client/proc/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/
/client/proc/dsay, /*talk in deadchat using our ckey/fakekey*/ /client/proc/dsay, /*talk in deadchat using our ckey/fakekey*/
@@ -693,15 +693,15 @@ var/list/admin_verbs_mentor = list(
if(holder) if(holder)
src.holder.output_ai_laws() src.holder.output_ai_laws()
/client/proc/rename_ai(mob/living/silicon/ai/AI in world) /client/proc/rename_silicon(mob/living/silicon/S in world)
set name = "Rename AI" set name = "Rename Silicon"
set category = "Admin" set category = "Admin"
if(holder) if(holder)
var/new_name = trim_strip_input(src, "Enter new AI name. Leave blank or as is to cancel.", "Enter new AI Name", AI.name) var/new_name = trim_strip_input(src, "Enter new name. Leave blank or as is to cancel.", "Enter new silicon name", S.real_name)
if(new_name && new_name != AI.name) if(new_name && new_name != S.real_name)
admin_log_and_message_admins("has renamed the AI '[AI.name]' to '[new_name]'") admin_log_and_message_admins("has renamed the silicon '[S.real_name]' to '[new_name]'")
AI.SetName(new_name) S.SetName(new_name)
feedback_add_details("admin_verb","RAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! feedback_add_details("admin_verb","RAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -211,9 +211,8 @@ var/list/ai_verbs_default = list(
else else
stat(null, text("Systems nonfunctional")) stat(null, text("Systems nonfunctional"))
/mob/living/silicon/ai/proc/SetName(pickedName as text) /mob/living/silicon/ai/SetName(pickedName as text)
real_name = pickedName ..()
name = pickedName
announcement.announcer = pickedName announcement.announcer = pickedName
if(eyeobj) if(eyeobj)
eyeobj.name = "[pickedName] (AI Eye)" eyeobj.name = "[pickedName] (AI Eye)"

View File

@@ -77,6 +77,11 @@
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0) playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
//Redefining some robot procs... //Redefining some robot procs...
/mob/living/silicon/robot/drone/SetName(pickedName as text)
// Would prefer to call the grandparent proc but this isn't possible, so..
real_name = pickedName
name = real_name
/mob/living/silicon/robot/drone/updatename() /mob/living/silicon/robot/drone/updatename()
real_name = "maintenance drone ([rand(100,999)])" real_name = "maintenance drone ([rand(100,999)])"
name = real_name name = real_name

View File

@@ -184,6 +184,10 @@ var/list/robot_verbs_default = list(
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0) playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
/mob/living/silicon/robot/SetName(pickedName as text)
custom_name = pickedName
updatename()
/mob/living/silicon/robot/proc/sync() /mob/living/silicon/robot/proc/sync()
if(lawupdate && connected_ai) if(lawupdate && connected_ai)
lawsync() lawsync()

View File

@@ -30,6 +30,10 @@
..() ..()
add_language("Galactic Common") add_language("Galactic Common")
/mob/living/silicon/proc/SetName(pickedName as text)
real_name = pickedName
name = real_name
/mob/living/silicon/proc/show_laws() /mob/living/silicon/proc/show_laws()
return return