Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,33 @@
/atom/proc/CtrlAltClick(var/mob/user)
return

/*
Rclick.
*/

/mob/proc/RightClickOn(atom/A)
A.RightClick(src)

///Called when a owner mob Shift + Rightmouseclicks an atom
/mob/proc/ShiftRightClickOn(atom/A)
A.ShiftRightClick(src)

///Called when a owner mob Alt + Rightmouseclicks an atom, given that Altclick does not return TRUE
/mob/proc/AltRightClickOn(atom/A)
A.AltRightClick(src)

///Called when a mob Rightmouseclicks this atom
/atom/proc/RightClick(mob/user)
return

///Called when a mob Shift + Rightmouseclicks this atom
/atom/proc/ShiftRightClick(mob/user)
return

///Called when a mob Alt + Rightmouseclicks this atom, given that mobs Altclick() does not return TRUE
/atom/proc/AltRightClick(mob/user)
return

/*
Misc helpers

Expand Down
4 changes: 4 additions & 0 deletions code/game/machinery/bodyscanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src

/obj/machinery/bodyscanner/RightClick(mob/user)
if(CanPhysicallyInteract(user))
eject()

/obj/machinery/bodyscanner/proc/drop_contents()
for(var/obj/O in (contents - component_parts))
O.dropInto(loc)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
var/related_accounts_ip = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this ip
var/related_accounts_cid = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this computer id

///remembers what our context menu setting is currently set to
var/shift_to_open_context_menu = TRUE


/*
As of byond 512, due to how broken preloading is, preload_rsc MUST be set to 1 at compile time if resource URLs are *not* in use,
BUT you still want resource preloading enabled (from the server itself). If using resource URLs, it should be set to 0 and
Expand Down
18 changes: 18 additions & 0 deletions code/modules/client/preferences_toggle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,21 @@ var/list/client_preference_stats_

/stat_client_preference/proc/update_name(var/mob/user)
name = user.get_preference_value(client_preference)

///Toggles whether or not you need to hold shift to access the right click menu
/client/verb/toggle_right_click()
set name = "Toggle Right Click"
set category = "Preferences"

if(shift_to_open_context_menu)
winset(src, "mapwindow.map", "right-click=false")
winset(src, "default.Shift", "is-disabled=true")
winset(src, "default.ShiftUp", "is-disabled=true")
shift_to_open_context_menu = FALSE
to_chat(usr, "<span class='notice'>You will no longer need to hold the Shift key to access the right click menu</span>")
else
winset(src, "mapwindow.map", "right-click=true")
winset(src, "ShiftUp", "is-disabled=false")
winset(src, "Shift", "is-disabled=false")
shift_to_open_context_menu = TRUE
to_chat(usr, "<span class='notice'>You will now need to hold the Shift key to access the right click menu</span>")
2 changes: 1 addition & 1 deletion code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@
if(pin)
to_chat(user, SPAN_WARNING("There's already a pin installed."))

/obj/item/weapon/gun/AltClick(var/mob/user)
/obj/item/weapon/gun/RightClick(var/mob/user)
if(!pin)
to_chat(user, SPAN_WARNING("There's no firing pin installed in this weapon."))
return
Expand Down
43 changes: 42 additions & 1 deletion interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,16 @@ macro "borghotkeymode"
elem
name = "."
command = "move-down"
elem ".winset :map.right-click=false"
name = "SHIFT+Shift"
elem "Shift"
name = "SHIFT"
command = ".winset :map.right-click=false"
elem "ShiftUp"
name = "SHIFT+UP"
command = ".winset :map.right-click=true"



macro "macro"
elem
Expand Down Expand Up @@ -451,6 +461,16 @@ macro "macro"
elem
name = "CTRL+Subtract"
command = "move-down"
elem ".winset :map.right-click=false"
name = "SHIFT+Shift"
elem "Shift"
name = "SHIFT"
command = ".winset :map.right-click=false"
elem "ShiftUp"
name = "SHIFT+UP"
command = ".winset :map.right-click=true"



macro "hotkeymode"
elem
Expand Down Expand Up @@ -549,7 +569,7 @@ macro "hotkeymode"
elem
name = "Delete"
command = "delete-key-pressed"
elem
elem
name = "1"
command = "a-intent help"
elem
Expand Down Expand Up @@ -735,6 +755,16 @@ macro "hotkeymode"
elem
name = "SHIFT+UP"
command = "setmovingslowly"
elem ".winset :map.right-click=false"
name = "SHIFT+Shift"
elem "Shift"
name = "SHIFT"
command = ".winset :map.right-click=false"
elem "ShiftUp"
name = "SHIFT+UP"
command = ".winset :map.right-click=true"



macro "borgmacro"
elem
Expand Down Expand Up @@ -911,6 +941,16 @@ macro "borgmacro"
elem
name = "CTRL+Subtract"
command = "move-down"
elem ".winset :map.right-click=false"
name = "SHIFT+Shift"
elem "Shift"
name = "SHIFT"
command = ".winset :map.right-click=false"
elem "ShiftUp"
name = "SHIFT+UP"
command = ".winset :map.right-click=true"




menu "menu"
Expand Down Expand Up @@ -1077,6 +1117,7 @@ window "mapwindow"
saved-params = "pos;size;is-minimized;is-maximized"
titlebar = false
statusbar = false
right-click = true
can-close = false
can-minimize = false
can-resize = false
Expand Down