From f7e2f8d7b4670abb45111707f79e01cd0a48a1ec Mon Sep 17 00:00:00 2001 From: skoglol <33292112+kriskog@users.noreply.github.com> Date: Wed, 7 Nov 2018 09:50:04 +0100 Subject: [PATCH] Adds safer alt-click helper proc, fixed proc name, removed signal. (#41237) cl Skoglol code: New helper proc for alt-click turf listing, bypasses any interaction overrides. code: Ghosts and revenants now use the new proc. fix: Ghosts can no longer toggleopen sleepers, adjust skateboard speed or close laptops fix: Revenant can now alt-click turf to list contents. tweak: Revenant now slightly less nosy, use shift click to examine. tweak: Alt-clicking the same turf again no longer closes the turf listing tab. /cl Fixes #22410 Use the new helper when you want something to have alt-click turf content listing, but no other world interaction. --- code/_onclick/click.dm | 14 +++++++++----- code/_onclick/observer.dm | 2 +- .../antagonists/revenant/revenant_abilities.dm | 12 ++++++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index d4873798b8d..d4c7d87fbe6 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -365,11 +365,15 @@ SEND_SIGNAL(src, COMSIG_CLICK_ALT, user) var/turf/T = get_turf(src) if(T && user.TurfAdjacent(T)) - if(user.listed_turf == T) - user.listed_turf = null - else - user.listed_turf = T - user.client.statpanel = T.name + user.listed_turf = T + user.client.statpanel = T.name + +// Use this instead of /mob/proc/AltClickOn(atom/A) where you only want turf content listing without additional atom alt-click interaction +/atom/proc/AltClickNoInteract(mob/user, atom/A) + var/turf/T = get_turf(A) + if(T && user.TurfAdjacent(T)) + user.listed_turf = T + user.client.statpanel = T.name /mob/proc/TurfAdjacent(turf/T) return T.Adjacent(src) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 6cacc90fcb5..299d7f64f8b 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -31,7 +31,7 @@ ShiftClickOn(A) return if(modifiers["alt"]) - AltClickOn(A) + AltClickNoInteract(src, A) return if(modifiers["ctrl"]) CtrlClickOn(A) diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index 00a2f5e92d1..f73d5d56257 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -1,13 +1,21 @@ -//Harvest; activated ly clicking the target, will try to drain their essence. /mob/living/simple_animal/revenant/ClickOn(atom/A, params) //revenants can't interact with the world directly. - A.examine(src) + var/list/modifiers = params2list(params) + if(modifiers["shift"]) + ShiftClickOn(A) + return + if(modifiers["alt"]) + AltClickNoInteract(src, A) + return + if(ishuman(A)) if(A in drained_mobs) to_chat(src, "[A]'s soul is dead and empty." ) else if(in_range(src, A)) Harvest(A) + +//Harvest; activated by clicking the target, will try to drain their essence. /mob/living/simple_animal/revenant/proc/Harvest(mob/living/carbon/human/target) if(!castcheck(0)) return