mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +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:
@@ -97,20 +97,20 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/reagent_containers/blood/MouseDrop(over_object, src_location, over_location)
|
||||
/obj/item/reagent_containers/blood/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params)
|
||||
if(!ismob(loc))
|
||||
return
|
||||
var/turf/our_turf = get_turf(src)
|
||||
var/turf/target_turf = get_turf(over_object)
|
||||
var/turf/target_turf = get_turf(over)
|
||||
if(!our_turf.Adjacent(target_turf))
|
||||
return
|
||||
if(attached_mob)
|
||||
remove_iv_mob()
|
||||
else if(ishuman(over_object))
|
||||
visible_message(SPAN_WARNING("\The [usr] starts hooking \the [over_object] up to \the [src]."))
|
||||
if(do_after(usr, 30))
|
||||
to_chat(usr, SPAN_NOTICE("You hook \the [over_object] up to \the [src]."))
|
||||
attached_mob = WEAKREF(over_object)
|
||||
else if(ishuman(over))
|
||||
visible_message(SPAN_WARNING("\The [user] starts hooking \the [over] up to \the [src]."))
|
||||
if(do_after(user, 30))
|
||||
to_chat(user, SPAN_NOTICE("You hook \the [over] up to \the [src]."))
|
||||
attached_mob = WEAKREF(over)
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -36,11 +36,12 @@
|
||||
can.pixel_y = positions[2]
|
||||
underlays += can
|
||||
|
||||
/obj/item/storage/box/fancy/yoke/MouseDrop(mob/user)
|
||||
if(use_check_and_message(user))
|
||||
/obj/item/storage/box/fancy/yoke/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params)
|
||||
var/mob/mob_dropped_over = over
|
||||
if(use_check_and_message(mob_dropped_over))
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You pick up \the [src]."))
|
||||
user.put_in_hands(src)
|
||||
to_chat(mob_dropped_over, SPAN_NOTICE("You pick up \the [src]."))
|
||||
mob_dropped_over.put_in_hands(src)
|
||||
|
||||
/obj/item/storage/box/fancy/yoke/attack_hand(mob/user)
|
||||
if(!length(contents)) // no more cans, continue as normal
|
||||
|
||||
@@ -574,11 +574,13 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks/bowl)
|
||||
user.put_in_hands(waste)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/bowl/MouseDrop(mob/user) //Dropping the bowl of food onto the user
|
||||
if(istype(user) && !use_check_and_message(user))
|
||||
user.put_in_active_hand(src)
|
||||
src.pickup(user)
|
||||
/obj/item/reagent_containers/food/snacks/bowl/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params) //Dropping the bowl of food onto the user
|
||||
var/mob/mob_dropped_over = over
|
||||
if(istype(mob_dropped_over) && !use_check_and_message(mob_dropped_over))
|
||||
mob_dropped_over.put_in_active_hand(src)
|
||||
src.pickup(mob_dropped_over)
|
||||
return
|
||||
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/bowl/puffpuffs/update_icon()
|
||||
|
||||
@@ -208,11 +208,13 @@
|
||||
user.put_in_hands(waste)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/chipplate/MouseDrop(mob/user) //Dropping the chip onto the user
|
||||
if(istype(user) && user == usr)
|
||||
user.put_in_active_hand(src)
|
||||
src.pickup(user)
|
||||
/obj/item/reagent_containers/food/snacks/chipplate/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params) //Dropping the chip onto the user
|
||||
var/mob/mob_dropped_over = over
|
||||
if(istype(mob_dropped_over) && user == user)
|
||||
mob_dropped_over.put_in_active_hand(src)
|
||||
src.pickup(mob_dropped_over)
|
||||
return
|
||||
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/chipplate/nachos
|
||||
|
||||
Reference in New Issue
Block a user