Skip to content

Commit

Permalink
book console fix (tgstation#49696)
Browse files Browse the repository at this point in the history
* book console fix

* proper console for randomruins
  • Loading branch information
spookydonut authored Mar 5, 2020
1 parent 1f63a16 commit 106b4ba
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 40 deletions.
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/intactemptyship.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
/area/ruin/space/has_grav/powered/authorship)
"o" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/space/has_grav/powered/authorship)
"p" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/listeningstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
pixel_y = 24
},
/obj/effect/decal/cleanable/dirt,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/turf/open/floor/plasteel/dark,
/area/ruin/space/has_grav/listeningstation)
"af" = (
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/BoxStation/BoxStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
/turf/open/floor/plasteel/cafeteria,
/area/security/prison)
"aaM" = (
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/structure/table,
/obj/machinery/newscaster{
pixel_x = -32
Expand Down Expand Up @@ -17731,7 +17731,7 @@
/area/library)
"aTd" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/machinery/light_switch{
pixel_y = 28
},
Expand Down
20 changes: 10 additions & 10 deletions _maps/map_files/Deltastation/DeltaStation2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -17539,7 +17539,7 @@
/area/security/prison)
"aMe" = (
/obj/structure/table,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/structure/cable,
/turf/open/floor/plating,
/area/security/prison)
Expand Down Expand Up @@ -64428,7 +64428,7 @@
/area/library)
"cpz" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/machinery/newscaster{
pixel_x = 32
},
Expand Down Expand Up @@ -113600,6 +113600,14 @@
},
/turf/open/floor/plasteel,
/area/maintenance/port)
"kzm" = (
/obj/effect/turf_decal/tile/blue{
dir = 4
},
/obj/structure/cable,
/obj/machinery/atmospherics/pipe/manifold/scrubbers/hidden,
/turf/open/floor/plasteel/white,
/area/medical/medbay/central)
"kDh" = (
/obj/structure/table/reinforced,
/obj/effect/turf_decal/tile/neutral{
Expand All @@ -113615,14 +113623,6 @@
/obj/structure/displaycase/forsale,
/turf/open/floor/plasteel/dark,
/area/crew_quarters/bar)
"kzm" = (
/obj/effect/turf_decal/tile/blue{
dir = 4
},
/obj/structure/cable,
/obj/machinery/atmospherics/pipe/manifold/scrubbers/hidden,
/turf/open/floor/plasteel/white,
/area/medical/medbay/central)
"kEN" = (
/obj/effect/decal/cleanable/dirt,
/turf/closed/wall,
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/Donutstation/Donutstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -16357,7 +16357,7 @@
/area/library)
"aLD" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/turf/open/floor/carpet,
/area/library)
"aLE" = (
Expand Down Expand Up @@ -19541,7 +19541,7 @@
/area/maintenance/disposal/incinerator)
"aSY" = (
/obj/structure/table,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/effect/decal/cleanable/dirt,
/turf/open/floor/plasteel,
/area/security/prison/rec)
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/KiloStation/KiloStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -48855,7 +48855,7 @@
dir = 1
},
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement{
/obj/machinery/computer/bookmanagement{
pixel_y = 5
},
/obj/machinery/light{
Expand Down Expand Up @@ -58121,7 +58121,7 @@
/turf/open/floor/plasteel/dark,
/area/crew_quarters/locker)
"bJz" = (
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/structure/table,
/obj/effect/decal/cleanable/dirt,
/obj/effect/turf_decal/tile/red,
Expand Down Expand Up @@ -87942,7 +87942,7 @@
/area/engine/engineering)
"cEr" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement{
/obj/machinery/computer/bookmanagement{
pixel_y = 5
},
/obj/effect/turf_decal/tile/neutral,
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
/area/security/prison)
"abl" = (
/obj/structure/table,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/effect/decal/cleanable/dirt,
/turf/open/floor/plasteel,
/area/security/prison)
Expand Down Expand Up @@ -64517,7 +64517,7 @@
/area/hallway/primary/central)
"cVe" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/structure/noticeboard{
desc = "A board for pinning important notices upon. Probably helpful for keeping track of requests.";
dir = 8;
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/Mining/Lavaland.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
/area/mine/laborcamp)
"au" = (
/obj/structure/table,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/effect/decal/cleanable/dirt,
/turf/open/floor/plasteel,
/area/mine/laborcamp)
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/PubbyStation/PubbyStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@
/turf/open/floor/plating,
/area/ai_monitored/turret_protected/AIsatextAS)
"afn" = (
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/obj/structure/table,
/obj/machinery/newscaster{
pixel_x = -32
Expand Down Expand Up @@ -44929,7 +44929,7 @@
/area/library/lounge)
"clp" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/turf/open/floor/plasteel/dark,
/area/library)
"cls" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -11959,7 +11959,7 @@
/area/centcom/holding)
"Bs" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/turf/open/floor/wood,
/area/centcom/holding)
"Bu" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_imfedupwiththisworld.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
/area/shuttle/escape)
"A" = (
/obj/structure/table/wood,
/obj/machinery/computer/libraryconsole/bookmanagement,
/obj/machinery/computer/bookmanagement,
/turf/open/floor/wood,
/area/shuttle/escape)
"B" = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@

/obj/item/circuitboard/computer/libraryconsole/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(build_path == /obj/machinery/computer/libraryconsole/bookmanagement)
if(build_path == /obj/machinery/computer/bookmanagement)
name = "Library Visitor Console (Computer Board)"
build_path = /obj/machinery/computer/libraryconsole
to_chat(user, "<span class='notice'>Defaulting access protocols.</span>")
else
name = "Book Inventory Management Console (Computer Board)"
build_path = /obj/machinery/computer/libraryconsole/bookmanagement
build_path = /obj/machinery/computer/bookmanagement
to_chat(user, "<span class='notice'>Access protocols successfully updated.</span>")
else
return ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/library/lib_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_TINY
var/obj/machinery/computer/libraryconsole/bookmanagement/computer //Associated computer - Modes 1 to 3 use this
var/obj/machinery/computer/bookmanagement/computer //Associated computer - Modes 1 to 3 use this
var/obj/item/book/book //Currently scanned book
var/mode = 0 //0 - Scan only, 1 - Scan and Set Buffer, 2 - Scan and Attempt to Check In, 3 - Scan and Attempt to Add to Inventory

Expand Down
29 changes: 18 additions & 11 deletions code/modules/library/lib_machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,21 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
// 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's December 25th, 2014, and this is STILL here, and it's STILL relevant. Kill me
/obj/machinery/computer/libraryconsole/bookmanagement
/obj/machinery/computer/bookmanagement
name = "book inventory management console"
desc = "Librarian's command station."
screenstate = 0 // 0 - Main Menu, 1 - Inventory, 2 - Checked Out, 3 - Check Out a Book
verb_say = "beeps"
verb_ask = "beeps"
verb_exclaim = "beeps"
pass_flags = PASSTABLE

icon_state = "oldcomp"
icon_screen = "library"
icon_keyboard = null
circuit = /obj/item/circuitboard/computer/libraryconsole

var/screenstate = 0 // 0 - Main Menu, 1 - Inventory, 2 - Checked Out, 3 - Check Out a Book

var/arcanecheckout = 0
var/buffer_book
var/buffer_mob
Expand All @@ -182,7 +189,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
var/page = 1 //current page of the external archives
var/cooldown = 0

/obj/machinery/computer/libraryconsole/bookmanagement/proc/build_library_menu()
/obj/machinery/computer/bookmanagement/proc/build_library_menu()
if(libcomp_menu)
return
load_library_db_to_cache()
Expand All @@ -198,13 +205,13 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
libcomp_menu[page] = ""
libcomp_menu[page] += "<tr><td>[C.author]</td><td>[C.title]</td><td>[C.category]</td><td><A href='?src=[REF(src)];targetid=[C.id]'>\[Order\]</A></td></tr>\n"

/obj/machinery/computer/libraryconsole/bookmanagement/Initialize()
/obj/machinery/computer/bookmanagement/Initialize()
. = ..()
if(circuit)
circuit.name = "Book Inventory Management Console (Machine Board)"
circuit.build_path = /obj/machinery/computer/libraryconsole/bookmanagement
circuit.build_path = /obj/machinery/computer/bookmanagement

/obj/machinery/computer/libraryconsole/bookmanagement/ui_interact(mob/user)
/obj/machinery/computer/bookmanagement/ui_interact(mob/user)
. = ..()
var/dat = "" // <META HTTP-EQUIV='Refresh' CONTENT='10'>
switch(screenstate)
Expand Down Expand Up @@ -316,17 +323,17 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()

/obj/machinery/computer/libraryconsole/bookmanagement/proc/findscanner(viewrange)
/obj/machinery/computer/bookmanagement/proc/findscanner(viewrange)
for(var/obj/machinery/libraryscanner/S in range(viewrange, get_turf(src)))
return S
return null

/obj/machinery/computer/libraryconsole/bookmanagement/proc/print_forbidden_lore(mob/user)
/obj/machinery/computer/bookmanagement/proc/print_forbidden_lore(mob/user)
new /obj/item/melee/cultblade/dagger(get_turf(src))
to_chat(user, "<span class='warning'>Your sanity barely endures the seconds spent in the vault's browsing window. The only thing to remind you of this when you stop browsing is a sinister dagger sitting on the desk. You don't even remember where it came from...</span>")
user.visible_message("<span class='warning'>[user] stares at the blank screen for a few moments, [user.p_their()] expression frozen in fear. When [user.p_they()] finally awaken[user.p_s()] from it, [user.p_they()] look[user.p_s()] a lot older.</span>", 2)

/obj/machinery/computer/libraryconsole/bookmanagement/attackby(obj/item/W, mob/user, params)
/obj/machinery/computer/bookmanagement/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/barcodescanner))
var/obj/item/barcodescanner/scanner = W
scanner.computer = src
Expand All @@ -335,11 +342,11 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
else
return ..()

/obj/machinery/computer/libraryconsole/bookmanagement/emag_act(mob/user)
/obj/machinery/computer/bookmanagement/emag_act(mob/user)
if(density && !(obj_flags & EMAGGED))
obj_flags |= EMAGGED

/obj/machinery/computer/libraryconsole/bookmanagement/Topic(href, href_list)
/obj/machinery/computer/bookmanagement/Topic(href, href_list)
if(..())
usr << browse(null, "window=library")
onclose(usr, "library")
Expand Down

0 comments on commit 106b4ba

Please sign in to comment.