atom
Click()
var/mob/M = usr
if(M.Click_Listener)
var/datum/Click_Listener/CL = M.Click_Listener
if(istype(src, CL.clickType))
CL.clickHeard = src
return
Problem description:
I'm trying to make a library that allows the dev to call a proc that returns the first atom of /type that the player clicks on.
The problem is that for this to be plug and play, I can't just override Click(). Is there a way to do this without giving them a hook to copy and paste into their Click() proc?
EDIT: If the code is confusing, sorry. It's irrelevant to the problem, as I just need to know if there's a good way to get it into the default Click() without overriding.
You could see how he did it, or if it suits your needs, just use it.
It looks like he just overrode client/Click(), and called the parent process with ..() to make sure it didn't override any competing definitions from the library's users.