From 7e6584093781ce3af9ea0e5daa5d26aed8f02856 Mon Sep 17 00:00:00 2001 From: listerla <57296132+listerla@users.noreply.github.com> Date: Thu, 20 Aug 2020 22:14:15 -0400 Subject: [PATCH 1/2] Adds shift-middle click pointing (#7487) * Adds shift-middle click pointing * Borgs and buckled folk can now point * Create Lorilili - pointing.yml --- code/_onclick/click.dm | 12 ++++++++++++ code/_onclick/cyborg.dm | 5 ++++- code/modules/mob/living/living.dm | 4 ++-- html/changelogs/Lorilili - pointing.yml | 4 ++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 html/changelogs/Lorilili - pointing.yml diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 544bb736cb..30e6c784a8 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -51,6 +51,9 @@ if(modifiers["shift"] && modifiers["ctrl"]) CtrlShiftClickOn(A) return 1 + if(modifiers["shift"] && modifiers["middle"]) + ShiftMiddleClickOn(A) + return 1 if(modifiers["middle"]) MiddleClickOn(A) return 1 @@ -229,6 +232,15 @@ return */ +/* + Shift middle click + Used for pointing. +*/ + +/mob/proc/ShiftMiddleClickOn(atom/A) + pointed(A) + return + /* Shift click For most mobs, examine. diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index ab56dc6032..d63d49e8d7 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -9,7 +9,7 @@ /mob/living/silicon/robot/ClickOn(var/atom/A, var/params) if(!checkClickCooldown()) return - + setClickCooldown(1) if(client.buildmode) // comes after object.Click to allow buildmode gui objects to be clicked @@ -20,6 +20,9 @@ if(modifiers["shift"] && modifiers["ctrl"]) CtrlShiftClickOn(A) return + if(modifiers["shift"] && modifiers["middle"]) + ShiftMiddleClickOn(A) + return if(modifiers["middle"]) MiddleClickOn(A) return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a472366b03..f72ec0d488 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -48,7 +48,7 @@ //mob verbs are faster than object verbs. See above. /mob/living/pointed(atom/A as mob|obj|turf in view()) - if(src.stat || !src.canmove || src.restrained()) + if(src.stat || src.restrained()) return 0 if(src.status_flags & FAKEDEATH) return 0 @@ -248,7 +248,7 @@ default behaviour is: /mob/living/Crossed(var/atom/movable/AM) // Transplanting this from /mob/living/carbon/human/Crossed() if(AM == src || AM.is_incorporeal()) // We're not going to run over ourselves or ghosts return - + if(istype(AM, /mob/living/bot/mulebot)) var/mob/living/bot/mulebot/MB = AM MB.runOver(src) diff --git a/html/changelogs/Lorilili - pointing.yml b/html/changelogs/Lorilili - pointing.yml new file mode 100644 index 0000000000..400817f8c6 --- /dev/null +++ b/html/changelogs/Lorilili - pointing.yml @@ -0,0 +1,4 @@ +author: Lorilili +delete-after: True +changes: + - rscadd: "You can now point using shift and middle mouse button." \ No newline at end of file