mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
map_export now saves welded airlocks and paper on noticeboards (#91960)
When using `map-export`: - Exports the welded state of an airlock to the welded airlock mapping helper - Exports the paper inside of a noticeboard to pop out and be saved on the same turf Both `airlocks` and `noticeboards` handle the outside objects already in their `Initialization()` procs so I didn't have to change anything. Also I cleaned up the paper code and added some better code documentation to `on_object_saved()`. We convert this:  To this:  ## Why It's Good For The Game There weren't any good examples of using `on_object_saved()` and the documentation was lacking so I wanted to include some proof of concept for a few objects. Also airlocks already save their welded state, but I think it looks better to have it as a mapping helper since it shows up in StrongDMM instead of being a VV edit.
This commit is contained in:
@@ -13,18 +13,27 @@
|
||||
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/noticeboard, 32)
|
||||
|
||||
/obj/structure/noticeboard/on_object_saved()
|
||||
var/data
|
||||
|
||||
for(var/obj/item/paper/paper in contents)
|
||||
var/metadata = generate_tgm_metadata(paper)
|
||||
data += "[data ? ",\n" : ""][paper.type][metadata]"
|
||||
|
||||
return data
|
||||
|
||||
/obj/structure/noticeboard/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
if(!mapload)
|
||||
return
|
||||
|
||||
for(var/obj/item/I in loc)
|
||||
for(var/obj/item/paper/paper in loc)
|
||||
if(notices >= MAX_NOTICES)
|
||||
break
|
||||
if(istype(I, /obj/item/paper))
|
||||
I.forceMove(src)
|
||||
notices++
|
||||
|
||||
paper.forceMove(src)
|
||||
notices++
|
||||
update_appearance(UPDATE_ICON)
|
||||
find_and_hang_on_wall()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user