From 97027f9a07f1b0c70e92f3e39cdad3eede276417 Mon Sep 17 00:00:00 2001 From: Casey Date: Wed, 3 Nov 2021 04:49:49 -0400 Subject: [PATCH 1/2] Merge pull request #11760 from Very-Soft/sortchems Makes Chem Storage list alphabetical --- code/_helpers/sorts/comparators.dm | 3 +++ code/modules/food/kitchen/smartfridge/smartfridge.dm | 1 + 2 files changed, 4 insertions(+) diff --git a/code/_helpers/sorts/comparators.dm b/code/_helpers/sorts/comparators.dm index c24267e678..2f1b69191c 100644 --- a/code/_helpers/sorts/comparators.dm +++ b/code/_helpers/sorts/comparators.dm @@ -95,3 +95,6 @@ ///Species have sort_hint they self-generate to hint themselves into groups. After that, alphabetical. /proc/cmp_species(datum/species/A, datum/species/B) return A.sort_hint == B.sort_hint ? sorttext("[B.name]","[A.name]") : A.sort_hint - B.sort_hint + +/proc/cmp_stored_item_name(datum/stored_item/A, datum/stored_item/B) + return sorttext(B.item_name, A.item_name) \ No newline at end of file diff --git a/code/modules/food/kitchen/smartfridge/smartfridge.dm b/code/modules/food/kitchen/smartfridge/smartfridge.dm index 5e0f2e4284..f98da20f8c 100644 --- a/code/modules/food/kitchen/smartfridge/smartfridge.dm +++ b/code/modules/food/kitchen/smartfridge/smartfridge.dm @@ -112,6 +112,7 @@ user.remove_from_mob(O) stock(O) user.visible_message("[user] has added \the [O] to \the [src].", "You add \the [O] to \the [src].") + sortTim(item_records, /proc/cmp_stored_item_name) else if(istype(O, /obj/item/weapon/storage/bag)) var/obj/item/weapon/storage/bag/P = O