15
15
# define ROOM_ERR_SPACE - 1
16
16
# define ROOM_ERR_TOOLARGE - 2
17
17
18
+ var /global /list /blueprint_archives = list ()
18
19
19
20
/ obj / item/ blueprints
20
21
name = " station blueprints"
26
27
flammable = TRUE
27
28
28
29
var /header = " <small>property of Nanotrasen. For heads of staff only. Store in high-secure storage.</small>"
30
+ var /shows_archives = TRUE
31
+ var /last_shown_archive
29
32
30
33
var /can_create_areas_in = list (AREA_SPACE ,AREA_CONSTRUCT )
31
34
var /can_rename_areas = list (AREA_STATION , AREA_BLUEPRINTS )
43
46
44
47
var /mob /editor
45
48
49
+ // below is non functional, uncomment if you want to have a go at this being available from a roundstart snapshot
50
+ /* /obj/item/blueprints/initialize()
51
+ . = ..()
52
+ if(shows_archives && !blueprint_archives.len)
53
+ for(var/area/A in areas)
54
+ if(get_area_type(A) == AREA_STATION)
55
+ for(var/turf/T in A.area_turfs)
56
+ update_turf_image(T)*/
57
+
58
+ / obj / item/ blueprints/ proc / update_turf_image(var /turf /T )
59
+ var /image /overlay = image(T. icon,T,T. icon_state,T. layer,T. dir,T. pixel_x,T. pixel_y)
60
+ overlay. plane = NARSIE_PLANE
61
+ overlay. alpha = 128
62
+ overlay. color = " #06f"
63
+ blueprint_archives[" [ T. x] , [ T. y] , [ T. z] " ] = list (overlay)
64
+ for (var /atom /AM in T. contents)
65
+ if (AM . type == / atom/movable / lighting_overlay)
66
+ continue
67
+ overlay = image(AM . icon,T,AM . icon_state,AM . layer,AM . dir,AM . pixel_x,AM . pixel_y)
68
+ overlay. plane = NARSIE_PLANE
69
+ overlay. alpha = 128
70
+ overlay. color = " #0af"
71
+ blueprint_archives[" [ T. x] , [ T. y] , [ T. z] " ] += overlay
72
+
46
73
// MoMMI blueprints
47
74
/ obj / item/ blueprints/ mommiprints
48
75
name = " MoMMI station blueprints"
@@ -62,6 +89,7 @@ these cannot rename rooms that are in by default BUT can rename rooms that are c
62
89
icon_state = " permit"
63
90
64
91
w_class = W_CLASS_TINY
92
+ shows_archives = FALSE
65
93
66
94
can_rename_areas = list (AREA_BLUEPRINTS )
67
95
can_delete_areas = list (AREA_BLUEPRINTS )
@@ -109,6 +137,12 @@ these cannot rename rooms that are in by default BUT can rename rooms that are c
109
137
return
110
138
111
139
switch (href_list[" action" ])
140
+ if (" show_room" )
141
+ show_room (usr )
142
+
143
+ if (" update_room" )
144
+ update_room (usr )
145
+
112
146
if (" create_room" )
113
147
create_room (usr )
114
148
@@ -149,6 +183,9 @@ these cannot rename rooms that are in by default BUT can rename rooms that are c
149
183
150
184
text += " <br>"
151
185
186
+ if (shows_archives)
187
+ text += " <p><a href='?src=\ref [ src ] ;action=show_room'>Show archive of surroundings</a></p>"
188
+ text += " <p><a href='?src=\ref [ src ] ;action=update_room'>Update archive of surroundings</a></p>"
152
189
if (area_type in can_create_areas_in)
153
190
text += " <p><a href='?src=\ref [ src ] ;action=create_room'>Create a new room</a></p>"
154
191
text += " <p><a href='?src=\ref [ src ] ;action=create_area'>Start a new drawing</a></p>"
@@ -262,6 +299,30 @@ these cannot rename rooms that are in by default BUT can rename rooms that are c
262
299
263
300
#undef error_flash_dur
264
301
302
+ // Shows an archive of surrounding tiles
303
+ / obj / item/ blueprints/ proc / show_room( mob / user)
304
+ if (shows_archives && user. client)
305
+ var /list /shown_images = list ()
306
+ var /tstring = " "
307
+ for (var /turf /T in spiral_block (get_turf(user),user. client. view))
308
+ tstring = " [ T. x] , [ T. y] , [ T. z] "
309
+ if (tstring in blueprint_archives)
310
+ for (var /I in blueprint_archives[tstring])
311
+ shown_images += I
312
+ user. client. images += I
313
+ last_shown_archive = world . time
314
+ spawn (10 SECONDS )
315
+ if (world . time - last_shown_archive >= 99 ) // sanity for mass clicking of this
316
+ user. client. images -= shown_images
317
+
318
+ / obj / item/ blueprints/ proc / update_room( mob / user)
319
+ if (shows_archives)
320
+ if (blueprint_archives. len)
321
+ if (alert(usr ," This will overwrite any archives, continue?" ," Overwriting" ," Yes" ," No" ) == " No" )
322
+ return
323
+ for (var /turf /T in view (user. client. view))
324
+ update_turf_image (T)
325
+
265
326
// Creates a new area and spreads it to cover the current room
266
327
/ obj / item/ blueprints/ proc / create_room( mob / user)
267
328
if (! (get_area_type() in can_create_areas_in))
0 commit comments