Merge branch 'master' into limbs
This commit is contained in:
@@ -247,6 +247,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
/// Which of the 5 persistent scar slots we randomly roll to load for this round, if enabled. Actually rolled in [/datum/preferences/proc/load_character(slot)]
|
||||
var/scars_index = 1
|
||||
|
||||
var/chosen_limb_id //body sprite selected to load for the users limbs, null means default, is sanitized when loaded
|
||||
|
||||
/datum/preferences/New(client/C)
|
||||
parent = C
|
||||
|
||||
@@ -526,6 +528,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "</td>"
|
||||
mutant_category = 0
|
||||
|
||||
if(length(pref_species.allowed_limb_ids))
|
||||
if(!chosen_limb_id || !(chosen_limb_id in pref_species.allowed_limb_ids))
|
||||
chosen_limb_id = pref_species.id
|
||||
dat += "<h3>Body sprite</h3>"
|
||||
dat += "<a style='display:block;width:100px' href='?_src_=prefs;preference=bodysprite;task=input'>[chosen_limb_id]</a>"
|
||||
|
||||
if(mutant_category)
|
||||
dat += "</td>"
|
||||
mutant_category = 0
|
||||
@@ -2120,8 +2128,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
else
|
||||
features["body_model"] = chosengender
|
||||
gender = chosengender
|
||||
facial_hair_style = random_facial_hair_style(gender)
|
||||
hair_style = random_hair_style(gender)
|
||||
|
||||
if("body_size")
|
||||
var/min = CONFIG_GET(number/body_size_min)
|
||||
@@ -2147,6 +2153,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/selected_custom_speech_verb = input(user, "Choose your desired speech verb (none means your species speech verb)", "Character Preference") as null|anything in GLOB.speech_verbs
|
||||
if(selected_custom_speech_verb)
|
||||
custom_speech_verb = selected_custom_speech_verb
|
||||
|
||||
if("bodysprite")
|
||||
var/selected_body_sprite = input(user, "Choose your desired body sprite", "Character Preference") as null|anything in pref_species.allowed_limb_ids
|
||||
if(selected_body_sprite)
|
||||
chosen_limb_id = selected_body_sprite //this gets sanitized before loading
|
||||
else
|
||||
switch(href_list["preference"])
|
||||
//CITADEL PREFERENCES EDIT - I can't figure out how to modularize these, so they have to go here. :c -Pooj
|
||||
@@ -2538,6 +2549,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
character.dna.features = features.Copy()
|
||||
character.set_species(chosen_species, icon_update = FALSE, pref_load = TRUE)
|
||||
if(chosen_limb_id && (chosen_limb_id in character.dna.species.allowed_limb_ids))
|
||||
character.dna.species.mutant_bodyparts["limbs_id"] = chosen_limb_id
|
||||
character.dna.real_name = character.real_name
|
||||
character.dna.nameless = character.nameless
|
||||
character.dna.custom_species = character.custom_species
|
||||
|
||||
@@ -515,7 +515,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["scars4"] >> scars_list["4"]
|
||||
S["scars5"] >> scars_list["5"]
|
||||
json_decode(S["modified_limbs"]) >> modified_limbs
|
||||
|
||||
S["chosen_limb_id"] >> chosen_limb_id
|
||||
|
||||
//Custom names
|
||||
for(var/custom_name_id in GLOB.preferences_custom_names)
|
||||
@@ -872,6 +872,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["scars4"] , scars_list["4"])
|
||||
WRITE_FILE(S["scars5"] , scars_list["5"])
|
||||
WRITE_FILE(S["modified_limbs"] , json_encode(modified_limbs))
|
||||
WRITE_FILE(S["chosen_limb_id"], chosen_limb_id)
|
||||
|
||||
//gear loadout
|
||||
if(chosen_gear.len)
|
||||
|
||||
Reference in New Issue
Block a user