Merge pull request #6572 from VOREStation/upstream-merge-6689

[MIRROR] cash registers and retail scanners show transaction totals on examine
This commit is contained in:
Novacat
2020-02-14 09:33:01 -05:00
committed by GitHub
2 changed files with 22 additions and 15 deletions

View File

@@ -33,11 +33,13 @@
/obj/machinery/cash_register/examine(mob/user as mob)
..(user)
if(transaction_amount)
to_chat(user, "It has a purchase of [transaction_amount] pending[transaction_purpose ? " for [transaction_purpose]" : ""].")
if(cash_open)
if(cash_stored)
user << "It holds [cash_stored] Thaler\s of money."
to_chat(user, "It holds [cash_stored] Thaler\s of money.")
else
user << "It's completely empty."
to_chat(user, "It's completely empty.")
/obj/machinery/cash_register/attack_hand(mob/user as mob)
@@ -101,7 +103,7 @@
if(allowed(usr))
locked = !locked
else
usr << "\icon[src]<span class='warning'>Insufficient access.</span>"
to_chat(usr, "\icon[src]<span class='warning'>Insufficient access.</span>")
if("toggle_cash_lock")
cash_locked = !cash_locked
if("link_account")
@@ -113,7 +115,7 @@
linked_account = null
src.visible_message("\icon[src]<span class='warning'>Account has been suspended.</span>")
else
usr << "\icon[src]<span class='warning'>Account not found.</span>"
to_chat(usr, "\icon[src]<span class='warning'>Account not found.</span>")
if("custom_order")
var/t_purpose = sanitize(input("Enter purpose", "New purpose") as text)
if (!t_purpose || !Adjacent(usr)) return
@@ -161,7 +163,7 @@
price_list.Cut()
if("reset_log")
transaction_logs.Cut()
usr << "\icon[src]<span class='notice'>Transaction log reset.</span>"
to_chat(usr, "\icon[src]<span class='notice'>Transaction log reset.</span>")
updateDialog()
@@ -177,7 +179,7 @@
else if (istype(O, /obj/item/weapon/spacecash))
var/obj/item/weapon/spacecash/SC = O
if(cash_open)
user << "You neatly sort the cash into the box."
to_chat(user, "You neatly sort the cash into the box.")
cash_stored += SC.worth
overlays |= "register_cash"
if(ishuman(user))
@@ -217,7 +219,7 @@
if (cash_open)
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
usr << "\icon[src]<span class='warning'>The cash box is open.</span>"
to_chat(usr, "\icon[src]<span class='warning'>The cash box is open.</span>")
return
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(I))
@@ -282,7 +284,7 @@
if (cash_open)
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
usr << "\icon[src]<span class='warning'>The cash box is open.</span>"
to_chat(usr, "\icon[src]<span class='warning'>The cash box is open.</span>")
return
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(E))
@@ -320,7 +322,7 @@
if (cash_open)
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
usr << "\icon[src]<span class='warning'>The cash box is open.</span>"
to_chat(usr, "\icon[src]<span class='warning'>The cash box is open.</span>")
return
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(SC))
@@ -353,7 +355,7 @@
return
if (cash_open)
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
usr << "\icon[src]<span class='warning'>The cash box is open.</span>"
to_chat(usr, "\icon[src]<span class='warning'>The cash box is open.</span>")
return
// First check if item has a valid price

View File

@@ -56,6 +56,11 @@
user.set_machine(src)
interact(user)
/obj/item/device/retail_scanner/examine(mob/user as mob)
..(user)
if(transaction_amount)
to_chat(user, "It has a purchase of [transaction_amount] pending[transaction_purpose ? " for [transaction_purpose]" : ""].")
/obj/item/device/retail_scanner/interact(mob/user as mob)
var/dat = "<h2>Retail Scanner<hr></h2>"
@@ -95,7 +100,7 @@
if(allowed(usr))
locked = !locked
else
usr << "\icon[src]<span class='warning'>Insufficient access.</span>"
to_chat(usr, "\icon[src]<span class='warning'>Insufficient access.</span>")
if("link_account")
var/attempt_account_num = input("Enter account number", "New account number") as num
var/attempt_pin = input("Enter PIN", "Account PIN") as num
@@ -105,7 +110,7 @@
linked_account = null
src.visible_message("\icon[src]<span class='warning'>Account has been suspended.</span>")
else
usr << "\icon[src]<span class='warning'>Account not found.</span>"
to_chat(usr, "\icon[src]<span class='warning'>Account not found.</span>")
if("custom_order")
var/t_purpose = sanitize(input("Enter purpose", "New purpose") as text)
if (!t_purpose || !Adjacent(usr)) return
@@ -153,7 +158,7 @@
price_list.Cut()
if("reset_log")
transaction_logs.Cut()
usr << "\icon[src]<span class='notice'>Transaction log reset.</span>"
to_chat(usr, "\icon[src]<span class='notice'>Transaction log reset.</span>")
updateDialog()
@@ -167,7 +172,7 @@
var/obj/item/weapon/spacecash/ewallet/E = O
scan_wallet(E)
else if (istype(O, /obj/item/weapon/spacecash))
usr << "<span class='warning'>This device does not accept cash.</span>"
to_chat(usr, "<span class='warning'>This device does not accept cash.</span>")
else if(istype(O, /obj/item/weapon/card/emag))
return ..()
@@ -392,7 +397,7 @@
/obj/item/device/retail_scanner/emag_act(var/remaining_charges, var/mob/user)
if(!emagged)
user << "<span class='danger'>You stealthily swipe the cryptographic sequencer through \the [src].</span>"
to_chat(user, "<span class='danger'>You stealthily swipe the cryptographic sequencer through \the [src].</span>")
playsound(src, "sparks", 50, 1)
req_access = list()
emagged = 1