mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Merge pull request #4371 from tigercat2000/better_blueprints
Ports holomap blueprints from tg/vg.
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
if(href_list["create_area"])
|
||||
if(get_area_type()==AREA_SPACE)
|
||||
create_area()
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
//One-use area creation permits.
|
||||
@@ -77,6 +77,12 @@
|
||||
icon_state = "blueprints"
|
||||
fluffnotice = "Property of Nanotrasen. For heads of staff only. Store in high-secure storage."
|
||||
w_class = 3
|
||||
var/list/showing = list()
|
||||
var/client/viewing
|
||||
|
||||
/obj/item/areaeditor/blueprints/Destroy()
|
||||
clear_viewer()
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/areaeditor/blueprints/attack_self(mob/user as mob)
|
||||
@@ -85,6 +91,11 @@
|
||||
if(get_area_type() == AREA_STATION)
|
||||
. += "<p>According to the [src], you are now in <b>\"[sanitize(A.name)]\"</b>.</p>"
|
||||
. += "<p>You may <a href='?src=\ref[src];edit_area=1'> move an amendment</a> to the drawing.</p>"
|
||||
if(!viewing)
|
||||
. += "<p><a href='?src=\ref[src];view_blueprints=1'>View structural data</a></p>"
|
||||
else
|
||||
. += "<p><a href='?src=\ref[src];refresh=1'>Refresh structural data</a></p>"
|
||||
. += "<p><a href='?src=\ref[src];hide_blueprints=1'>Hide structural data</a></p>"
|
||||
var/datum/browser/popup = new(user, "blueprints", "[src]", 700, 500)
|
||||
popup.set_content(.)
|
||||
popup.open()
|
||||
@@ -97,8 +108,43 @@
|
||||
if(get_area_type()!=AREA_STATION)
|
||||
return
|
||||
edit_area()
|
||||
updateUsrDialog()
|
||||
if(href_list["view_blueprints"])
|
||||
set_viewer(usr, "<span class='notice'>You flip the blueprints over to view the complex information diagram.</span>")
|
||||
if(href_list["hide_blueprints"])
|
||||
clear_viewer(usr, "<span class='notice'>You flip the blueprints over to view the simple information diagram.</span>")
|
||||
if(href_list["refresh"])
|
||||
clear_viewer(usr)
|
||||
set_viewer(usr)
|
||||
|
||||
attack_self(usr)
|
||||
/obj/item/areaeditor/blueprints/proc/get_images(turf/T, viewsize)
|
||||
. = list()
|
||||
for(var/tt in RANGE_TURFS(viewsize, T))
|
||||
var/turf/TT = tt
|
||||
if(TT.blueprint_data)
|
||||
. += TT.blueprint_data
|
||||
|
||||
/obj/item/areaeditor/blueprints/proc/set_viewer(mob/user, message = "")
|
||||
if(user && user.client)
|
||||
if(viewing)
|
||||
clear_viewer()
|
||||
viewing = user.client
|
||||
showing = get_images(get_turf(user), viewing.view)
|
||||
viewing.images |= showing
|
||||
if(message)
|
||||
to_chat(user, message)
|
||||
|
||||
/obj/item/areaeditor/blueprints/proc/clear_viewer(mob/user, message = "")
|
||||
if(viewing)
|
||||
viewing.images -= showing
|
||||
viewing = null
|
||||
showing.Cut()
|
||||
if(message)
|
||||
to_chat(user, message)
|
||||
|
||||
/obj/item/areaeditor/blueprints/dropped(mob/user)
|
||||
..()
|
||||
clear_viewer()
|
||||
|
||||
/obj/item/areaeditor/proc/get_area()
|
||||
var/turf/T = get_turf(usr)
|
||||
|
||||
@@ -23,6 +23,19 @@
|
||||
// Reagent ID => friendly name
|
||||
var/list/reagents_to_log=list()
|
||||
|
||||
var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart?
|
||||
var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created.
|
||||
|
||||
/obj/New()
|
||||
. = ..()
|
||||
|
||||
if(on_blueprints && isturf(loc))
|
||||
var/turf/T = loc
|
||||
if(force_blueprints)
|
||||
T.add_blueprints(src)
|
||||
else
|
||||
T.add_blueprints_preround(src)
|
||||
|
||||
/obj/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/state = default_state)
|
||||
// Calling Topic without a corresponding window open causes runtime errors
|
||||
if(!nowindow && ..())
|
||||
|
||||
Reference in New Issue
Block a user