Added option to print research levels and researched devices to RD consoles

This commit is contained in:
Tramziller
2015-01-08 19:03:05 +01:00
parent 75a2ce5cfb
commit aa3c7574ca

View File

@@ -122,6 +122,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
C.files.AddDesign2Known(D)
C.files.RefreshResearch()
/obj/machinery/computer/rdconsole/New()
..()
files = new /datum/research(src) //Setup the research data holder.
@@ -523,9 +525,52 @@ won't update every console in existence) but it's more of a hassle to do. Also,
spawn(20)
screen = 1.6
updateUsrDialog()
else if (href_list["print"]) //Print research information
screen = 0.5
spawn(20)
var/obj/item/weapon/paper/PR = new/obj/item/weapon/paper
if( text2num(href_list["print"]) == 2)
PR.name = "research list"
PR.info = GetResearchListInfo()
else
PR.name = "research levels"
PR.info = GetResearchLevelsInfo()
PR.info_links = PR.info
PR.icon_state = "paper_words"
PR.loc = src.loc
spawn(10)
screen = ((text2num(href_list["print"]) == 2) ? 5.0 : 1.1)
updateUsrDialog()
updateUsrDialog()
return
/obj/machinery/computer/rdconsole/proc/GetResearchLevelsInfo()
var/dat
dat += "Current Research Levels:<BR><BR>"
dat += "<UL>"
for(var/datum/tech/T in files.known_tech)
dat += "<LI>"
dat += "[T.name]"
dat += "<UL>"
dat += "<LI>Level: [T.level]"
dat += "<LI>Summary: [T.desc]"
dat += "</UL>"
return dat
/obj/machinery/computer/rdconsole/proc/GetResearchListInfo()
var/dat
dat += "List of Researched Technologies and Designs:"
dat += "<UL>"
for(var/datum/design/D in files.known_designs)
if(D.build_path)
dat += "<LI><B>[D.name]</B>: [D.desc]"
dat += "</UL>"
return dat
/obj/machinery/computer/rdconsole/attack_hand(mob/user as mob)
if(stat & (BROKEN|NOPOWER))
return
@@ -570,6 +615,9 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(0.4)
dat += "Imprinting Circuit. Please Wait..."
if(0.5)
dat += "Printing Research Information. Please Wait..."
if(1.0) //Main Menu
dat += "Main Menu:<BR><BR>"
dat += "Loaded disk: "
@@ -593,16 +641,9 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "</UL>"
if(1.1) //Research viewer
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A><HR>"
dat += "Current Research Levels:<BR><BR>"
dat += "<UL>"
for(var/datum/tech/T in files.known_tech)
dat += "<LI>"
dat += "[T.name]"
dat += "<UL>"
dat += "<LI>Level: [T.level]"
dat += "<LI>Summary: [T.desc]"
dat += "</UL>"
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A> || "
dat += "<A href='?src=\ref[src];print=1'>Print This Page</A><HR>"
dat += GetResearchLevelsInfo()
dat += "</UL>"
if(1.2) //Technology Disk Menu
@@ -897,18 +938,15 @@ won't update every console in existence) but it's more of a hassle to do. Also,
///////////////////Research Information Browser////////////////////
if(5.0)
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A><HR>"
dat += "List of Researched Technologies and Designs:"
dat += "<UL>"
for(var/datum/design/D in files.known_designs)
if(D.build_path)
dat += "<LI><B>[D.name]</B>: [D.desc]"
dat += "</UL>"
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A> || "
dat += "<A href='?src=\ref[src];print=2'>Print This Page</A><HR>"
dat += GetResearchListInfo()
user << browse("<TITLE>Research and Development Console</TITLE><HR>[dat]", "window=rdconsole;size=850x600")
onclose(user, "rdconsole")
/obj/machinery/computer/rdconsole/robotics
name = "Robotics R&D Console"
id = 2