Files
Citadel-Station-13-RP/code/modules/lore_codex/pages.dm
silicons 5823fb93e7 migrates to github actions + sync tgui to main's, removes a bunch of dead maps and code and reworks how submap loading is done (#2917)
* move phoronlock define

* t

* force rename

* nuke unneeded things

* don't do that

* tgui sync?

* changes

* unit testing module

* backend

* tools update

* aaah

* go and stay go

* path replace

* move everything

* toss out more stuff

* remove

* fine those can stay

* dependencies.sh

* ruin datum move + rename

* level assets why did you guys put the turfs in my atmosphers folder grr

* more moving

* basemap, force stuff

* fix that desync meme

* move more stuff

* move those too

* repath

* get rid of useless initializers

* hacky patchy

* reservations

* alright

* tgui

* changelog example

* checksum

* md5

* errors

* more

* turf empty

* stop

* fix

* bad kwarg

* let's get those in again

* alright

* rid of that

* huh

* newlines

* newlines

* folder

* mood

* woops

* readme

* might as well trim now

* let's go

* fuck it tether isn't being used anyways lol

* ok

* empty files go

* tether is demoted

* sorry but this goes too

* okay

* make that work too

* ok

* wow.

* whew

* Fix

* fixes

* ok

* sigh

* fix

* fix

* aah.

* rust_g logging

* update rust g file

* fix

* funny

* Fix

* map issues

* fix

* initialize hints

* solves some problems

* those too

* ok

* pills

* let's do that.

* hit that too

* runtime

* add that too

* alright

* fix

* fix

* fix

* Fix

* add

* fix

* wildwest, what have they done to you...

* do that too'
git push

* fixes

* fixes

* fixes

* pack this tightly

* let's not have empty files

* sigh

* fix

* FUCK OFF

* fix icon

* rip old mapmerge

* zz

* woo yeah woo yeah

* logging

* fix

* better logs

* GRRRRRR

* last commit??

* awful
2021-04-01 16:07:03 -05:00

67 lines
2.2 KiB
Plaintext

// Contains the 'raw' lore data.
/datum/lore/codex
var/name = null // Title displayed
var/data = null // The actual words.
var/datum/lore/codex/parent = null // Category above us
var/list/keywords = list() // Used for searching.
var/datum/codex_tree/holder = null
/datum/lore/codex/New(var/new_holder, var/new_parent)
..()
holder = new_holder
parent = new_parent
add_content()
if(name)
keywords.Add(name)
/datum/lore/codex/Topic(href, href_list)
. = ..()
if(.)
return
holder.Topic(href, href_list) // Redirect to the physical object
/datum/lore/codex/page
// Returns an assoc list of keywords binded to a ref of this page. If it's a category, it will also recursively call this on its children.
/datum/lore/codex/proc/index_page()
var/list/results = list()
for(var/keyword in keywords)
results[keyword] = src
return results
// This gets called in New(), which is helpful for inserting quick_link()s.
/datum/lore/codex/proc/add_content()
return
// Use this to quickly link to a different page
/datum/lore/codex/proc/quick_link(var/target, var/word_to_display)
if(isnull(word_to_display))
word_to_display = target
return "<a href='?src=\ref[src];quick_link=[target]'>[word_to_display]</a>"
// Can only be found by specifically searching for it.
/datum/lore/codex/page/ultimate_answer
name = "Answer to the Ultimate Question of Life, the Universe, and Everything"
data = "42"
keywords = list("Ultimate Question", "Ultimate Question of Life, the Universe, and Everything", "Life, the Universe, and Everything", "Everything", "42")
// Organizes pages together.
/datum/lore/codex/category
var/list/children = list() // Pages or more categories relevant to this category. Self initializes from types to refs in New()
/datum/lore/codex/category/New()
..()
var/list/new_children_list = list()
for(var/type in children)
new_children_list.Add(new type(holder, src))
children = new_children_list
/datum/lore/codex/category/index_page()
// First, get our own keywords.
var/list/results = ..()
// Now get our children. If a child is also a category, it will get their children too.
for(var/datum/lore/codex/child in children)
results += child.index_page()
return results