From b2d5ec8d0cdbf5922386ac017a47737f26894b3c Mon Sep 17 00:00:00 2001 From: Sishen Date: Sun, 30 Jun 2019 15:42:04 -0400 Subject: [PATCH] Update action_button.dm --- code/_onclick/hud/action_button.dm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 73a207a457..2b5af9ddb8 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -20,10 +20,23 @@ else return TRUE -/obj/screen/movable/action_button/MouseDrop() - if (!can_use(usr)) +/obj/screen/movable/action_button/MouseDrop(over_object) + if(!can_use(usr)) return - return ..() + if((istype(over_object, /obj/screen/movable/action_button) && !istype(over_object, /obj/screen/movable/action_button/hide_toggle))) + if(locked) + to_chat(usr, "Action button \"[name]\" is locked, unlock it first.") + return + var/obj/screen/movable/action_button/B = over_object + var/list/actions = usr.actions + actions.Swap(actions.Find(src.linked_action), actions.Find(B.linked_action)) + moved = FALSE + ordered = TRUE + B.moved = FALSE + B.ordered = TRUE + usr.update_action_buttons() + else + return ..() /obj/screen/movable/action_button/Click(location,control,params) if (!can_use(usr))