diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index 2ed081b931d..7dd312460d5 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -36,7 +36,7 @@ var/global/list/datum/species/all_species = list() var/global/list/all_languages = list() var/global/list/language_keys = list() // Table of say codes for all languages var/global/list/whitelisted_species = list(SPECIES_HUMAN) // Species that require a whitelist check. -var/global/list/playable_species = list(SPECIES_HUMAN) // A list of ALL playable species, whitelisted, latejoin or otherwise. +var/global/list/playable_species = list() // A list of ALL playable species, whitelisted, latejoin or otherwise. // Posters var/global/list/poster_designs = list() @@ -168,8 +168,10 @@ var/global/list/cloaking_devices = list() for (var/thing in all_species) var/datum/species/S = all_species[thing] - if (!(S.spawn_flags & IS_RESTRICTED)) - playable_species += S.name + if(!(S.spawn_flags & IS_RESTRICTED) && S.category_name) + if(!length(playable_species[S.category_name])) + playable_species[S.category_name] = list() + playable_species[S.category_name] += S.name if(S.spawn_flags & IS_WHITELISTED) whitelisted_species += S.name diff --git a/code/modules/client/preference_setup/general/01_basic.dm b/code/modules/client/preference_setup/general/01_basic.dm index ba17623aaee..765e6f7c3a0 100644 --- a/code/modules/client/preference_setup/general/01_basic.dm +++ b/code/modules/client/preference_setup/general/01_basic.dm @@ -118,7 +118,13 @@ log_debug("SQL CHARACTER LOAD: Logic error, general/basic/load_special() didn't return any rows when it should have. Character ID: [pref.current_character].") /datum/category_item/player_setup_item/general/basic/sanitize_character() - if(!pref.species || !(pref.species in playable_species)) + if(!pref.species) + pref.species = SPECIES_HUMAN + var/is_in_playable_species = FALSE + for(var/thing in playable_species) + if(pref.species in playable_species[thing]) + is_in_playable_species = TRUE + if(!is_in_playable_species) pref.species = SPECIES_HUMAN pref.age = sanitize_integer(text2num(pref.age), pref.getMinAge(), pref.getMaxAge(), initial(pref.age)) diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 4725972b386..6ad637fafcc 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -313,8 +313,16 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O else if(href_list["show_species"]) // Actual whitelist checks are handled elsewhere, this is just for accessing the preview window. - var/choice = input("Which species would you like to look at?") as null|anything in playable_species - if(!choice) return + var/species_choice = input(usr, "Which species would you like to look at?", "Species Selection") as null|anything in playable_species + if(!species_choice) + return + var/choice + if(length(playable_species[species_choice]) == 1) + choice = playable_species[species_choice][1] + else + choice = input(usr, "Which subspecies would you like to look at?", "Sub-species Selection") as null|anything in playable_species[species_choice] + if(!choice) + return choice = html_decode(choice) pref.species_preview = choice SetSpecies(preference_mob()) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 947f8f7155d..918249e0547 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -9,6 +9,7 @@ var/name_plural // Pluralized name (since "[name]s" is not always valid) var/hide_name = FALSE // If TRUE, the species' name won't be visible on examine. var/short_name // Shortened form of the name, for code use. Must be exactly 3 letter long, and all lowercase + var/category_name // a name for this overarching species, ie 'Human', 'Skrell', 'IPC'. only used in character creation var/blurb = "A completely nondescript species." // A brief lore summary for use in the chargen screen. var/bodytype var/age_min = 17 diff --git a/code/modules/mob/living/carbon/human/species/station/human/human.dm b/code/modules/mob/living/carbon/human/species/station/human/human.dm index dd460f83728..900b212ca55 100644 --- a/code/modules/mob/living/carbon/human/species/station/human/human.dm +++ b/code/modules/mob/living/carbon/human/species/station/human/human.dm @@ -3,6 +3,7 @@ hide_name = TRUE short_name = "hum" name_plural = "Humans" + category_name = "Human" bodytype = BODYTYPE_HUMAN age_max = 125 economic_modifier = 12 diff --git a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm index 9cfc138ec48..0cc04f41171 100644 --- a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm +++ b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm @@ -2,6 +2,7 @@ name = SPECIES_IPC short_name = "ipc" name_plural = "Baselines" + category_name = "Integrated Positronic Chassis" bodytype = BODYTYPE_IPC age_min = 1 age_max = 60 diff --git a/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm b/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm index 4acfb900cf1..d01a34ff000 100644 --- a/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm +++ b/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm @@ -2,6 +2,7 @@ name = SPECIES_SKRELL short_name = "skr" name_plural = "Skrell" + category_name = "Skrell" bodytype = BODYTYPE_SKRELL age_max = 500 default_genders = list(PLURAL) diff --git a/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm b/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm index 0ca9dc2ed80..3929136a1e6 100644 --- a/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm +++ b/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm @@ -2,6 +2,7 @@ name = SPECIES_TAJARA short_name = "taj" name_plural = "Tajara" + category_name = "Tajara" bodytype = BODYTYPE_TAJARA icobase = 'icons/mob/human_races/tajara/r_tajaran.dmi' deform = 'icons/mob/human_races/tajara/r_def_tajaran.dmi' diff --git a/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm b/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm index 7c881a259cf..da04f664a9d 100644 --- a/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm +++ b/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm @@ -2,6 +2,7 @@ name = SPECIES_UNATHI short_name = "una" name_plural = "Unathi" + category_name = "Unathi" bodytype = BODYTYPE_UNATHI icobase = 'icons/mob/human_races/unathi/r_lizard.dmi' deform = 'icons/mob/human_races/unathi/r_def_lizard.dmi' diff --git a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm index 6cab8a6b8b0..fa0bcd2b896 100644 --- a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm +++ b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm @@ -2,6 +2,7 @@ name = SPECIES_VAURCA_WORKER short_name = "vau" name_plural = "Type A" + category_name = "Vaurca" bodytype = BODYTYPE_VAURCA age_min = 1 age_max = 20 diff --git a/html/changelogs/geeves-better_species_select.yml b/html/changelogs/geeves-better_species_select.yml new file mode 100644 index 00000000000..d98f2d6b0bd --- /dev/null +++ b/html/changelogs/geeves-better_species_select.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "The species select in the character creation menu will now display the main species first, and then the sub-species after select the main one, instead of putting them all in one screen." \ No newline at end of file