Fixes borg names. (#38733)

* Fixes borg names.

* Makes it call the db only once.

* Default cyborg naming scheme.

* Makes cyborgs default to default name instead of random ai one.
This commit is contained in:
AnturK
2018-06-28 20:32:14 +03:00
committed by vuonojenmustaturska
parent 38109114c2
commit abfe09659c
9 changed files with 26 additions and 17 deletions
+7 -2
View File
@@ -127,7 +127,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
parent = C
custom_names["human"] = random_unique_name()
custom_names["ai"] = pick(GLOB.ai_names)
custom_names["cyborg"] = pick(GLOB.ai_names)
custom_names["cyborg"] = DEFAULT_CYBORG_NAME
custom_names["clown"] = pick(GLOB.clown_names)
custom_names["mime"] = pick(GLOB.mime_names)
UI_style = GLOB.available_ui_styles[1]
@@ -1341,7 +1341,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
to_chat(user, "<font color='red'>Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, 0-9, -, ' and .</font>")
if("cyborg_name")
var/new_cyborg_name = reject_bad_name( input(user, "Choose your character's cyborg name:", "Character Preference") as text|null, 1 )
var/raw_name = input(user, "Choose your character's cyborg name (Leave empty to use default naming scheme):", "Character Preference") as text|null
var/new_cyborg_name
if(!raw_name)
new_cyborg_name = DEFAULT_CYBORG_NAME
else
new_cyborg_name = reject_bad_name(raw_name,1 )
if(new_cyborg_name)
custom_names["cyborg"] = new_cyborg_name
else
+2 -2
View File
@@ -18,7 +18,7 @@ Clown
minimal_access = list(ACCESS_THEATRE)
/datum/job/clown/after_spawn(mob/living/carbon/human/H, mob/M)
H.rename_self("clown", M.client)
H.apply_pref_name("clown", M.client)
/datum/outfit/job/clown
name = "Clown"
@@ -81,7 +81,7 @@ Mime
minimal_access = list(ACCESS_THEATRE)
/datum/job/mime/after_spawn(mob/living/carbon/human/H, mob/M)
H.rename_self("mime", M.client)
H.apply_pref_name("mime", M.client)
/datum/outfit/job/mime
name = "Mime"
+1 -1
View File
@@ -81,7 +81,7 @@
if(CONFIG_GET(flag/enforce_human_authority) && (title in GLOB.command_positions))
if(H.dna.species.id != "human")
H.set_species(/datum/species/human)
H.rename_self("human", H.client)
H.apply_pref_name("human", H.client)
purrbation_remove(H, silent=TRUE)
//Equip the rest of the gear
+2 -2
View File
@@ -34,7 +34,7 @@ AI
H.forceMove(lateJoinCore.loc)
qdel(lateJoinCore)
var/mob/living/silicon/ai/AI = H
AI.rename_self("ai", M.client) //If this runtimes oh well jobcode is fucked.
AI.apply_pref_name("ai", M.client) //If this runtimes oh well jobcode is fucked.
//we may have been created after our borg
if(SSticker.current_state == GAME_STATE_SETTING_UP)
@@ -85,4 +85,4 @@ Cyborg
return H.Robotize(FALSE, latejoin)
/datum/job/cyborg/after_spawn(mob/living/silicon/robot/R, mob/M)
R.rename_self("cyborg", M.client)
R.apply_pref_name("cyborg", M.client)
+1 -1
View File
@@ -124,7 +124,7 @@
job = "AI"
create_eye()
rename_self("ai")
apply_pref_name("ai")
holo_icon = getHologramIcon(icon('icons/mob/ai.dmi',"default"))
@@ -240,9 +240,9 @@
var/changed_name = ""
if(custom_name)
changed_name = custom_name
if(changed_name == "" && client)
rename_self(src, client)
return //built in camera handled in proc
if(changed_name == "" && client && client.prefs.custom_names["cyborg"] != DEFAULT_CYBORG_NAME)
if(apply_pref_name("cyborg", client))
return //built in camera handled in proc
if(!changed_name)
changed_name = get_standard_name()
+1 -1
View File
@@ -379,7 +379,7 @@
else if(transfer_after)
R.key = key
R.rename_self("cyborg")
R.apply_pref_name("cyborg")
if(R.mmi)
R.mmi.name = "Man-Machine Interface: [real_name]"