Files
Paradise/code/_onclick/drag_drop.dm
dearmochi 6ecc3d5234 Add ability to swap items in storage (#13648)
* Add ability to swap items in storage

Add ability to swap items in storage through
drag and drop
Fix "the the" message when putting item in storage
Clean code where possible

* Fix swap in stacked storages, clean up code (v3)

* Ignore restraints and lying for swapping items

* Clean up the code a bit, increase readability

* Clean up code, remove spawn(0)

* Fix some spacing issues

* Rename var, use crisp font
2020-12-22 16:15:40 -05:00

20 lines
569 B
Plaintext

/*
MouseDrop:
Called on the atom you're dragging. In a lot of circumstances we want to use the
recieving object instead, so that's the default action. This allows you to drag
almost anything into a trash can.
*/
/atom/MouseDrop(atom/over)
if(!usr || !over)
return
if(!(istype(over, /obj/screen) || (loc && loc == over.loc)))
if(!Adjacent(usr) || !over.Adjacent(usr)) // should stop you from dragging through windows
return
INVOKE_ASYNC(over, .proc/MouseDrop_T, src, usr)
// recieve a mousedrop
/atom/proc/MouseDrop_T(atom/dropping, mob/user)
return