mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
[MIRROR] CE blueprints: Fix structural overlay [MDB IGNORE] (#8729)
* CE blueprints: Fix structural overlay (#61974) CE blueprints come with a niche but situationally useful ability to view the original atmos, disposals, and power cable layout. This has suffered a fair amount of bitrot. Not only was this not updated to use the plane and layer variables, but it also didn't handle any client running in widescreen mode - RANGE_TURFS requires a numerical parameter for its radius parameter, and cannot handle a modern viewstring such as "17x17". * CE blueprints: Fix structural overlay Co-authored-by: esainane <esainane+github@gmail.com>
This commit is contained in:
@@ -115,18 +115,21 @@
|
||||
|
||||
attack_self(usr) //this is not the proper way, but neither of the old update procs work! it's too ancient and I'm tired shush.
|
||||
|
||||
/obj/item/areaeditor/blueprints/proc/get_images(turf/T, viewsize)
|
||||
/obj/item/areaeditor/blueprints/proc/get_images(turf/central_turf, viewsize)
|
||||
. = list()
|
||||
for(var/turf/TT in RANGE_TURFS(viewsize, T))
|
||||
if(TT.blueprint_data)
|
||||
. += TT.blueprint_data
|
||||
var/list/dimensions = getviewsize(viewsize)
|
||||
var/horizontal_radius = dimensions[1] / 2
|
||||
var/vertical_radius = dimensions[2] / 2
|
||||
for(var/turf/nearby_turf as anything in RECT_TURFS(horizontal_radius, vertical_radius, central_turf))
|
||||
if(nearby_turf.blueprint_data)
|
||||
. += nearby_turf.blueprint_data
|
||||
|
||||
/obj/item/areaeditor/blueprints/proc/set_viewer(mob/user, message = "")
|
||||
if(user?.client)
|
||||
if(viewing)
|
||||
clear_viewer()
|
||||
viewing = user.client
|
||||
showing = get_images(get_turf(user), viewing.view)
|
||||
showing = get_images(get_turf(viewing.eye || user), viewing.view)
|
||||
viewing.images |= showing
|
||||
if(message)
|
||||
to_chat(user, message)
|
||||
|
||||
Reference in New Issue
Block a user