mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 16:10:02 +01:00
Mouse drop refactor (#20256)
Refactored mousedrag procs, added signals, some safeguards, did some cleanups around, renamed them to make a little more sense. Mostly put in line with TG's code. Fast clicking and releasing with a drag, depending on the grace period and how fast it is done, can be counted as clicks, to aid in combat scenarios where you spamclick.
This commit is contained in:
@@ -301,8 +301,8 @@
|
||||
if(length(contents) || reagents?.total_volume)
|
||||
. += SPAN_NOTICE("To attempt cooking: click and hold, then drag this onto your character.")
|
||||
|
||||
/obj/item/reagent_containers/cooking_container/board/MouseDrop(var/obj/over_obj)
|
||||
if(over_obj != usr || use_check(usr))
|
||||
/obj/item/reagent_containers/cooking_container/board/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params)
|
||||
if(over != user || use_check(user))
|
||||
return ..()
|
||||
if(!(length(contents) || reagents?.total_volume))
|
||||
return ..()
|
||||
@@ -329,12 +329,12 @@
|
||||
R.forceMove(src) //Move everything from the buffer back to the container
|
||||
|
||||
var/l = length(results)
|
||||
if (l && usr)
|
||||
if (l && user)
|
||||
var/name = results[1].name
|
||||
if (l > 1)
|
||||
to_chat(usr, SPAN_NOTICE("You made some [pluralize_word(name, TRUE)]!"))
|
||||
to_chat(user, SPAN_NOTICE("You made some [pluralize_word(name, TRUE)]!"))
|
||||
else
|
||||
to_chat(usr, SPAN_NOTICE("You made [name]!"))
|
||||
to_chat(user, SPAN_NOTICE("You made [name]!"))
|
||||
|
||||
QDEL_NULL(temp) //delete buffer object
|
||||
return ..()
|
||||
|
||||
@@ -107,10 +107,10 @@
|
||||
|
||||
do_hair_pull(user)
|
||||
|
||||
/obj/machinery/gibber/MouseDrop_T(atom/dropping, mob/user)
|
||||
/obj/machinery/gibber/mouse_drop_receive(atom/dropped, mob/user, params)
|
||||
if(user.stat || user.restrained())
|
||||
return
|
||||
move_into_gibber(user, dropping)
|
||||
move_into_gibber(user, dropped)
|
||||
|
||||
/obj/machinery/gibber/proc/move_into_gibber(var/mob/user,var/mob/living/victim)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user