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:
Fluffy
2024-12-26 14:26:32 +00:00
committed by GitHub
parent a904e1d435
commit df014f9bc0
108 changed files with 860 additions and 485 deletions
+11 -11
View File
@@ -54,20 +54,20 @@
return FALSE
return ..(M)
/obj/vehicle/animal/MouseDrop(atom/over)
if(use_check_and_message(usr))
return
if(usr == over && ishuman(over))
var/mob/living/carbon/human/H = over
storage_compartment.open(H)
/obj/vehicle/animal/MouseDrop_T(atom/dropping, mob/user)
/obj/vehicle/animal/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params)
if(use_check_and_message(user))
return
if(!load(dropping))
to_chat(user, SPAN_WARNING("You were unable to load \the [dropping] onto \the [src]."))
if(user == over && ishuman(over))
var/mob/living/carbon/human/H = over
storage_compartment.open(H)
/obj/vehicle/animal/mouse_drop_receive(atom/dropped, mob/user, params)
if(use_check_and_message(user))
return
if(!load(dropped))
to_chat(user, SPAN_WARNING("You were unable to load \the [dropped] onto \the [src]."))
return
/obj/vehicle/animal/attack_hand(var/mob/user as mob)
+5 -5
View File
@@ -151,14 +151,14 @@
return 0
return ..(M)
/obj/vehicle/bike/MouseDrop(atom/over)
if(usr == over && ishuman(over))
/obj/vehicle/bike/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params)
if(user == over && ishuman(over))
var/mob/living/carbon/human/H = over
storage_compartment.open(H)
/obj/vehicle/bike/MouseDrop_T(atom/dropping, mob/user)
if(!load(dropping))
to_chat(user, SPAN_WARNING("You were unable to load \the [dropping] onto \the [src]."))
/obj/vehicle/bike/mouse_drop_receive(atom/dropped, mob/user, params)
if(!load(dropped))
to_chat(user, SPAN_WARNING("You were unable to load \the [dropped] onto \the [src]."))
return
/obj/vehicle/bike/attack_hand(var/mob/user as mob)
+2 -2
View File
@@ -32,10 +32,10 @@
desc = "A high-tech titanium pod, capable of transporting its passenger right into the action at considerable ranges. The metal foam dispensers lining the top prevent most hull breaches on station ingress."
icon_state = "syndie_pod"
/obj/vehicle/droppod/MouseDrop()
/obj/vehicle/droppod/mouse_drop_dragged(atom/over, mob/user, src_location, over_location, params)
return
/obj/vehicle/droppod/MouseDrop_T()
/obj/vehicle/droppod/mouse_drop_receive(atom/dropped, mob/user, params)
return
/obj/vehicle/droppod/emag_act()
+5 -5
View File
@@ -84,14 +84,14 @@
// Interaction procs
//-------------------------------------------
/obj/vehicle/train/MouseDrop_T(atom/dropping, mob/user)
/obj/vehicle/train/mouse_drop_receive(atom/dropped, mob/user, params)
if(use_check_and_message(user))
return
if(istype(dropping, /obj/vehicle/train))
latch(dropping, user)
if(istype(dropped, /obj/vehicle/train))
latch(dropped, user)
else
if(!load(dropping))
to_chat(user, SPAN_WARNING("You were unable to load \the [dropping] on \the [src]."))
if(!load(dropped))
to_chat(user, SPAN_WARNING("You were unable to load \the [dropped] on \the [src]."))
/obj/vehicle/train/attack_hand(mob/user as mob)
if(use_check_and_message(user))
+3 -3
View File
@@ -29,9 +29,9 @@
return 0
return ..(M)
/obj/vehicle/unicycle/MouseDrop_T(atom/dropping, mob/user)
if(!load(dropping))
to_chat(user, SPAN_WARNING("You were unable to load \the [dropping] onto \the [src]."))
/obj/vehicle/unicycle/mouse_drop_receive(atom/dropped, mob/user, params)
if(!load(dropped))
to_chat(user, SPAN_WARNING("You were unable to load \the [dropped] onto \the [src]."))
return
/obj/vehicle/unicycle/attack_hand(var/mob/user as mob)