diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 3ddfb73dfe4..7df14b5fa2d 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -219,7 +219,7 @@ GLOBAL_LIST_INIT(allowed_money, typecacheof(list( /// Inits GLOB.plant_traits /proc/init_plant_traits() var/traits = list() - for(var/trait_path in subtypesof(/datum/plant_gene/trait)) + for(var/trait_path in subtypesof(/datum/plant_gene)) traits += new trait_path sort_list(traits, GLOBAL_PROC_REF(cmp_typepaths_asc)) return traits diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 1d7b2109be1..4707ebf0a96 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -104,5 +104,3 @@ GLOBAL_LIST_INIT(prototype_organs, typecacheof(list( /obj/item/organ/eyes/dullahan, ), only_root_path = TRUE)) -/// list of all plan traits -GLOBAL_LIST_INIT(plant_traits, init_plant_traits()) diff --git a/code/_globalvars/lists/reagents.dm b/code/_globalvars/lists/reagents.dm index dc18f9814c6..b760b5c6d69 100644 --- a/code/_globalvars/lists/reagents.dm +++ b/code/_globalvars/lists/reagents.dm @@ -56,6 +56,8 @@ GLOBAL_LIST_INIT(blacklisted_metalgen_types, typecacheof(list( ))) /// Map of reagent names to its datum path GLOBAL_LIST_INIT(name2reagent, build_name2reagentlist()) +/// list of all plan traits +GLOBAL_LIST_INIT(plant_traits, init_plant_traits()) /// Initialises all /datum/reagent into a list indexed by reagent id /proc/init_chemical_reagent_list() diff --git a/code/game/objects/items/devices/scanners/plant_analyzer.dm b/code/game/objects/items/devices/scanners/plant_analyzer.dm index 86980d2ee15..25bfab652f7 100644 --- a/code/game/objects/items/devices/scanners/plant_analyzer.dm +++ b/code/game/objects/items/devices/scanners/plant_analyzer.dm @@ -140,10 +140,10 @@ var/list/data = list() data["cycle_seconds"] = HYDROTRAY_CYCLE_DELAY / 10 data["trait_db"] = list() - for(var/datum/plant_gene/trait/trait as anything in GLOB.plant_traits) + for(var/datum/plant_gene/trait as anything in GLOB.plant_traits) var/trait_data = list(list( "path" = trait.type, - "name" = trait.name, + "name" = trait.get_name(), "icon" = trait.icon, "description" = trait.description )) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 7dbfc4262ed..278ec19228e 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -2,6 +2,8 @@ /datum/plant_gene /// The name of the gene. var/name + /// Bonus lines displayed on examine. + var/description = "" /// The font awesome icon name representing the gene in the seed extractor UI var/icon = FA_ICON_DNA /// Flags that determine if a gene can be modified. @@ -62,7 +64,8 @@ var/formatted_name if(!(mutability_flags & PLANT_GENE_REMOVABLE)) formatted_name += "Fragile " - formatted_name += "[name] production [rate*100]%" + var/datum/reagent/reagent = reagent_id + formatted_name += "[reagent.name] production [rate*100]%" return formatted_name /* @@ -117,8 +120,6 @@ /datum/plant_gene/trait /// The rate at which this trait affects something. This can be anything really - why? I dunno. var/rate = 0.05 - /// Bonus lines displayed on examine. - var/description = "" /// Flag - Traits that share an ID cannot be placed on the same plant. var/trait_ids /// Flag - Modifications made to the final product. diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index ae94580ada5..0df75d987e9 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -268,10 +268,10 @@ var/list/data = list() data["cycle_seconds"] = HYDROTRAY_CYCLE_DELAY / 10 data["trait_db"] = list() - for(var/datum/plant_gene/trait/trait as anything in GLOB.plant_traits) + for(var/datum/plant_gene/trait as anything in GLOB.plant_traits) var/trait_data = list(list( "path" = trait.type, - "name" = trait.name, + "name" = trait.get_name(), "icon" = trait.icon, "description" = trait.description )) diff --git a/tgui/packages/tgui/interfaces/SeedExtractor.tsx b/tgui/packages/tgui/interfaces/SeedExtractor.tsx index 9e868f32381..defb9fb9fb2 100644 --- a/tgui/packages/tgui/interfaces/SeedExtractor.tsx +++ b/tgui/packages/tgui/interfaces/SeedExtractor.tsx @@ -436,9 +436,11 @@ export const TraitTooltip = (props) => { const trait = props.trait_db.find((t) => { return t.path === props.path; }); + if (!trait) { + return; + } return ( {!!props.grafting && (