Ports TG painting code (Needs VV rework by kevinz)

This commit is contained in:
Ghom
2020-05-21 03:45:36 +02:00
committed by Archie
parent c60866c101
commit 8e982a32c4
18 changed files with 1344 additions and 799 deletions
+19
View File
@@ -18,6 +18,8 @@ SUBSYSTEM_DEF(persistence)
var/list/picture_logging_information = list()
var/list/obj/structure/sign/picture_frame/photo_frames
var/list/obj/item/storage/photo_album/photo_albums
var/list/obj/structure/sign/painting/painting_frames = list()
var/list/paintings = list()
/datum/controller/subsystem/persistence/Initialize()
LoadSatchels()
@@ -208,6 +210,7 @@ SUBSYSTEM_DEF(persistence)
if(CONFIG_GET(flag/use_antag_rep))
CollectAntagReputation()
SaveRandomizedRecipes()
SavePaintings()
/datum/controller/subsystem/persistence/proc/GetPhotoAlbums()
var/album_path = file("data/photo_albums.json")
@@ -413,3 +416,19 @@ SUBSYSTEM_DEF(persistence)
fdel(json_file)
WRITE_FILE(json_file, json_encode(file_data))
/datum/controller/subsystem/persistence/proc/LoadPaintings()
var/json_file = file("data/paintings.json")
if(fexists(json_file))
paintings = json_decode(file2text(json_file))
for(var/obj/structure/sign/painting/P in painting_frames)
P.load_persistent()
/datum/controller/subsystem/persistence/proc/SavePaintings()
for(var/obj/structure/sign/painting/P in painting_frames)
P.save_persistent()
var/json_file = file("data/paintings.json")
fdel(json_file)
WRITE_FILE(json_file, json_encode(paintings))