General code maintenance for Mat container related stuff (#77671)

1. Removes `/obj/machinery/ore_silo/proc/remote_attackby()`. This proc
calls `datum/component/material_container/user_insert()` anyway which
performs all the checks necessary for inserting stuff into the ore silo
and `/obj/machinery/ore_silo/proc/remote_attackby()` was just repeating
its code & checks. So now inserting into the ore silo is directly
handled by the mat container without this proxy proc making the
operation slightly faster
2. Removed silo `attackby` code. Same operations can be done via
`screwdriver_act` & `crowbar_act` procs much cleaner
3. The ore silo now hooks onto signals
`COMSIG_MATCONTAINER_ITEM_CONSUMED` and
`COMSIG_MATCONTAINER_SHEETS_RETRIVED` and logs into silo when they are
triggered. This means when you insert/eject sheets from the silo the
connected machine performing the operation no longer has to do the
logging manually thus the proc `silo_log` has been removed from a lot of
places ,reducing overall code size
4. A lot of stuff that use materials from the ore silo follow this
pattern.

i.e. They first use the materials from the silo and then log it via
`silo_log` proc. This code pattern is repeated in a lot of places so
let's just merge these 2 lines with some extra sanity checks into a
single proc inside `remote_materials` itself. That's what was done and
the number of places where you log manually into the silo has been
removed further reducing code size everywhere.
5. Added auto doc & cleaned up some procs

Since logging is now done by the ore silo directly, we need a way to
pass the machine that is inserting items into the silo to the signal
handlers of the ore silo [via the `context` var]. So other code changes
elsewhere is because of this var
This commit is contained in:
SyncIt21
2023-08-21 22:23:01 +00:00
committed by GitHub
parent d181bc3c9e
commit 9aed3b6a8f
14 changed files with 178 additions and 162 deletions
+1 -1
View File
@@ -835,7 +835,7 @@
balloon_alert(mod.wearer, "not enough material")
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE)
/obj/item/mod/module/recycler/proc/InsertSheets(obj/item/recycler, obj/item/stack/sheets)
/obj/item/mod/module/recycler/proc/InsertSheets(obj/item/recycler, obj/item/stack/sheets, atom/context)
SIGNAL_HANDLER
attempt_insert_storage(sheets)