mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
[MIRROR] Fixes issues with printing posters from the library management computer [MDB IGNORE] (#17344)
* Fixes issues with printing posters from the library management computer (#70471) ## About The Pull Request Posters are kind of insane and they require that the poster item have either a poster_type defined in the type or that you pass the structure version of the poster to /new() otherwise they don't work. The weird thing is that the structure needs to be in the contents of the item too, or it again won't work (it won't remove the poster from your hands when placing it). I fixed it so all you need to do is pass the structure version of the poster to /new() on the item and it will move the structure to the contents of the item if needed. It's still a bit insane but it's better than it was and it fixed the bug. Also SSLibrary.printable_posters was grabbing the directional mapping helper of the random poster and so when you printed it and placed it, you'd get confusing results. I made a quick fix to stop that from happening. ## Why It's Good For The Game Bug fixes are generally good things. Fixes #70382 Fixes #66504 ## Changelog 🆑 VexingRaven fix: Fixed posters printed from the library console staying in your hand when you place them fix: Fixed Random Official Poster printed from the library console always placing the west-facing variant no matter where you place it /🆑 * Fixes issues with printing posters from the library management computer Co-authored-by: VexingRaven <msgerbs@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user