Files
Paradise/code/modules/buildmode/effects/line.dm
Crazylemon64 5b0eedcee5 Refactors buildmode into submodules, and adds an "atmos" buildmode
Also makes the mode selection interface far less tedious/painful

Adds unsimulated turf overriding, and admin logging

Temporary commit for storing the sdql buildmode

Adds extra documentation

also requires a path to be selected for "advanced" and "fill" modes, now

Spaces out mode switch buttons nicer

removes need for debug rights to do a fill with mob paths

Adds a bunch of extra fancy paths

Fox Changes pt 1

Backports /tg/station changes

Fixes a double-tap issue with dclick handling of certain mobs

Also no longer shows the "selection canceled" if you haven't selected a
region for the buildmode that supports region selection

Updates buildmode stuff
2018-10-07 20:54:40 -07:00

28 lines
867 B
Plaintext

/obj/effect/buildmode_line
var/image/I
var/client/cl
/obj/effect/buildmode_line/New(client/C, atom/atom_a, atom/atom_b, linename)
name = linename
loc = get_turf(atom_a)
I = image('icons/misc/mark.dmi', src, "line", 19.0)
var/x_offset = ((atom_b.x * 32) + atom_b.pixel_x) - ((atom_a.x * 32) + atom_a.pixel_x)
var/y_offset = ((atom_b.y * 32) + atom_b.pixel_y) - ((atom_a.y * 32) + atom_a.pixel_y)
var/matrix/mat = matrix()
mat.Translate(0, 16)
mat.Scale(1, sqrt((x_offset * x_offset) + (y_offset * y_offset)) / 32)
mat.Turn(90 - Atan2(x_offset, y_offset)) // So... You pass coords in order x,y to this version of atan2. It should be called acsc2.
mat.Translate(atom_a.pixel_x, atom_a.pixel_y)
transform = mat
cl = C
cl.images += I
/obj/effect/buildmode_line/Destroy()
if(I)
if(istype(cl))
cl.images -= I
cl = null
QDEL_NULL(I)
return ..()