mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Can swap out seeds and disks in the plant DNA manipulator with a click (#45975)
Either click the machine itself or the UI fields when it already has seeds or a disk in it
This commit is contained in:
@@ -75,22 +75,22 @@
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/seeds))
|
||||
if(seed)
|
||||
to_chat(user, "<span class='warning'>A sample is already loaded into the machine!</span>")
|
||||
else
|
||||
if(!user.temporarilyRemoveItemFromInventory(I))
|
||||
return
|
||||
insert_seed(I)
|
||||
to_chat(user, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
interact(user)
|
||||
return
|
||||
if (operation)
|
||||
to_chat(user, "<span class='notice'>Please complete current operation.</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
eject_seed()
|
||||
insert_seed(I)
|
||||
to_chat(user, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
interact(user)
|
||||
else if(istype(I, /obj/item/disk/plantgene))
|
||||
if (operation)
|
||||
to_chat(user, "<span class='notice'>Please complete current operation.</span>")
|
||||
return
|
||||
eject_disk()
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
eject_disk()
|
||||
disk = I
|
||||
to_chat(user, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
interact(user)
|
||||
@@ -254,28 +254,25 @@
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["eject_seed"] && !operation)
|
||||
if (seed)
|
||||
seed.forceMove(drop_location())
|
||||
seed.verb_pickup()
|
||||
seed = null
|
||||
update_genes()
|
||||
update_icon()
|
||||
var/obj/item/I = usr.get_active_held_item()
|
||||
if(istype(I, /obj/item/seeds))
|
||||
if(!usr.transferItemToLoc(I, src))
|
||||
return
|
||||
eject_seed()
|
||||
insert_seed(I)
|
||||
to_chat(usr, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
else
|
||||
var/obj/item/I = usr.get_active_held_item()
|
||||
if (istype(I, /obj/item/seeds))
|
||||
if(!usr.temporarilyRemoveItemFromInventory(I))
|
||||
return
|
||||
insert_seed(I)
|
||||
to_chat(usr, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
update_icon()
|
||||
eject_seed()
|
||||
else if(href_list["eject_disk"] && !operation)
|
||||
var/obj/item/I = usr.get_active_held_item()
|
||||
eject_disk()
|
||||
if(istype(I, /obj/item/disk/plantgene))
|
||||
if(!usr.transferItemToLoc(I, src))
|
||||
return
|
||||
eject_disk()
|
||||
disk = I
|
||||
to_chat(usr, "<span class='notice'>You add [I] to the machine.</span>")
|
||||
else
|
||||
eject_disk()
|
||||
else if(href_list["op"] == "insert" && disk && disk.gene && seed)
|
||||
if(!operation) // Wait for confirmation
|
||||
operation = "insert"
|
||||
@@ -365,7 +362,7 @@
|
||||
|
||||
/obj/machinery/plantgenes/proc/eject_disk()
|
||||
if (disk && !operation)
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
if(Adjacent(usr) && !issiliconoradminghost(usr))
|
||||
if (!usr.put_in_hands(disk))
|
||||
disk.forceMove(drop_location())
|
||||
else
|
||||
@@ -373,6 +370,16 @@
|
||||
disk = null
|
||||
update_genes()
|
||||
|
||||
/obj/machinery/plantgenes/proc/eject_seed()
|
||||
if (seed && !operation)
|
||||
if(Adjacent(usr) && !issiliconoradminghost(usr))
|
||||
if (!usr.put_in_hands(seed))
|
||||
seed.forceMove(drop_location())
|
||||
else
|
||||
seed.forceMove(drop_location())
|
||||
seed = null
|
||||
update_genes()
|
||||
|
||||
/obj/machinery/plantgenes/proc/update_genes()
|
||||
core_genes = list()
|
||||
reagent_genes = list()
|
||||
|
||||
Reference in New Issue
Block a user