obj/button
var
multi //multi-tiled buttons
over //whether or not the mouse is over it
multitype //mutli-tiled buttons have a type so we can find it the other parts of this button
single
multi = 0
over = 0
multi
multi = 1
over = 0
mob/buttonuser //lawl
var/obj/button/BO //the button that the mouse was last over
MouseDrag(O)
if(!istype(O,/obj/button)) //if it isn't a button ignore it
if(src.BO) //if a button was saved as being the last one the mouse was over
if(BO.multi) //and if it's a multi-tiled button
for(var/obj/button/multi/M /*in wherever*/) //it finds other multi-tiled buttons
if(M.multitype == BO.multitype) //and checks to see if they are part of the last button
M.icon_state = "up" //if they are, it changes their icon state
M.over = 0 //and tells it that the mouse isnt over it any more
else //if it's not a multi-tiled button
BO.icon_state = "up" //it just changes the last button's icon state
BO.over = 0 //and changes the over var. too
src.BO = null
return
var/obj/button/B = O
if(!B.over) //if the current button isn't the last button the mouse was over
if(BO.multi)
for(var/obj/button/multi/M /*in wherever*/)
if(M.multitype == BO.multitype)
M.icon_state = "up"
M.over = 0
else
BO.icon_state = "up"
BO.over = 0
if(B.multi)
for(var/obj/button/multi/M /*in wherever*/)
if(M.multitype == B.multitype)
M.icon_state = "over"
M.over = 1
else
B.icon_state = "over"
B.over = 1
else
return
This isn't exactly as the original one was but it's pretty close. The original one was shorter because it was specifically for one type of button. This one covers more bases. I know the original snippet worked perfectly but I'm not sure if this one does as I made it like three seconds ago.
Improvements? Questions? Comments? GTFO?
EDIT: I also note that, before my HDD went down, I never found a way to revert the button if the mouse moves from a button to, well nothing. Apparently the MouseDrag() doesn't get called when the mouse is dragged over nothing. Bummer.