Files
RikuTheKillerandGitHub 67b19027b2 Add Botanical Encyclopedia app for browsing knowledge about plants (#96652)
## About The Pull Request

The app comes pre-installed on all botanist PDAs and can be manually
installed by anyone on any device.

I extracted the seed extractor UI into a seed table component that the
botanical encyclopedia now also uses.

I also made the seed extractor Scrap and Take buttons separate instead
of sharing a button with a toggle.

I'm not great at UI work so expect some rough edges and bugs. It does
work in testing.

Video of me testing the botanical encyclopedia:
https://streamable.com/um3yul

Video of me testing the seed extractor: https://streamable.com/5fn3ll
## Why It's Good For The Game

It allows players to access plant information without code-diving or
using the wiki.
## Changelog
🆑
add: Added Botanical Encyclopedia app for browsing knowledge about
plants, which comes pre-installed on all botanist PDAs.
/🆑
2026-07-02 09:41:59 +02:00

53 lines
1.6 KiB
Plaintext

/datum/computer_file/program/botanical_encyclopedia
filename = "botanyapp"
filedesc = "Botanical Encyclopedia"
downloader_category = PROGRAM_CATEGORY_SERVICE
program_open_overlay = "bountyboard"
extended_desc = "A program for browsing knowledge about plants."
size = 2
tgui_id = "NtosBotanicalEncyclopedia"
program_icon = FA_ICON_SEEDLING
/// Lazy list of all seed data for valid seed types.
/// Generated when first needed to display the UI.
var/static/list/all_seed_data = null
/datum/computer_file/program/botanical_encyclopedia/proc/generate_all_seed_data()
all_seed_data = list()
for(var/obj/item/seeds/seed_type as anything in valid_subtypesof(/obj/item/seeds))
if (ispath(seed_type, /obj/item/seeds/random))
continue
var/obj/item/seeds/seeds = new seed_type
var/list/seed_data = generate_seed_data_from(seeds)
seed_data["name"] = full_capitalize(initial(seed_type.plantname))
seed_data["icon"] = initial(seed_type.growing_icon)
seed_data["icon_state"] = initial(seed_type.icon_harvest) || "[initial(seed_type.species)]-harvest"
all_seed_data += list(seed_data)
qdel(seeds)
/datum/computer_file/program/botanical_encyclopedia/ui_static_data(mob/user)
if(isnull(all_seed_data))
generate_all_seed_data()
var/list/data = list()
data["seeds"] = all_seed_data
data["cycle_seconds"] = HYDROTRAY_CYCLE_DELAY / 10
data["trait_db"] = list()
for(var/datum/plant_gene/trait as anything in GLOB.plant_traits)
data["trait_db"] += list(list(
"path" = trait.type,
"name" = trait.get_name(),
"icon" = trait.icon,
"description" = trait.description
))
return data