Merge pull request #12356 from Very-Soft/persistchange

Change painting persist decay
This commit is contained in:
Casey
2022-03-02 06:08:02 +00:00
committed by CHOMPStation2
parent 24a996b17c
commit 68c0ed10a7
2 changed files with 40 additions and 8 deletions
+18 -2
View File
@@ -336,6 +336,7 @@
var/persistence_id
var/loaded = FALSE
var/curator = "nobody! Report bug if you see this."
var/static/list/art_appreciators = list()
//Presets for art gallery mapping, for paintings to be shared across stations
/obj/structure/sign/painting/public
@@ -406,11 +407,12 @@
if(current_canvas)
current_canvas.tgui_interact(user)
. += "<span class='notice'>Use wirecutters to remove the painting.</span>"
. += "<span class='notice'>Paintings hung here are curated based on interest. The more often someone EXAMINEs the painting, the longer it will stay in rotation.</span>"
// Painting loaded and persistent frame, give a hint about removal safety
if(persistence_id)
if(loaded)
. += "<span class='notice'>Don't worry, the currently framed painting has already been entered into the archives and can be safely removed. It will still be used on future shifts.</span>"
. += "<span class='warning'>Don't worry, the currently framed painting has already been entered into the archives and can be safely removed. It will still be used on future shifts.</span>"
back_of_the_line(user)
else
. += "<span class='warning'>This painting has not been entered into the archives yet. Removing it will prevent that from happening.</span>"
@@ -554,6 +556,20 @@
"ckey" = current_canvas.author_ckey
))
/obj/structure/sign/painting/proc/back_of_the_line(mob/user)
if(user.ckey in art_appreciators)
return
if(!persistence_id || !current_canvas || current_canvas.no_save)
return
var/data = current_canvas.get_data_string()
var/md5 = md5(lowertext(data))
for(var/list/entry in SSpersistence.all_paintings)
if(entry["md5"] == md5 && entry["persistence_id"] == persistence_id)
SSpersistence.all_paintings.Remove(list(entry))
SSpersistence.all_paintings.Add(list(entry))
art_appreciators += user.ckey
to_chat(user, "<span class='notice'>Showing interest in this painting renews its position in the curator database.</span>")
/obj/structure/sign/painting/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION("removepainting", "Remove Persistent Painting")