From c179c2bf599543b2a58fc68f70b862003bbc64ea Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 5 Feb 2021 23:06:57 +0100 Subject: [PATCH] [MIRROR] You no longer need to hold shift to open the context menu as a ghost (#3122) * You no longer need to hold shift to open the context menu as a ghost (#56646) * You no longer need to hold shift to open the context menu as a ghost Co-authored-by: Qustinnus --- code/modules/client/client_procs.dm | 13 +++++++++++++ code/modules/mob/dead/observer/login.dm | 3 +++ code/modules/mob/dead/observer/observer.dm | 1 + code/modules/mob/login.dm | 1 + code/modules/mob/mob_defines.dm | 1 + 5 files changed, 19 insertions(+) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 4764ca63f19..cd8473cba53 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -215,6 +215,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( // Instantiate tgui panel tgui_panel = new(src) + set_right_click_menu_mode(TRUE) + GLOB.ahelp_tickets.ClientLogin(src) GLOB.interviews.client_login(src) var/connecting_admin = FALSE //because de-admined admins connecting should be treated like admins. @@ -1116,3 +1118,14 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if(holder) holder.filteriffic = new /datum/filter_editor(in_atom) holder.filteriffic.ui_interact(mob) + + +/client/proc/set_right_click_menu_mode(shift_only) + if(shift_only) + winset(src, "mapwindow.map", "right-click=true") + winset(src, "ShiftUp", "is-disabled=false") + winset(src, "Shift", "is-disabled=false") + else + winset(src, "mapwindow.map", "right-click=false") + winset(src, "default.Shift", "is-disabled=true") + winset(src, "default.ShiftUp", "is-disabled=true") diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm index 9a9744e3515..c98a452bdfa 100644 --- a/code/modules/mob/dead/observer/login.dm +++ b/code/modules/mob/dead/observer/login.dm @@ -20,3 +20,6 @@ update_icon(preferred_form) updateghostimages() + client.set_right_click_menu_mode(FALSE) + + diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 68d245d8cdb..af079ebd87e 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -21,6 +21,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) light_range = 1 light_power = 2 light_on = FALSE + shift_to_open_context_menu = FALSE var/can_reenter_corpse var/datum/hud/living/carbon/hud = null // hud var/bootime = 0 diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 3bb706730f8..269d0608327 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -32,6 +32,7 @@ world.update_status() client.screen = list() //remove hud items just in case client.images = list() + client.set_right_click_menu_mode(shift_to_open_context_menu) if(!hud_used) create_mob_hud() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 9c50e3f9822..b4cda48aa86 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -18,6 +18,7 @@ throwforce = 10 blocks_emissive = EMISSIVE_BLOCK_GENERIC pass_flags_self = PASSMOB + var/shift_to_open_context_menu = TRUE ///when this be added to vis_contents of something it inherit something.plane, important for visualisation of mob in openspace. vis_flags = VIS_INHERIT_PLANE