From cc0157190d97aa5962d7e190bb98a25bddbffff4 Mon Sep 17 00:00:00 2001 From: Return <110273561+ReturnToZender@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:43:55 -0500 Subject: [PATCH] Makes species in the menu sort themselves better (#4470) ## About The Pull Request This PR makes species in the species menu sort themselves by how much lore is present for them, and also sorts template species to the bottom of the species list. This should help ensure that players see finished species to get their brains whirling first. As more species have lore written for them, this list is likely to change, and we will probably rewrite species with excessive lore in order to simplify them. Unathi are renamed to Lizardperson (generic) and moved to a template species. ## Why It's Good For The Game The species we've finished so far come first in the species menu, without removing any species from the game ## Proof Of Testing image ## Changelog :cl: ReturnToZender add: The species menu now sorts itself based on the length of provided lore. Species with lore come first. del: Unathi have been renamed to Lizardperson (Generic). They don't have lore, and lack a lot of the engaging mechanics that Lizardpeople have, so we've reflavored them as a template species. /:cl: --- code/modules/client/preferences/species.dm | 1 + .../ashwalkers/code/species/Ashwalkers.dm | 1 + .../mob/living/carbon/human/species/aquatic.dm | 1 + .../mob/living/carbon/human/species/humanoid.dm | 1 + .../mob/living/carbon/human/species/insect.dm | 1 + .../mob/living/carbon/human/species/mammal.dm | 1 + .../mob/living/carbon/human/species/podweak.dm | 1 + .../mob/living/carbon/human/species/unathi.dm | 3 ++- .../modules/primitive_catgirls/code/species.dm | 1 + .../modules/mob/living/carbon/human/_species.dm | 4 ++++ .../carbon/human/species_types/podpeople.dm | 1 + .../CharacterPreferences/SpeciesPage.tsx | 16 ++++++++++++++++ .../tgui/interfaces/PreferencesMenu/types.ts | 2 ++ 13 files changed, 33 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preferences/species.dm b/code/modules/client/preferences/species.dm index 1f0d6847002..4bf5c7aabc0 100644 --- a/code/modules/client/preferences/species.dm +++ b/code/modules/client/preferences/species.dm @@ -61,5 +61,6 @@ data[species_id]["enabled_features"] = species.get_features() data[species_id]["perks"] = species.get_species_perks() data[species_id]["diet"] = species.get_species_diet() + data[species_id]["sort_bottom"] = species.sort_bottom //BUBBER EDIT ADDITION: Do we sort the species to the bottom? return data diff --git a/modular_skyrat/modules/ashwalkers/code/species/Ashwalkers.dm b/modular_skyrat/modules/ashwalkers/code/species/Ashwalkers.dm index d62b07055c4..ffb991ebc35 100644 --- a/modular_skyrat/modules/ashwalkers/code/species/Ashwalkers.dm +++ b/modular_skyrat/modules/ashwalkers/code/species/Ashwalkers.dm @@ -8,6 +8,7 @@ BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/lizard/ashwalker, BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/lizard/ashwalker, ) + sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a ghostrole only species. /datum/species/lizard/ashwalker/on_species_gain(mob/living/carbon/carbon_target, datum/species/old_species, regenerate_icons) . = ..() diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/aquatic.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/aquatic.dm index 37ca6a84ab5..2cfbff50d92 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/aquatic.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/aquatic.dm @@ -24,6 +24,7 @@ ) meat = /obj/item/food/fishmeat/moonfish/akula + sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template. /datum/species/aquatic/get_default_mutant_bodyparts() return list( diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/humanoid.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/humanoid.dm index e43c188173e..7fd24ab3d68 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/humanoid.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/humanoid.dm @@ -12,6 +12,7 @@ changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_MAGIC | MIRROR_PRIDE | ERT_SPAWN | RACE_SWAP | SLIME_EXTRACT payday_modifier = 1.0 examine_limb_id = SPECIES_HUMAN + sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template. /datum/species/humanoid/get_default_mutant_bodyparts() return list( diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/insect.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/insect.dm index 0b8d95f6c35..0e92bb585ef 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/insect.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/insect.dm @@ -22,6 +22,7 @@ BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/mutant/insect, ) eyes_icon = 'modular_skyrat/modules/organs/icons/insect_eyes.dmi' + sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template. /datum/species/insect/get_default_mutant_bodyparts() return list( diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/mammal.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/mammal.dm index 0ce9f1694fe..857d73e3589 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/mammal.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/mammal.dm @@ -20,6 +20,7 @@ BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/mutant, BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/mutant, ) + sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template. /datum/species/mammal/get_default_mutant_bodyparts() return list( diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/podweak.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/podweak.dm index 3d7c34a6da6..55e51b62d59 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/podweak.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/podweak.dm @@ -25,6 +25,7 @@ TRAIT_LITERATE, TRAIT_MUTANT_COLORS, ) + sort_bottom = FALSE //We don't want this to sort to the bottom like regular podpeople, because it's not a ghostrole species always_customizable = FALSE diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/unathi.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/unathi.dm index 2aebc568caa..6440543ffe2 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/unathi.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/unathi.dm @@ -1,5 +1,5 @@ /datum/species/unathi - name = "Unathi" + name = "Lizardperson (Generic)" id = SPECIES_UNATHI inherent_traits = list( TRAIT_ADVANCEDTOOLUSER, @@ -13,6 +13,7 @@ payday_modifier = 1.0 changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_MAGIC | MIRROR_PRIDE | ERT_SPAWN | RACE_SWAP | SLIME_EXTRACT examine_limb_id = SPECIES_LIZARD + sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a custom species template. It can't have its own lore. bodypart_overrides = list( BODY_ZONE_HEAD = /obj/item/bodypart/head/lizard, diff --git a/modular_skyrat/modules/primitive_catgirls/code/species.dm b/modular_skyrat/modules/primitive_catgirls/code/species.dm index c317b0febc5..43de45d4d42 100644 --- a/modular_skyrat/modules/primitive_catgirls/code/species.dm +++ b/modular_skyrat/modules/primitive_catgirls/code/species.dm @@ -32,6 +32,7 @@ TRAIT_RESISTCOLD, TRAIT_USES_SKINTONES, ) + sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a ghostrole only species. always_customizable = TRUE diff --git a/modular_zubbers/code/modules/mob/living/carbon/human/_species.dm b/modular_zubbers/code/modules/mob/living/carbon/human/_species.dm index 1a91984b435..973e331772a 100644 --- a/modular_zubbers/code/modules/mob/living/carbon/human/_species.dm +++ b/modular_zubbers/code/modules/mob/living/carbon/human/_species.dm @@ -1,3 +1,7 @@ +/datum/species + var/sort_bottom = FALSE +//Whether or not a given species is sorted to the bottom of the list. We mainly want to do this for species that are used only for ghostroles, and template species. + /// Called once the target is made into a bloodsucker. Used for removing conflicting species organs mostly /datum/species/proc/on_bloodsucker_gain(mob/living/carbon/human/target) return null diff --git a/modular_zubbers/code/modules/mob/living/carbon/human/species_types/podpeople.dm b/modular_zubbers/code/modules/mob/living/carbon/human/species_types/podpeople.dm index 80d02681440..71cf0e5a0ba 100644 --- a/modular_zubbers/code/modules/mob/living/carbon/human/species_types/podpeople.dm +++ b/modular_zubbers/code/modules/mob/living/carbon/human/species_types/podpeople.dm @@ -1,5 +1,6 @@ /datum/species/pod inert_mutation = /datum/mutation/harmonizing_pulses + sort_bottom = TRUE //BUBBER EDIT ADDITION: We want to sort this to the bottom because it's a ghostrole only species. /datum/species/pod/get_species_description() return list( diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferences/SpeciesPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferences/SpeciesPage.tsx index 70e6b18bf2b..517778ec771 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferences/SpeciesPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferences/SpeciesPage.tsx @@ -273,6 +273,22 @@ function SpeciesPageInner(props: SpeciesPageInnerProps) { species[0] = species[humanIndex]; species[humanIndex] = swapWith; + /* BUBBER EDIT START - SPECIES LIST SORTING */ + species.sort(([keyA, speciesA], [keyB, speciesB]) => { + // Human first + if (keyA === 'human') return -1; + if (keyB === 'human') return 1; + + // Species with sort_bottom = true go to the bottom + if (speciesA.sort_bottom !== speciesB.sort_bottom) { + return speciesA.sort_bottom ? 1 : -1; + } + + // Otherwise sort by lore length descending + return speciesB.lore.length - speciesA.lore.length; + }); + /* BUBBER EDIT END - SPECIES LIST SORTING */ + const currentSpecies = species.filter(([speciesKey]) => { return speciesKey === data.character_preferences.misc.species; })[0][1]; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/types.ts b/tgui/packages/tgui/interfaces/PreferencesMenu/types.ts index dcc2d0d3fee..9e1627d480b 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/types.ts +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/types.ts @@ -49,6 +49,8 @@ export type Species = { desc: string[]; lore: string[]; icon: string; + sort_bottom: BooleanLike; + //BUBBER EDIT ADD: Sort_bottom, whether a species is sorted to the bottom of the list. use_skintones: BooleanLike; sexes: BooleanLike;