mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
* Icons folder cleaning wave two * Merge conflict resolution * Modular path hell * hmm * Update 2022-10.yml * Another modular thing --------- Co-authored-by: YesterdaysPromise <122572637+YesterdaysPromise@users.noreply.github.com> Co-authored-by: Giz <vinylspiders@gmail.com>
29 lines
926 B
Plaintext
29 lines
926 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
|
|
///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)
|