Merge pull request #3942 from Citadel-Station-13/upstream-merge-32607

[MIRROR] Alt clicking additions
This commit is contained in:
LetterJay
2017-11-14 15:57:06 -06:00
committed by GitHub
2 changed files with 46 additions and 24 deletions
@@ -678,15 +678,7 @@
update_icon()
return
else if(istype(W, /obj/item/card/id) || istype(W, /obj/item/device/pda))// trying to unlock the interface with an ID card
if(stat & (NOPOWER|BROKEN))
to_chat(user, "<span class='warning'>It does nothing!</span>")
else
if(src.allowed(usr) && !wires.is_cut(WIRE_IDSCAN))
locked = !locked
to_chat(user, "<span class='notice'>You [ locked ? "lock" : "unlock"] the air alarm interface.</span>")
else
to_chat(user, "<span class='danger'>Access denied.</span>")
return
togglelock(user)
else if(panel_open && is_wire_tool(W))
wires.interact(user)
return
@@ -751,6 +743,25 @@
return
return ..()
/obj/machinery/airalarm/AltClick(mob/user)
..()
if(!issilicon(user) && (!user.canUseTopic(src, be_close=TRUE) || !isturf(loc)))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
else
togglelock(user)
/obj/machinery/airalarm/proc/togglelock(mob/living/user)
if(stat & (NOPOWER|BROKEN))
to_chat(user, "<span class='warning'>It does nothing!</span>")
else
if(src.allowed(usr) && !wires.is_cut(WIRE_IDSCAN))
locked = !locked
to_chat(user, "<span class='notice'>You [ locked ? "lock" : "unlock"] the air alarm interface.</span>")
else
to_chat(user, "<span class='danger'>Access denied.</span>")
return
/obj/machinery/airalarm/power_change()
..()