Skip to content

Commit

Permalink
add ability to cancel alt click
Browse files Browse the repository at this point in the history
  • Loading branch information
intercepti0n committed Mar 31, 2024
1 parent 116a5f0 commit 2b1c7ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,15 @@
A.AltClick(src)

/atom/proc/AltClick(mob/user)
SEND_SIGNAL(src, SIGNAL_ALT_CLICKED, src, user)
var/cancel = SEND_SIGNAL(src, SIGNAL_ALT_CLICKED, src, user)
if(cancel)
return

var/turf/clicked_turf = get_turf(src)

if(clicked_turf && user.TurfAdjacent(clicked_turf))
user.set_listed_turf(clicked_turf)

return TRUE

/mob/proc/TurfAdjacent(turf/T)
return T.AdjacentQuick(src)

Expand Down Expand Up @@ -335,10 +335,9 @@
return

/atom/proc/CtrlAltClick(mob/user)
SEND_SIGNAL(src, SIGNAL_CTRL_ALT_CLICKED, src, user)
return


var/cancel = SEND_SIGNAL(src, SIGNAL_CTRL_ALT_CLICKED, src, user)
if(cancel)
return

/*
Rclick.
Expand Down
2 changes: 2 additions & 0 deletions code/datums/elements/simple_rotation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@

/datum/element/simple_rotation/proc/on_alt_click(atom/clicked, mob/user)
clicked.rotate(user)
return TRUE

/datum/element/simple_rotation/proc/on_ctrl_alt_click(atom/clicked, mob/user)
clicked.rotate_counter(user)
return TRUE

/atom/proc/can_rotate(mob/user)
return !(!user || user.incapacitated() || !Adjacent(user))
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mining/drilling/drill.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@

RefreshParts()

AddElement(/datum/element/simple_rotation)

/obj/machinery/mining/drill/Process()

if(need_player_check)
Expand Down

0 comments on commit 2b1c7ca

Please sign in to comment.