Files
Bubberstation/code/modules/library/barcode_scanner.dm
SkyratBot f7938c2db0 [MIRROR] Barcode scanners can now be printed. (#26413)
* Barcode scanners can now be printed. (#81324)

## About The Pull Request

Currently the only way to get a barcode scanner is by spawning as a
Curator, this is lame and prevents people to job change into a
librarian, so now it can be printed like basically all other service
job's tools.

Part of computer tech

![image](https://github.com/tgstation/tgstation/assets/53777086/26254e14-b957-41e4-9349-bd4bf848c18c)

## Why It's Good For The Game

You no longer have to spawn as a Curator to be able to work in the
Library, and Curators can now replace their otherwise completely
irreplaceable equipment.

## Changelog

🆑
qol: The barcode scanner is now part of computer tech and can be printed
at the service techfab.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com>

* Barcode scanners can now be printed.

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com>
2024-02-08 21:11:09 +01:00

30 lines
1001 B
Plaintext

/obj/item/barcodescanner
name = "barcode scanner"
icon = 'icons/obj/service/library.dmi'
icon_state ="scanner"
desc = "A fabulous tool if you need to scan a barcode."
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_TINY
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
///Weakref to the library computer we are connected to.
var/datum/weakref/computer_ref
///The current scanning mode (BARCODE_SCANNER_CHECKIN|BARCODE_SCANNER_INVENTORY)
var/scan_mode = BARCODE_SCANNER_CHECKIN
/obj/item/barcodescanner/attack_self(mob/user)
. = ..()
if(.)
return
if(!computer_ref?.resolve())
user.balloon_alert(user, "not connected to computer!")
return
switch(scan_mode)
if(BARCODE_SCANNER_CHECKIN)
scan_mode = BARCODE_SCANNER_INVENTORY
user.balloon_alert(user, "inventory adding mode")
if(BARCODE_SCANNER_INVENTORY)
scan_mode = BARCODE_SCANNER_CHECKIN
user.balloon_alert(user, "check-in mode")
playsound(loc, 'sound/items/click.ogg', 20, TRUE)