diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 4bac886a05..85ecd036de 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -13,17 +13,21 @@ if(modifiers["shift"]) moved = 0 usr.update_action_buttons() //redraw buttons that are no longer considered "moved" - return 1 + return TRUE + if(modifiers["ctrl"]) + locked = !locked + to_chat(usr, "Action button \"[name]\" [locked ? "" : "un"]locked.") + return TRUE if(usr.next_click > world.time) return usr.next_click = world.time + 1 linked_action.Trigger() - return 1 + return TRUE //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." + desc = "Shift-click any button to reset its position, and Control-click it to lock it in place. Alt-click this button to reset all buttons to their default positions." icon = 'icons/mob/actions.dmi' icon_state = "bg_default" var/hidden = 0 @@ -37,11 +41,17 @@ moved = FALSE usr.update_action_buttons(TRUE) return TRUE + if(modifiers["ctrl"]) + locked = !locked + to_chat(usr, "Action button \"[name]\" [locked ? "" : "un"]locked.") + 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 + B.locked = usr.client.prefs.buttons_locked + locked = usr.client.prefs.buttons_locked moved = FALSE usr.update_action_buttons(TRUE) to_chat(usr, "Action button positions have been reset.") diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 1bb3ba5223..4074d7d3f3 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -58,6 +58,8 @@ hide_actions_toggle = new hide_actions_toggle.InitialiseIcon(src) + if(mymob.client) + hide_actions_toggle.locked = mymob.client.prefs.buttons_locked hand_slots = list() diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index 315fce5bf6..4da721012d 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -11,6 +11,7 @@ /obj/screen/movable var/snap2grid = FALSE var/moved = FALSE + var/locked = FALSE //Snap Screen Object //Tied to the grid, snaps to the nearest turf @@ -20,6 +21,8 @@ /obj/screen/movable/MouseDrop(over_object, src_location, over_location, src_control, over_control, params) + if(locked) //no! I am locked! begone! + return var/list/PM = params2list(params) //No screen-loc information? abort. diff --git a/code/datums/action.dm b/code/datums/action.dm index 5049916780..715aea1493 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -45,6 +45,7 @@ M.actions += src if(M.client) M.client.screen += button + button.locked = M.client.prefs.buttons_locked M.update_action_buttons() else Remove(owner) @@ -57,6 +58,7 @@ M.update_action_buttons() owner = null button.moved = FALSE //so the button appears in its normal position when given to another owner. + button.locked = FALSE /datum/action/proc/Trigger() if(!IsAvailable()) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index e9b877a3ac..484e09c5ad 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -30,6 +30,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/UI_style = "Midnight" + var/buttons_locked = FALSE var/hotkeys = FALSE var/tgui_fancy = TRUE var/tgui_lock = TRUE @@ -278,6 +279,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "