mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 18:11:47 +00:00
* Datumizes all uses of change_view * Cleanup and helper procs * tweaks values to match the format, hint hint, (value - 0.5) works just fine * And there's the rest * woop, braindamage * and one more * fuck you menu file * woops * we should apply that * fixes tooltip drift, thank you goon coders * you can shake but you can't zoom
19 lines
633 B
Plaintext
19 lines
633 B
Plaintext
/proc/getviewsize(view)
|
|
var/viewX
|
|
var/viewY
|
|
if(isnum(view))
|
|
var/totalviewrange = (view < 0 ? -1 : 1) + 2 * view
|
|
viewX = totalviewrange
|
|
viewY = totalviewrange
|
|
else
|
|
var/list/viewrangelist = splittext(view,"x")
|
|
viewX = text2num(viewrangelist[1])
|
|
viewY = text2num(viewrangelist[2])
|
|
return list(viewX, viewY)
|
|
|
|
/proc/in_view_range(mob/user, atom/A)
|
|
var/list/view_range = getviewsize(user.client.view)
|
|
var/turf/source = get_turf(user)
|
|
var/turf/target = get_turf(A)
|
|
return ISINRANGE(target.x, source.x - view_range[1], source.x + view_range[1]) && ISINRANGE(target.y, source.y - view_range[1], source.y + view_range[1])
|