Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
//Note: More than one of these can be added to a design but imprinter and lathe designs are incompatable.
/// Can be made by the orderable colony fabricator
#define COLONY_FABRICATOR (1<<11)
/// Can be made by the Omnilathe
#define SYNDICATE_PRINTER (1<<12)

#define FIREDOOR_OPEN 1
#define FIREDOOR_CLOSED 2
Expand Down
3 changes: 3 additions & 0 deletions code/modules/research/machinery/_production.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
var/drop_direction = 0
/// Whether or not the fabricator links to the ore silo on init. Special derelict or maintanance variants should set this to FALSE.
var/link_on_init = TRUE
/// Optional tgui theme override for this fabricator.
var/ui_theme

/obj/machinery/rnd/production/Initialize(mapload)
materials = AddComponent(
Expand Down Expand Up @@ -270,6 +272,7 @@
data["onHold"] = materials.on_hold()
data["busy"] = busy
data["materialMaximum"] = materials.local_size
data["ui_theme"] = ui_theme
data["queue"] = list()

return data
Expand Down
33 changes: 29 additions & 4 deletions monkestation/code/modules/blueshift/elements/repacking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
return

INVOKE_ASYNC(src, PROC_REF(repack), source, user)
return COMPONENT_CANCEL_ATTACK_CHAIN

/// Removes the element target and spawns a new one of whatever item_to_pack_into is
/datum/element/repackable/proc/repack(atom/source, mob/user)
Expand All @@ -56,13 +57,37 @@
return

playsound(source, 'sound/items/ratchet.ogg', 50, TRUE)
if(hascall(source, "prepare_for_packing"))
call(source, "prepare_for_packing")()
else if(hascall(source, "build_packed_material_cache"))
call(source, "build_packed_material_cache")()
var/obj/item/new_pack

if(generic_repack)
var/obj/item/flatpacked_machine/generic/new_pack = new item_to_pack_into(source.drop_location())
new_pack.type_to_deploy = source.type
new_pack.after_set()
var/obj/item/flatpacked_machine/generic/new_generic_pack = new item_to_pack_into(source.drop_location())
new_pack = new_generic_pack
new_generic_pack.type_to_deploy = source.type
new_generic_pack.after_set()
else
new item_to_pack_into(source.drop_location())
new_pack = new item_to_pack_into(source.drop_location())

if(new_pack && ("imported_designs" in source.vars) && ("imported_designs" in new_pack.vars))
var/list/imported_designs = source.vars["imported_designs"]
new_pack.vars["imported_designs"] = islist(imported_designs) ? imported_designs.Copy() : list()

if(new_pack && ("unlocked_techfab_departments" in source.vars) && ("unlocked_techfab_departments" in new_pack.vars))
var/list/unlocked_techfab_departments = source.vars["unlocked_techfab_departments"]
new_pack.vars["unlocked_techfab_departments"] = islist(unlocked_techfab_departments) ? unlocked_techfab_departments.Copy() : list()

if(new_pack && ("lathe_recipe_set" in source.vars) && ("lathe_recipe_set" in new_pack.vars))
new_pack.vars["lathe_recipe_set"] = source.vars["lathe_recipe_set"]

if(new_pack && ("packed_materials" in source.vars) && ("packed_materials" in new_pack.vars))
var/list/packed_materials = source.vars["packed_materials"]
new_pack.vars["packed_materials"] = islist(packed_materials) ? packed_materials.Copy() : list()

if(new_pack && hascall(source, "transfer_contents_to_packed_item"))
call(source, "transfer_contents_to_packed_item")(new_pack)
qdel(source)

/// Adds screen context for hovering over the repackable items with your mouse
Expand Down
Loading
Loading