Merge pull request #4236 from Citadel-Station-13/upstream-merge-33274

[MIRROR] Removes ComponentActivated in favor of callbacks
This commit is contained in:
deathride58
2017-12-06 03:53:35 +00:00
committed by GitHub
14 changed files with 79 additions and 151 deletions
+12 -18
View File
@@ -46,7 +46,7 @@
)
/obj/machinery/autolathe/Initialize()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS))
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS), 0, FALSE, null, null, CALLBACK(src, .proc/AfterMaterialInsert))
. = ..()
wires = new /datum/wires/autolathe(src)
@@ -124,23 +124,17 @@
return ..()
/obj/machinery/mecha_part_fabricator/ComponentActivated(datum/component/C)
..()
if(istype(C, /datum/component/material_container))
var/datum/component/material_container/M = C
if(!M.last_insert_success)
return
var/lit = M.last_inserted_type
if(ispath(lit, /obj/item/ore/bluespace_crystal))
use_power(max(500,M.last_amount_inserted/10))
else
switch(M.last_inserted_id)
if (MAT_METAL)
flick("autolathe_o",src)//plays metal insertion animation
if (MAT_GLASS)
flick("autolathe_r",src)//plays glass insertion animation
use_power(M.last_amount_inserted*100)
updateUsrDialog()
/obj/machinery/autolathe/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
if(ispath(type_inserted, /obj/item/ore/bluespace_crystal))
use_power(max(500, amount_inserted / 10))
else
switch(id_inserted)
if (MAT_METAL)
flick("autolathe_o",src)//plays metal insertion animation
if (MAT_GLASS)
flick("autolathe_r",src)//plays glass insertion animation
use_power(amount_inserted * 100)
updateUsrDialog()
/obj/machinery/autolathe/Topic(href, href_list)
if(..())