diff --git a/code/controllers/subsystem/library.dm b/code/controllers/subsystem/library.dm index 3f6a04a3f02..e296d34eed6 100644 --- a/code/controllers/subsystem/library.dm +++ b/code/controllers/subsystem/library.dm @@ -49,7 +49,8 @@ SUBSYSTEM_DEF(library) /datum/controller/subsystem/library/proc/prepare_official_posters() printable_posters = list() for(var/obj/structure/sign/poster/official/poster_type as anything in subtypesof(/obj/structure/sign/poster/official)) - printable_posters[initial(poster_type.name)] = poster_type + if (initial(poster_type.printable) == TRUE) //Mostly this check exists to keep directionals from ending up in the printable list + printable_posters[initial(poster_type.name)] = poster_type /datum/controller/subsystem/library/proc/prepare_library_areas() library_areas = typesof(/area/station/service/library) - /area/station/service/library/abandoned diff --git a/code/game/objects/effects/contraband.dm b/code/game/objects/effects/contraband.dm index aa96d12a087..bee0bc68dfb 100644 --- a/code/game/objects/effects/contraband.dm +++ b/code/game/objects/effects/contraband.dm @@ -3,6 +3,14 @@ // The poster item +/** + * The rolled up item form of a poster + * + * In order to create one of these for a specific poster, you must pass the structure form of the poster as an argument to /new(). + * This structure then gets moved into the contents of the item where it will stay until the poster is placed by a player. + * The structure form is [obj/structure/sign/poster] and that's where all the specific posters are defined. + * If you just want a random poster, see [/obj/item/poster/random_official] or [/obj/item/poster/random_contraband] + */ /obj/item/poster name = "poorly coded poster" desc = "You probably shouldn't be holding this." @@ -22,6 +30,8 @@ ) AddElement(/datum/element/contextual_screentip_item_typechecks, hovering_item_typechecks) + if(new_poster_structure && (new_poster_structure.loc != src)) + new_poster_structure.forceMove(src) //The poster structure *must* be in the item's contents for the exited() proc to properly clean up when placing the poster poster_structure = new_poster_structure if(!new_poster_structure && poster_type) poster_structure = new poster_type(src) @@ -81,6 +91,12 @@ // The poster sign/structure +/** + * The structure form of a poster. + * + * These are what get placed on maps as posters. They are also what gets created when a player places a poster on a wall. + * For the item form that can be spawned for players, see [/obj/item/poster] + */ /obj/structure/sign/poster name = "poster" var/original_name @@ -91,6 +107,8 @@ var/ruined = FALSE var/random_basetype var/never_random = FALSE // used for the 'random' subclasses. + ///Whether the poster should be printable from library management computer. Mostly exists to keep directionals from being printed. + var/printable = FALSE var/poster_item_name = "hypothetical poster" var/poster_item_desc = "This hypothetical poster item should not exist, let's be honest here." @@ -726,6 +744,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/poster/contraband/random, 32) poster_item_name = "motivational poster" poster_item_desc = "An official Nanotrasen-issued poster to foster a compliant and obedient workforce. It comes with state-of-the-art adhesive backing, for easy pinning to any vertical surface." poster_item_icon_state = "rolled_legit" + printable = TRUE /obj/structure/sign/poster/official/random name = "Random Official Poster (ROP)" @@ -734,6 +753,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/poster/contraband/random, 32) never_random = TRUE MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/poster/official/random, 32) +//This is being hardcoded here to ensure we don't print directionals from the library management computer because they act wierd as a poster item +/obj/structure/sign/poster/official/random/directional + printable = FALSE /obj/structure/sign/poster/official/here_for_your_safety name = "Here For Your Safety" diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 9ad2579b554..048e4507880 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -646,9 +646,7 @@ var/poster_type = SSlibrary.printable_posters[poster_name] if(!poster_type) return - - var/obj/item/poster/random_official/poster = new(loc, new poster_type) - poster.name = poster_name + new /obj/item/poster(loc, new poster_type) /obj/machinery/computer/libraryconsole/bookmanagement/proc/print_book(id) if (!SSdbcore.Connect())