Files
Bubberstation/code/_onclick/drag_drop.dm
SkyratBot 980bd74047 [MIRROR] Fixes not being able to open inactive ticket browser on admin ticket tab. (#4314)
* Fixes not being able to open inactive ticket browser on admin ticket tab. (#57882)

About The Pull Request

Currently admins can't access the ticket logs for Resolved, Disconnected, Closed and Active tickets due to an early return that will block these from being opened in 100% of circumstances.

Clicking on the Active/Disconnected/Closed/Resolved tickets would have behaviour handled by /datum/admin_help_tickets/proc/BrowseTickets() which was reached through Click() calls.

image

When we call .Click() from topic calls, we provide a null var for the control parameter.

This then leads through to /client/Click() where #57084 added a bunch of if(!control) checks supposedly ported from TGMC (or at least Fikou couldn't explain why we changed that).

I can't find a single instance of us using this locally, it appears it's always passed through to Byond. Byond docs at http://www.byond.com/docs/ref/#/client/proc/Click describe it as control - the name of the skin control involved

I can't see any reason to early return if control is a FALSE-y value. This check is what was blocking access to the admin_help_tickets datum.

In testing, removing these checks restored previous functionality.
Why It's Good For The Game

Admins less triggered.
Changelog

🆑
fix: Admins can once again open the stat panels to look at active, disconnected, closed and resolved tickets.
/🆑

* Fixes not being able to open inactive ticket browser on admin ticket tab.

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
2021-03-22 12:57:20 +00:00

119 lines
3.9 KiB
Plaintext

/*
MouseDrop:
Called on the atom you're dragging. In a lot of circumstances we want to use the
receiving object instead, so that's the default action. This allows you to drag
almost anything into a trash can.
*/
/atom/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
if(!usr || !over)
return
if(SEND_SIGNAL(src, COMSIG_MOUSEDROP_ONTO, over, usr) & COMPONENT_NO_MOUSEDROP) //Whatever is receiving will verify themselves for adjacency.
return
if(over == src)
return usr.client.Click(src, src_location, src_control, params)
if(!Adjacent(usr) || !over.Adjacent(usr))
return // should stop you from dragging through windows
over.MouseDrop_T(src,usr)
return
// receive a mousedrop
/atom/proc/MouseDrop_T(atom/dropping, mob/user)
SEND_SIGNAL(src, COMSIG_MOUSEDROPPED_ONTO, dropping, user)
return
/client/MouseDown(datum/object, location, control, params)
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])
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(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)
active_mousedown_item.onMouseUp(object, location, params, mob)
active_mousedown_item = null
/mob/proc/CanMobAutoclick(object, location, params)
/mob/living/carbon/CanMobAutoclick(atom/object, location, params)
if(!object.IsAutoclickable())
return
var/obj/item/h = get_active_held_item()
if(h)
. = h.CanItemAutoclick(object, location, params)
/mob/proc/canMobMousedown(atom/object, location, params)
/mob/living/carbon/canMobMousedown(atom/object, location, params)
var/obj/item/H = get_active_held_item()
if(H)
. = H.canItemMouseDown(object, location, params)
/obj/item/proc/CanItemAutoclick(object, location, params)
/obj/item/proc/canItemMouseDown(object, location, params)
if(canMouseDown)
return src
/obj/item/proc/onMouseDown(object, location, params, mob)
return
/obj/item/proc/onMouseUp(object, location, params, mob)
return
/atom/proc/IsAutoclickable()
return TRUE
/atom/movable/screen/IsAutoclickable()
return FALSE
/atom/movable/screen/click_catcher/IsAutoclickable()
return TRUE
/client/MouseDrag(src_object,atom/over_object,src_location,over_location,src_control,over_control,params)
var/list/modifiers = params2list(params)
if (LAZYACCESS(modifiers, MIDDLE_CLICK))
if (src_object && src_location != over_location)
middragtime = world.time
middragatom = src_object
else
middragtime = 0
middragatom = null
mouseParams = params
mouseLocation = over_location
mouseObject = over_object
if(selected_target[1] && over_object?.IsAutoclickable())
selected_target[1] = over_object
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
/client/MouseDrop(src_object, over_object, src_location, over_location, src_control, over_control, params)
if (middragatom == src_object)
middragtime = 0
middragatom = null
..()