Merge pull request #2488 from CHOMPStationBot/upstream-merge-10993

[MIRROR] Stack Examine Improvements, Log Examine Fix
This commit is contained in:
Nadyr
2021-07-10 01:47:29 -04:00
committed by GitHub
6 changed files with 39 additions and 7 deletions
+7 -4
View File
@@ -56,14 +56,17 @@
icon_state = "[initial(icon_state)]_3"
item_state = initial(icon_state)
/obj/item/stack/proc/get_examine_string()
if(!uses_charge)
return "There [src.amount == 1 ? "is" : "are"] [src.amount] [src.singular_name]\s in the stack."
else
return "There is enough charge for [get_amount()]."
/obj/item/stack/examine(mob/user)
. = ..()
if(Adjacent(user))
if(!uses_charge)
. += "There are [src.amount] [src.singular_name]\s in the stack."
else
. += "There is enough charge for [get_amount()]."
. += get_examine_string()
/obj/item/stack/attack_self(mob/user)
tgui_interact(user)
@@ -165,6 +165,7 @@ var/list/name_to_material
var/flags = 0 // Various status modifiers.
var/sheet_singular_name = "sheet"
var/sheet_plural_name = "sheets"
var/sheet_collective_name = "stack"
var/is_fusion_fuel
// Shards/tables/structures
@@ -67,10 +67,12 @@
/datum/material/wood/log
name = MAT_LOG
display_name = "wood" // will lead to "wood log"
icon_base = "log"
stack_type = /obj/item/stack/material/log
sheet_singular_name = null
sheet_plural_name = "pile"
sheet_singular_name = "log"
sheet_plural_name = "logs"
sheet_collective_name = "pile"
pass_stack_colors = TRUE
supply_conversion_value = 1
@@ -81,6 +83,7 @@
/datum/material/wood/log/sif
name = MAT_SIFLOG
display_name = "alien wood"
icon_colour = "#0099cc" // Cyan-ish
stack_origin_tech = list(TECH_MATERIAL = 2, TECH_BIO = 2)
stack_type = /obj/item/stack/material/log/sif
+6 -1
View File
@@ -54,13 +54,18 @@
if(amount>1)
name = "[material.use_name] [material.sheet_plural_name]"
desc = "A stack of [material.use_name] [material.sheet_plural_name]."
desc = "A [material.sheet_collective_name] of [material.use_name] [material.sheet_plural_name]."
gender = PLURAL
else
name = "[material.use_name] [material.sheet_singular_name]"
desc = "A [material.sheet_singular_name] of [material.use_name]."
gender = NEUTER
/obj/item/stack/material/get_examine_string()
if(!uses_charge)
return "There [amount == 1 ? "is" : "are"] [amount] [material.sheet_singular_name]\s in the [material.sheet_collective_name]."
return ..()
/obj/item/stack/material/use(var/used)
. = ..()
update_strings()
+19
View File
@@ -0,0 +1,19 @@
/datum/unit_test/materials_shall_have_names
name = "MATERIALS: Materials Shall Have All Names"
/datum/unit_test/materials_shall_have_names/start_test()
var/list/failures = list()
populate_material_list()
for(var/name in global.name_to_material)
var/datum/material/mat = global.name_to_material[name]
if(!mat)
continue // how did we get here?
if(!mat.display_name || !mat.use_name || !mat.sheet_singular_name || !mat.sheet_plural_name || !mat.sheet_collective_name)
failures[name] = mat.type
if(length(failures))
fail("[length(failures)] material\s had missing name strings: [english_list(failures)].")
else
pass("All materials had all their name strings.")
return TRUE
+1
View File
@@ -4295,6 +4295,7 @@
#include "code\unit_tests\language_tests.dm"
#include "code\unit_tests\loadout_tests.dm"
#include "code\unit_tests\map_tests.dm"
#include "code\unit_tests\material_tests.dm"
#include "code\unit_tests\mob_tests.dm"
#include "code\unit_tests\recipe_tests.dm"
#include "code\unit_tests\research_tests.dm"