From 709ddb4e584952552ab89941351ecc4430f9159f Mon Sep 17 00:00:00 2001
From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Fri, 21 Aug 2020 03:48:30 +0100
Subject: [PATCH] test
---
code/modules/client/preferences.dm | 13 +++++++++++++
code/modules/mob/living/carbon/human/species.dm | 7 ++++++-
.../carbon/human/species_types/furrypeople.dm | 2 ++
.../modules/mob/living/carbon/human/update_icons.dm | 2 +-
code/modules/surgery/bodyparts/_bodyparts.dm | 2 +-
5 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 480ebda4f8..a1b986f0ac 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -246,6 +246,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
@@ -521,6 +523,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += ""
mutant_category = 0
+ if(length(pref_species.allowed_limb_ids))
+ dat += "
Body sprite
"
+ dat += "[pref_species.mutant_bodyparts["limbs_id"]]"
+
if(mutant_category)
dat += ""
mutant_category = 0
@@ -2119,6 +2125,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
@@ -2510,6 +2521,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
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 230a634e0e..ed509f900a 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -114,6 +114,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/// Our default override for typing indicator state
var/typing_indicator_state
+ //the ids you can use for your species, if empty, it means default only and not changeable
+ var/list/allowed_limb_ids
+
///////////
// PROCS //
///////////
@@ -121,7 +124,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/datum/species/New()
if(!limbs_id) //if we havent set a limbs id to use, just use our own id
- limbs_id = id
+ mutant_bodyparts["limbs_id"] = id //done this way to be non-intrusive to the existing system
+ else
+ mutant_bodyparts["limbs_id"] = limbs_id
..()
//update our mutant bodyparts to include unlocked ones
diff --git a/code/modules/mob/living/carbon/human/species_types/furrypeople.dm b/code/modules/mob/living/carbon/human/species_types/furrypeople.dm
index 7706d4a9d5..6fca61e4dd 100644
--- a/code/modules/mob/living/carbon/human/species_types/furrypeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/furrypeople.dm
@@ -17,3 +17,5 @@
tail_type = "mam_tail"
wagging_type = "mam_waggingtail"
species_type = "furry"
+
+ allowed_limb_ids = list("lizard","pod","mammal","human","insect")
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index e399ddf872..9b39438563 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -660,7 +660,7 @@ use_mob_overlay_icon: if FALSE, it will always use the default_icon_file even if
//produces a key based on the human's limbs
/mob/living/carbon/human/generate_icon_render_key()
- . = "[dna.species.limbs_id]"
+ . = "[dna.species.mutant_bodyparts["limbs_id"]]"
if(dna.check_mutation(HULK))
. += "-coloured-hulk"
diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm
index 3d88282937..8e360a38b4 100644
--- a/code/modules/surgery/bodyparts/_bodyparts.dm
+++ b/code/modules/surgery/bodyparts/_bodyparts.dm
@@ -598,7 +598,7 @@
var/datum/species/S = H.dna.species
base_bp_icon = S?.icon_limbs || DEFAULT_BODYPART_ICON
- species_id = S.limbs_id
+ species_id = S.mutant_bodyparts["limbs_id"]
species_flags_list = H.dna.species.species_traits
//body marking memes