Merge pull request #4371 from tigercat2000/better_blueprints

Ports holomap blueprints from tg/vg.
This commit is contained in:
Fox McCloud
2016-05-07 22:54:52 -04:00
7 changed files with 87 additions and 3 deletions
+1
View File
@@ -16,6 +16,7 @@ Pipelines + Other Objects -> Pipe network
idle_power_usage = 0
active_power_usage = 0
power_channel = ENVIRON
on_blueprints = TRUE
var/nodealert = 0
var/can_unwrench = 0
+48 -2
View File
@@ -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)
+13
View File
@@ -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 && ..())
+21 -1
View File
@@ -29,6 +29,8 @@
var/image/obscured //camerachunks
var/list/blueprint_data //for the station blueprints, images of objects eg: pipes
var/list/footstep_sounds = list()
var/shoe_running_volume = 50
var/shoe_walking_volume = 20
@@ -161,6 +163,7 @@
var/old_dynamic_lighting = dynamic_lighting
var/list/old_affecting_lights = affecting_lights
var/old_lighting_overlay = lighting_overlay
var/old_blueprint_data = blueprint_data
if(air_master)
air_master.remove_from_active(src)
@@ -170,6 +173,7 @@
if(istype(W, /turf/simulated))
W:Assimilate_Air()
W.RemoveLattice()
W.blueprint_data = old_blueprint_data
for(var/turf/space/S in range(W,1))
S.update_starlight()
@@ -384,4 +388,20 @@
return 1
/turf/proc/can_lay_cable()
return can_have_cabling() & !intact
return can_have_cabling() & !intact
/turf/proc/add_blueprints(atom/movable/AM)
var/image/I = new
I.appearance = AM.appearance
I.appearance_flags = RESET_COLOR|RESET_ALPHA|RESET_TRANSFORM
I.loc = src
I.dir = AM.dir
I.alpha = 128
if(!blueprint_data)
blueprint_data = list()
blueprint_data += I
/turf/proc/add_blueprints_preround(atom/movable/AM)
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
add_blueprints(AM)
+1
View File
@@ -25,6 +25,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable
level = 1
anchored =1
on_blueprints = TRUE
var/datum/powernet/powernet
name = "power cable"
desc = "A flexible superconducting cable for heavy-duty power transfer"
+1
View File
@@ -10,6 +10,7 @@
name = null
icon = 'icons/obj/power.dmi'
anchored = 1.0
on_blueprints = TRUE
var/datum/powernet/powernet = null
use_power = 0
idle_power_usage = 0
+2
View File
@@ -14,6 +14,7 @@
icon_state = "disposal"
anchored = 1
density = 1
on_blueprints = TRUE
var/datum/gas_mixture/air_contents // internal reservoir
var/mode = 1 // item mode 0=off 1=charging 2=charged
var/flush = 0 // true if flush handle is pulled
@@ -656,6 +657,7 @@
anchored = 1
density = 0
on_blueprints = TRUE
level = 1 // underfloor only
var/dpdir = 0 // bitmask of pipe directions
dir = 0 // dir will contain dominant direction for junction pipes