mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Codex code improvements, recipes (#7068)
This commit is contained in:
@@ -9,13 +9,21 @@
|
||||
var/datum/codex_tree/tree = null
|
||||
var/root_type = /datum/lore/codex/category/main_borealis_lore //YW EDIT
|
||||
|
||||
var/static/list/codex_tree_keys = list() // CHOMPedit: static list linking codexes to the correct codex_tree.
|
||||
|
||||
/obj/item/weapon/book/codex/Initialize()
|
||||
tree = new(src, root_type)
|
||||
tree = codex_tree_keys["[root_type]"] // CHOMPedit start
|
||||
if(!tree)
|
||||
tree = new(src, root_type)
|
||||
codex_tree_keys["[root_type]"] = tree // CHOMPedit end
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/book/codex/attack_self(mob/user)
|
||||
if(!tree)
|
||||
tree = new(src, root_type)
|
||||
if(!tree) // CHOMPedit start
|
||||
tree = codex_tree_keys["[root_type]"]
|
||||
if(!tree)
|
||||
tree = new(src, root_type)
|
||||
codex_tree_keys["[root_type]"] = tree // CHOMPedit end
|
||||
icon_state = "[initial(icon_state)]-open"
|
||||
tree.display(user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user