From 63d0f1c772318fc875b339ecb078c323b99b1c95 Mon Sep 17 00:00:00 2001 From: Xhuis Date: Tue, 20 Jun 2017 00:27:39 -0400 Subject: [PATCH] Action button QoL improvements --- code/_onclick/hud/action_button.dm | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 96a07bad24c..4bac886a054 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -23,6 +23,7 @@ //Hide/Show Action Buttons ... Button /obj/screen/movable/action_button/hide_toggle name = "Hide Buttons" + desc = "Shift-click any button to reset its position. Alt-click to reset all buttons to their default positions." icon = 'icons/mob/actions.dmi' icon_state = "bg_default" var/hidden = 0 @@ -33,8 +34,18 @@ /obj/screen/movable/action_button/hide_toggle/Click(location,control,params) var/list/modifiers = params2list(params) if(modifiers["shift"]) - moved = 0 - return 1 + moved = FALSE + usr.update_action_buttons(TRUE) + return TRUE + if(modifiers["alt"]) + for(var/V in usr.actions) + var/datum/action/A = V + var/obj/screen/movable/action_button/B = A.button + B.moved = FALSE + moved = FALSE + usr.update_action_buttons(TRUE) + to_chat(usr, "Action button positions have been reset.") + return TRUE usr.hud_used.action_buttons_hidden = !usr.hud_used.action_buttons_hidden hidden = usr.hud_used.action_buttons_hidden @@ -45,6 +56,16 @@ UpdateIcon() usr.update_action_buttons() +/obj/screen/movable/action_button/hide_toggle/AltClick(mob/user) + for(var/V in user.actions) + var/datum/action/A = V + var/obj/screen/movable/action_button/B = A.button + B.moved = FALSE + if(moved) + moved = FALSE + user.update_action_buttons(TRUE) + to_chat(user, "Action button positions have been reset.") + /obj/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(datum/hud/owner_hud) var settings = owner_hud.get_action_buttons_icons()