Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Numbers in Any Name #479

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions code/modules/client/preferences/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
/// These will be grouped together on the preferences menu
var/group

/// Whether or not to allow numbers in the person's name
var/allow_numbers = FALSE

/// If the highest priority job matches this, will prioritize this name in the UI
var/relevant_job

Expand All @@ -22,15 +19,15 @@
return

/datum/preference/name/deserialize(input, datum/preferences/preferences)
return reject_bad_name("[input]", allow_numbers)
return reject_bad_name("[input]", allow_numbers = TRUE)

/datum/preference/name/serialize(input)
// `is_valid` should always be run before `serialize`, so it should not
// be possible for this to return `null`.
return reject_bad_name(input, allow_numbers)
return reject_bad_name(input, allow_numbers = TRUE)

/datum/preference/name/is_valid(value)
return istext(value) && !isnull(reject_bad_name(value, allow_numbers))
return istext(value) && !isnull(reject_bad_name(value, allow_numbers = TRUE))

/// A character's real name
/datum/preference/name/real_name
Expand Down Expand Up @@ -63,7 +60,7 @@
else if(first_space == length(input))
input += "[pick(GLOB.last_names)]"

return reject_bad_name(input, allow_numbers)
return reject_bad_name(input, allow_numbers = TRUE)

/// The name for a backup human, when nonhumans are made into head of staff
/datum/preference/name/backup_human
Expand Down Expand Up @@ -98,10 +95,7 @@

/datum/preference/name/cyborg
savefile_key = "cyborg_name"

allow_numbers = TRUE
can_randomize = FALSE

explanation = "Cyborg name"
group = "silicons"
relevant_job = /datum/job/cyborg
Expand All @@ -111,8 +105,6 @@

/datum/preference/name/ai
savefile_key = "ai_name"

allow_numbers = TRUE
explanation = "AI name"
group = "silicons"
relevant_job = /datum/job/ai
Expand All @@ -122,9 +114,6 @@

/datum/preference/name/religion
savefile_key = "religion_name"

allow_numbers = TRUE

explanation = "Religion name"
group = "religion"

Expand All @@ -133,10 +122,7 @@

/datum/preference/name/deity
savefile_key = "deity_name"

allow_numbers = TRUE
can_randomize = FALSE

explanation = "Deity name"
group = "religion"

Expand All @@ -145,10 +131,7 @@

/datum/preference/name/bible
savefile_key = "bible_name"

allow_numbers = TRUE
can_randomize = FALSE

explanation = "Bible name"
group = "religion"

Expand Down
Loading