Merge pull request #15848 from shellspeed1/full-auto-port-from-tg-Credit-to-Fikou
Port of a bunch of stuff to update guns at this point because we have a bunch of stuff we are missing.
This commit is contained in:
@@ -23,23 +23,31 @@
|
||||
SEND_SIGNAL(src, COMSIG_MOUSEDROPPED_ONTO, dropping, user)
|
||||
return
|
||||
|
||||
|
||||
/client/MouseDown(object, location, control, params)
|
||||
if (mouse_down_icon)
|
||||
/client/MouseDown(datum/object, location, control, params)
|
||||
if(!control)
|
||||
return
|
||||
if(QDELETED(object)) //Yep, you can click on qdeleted things before they have time to nullspace. Fun.
|
||||
return
|
||||
SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEDOWN, object, location, control, params)
|
||||
if(mouse_down_icon)
|
||||
mouse_pointer_icon = mouse_down_icon
|
||||
var/delay = mob.CanMobAutoclick(object, location, params)
|
||||
if(delay)
|
||||
selected_target[1] = object
|
||||
selected_target[2] = params
|
||||
while(selected_target[1])
|
||||
Click(selected_target[1], location, control, selected_target[2], TRUE)
|
||||
Click(selected_target[1], location, control, selected_target[2])
|
||||
sleep(delay)
|
||||
active_mousedown_item = mob.canMobMousedown(object, location, params)
|
||||
if(active_mousedown_item)
|
||||
active_mousedown_item.onMouseDown(object, location, params, mob)
|
||||
|
||||
/client/MouseUp(object, location, control, params)
|
||||
if (mouse_up_icon)
|
||||
if(!control)
|
||||
return
|
||||
if(SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEUP, object, location, control, params) & COMPONENT_CLIENT_MOUSEUP_INTERCEPT)
|
||||
click_intercept_time = world.time
|
||||
if(mouse_up_icon)
|
||||
mouse_pointer_icon = mouse_up_icon
|
||||
selected_target[1] = null
|
||||
if(active_mousedown_item)
|
||||
@@ -74,9 +82,6 @@
|
||||
/obj/item/proc/onMouseUp(object, location, params, mob)
|
||||
return
|
||||
|
||||
/obj/item/gun/CanItemAutoclick(object, location, params)
|
||||
. = automatic
|
||||
|
||||
/atom/proc/IsAutoclickable()
|
||||
. = 1
|
||||
|
||||
@@ -110,6 +115,7 @@
|
||||
selected_target[2] = params
|
||||
if(active_mousedown_item)
|
||||
active_mousedown_item.onMouseDrag(src_object, over_object, src_location, over_location, params, mob)
|
||||
SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEDRAG, src_object, over_object, src_location, over_location, src_control, over_control, params)
|
||||
|
||||
/obj/item/proc/onMouseDrag(src_object, over_object, src_location, over_location, params, mob)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user