mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 01:23:41 +01:00
Merge pull request #9567 from Bram961/master
Window alt clicking utility
This commit is contained in:
@@ -65,7 +65,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The window is <i>unscrewed</i> from the floor, and could be deconstructed by <b>wrenching</b>.</span>")
|
||||
if(!anchored && !fulltile)
|
||||
to_chat(user, "<span class='notice'>Alt-click to rotate it clockwise.</span>")
|
||||
to_chat(user, "<span class='notice'>Alt-click to rotate it.</span>")
|
||||
|
||||
/obj/structure/window/New(Loc, direct)
|
||||
..()
|
||||
@@ -355,7 +355,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
@@ -378,7 +378,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
@@ -397,12 +397,31 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/AltClick(mob/user)
|
||||
|
||||
if(user.incapacitated())
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
|
||||
if(!Adjacent(user))
|
||||
to_chat(user, "<span class='warning'>Move closer to the window!</span>")
|
||||
return
|
||||
revrotate()
|
||||
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
|
||||
return FALSE
|
||||
|
||||
var/target_dir = turn(dir, 270)
|
||||
|
||||
if(!valid_window_location(loc, target_dir))
|
||||
target_dir = turn(dir, 90)
|
||||
if(!valid_window_location(loc, target_dir))
|
||||
to_chat(user, "<span class='warning'>There is no room to rotate the [src]</span>")
|
||||
return FALSE
|
||||
|
||||
setDir(target_dir)
|
||||
ini_dir = dir
|
||||
add_fingerprint(user)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/Destroy()
|
||||
density = FALSE
|
||||
|
||||
Reference in New Issue
Block a user