diff --git a/code/modules/library/hardcode_library/_library.dm b/code/modules/library/hardcode_library/_library.dm new file mode 100644 index 0000000000..03364fea0a --- /dev/null +++ b/code/modules/library/hardcode_library/_library.dm @@ -0,0 +1,61 @@ +/* + * Home of the New (NOV 1st, 2019) library books. + */ + +/obj/item/weapon/book/custom_library + name = "Book" + desc = "A hardbound book." + description_info = "This book is printed from the custom repo. If you can see this, something went wrong." + + icon = 'icons/obj/custom_books.dmi' + icon_state = "book" + + // This is the ckey of the book's author. + var/origkey = null + author = "UNKNOWN" + +/obj/item/weapon/book/custom_library/fiction + libcategory = "Fiction" + +/obj/item/weapon/book/custom_library/nonfiction + libcategory = "Non-Fiction" + +/obj/item/weapon/book/custom_library/reference + libcategory = "Reference" + +/obj/item/weapon/book/custom_library/religious + libcategory = "Religious" +/* +/obj/item/weapon/book/custom_library/adult + libcategory = "Adult" +*/ +/obj/item/weapon/book/bundle/custom_library + name = "Book" + desc = "A hardbound book." + description_info = "This book is printed from the custom repo. If you can see this, something went wrong." + + icon = 'icons/obj/custom_books.dmi' + icon_state = "book" + + // This is the ckey of the book's author. + var/origkey = null + author = "UNKNOWN" + + page = 1 //current page + pages = list() //the contents of each page + +/obj/item/weapon/book/bundle/custom_library/fiction + libcategory = "Fiction" + +/obj/item/weapon/book/bundle/custom_library/nonfiction + libcategory = "Non-Fiction" + +/obj/item/weapon/book/bundle/custom_library/reference + libcategory = "Reference" + +/obj/item/weapon/book/bundle/custom_library/religious + libcategory = "Religious" +/* +/obj/item/weapon/book/bundle/custom_library/adult + libcategory = "Adult" +*/ diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 3c7ebec377..9b9be0d6c8 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -147,6 +147,7 @@ var/dat // Actual page content var/due_date = 0 // Game time in 1/10th seconds var/author // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned + var/libcategory = "Miscellaneous" // The library category this book sits in. "Fiction", "Non-Fiction", "Adult", "Reference", "Religion" var/unique = 0 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified var/title // The real name of the book. var/carved = 0 // Has the book been hollowed out for use as a secret storage item? @@ -260,6 +261,74 @@ M << browse("Penned by [author].
" + "[dat]", "window=book") user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam +/* +* Book Bundle (Multi-page book) +*/ + +/obj/item/weapon/book/bundle + var/page = 1 //current page + var/list/pages = list() //the contents of each page + +/obj/item/weapon/book/bundle/proc/show_content(mob/user as mob) + var/dat + var/obj/item/weapon/W = pages[page] + // first + if(page == 1) + dat+= "
Front
" + dat+= "
Next Page


" + // last + else if(page == pages.len) + dat+= "
Previous Page
" + dat+= "
Back


" + // middle pages + else + dat+= "
Previous Page
" + dat+= "
Next Page


" + if(istype(pages[page], /obj/item/weapon/paper)) + var/obj/item/weapon/paper/P = W + if(!(istype(usr, /mob/living/carbon/human) || isobserver(usr) || istype(usr, /mob/living/silicon))) + dat += "[P.name][stars(P.info)][P.stamps]" + else + dat += "[P.name][P.info][P.stamps]" + user << browse(dat, "window=[name]") + else if(istype(pages[page], /obj/item/weapon/photo)) + var/obj/item/weapon/photo/P = W + user << browse_rsc(P.img, "tmp_photo.png") + user << browse(dat + "[P.name]" \ + + "" \ + + "
Written on the back:
[P.scribble]" : ]"\ + + "", "window=[name]") + else if(!isnull(pages[page])) + if(!(istype(usr, /mob/living/carbon/human) || isobserver(usr) || istype(usr, /mob/living/silicon))) + dat += "Page [page][stars(pages[page])]" + else + dat += "Page [page][pages[page]]" + user << browse(dat, "window=[name]") + +/obj/item/weapon/book/bundle/attack_self(mob/user as mob) + src.show_content(user) + add_fingerprint(usr) + update_icon() + return + +/obj/item/weapon/book/bundle/Topic(href, href_list) + if(..()) + return 1 + if((src in usr.contents) || (istype(src.loc, /obj/item/weapon/folder) && (src.loc in usr.contents))) + usr.set_machine(src) + if(href_list["next_page"]) + if(page != pages.len) + page++ + playsound(src.loc, "pageturn", 50, 1) + if(href_list["prev_page"]) + if(page > 1) + page-- + playsound(src.loc, "pageturn", 50, 1) + src.attack_self(usr) + updateUsrDialog() + else + to_chat(usr, "You need to hold it in your hands!") /* * Barcode Scanner diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 716b85f2f1..bdd2a718d0 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -113,7 +113,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f * Library Computer */ // TODO: Make this an actual /obj/machinery/computer that can be crafted from circuit boards and such -// It is August 22nd, 2012... This TODO has already been here for months.. I wonder how long it'll last before someone does something about it. +// It is August 22nd, 2012... This TODO has already been here for months.. I wonder how long it'll last before someone does something about it. // Nov 2019. Nope. /obj/machinery/librarycomp name = "Check-In/Out Computer" icon = 'icons/obj/library.dmi' @@ -133,6 +133,40 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f var/bibledelay = 0 // LOL NO SPAM (1 minute delay) -- Doohl + var/static/list/all_books + + var/static/list/base_genre_books + +/obj/machinery/librarycomp/Initialize() + ..() + + if(!base_genre_books || !base_genre_books.len) + base_genre_books = list( + /obj/item/weapon/book/custom_library/fiction, + /obj/item/weapon/book/custom_library/nonfiction, + /obj/item/weapon/book/custom_library/reference, + /obj/item/weapon/book/custom_library/religious, + /obj/item/weapon/book/bundle/custom_library/fiction, + /obj/item/weapon/book/bundle/custom_library/nonfiction, + /obj/item/weapon/book/bundle/custom_library/reference, + /obj/item/weapon/book/bundle/custom_library/religious + ) + + if(!all_books || !all_books.len) + all_books = list() + + for(var/path in subtypesof(/obj/item/weapon/book/codex/lore)) + var/obj/item/weapon/book/C = new path(null) + all_books[C.name] = C + + for(var/path in subtypesof(/obj/item/weapon/book/custom_library) - base_genre_books) + var/obj/item/weapon/book/B = new path(null) + all_books[B.title] = B + + for(var/path in subtypesof(/obj/item/weapon/book/bundle/custom_library) - base_genre_books) + var/obj/item/weapon/book/M = new path(null) + all_books[M.title] = M + /obj/machinery/librarycomp/attack_hand(var/mob/user as mob) usr.set_machine(src) var/dat = "Book Inventory Management\n" // @@ -144,7 +178,8 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f 3. Check out a Book
4. Connect to External Archive
5. Upload New Title to Archive
- 6. Print a Bible
"} + 6. Print a Bible
+ 8. Access NT Internal Archive
"} if(src.emagged) dat += "7. Access the Forbidden Lore Vault
" if(src.arcanecheckout) @@ -190,8 +225,11 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f (Commit Entry)
(Return to main menu)
"} if(4) - dat += "

External Archive

" + dat += "

Deprecated Archive

" establish_old_db_connection() + + dat += "

Warning: System Administrator has slated this archive for removal. Personal uploads should be taken to the NT board of internal literature.

" + if(!dbcon_old.IsConnected()) dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance." else @@ -210,6 +248,10 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f dat += "" dat += "
(Return to main menu)
" if(5) + dat += "

ERROR

" + dat+= "Library Database is in Secure Management Mode.
\ + Contact a System Administrator for more information.
" + /* dat += "

Upload a New Title

" if(!scanner) for(var/obj/machinery/libraryscanner/S in range(9)) @@ -227,12 +269,30 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f dat += {"Author: [scanner.cache.author]
Category: [upload_category]
\[Upload\]
"} + */ dat += "(Return to main menu)
" if(7) dat += {"

Accessing Forbidden Lore Vault v 1.3

Are you absolutely sure you want to proceed? EldritchTomes Inc. takes no responsibilities for loss of sanity resulting from this action.

Yes.
No.
"} + if(8) + dat += "

NT Internal Archive

" + if(!all_books || !all_books.len) + dat += "ERROR Something has gone seriously wrong. Contact System Administrator for more information." + else + dat += {" + " + dat += "
TITLE\[Order\]
" + dat += "
(Return to main menu)
" //dat += "Close

" user << browse(dat, "window=library") @@ -293,6 +353,8 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f if("7") screenstate = 7 + if("8") + screenstate = 8 if(href_list["arccheckout"]) if(src.emagged) src.arcanecheckout = 1 @@ -328,7 +390,8 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion") if(newcategory) upload_category = newcategory - if(href_list["upload"]) + +/* if(href_list["upload"]) if(scanner) if(scanner.cache) var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort") @@ -356,6 +419,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f else log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs") alert("Upload Complete.") +*/ if(href_list["targetid"]) var/sqlid = sanitizeSQL(href_list["targetid"]) @@ -392,6 +456,10 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f spawn() src.Topic(nhref, params2list(nhref), src) if(href_list["sort"] in list("author", "title", "category")) sortby = href_list["sort"] + if(href_list["hardprint"]) + var/newpath = href_list["hardprint"] + var/obj/item/weapon/book/NewBook = new newpath(get_turf(src)) + NewBook.name = "Book: [NewBook.name]" src.add_fingerprint(usr) src.updateUsrDialog() return diff --git a/code/modules/lore_codex/codex.dm b/code/modules/lore_codex/codex.dm index 126c470de4..f2c91bf6a6 100644 --- a/code/modules/lore_codex/codex.dm +++ b/code/modules/lore_codex/codex.dm @@ -23,14 +23,19 @@ desc = "Contains useful information about the world around you. It seems to have been written for travelers to Virgo-Erigone, human or not. It also \ has the words 'Don't Panic' in small, friendly letters on the cover." icon_state = "codex" +<<<<<<< HEAD root_type = /datum/lore/codex/category/main_virgo_lore +======= + root_type = /datum/lore/codex/category/main_vir_lore + libcategory = "Reference" +>>>>>>> 41fc81e... Setup for New Library (#6514) /obj/item/weapon/book/codex/lore/robutt name = "A Buyer's Guide to Artificial Bodies" desc = "Recommended reading for the newly cyborgified, new positronics, and the upwardly-mobile FBP." icon_state = "codex_robutt" root_type = /datum/lore/codex/category/main_robutts - + libcategory = "Reference" /obj/item/weapon/book/codex/lore/news name = "Daedalus Pocket Newscaster" @@ -38,6 +43,7 @@ icon_state = "newscodex" w_class = ITEMSIZE_SMALL root_type = /datum/lore/codex/category/main_news + libcategory = "Reference" /* //VORESTATION REMOVAL // Combines SOP/Regs/Law @@ -48,4 +54,8 @@ icon_state = "corp_regs" root_type = /datum/lore/codex/category/main_corp_regs throwforce = 5 // Throw the book at 'em. +<<<<<<< HEAD */ +======= + libcategory = "Reference" +>>>>>>> 41fc81e... Setup for New Library (#6514) diff --git a/icons/obj/custom_books.dmi b/icons/obj/custom_books.dmi new file mode 100644 index 0000000000..2be098e848 Binary files /dev/null and b/icons/obj/custom_books.dmi differ diff --git a/vorestation.dme b/vorestation.dme index e968b0c974..926c3b768d 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2020,6 +2020,7 @@ #include "code\modules\library\lib_items.dm" #include "code\modules\library\lib_machines.dm" #include "code\modules\library\lib_readme.dm" +#include "code\modules\library\hardcode_library\_library.dm" #include "code\modules\lighting\lighting_area.dm" #include "code\modules\lighting\lighting_atom.dm" #include "code\modules\lighting\lighting_corner.dm"