Fix research console showing duplicates, make pages more clear

This commit is contained in:
ShadowLarkens
2020-08-29 12:49:45 -07:00
parent f7553f76fc
commit 732b4a9530
4 changed files with 57 additions and 41 deletions

View File

@@ -43,6 +43,8 @@ research holder datum.
** Master Types **
** Includes all the helper procs and basic tech processing. **
***************************************************************/
GLOBAL_LIST_INIT(tech_levels, list())
GLOBAL_LIST_INIT(design_datums, list())
/datum/research //Holder for all the existing, archived, and known tech. Individual to console.
var/list/known_tech = list() //List of locally known tech. Datum/tech go here.
@@ -50,19 +52,26 @@ research holder datum.
var/list/known_designs = list() //List of available designs.
/datum/research/New() //Insert techs into possible_tech here. Known_tech automatically updated.
for(var/T in typesof(/datum/tech) - /datum/tech)
known_tech += new T(src)
for(var/D in typesof(/datum/design) - /datum/design)
possible_designs += new D(src)
// generate_integrated_circuit_designs()
if(!LAZYLEN(GLOB.tech_levels))
for(var/T in typesof(/datum/tech) - /datum/tech)
GLOB.tech_levels += new T
if(!LAZYLEN(GLOB.design_datums))
for(var/T in typesof(/datum/design) - /datum/design)
GLOB.design_datums += new T
known_tech = GLOB.tech_levels
possible_designs = GLOB.design_datums
RefreshResearch()
/datum/research/techonly
/datum/research/techonly/New()
for(var/T in typesof(/datum/tech) - /datum/tech)
known_tech += new T(src)
RefreshResearch()
. = ..()
possible_designs = list()
known_designs = list()
/datum/research/techonly/RefreshResearch()
. = ..()
known_designs = list() // Just in case
//Checks to see if design has all the required pre-reqs.
//Input: datum/design; Output: 0/1 (false/true)
@@ -117,21 +126,6 @@ research holder datum.
var/datum/tech/check_tech = T
if(initial(check_tech.id) == ID)
return initial(check_tech.name)
/*
/datum/research/proc/generate_integrated_circuit_designs()
spawn(2 SECONDS) // So the list has time to initialize.
for(var/obj/item/integrated_circuit/IC in all_integrated_circuits)
if(IC.spawn_flags & IC_SPAWN_RESEARCH)
var/datum/design/D = new /datum/design/circuit(src)
D.name = "Custom circuitry \[[IC.category_text]\] ([IC.name])"
D.id = "ic-[lowertext(IC.name)]"
if(IC.origin_tech && IC.origin_tech.len)
D.req_tech = IC.origin_tech.Copy()
else
D.req_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2)
D.build_path = IC.type
possible_designs += D
*/
/***************************************************************
** Technology Datums **