From acb55613d4130d85f124e5d61832d67414f542b5 Mon Sep 17 00:00:00 2001 From: Robertha89 Date: Sat, 10 Oct 2015 12:11:19 +0200 Subject: [PATCH] Better way of calling material and tech name --- code/game/objects/items.dm | 27 ++------------------------- code/modules/research/rdconsole.dm | 11 +++++------ 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index f07c621f0b1..6f4597ef7d8 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -144,31 +144,8 @@ if(origin_tech) msg += "Testing potentials:
" var/list/techlvls = params2list(origin_tech) - var/tech = null for(var/T in techlvls) //This needs to use the better names. - tech = T - switch(tech) - if("materials") - tech = "Materials Research" - if("engineering") - tech = "Engineering Research" - if("plasmatech") - tech = "Plasma Research" - if("powerstorage") - tech = "Power Manipulation Technology" - if("bluespace") - tech = "'Blue-space' Research" - if("biotech") - tech = "Biological Technology" - if("combat") - tech = "Combat Systems Research" - if("magnets") - tech = "Electromagnetic Spectrum Research" - if("programming") - tech = "Data Theory Research" - if("syndicate") - tech = "Illegal Technologies Research" - msg += "Tech: [tech] | Magnitude: [techlvls[T]]
" + msg += "Tech: [CallTechName(T)] | Magnitude: [techlvls[T]]
" msg += "Research reliability: [reliability]%
" if(crit_fail) msg += "Critical failure detected in subject!
" @@ -179,7 +156,7 @@ if(materials.len) msg += "Extractable materials:
" for(var/mat in materials) - msg += "[capitalize(copytext(mat, 2))]
" //Capitize first word, remove the "$" + msg += "[CallMaterialName(mat)]
" //Capitize first word, remove the "$" else msg += "No extractable materials detected.
" msg += "*--------*" diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 9072217e4f7..f0e7a0ddf69 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -54,7 +54,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, var/selected_category var/list/datum/design/matching_designs = list() //for the search function -/obj/machinery/computer/rdconsole/proc/CallTechName(var/ID) //A simple helper proc to find the name of a tech with a given ID. +/proc/CallTechName(ID) //A simple helper proc to find the name of a tech with a given ID. var/datum/tech/check_tech var/return_name = null for(var/T in subtypesof(/datum/tech)) @@ -68,7 +68,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, return return_name -/obj/machinery/computer/rdconsole/proc/CallMaterialName(var/ID) +proc/CallMaterialName(ID) var/datum/reagent/temp_reagent var/return_name = null if (copytext(ID, 1, 2) == "$") @@ -183,7 +183,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, /obj/machinery/computer/rdconsole/Topic(href, href_list) if(..()) return 1 - + if(!allowed(usr) && !isobserver(usr)) return 1 @@ -1115,7 +1115,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, dat += "" return dat - + /obj/machinery/computer/rdconsole/core name = "Core R&D Console" desc = "A console used to interface with R&D tools." @@ -1126,7 +1126,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, desc = "A console used to interface with R&D tools." id = 2 req_access = list(access_robotics) - + /obj/machinery/computer/rdconsole/experiment name = "E.X.P.E.R.I-MENTOR R&D Console" desc = "A console used to interface with R&D tools." @@ -1137,4 +1137,3 @@ won't update every console in existence) but it's more of a hassle to do. Also, desc = "A console used to interface with R&D tools." id = 4 req_access = list(access_mechanic) - \ No newline at end of file