Expands "genderless" to all species, adds body-type option, removes some gender checks (#23910)

* adds most body type support, removes some gender checks

* remove gender from species, accessories

* restore pick_list

* re-adds limitations on accessories

* Universal access to body hair

* remove unused var

* Update example config, some preference saving code

* updates tgui bundle

* oops

* Remove formatting

* hopefully undoes formatting changes

* dammit

* been meaning to fix this one for a while

* dgamer reviews

* move body_type into human_defines

* sql file changes

* update tgui

* Update db code

* bump versions

---------

Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Luc
2024-04-21 15:59:23 +00:00
committed by GitHub
co-authored by S34N github-actions <41898282+github-actions[bot]@users.noreply.github.com>
parent 9bc9b4b67a
commit f83ef617e9
34 changed files with 171 additions and 170 deletions
+28 -15
View File
@@ -6,6 +6,7 @@
var/real_name //our character's name
var/be_random_name = FALSE //whether we are a random name every round
var/gender = MALE //gender of character (well duh)
var/body_type = MALE //body sprite variant
var/age = 30 //age of character
var/b_type = "A+" //blood type (not-chooseable)
var/underwear = "Nude" //underwear type
@@ -118,13 +119,13 @@
var/markingcolourslist = list2params(m_colours)
var/markingstyleslist = list2params(m_styles)
if(!isemptylist(organ_data))
if(length(organ_data))
organ_list = list2params(organ_data)
if(!isemptylist(rlimb_data))
if(length(rlimb_data))
rlimb_list = list2params(rlimb_data)
if(!isemptylist(player_alt_titles))
if(length(player_alt_titles))
playertitlelist = list2params(player_alt_titles)
if(!isemptylist(loadout_gear))
if(length(loadout_gear))
gearlist = json_encode(loadout_gear)
var/datum/db_query/firstquery = SSdbcore.NewQuery("SELECT slot FROM characters WHERE ckey=:ckey ORDER BY slot", list(
@@ -141,6 +142,7 @@
real_name=:real_name,
name_is_always_random=:be_random_name,
gender=:gender,
body_type=:body_type,
age=:age,
species=:species,
language=:language,
@@ -193,7 +195,8 @@
hair_gradient_colour=:h_grad_colour,
hair_gradient_alpha=:h_grad_alpha,
custom_emotes=:custom_emotes,
cyborg_brain_type=:cyborg_brain_type
cyborg_brain_type=:cyborg_brain_type,
body_type=:body_type
WHERE ckey=:ckey
AND slot=:slot"}, list(
// OH GOD SO MANY PARAMETERS
@@ -201,6 +204,7 @@
"real_name" = real_name,
"be_random_name" = be_random_name,
"gender" = gender,
"body_type" = body_type,
"age" = age,
"species" = species,
"language" = language,
@@ -294,7 +298,7 @@
player_alt_titles,
disabilities, organ_data, rlimb_data, nanotrasen_relation, physique, height, speciesprefs,
socks, body_accessory, gear, autohiss,
hair_gradient, hair_gradient_offset, hair_gradient_colour, hair_gradient_alpha, custom_emotes, cyborg_brain_type)
hair_gradient, hair_gradient_offset, hair_gradient_colour, hair_gradient_alpha, custom_emotes, cyborg_brain_type, body_type)
VALUES
(:ckey, :slot, :metadata, :name, :be_random_name, :gender,
:age, :species, :language,
@@ -321,7 +325,7 @@
:playertitlelist,
:disabilities, :organ_list, :rlimb_list, :nanotrasen_relation, :physique, :height, :speciesprefs,
:socks, :body_accessory, :gearlist, :autohiss_mode,
:h_grad_style, :h_grad_offset, :h_grad_colour, :h_grad_alpha, :custom_emotes, :cyborg_brain_type)
:h_grad_style, :h_grad_offset, :h_grad_colour, :h_grad_alpha, :custom_emotes, :cyborg_brain_type, :body_type)
"}, list(
// This has too many params for anyone to look at this without going insae
"ckey" = C.ckey,
@@ -330,6 +334,7 @@
"name" = real_name,
"be_random_name" = be_random_name,
"gender" = gender,
"body_type" = body_type,
"age" = age,
"species" = species,
"language" = language,
@@ -394,6 +399,10 @@
return 1
/**
* Load in and process the database's information on the player's character save.
* The order of indices here is the relative order from get_query() in 20-load-characters.dm.
*/
/datum/character_save/proc/load(datum/db_query/query)
//Character
metadata = query.item[1]
@@ -471,6 +480,7 @@
physique = query.item[56]
height = query.item[57]
cyborg_brain_type = query.item[58]
body_type = query.item[59]
//Sanitize
var/datum/species/SP = GLOB.all_species[species]
@@ -504,7 +514,7 @@
real_name = random_name(gender, species)
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
gender = sanitize_gender(gender, FALSE, !SP.has_gender)
gender = sanitize_gender(gender, FALSE)
age = sanitize_integer(age, SP.min_age, SP.max_age, initial(age))
h_colour = sanitize_hexcolor(h_colour)
h_sec_colour = sanitize_hexcolor(h_sec_colour)
@@ -590,9 +600,10 @@
gender = gender_override
else
gender = pick(MALE, FEMALE)
underwear = random_underwear(gender, species)
undershirt = random_undershirt(gender, species)
socks = random_socks(gender, species)
body_type = pick(MALE, FEMALE)
underwear = random_underwear(body_type, species)
undershirt = random_undershirt(body_type, species)
socks = random_socks(body_type, species)
if(length(GLOB.body_accessory_by_species[species]))
body_accessory = random_body_accessory(species, S.optional_body_accessory)
if(S.bodyflags & (HAS_SKIN_TONE|HAS_ICON_SKIN_TONE))
@@ -794,7 +805,8 @@
qdel(preview_icon)
var/g = "m"
if(gender == FEMALE) g = "f"
if(body_type == FEMALE)
g = "f"
var/icon/icobase
var/datum/species/current_species = GLOB.all_species[species]
@@ -1808,6 +1820,7 @@
character.gen_record = gen_record
character.change_gender(gender)
character.body_type = body_type // TODO does this update the character properly or do we need a setter here
character.age = age
//Head-specific
@@ -1885,10 +1898,10 @@
character.backbag = backbag
//Debugging report to track down a bug, which randomly assigned the plural gender to people.
if(character.dna.species.has_gender && (character.gender in list(PLURAL, NEUTER)))
if(character.gender == NEUTER)
if(isliving(src)) //Ghosts get neuter by default
message_admins("[key_name_admin(character)] has spawned with their gender as plural or neuter. Please notify coders.")
character.change_gender(MALE)
message_admins("[key_name_admin(character)] has spawned with their gender as neuter. Please notify coders.")
character.change_gender(PLURAL)
character.change_eye_color(e_colour, skip_icons = TRUE)
character.original_eye_color = e_colour