From 635d56849ce2252c8855c56f8db1c04fc2d6b449 Mon Sep 17 00:00:00 2001 From: Beagle <56142455+BeagleGaming1@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:05:58 -0500 Subject: [PATCH 1/3] initial --- code/datums/action.dm | 8 ++++---- code/modules/mob/mob_verbs.dm | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/code/datums/action.dm b/code/datums/action.dm index 0510a43415a7..3a597ad262b1 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -11,9 +11,9 @@ var/cost = 0 // By default an action has no cost -> will be utilized by skill actions/xeno actions var/action_flags = 0 // Check out __game.dm for flags /// Whether the action is hidden from its owner - /// Useful for when you want to preserve action state while preventing - /// a mob from using said action - var/hidden = FALSE + var/hidden = FALSE //Preserve action state while preventing mob from using action + ///Hide the action from the owner without preventing them from using it (incase of keybind listen_signal) + var/player_hidden = FALSE var/unique = TRUE /// A signal on the mob that will cause the action to activate var/listen_signal @@ -227,7 +227,7 @@ var/atom/movable/screen/action_button/B = A.button if(reload_screen) client.add_to_screen(B) - if(A.hidden) + if(A.hidden || A.player_hidden) B.screen_loc = null continue button_number++ diff --git a/code/modules/mob/mob_verbs.dm b/code/modules/mob/mob_verbs.dm index a941dfc51090..9638590dae4b 100644 --- a/code/modules/mob/mob_verbs.dm +++ b/code/modules/mob/mob_verbs.dm @@ -245,3 +245,34 @@ //so we must undo it here so the victim can move right away M.client.next_movement = world.time M.update_transform(TRUE) + +/mob/verb/action_hide_menu() + set name = "Show/Hide Actions" + set category = "IC" + + if(!ismob(usr)) + return + var/mob/user = usr + + var/list/actions_list = list() + for(var/datum/action/action as anything in user.actions) + var/action_name = action.name + if(action.player_hidden) + action_name += " (Hidden)" + actions_list[action_name] += action + + if(!LAZYLEN(actions_list)) + to_chat(user, SPAN_WARNING("You have no actions available.")) + return + + var/selected_action_name = tgui_input_list(user, "Show or hide selected action", "Show/Hide Actions", actions_list, 30 SECONDS) + if(!selected_action_name) + to_chat(user, SPAN_WARNING("You did not select an action.")) + return + + var/datum/action/selected_action = actions_list[selected_action_name] + selected_action.player_hidden = !selected_action.player_hidden + user.update_action_buttons() + + if(!selected_action.player_hidden && selected_action.hidden) //Inform the player that even if they are unhiding it, itll still not be visible + to_chat(user, SPAN_NOTICE("[selected_action] is forcefully hidden, bypassing player unhiding.")) From 608d2a5f522fcef4af619582a8bf1cc5cca80d87 Mon Sep 17 00:00:00 2001 From: Beagle <56142455+BeagleGaming1@users.noreply.github.com> Date: Mon, 25 Dec 2023 23:07:57 -0500 Subject: [PATCH 2/3] /client --- code/modules/client/client_procs.dm | 31 +++++++++++++++++++++++++++++ code/modules/mob/mob_verbs.dm | 31 ----------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 171cade3ed4e..517790fc4024 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -842,3 +842,34 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( total_t3_playtime += get_job_playtime(src, caste_name) return total_t3_playtime + +/client/verb/action_hide_menu() + set name = "Show/Hide Actions" + set category = "IC" + + if(!ismob(usr)) + return + var/mob/user = usr + + var/list/actions_list = list() + for(var/datum/action/action as anything in user.actions) + var/action_name = action.name + if(action.player_hidden) + action_name += " (Hidden)" + actions_list[action_name] += action + + if(!LAZYLEN(actions_list)) + to_chat(user, SPAN_WARNING("You have no actions available.")) + return + + var/selected_action_name = tgui_input_list(user, "Show or hide selected action", "Show/Hide Actions", actions_list, 30 SECONDS) + if(!selected_action_name) + to_chat(user, SPAN_WARNING("You did not select an action.")) + return + + var/datum/action/selected_action = actions_list[selected_action_name] + selected_action.player_hidden = !selected_action.player_hidden + user.update_action_buttons() + + if(!selected_action.player_hidden && selected_action.hidden) //Inform the player that even if they are unhiding it, itll still not be visible + to_chat(user, SPAN_NOTICE("[selected_action] is forcefully hidden, bypassing player unhiding.")) diff --git a/code/modules/mob/mob_verbs.dm b/code/modules/mob/mob_verbs.dm index 9638590dae4b..a941dfc51090 100644 --- a/code/modules/mob/mob_verbs.dm +++ b/code/modules/mob/mob_verbs.dm @@ -245,34 +245,3 @@ //so we must undo it here so the victim can move right away M.client.next_movement = world.time M.update_transform(TRUE) - -/mob/verb/action_hide_menu() - set name = "Show/Hide Actions" - set category = "IC" - - if(!ismob(usr)) - return - var/mob/user = usr - - var/list/actions_list = list() - for(var/datum/action/action as anything in user.actions) - var/action_name = action.name - if(action.player_hidden) - action_name += " (Hidden)" - actions_list[action_name] += action - - if(!LAZYLEN(actions_list)) - to_chat(user, SPAN_WARNING("You have no actions available.")) - return - - var/selected_action_name = tgui_input_list(user, "Show or hide selected action", "Show/Hide Actions", actions_list, 30 SECONDS) - if(!selected_action_name) - to_chat(user, SPAN_WARNING("You did not select an action.")) - return - - var/datum/action/selected_action = actions_list[selected_action_name] - selected_action.player_hidden = !selected_action.player_hidden - user.update_action_buttons() - - if(!selected_action.player_hidden && selected_action.hidden) //Inform the player that even if they are unhiding it, itll still not be visible - to_chat(user, SPAN_NOTICE("[selected_action] is forcefully hidden, bypassing player unhiding.")) From aa0b08a06355b52741385a11e72f434039f5bb19 Mon Sep 17 00:00:00 2001 From: Beagle <56142455+BeagleGaming1@users.noreply.github.com> Date: Fri, 29 Dec 2023 14:32:35 -0500 Subject: [PATCH 3/3] fix 1 --- code/modules/client/client_procs.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 517790fc4024..214ef3410ac1 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -847,8 +847,6 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( set name = "Show/Hide Actions" set category = "IC" - if(!ismob(usr)) - return var/mob/user = usr var/list/actions_list = list()