Replaces every check for a hardcoded material stack type with a check
for material of the stack.
This commit is contained in:
mwerezak
2015-08-02 00:01:10 -04:00
parent e3609bac94
commit 0ceb0e291d
37 changed files with 179 additions and 168 deletions
@@ -44,6 +44,8 @@
/obj/item/stack/material/proc/update_strings()
// Update from material datum.
singular_name = material.sheet_singular_name
if(amount>1)
name = "[material.use_name] [material.sheet_plural_name]"
desc = "A stack of [material.use_name] [material.sheet_plural_name]."
+13 -1
View File
@@ -28,10 +28,16 @@
var/list/name_to_material
//Returns the material the object is made of, if applicable.
//Will we ever need to return more than one value here?
//Will we ever need to return more than one value here? Or should we just return the "dominant" material.
/obj/proc/get_material()
return null
//mostly for convenience
/obj/proc/get_material_name()
var/material/material = get_material()
if(material)
return material.name
// Builds the datum list above.
/proc/populate_material_list(force_remake=0)
if(name_to_material && !force_remake) return // Already set up!
@@ -49,6 +55,12 @@ var/list/name_to_material
populate_material_list()
return name_to_material[name]
/proc/material_display_name(name)
var/material/material = get_material_by_name(name)
if(material)
return material.display_name
return null
// Material definition and procs follow.
/material
var/name // Unique name for use in indexing the list.