mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
cash registers and retail scanners show transaction totals on examine (#6689)
This commit is contained in:
@@ -33,11 +33,13 @@
|
|||||||
|
|
||||||
/obj/machinery/cash_register/examine(mob/user as mob)
|
/obj/machinery/cash_register/examine(mob/user as mob)
|
||||||
..(user)
|
..(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_open)
|
||||||
if(cash_stored)
|
if(cash_stored)
|
||||||
user << "It holds [cash_stored] Thaler\s of money."
|
to_chat(user, "It holds [cash_stored] Thaler\s of money.")
|
||||||
else
|
else
|
||||||
user << "It's completely empty."
|
to_chat(user, "It's completely empty.")
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/cash_register/attack_hand(mob/user as mob)
|
/obj/machinery/cash_register/attack_hand(mob/user as mob)
|
||||||
@@ -101,7 +103,7 @@
|
|||||||
if(allowed(usr))
|
if(allowed(usr))
|
||||||
locked = !locked
|
locked = !locked
|
||||||
else
|
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")
|
if("toggle_cash_lock")
|
||||||
cash_locked = !cash_locked
|
cash_locked = !cash_locked
|
||||||
if("link_account")
|
if("link_account")
|
||||||
@@ -113,7 +115,7 @@
|
|||||||
linked_account = null
|
linked_account = null
|
||||||
src.visible_message("\icon[src]<span class='warning'>Account has been suspended.</span>")
|
src.visible_message("\icon[src]<span class='warning'>Account has been suspended.</span>")
|
||||||
else
|
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")
|
if("custom_order")
|
||||||
var/t_purpose = sanitize(input("Enter purpose", "New purpose") as text)
|
var/t_purpose = sanitize(input("Enter purpose", "New purpose") as text)
|
||||||
if (!t_purpose || !Adjacent(usr)) return
|
if (!t_purpose || !Adjacent(usr)) return
|
||||||
@@ -161,7 +163,7 @@
|
|||||||
price_list.Cut()
|
price_list.Cut()
|
||||||
if("reset_log")
|
if("reset_log")
|
||||||
transaction_logs.Cut()
|
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()
|
updateDialog()
|
||||||
|
|
||||||
|
|
||||||
@@ -177,7 +179,7 @@
|
|||||||
else if (istype(O, /obj/item/weapon/spacecash))
|
else if (istype(O, /obj/item/weapon/spacecash))
|
||||||
var/obj/item/weapon/spacecash/SC = O
|
var/obj/item/weapon/spacecash/SC = O
|
||||||
if(cash_open)
|
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
|
cash_stored += SC.worth
|
||||||
overlays |= "register_cash"
|
overlays |= "register_cash"
|
||||||
if(ishuman(user))
|
if(ishuman(user))
|
||||||
@@ -217,7 +219,7 @@
|
|||||||
|
|
||||||
if (cash_open)
|
if (cash_open)
|
||||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
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
|
return
|
||||||
|
|
||||||
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(I))
|
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(I))
|
||||||
@@ -282,7 +284,7 @@
|
|||||||
|
|
||||||
if (cash_open)
|
if (cash_open)
|
||||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
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
|
return
|
||||||
|
|
||||||
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(E))
|
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(E))
|
||||||
@@ -320,7 +322,7 @@
|
|||||||
|
|
||||||
if (cash_open)
|
if (cash_open)
|
||||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
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
|
return
|
||||||
|
|
||||||
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(SC))
|
if((item_list.len > 1 || item_list[item_list[1]] > 1) && !confirm(SC))
|
||||||
@@ -353,7 +355,7 @@
|
|||||||
return
|
return
|
||||||
if (cash_open)
|
if (cash_open)
|
||||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
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
|
return
|
||||||
|
|
||||||
// First check if item has a valid price
|
// First check if item has a valid price
|
||||||
|
|||||||
@@ -56,6 +56,11 @@
|
|||||||
user.set_machine(src)
|
user.set_machine(src)
|
||||||
interact(user)
|
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)
|
/obj/item/device/retail_scanner/interact(mob/user as mob)
|
||||||
var/dat = "<h2>Retail Scanner<hr></h2>"
|
var/dat = "<h2>Retail Scanner<hr></h2>"
|
||||||
@@ -95,7 +100,7 @@
|
|||||||
if(allowed(usr))
|
if(allowed(usr))
|
||||||
locked = !locked
|
locked = !locked
|
||||||
else
|
else
|
||||||
usr << "\icon[src]<span class='warning'>Insufficient access.</span>"
|
to_chat(usr, "\icon[src]<span class='warning'>Insufficient access.</span>")
|
||||||
if("link_account")
|
if("link_account")
|
||||||
var/attempt_account_num = input("Enter account number", "New account number") as num
|
var/attempt_account_num = input("Enter account number", "New account number") as num
|
||||||
var/attempt_pin = input("Enter PIN", "Account PIN") as num
|
var/attempt_pin = input("Enter PIN", "Account PIN") as num
|
||||||
@@ -105,7 +110,7 @@
|
|||||||
linked_account = null
|
linked_account = null
|
||||||
src.visible_message("\icon[src]<span class='warning'>Account has been suspended.</span>")
|
src.visible_message("\icon[src]<span class='warning'>Account has been suspended.</span>")
|
||||||
else
|
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")
|
if("custom_order")
|
||||||
var/t_purpose = sanitize(input("Enter purpose", "New purpose") as text)
|
var/t_purpose = sanitize(input("Enter purpose", "New purpose") as text)
|
||||||
if (!t_purpose || !Adjacent(usr)) return
|
if (!t_purpose || !Adjacent(usr)) return
|
||||||
@@ -153,7 +158,7 @@
|
|||||||
price_list.Cut()
|
price_list.Cut()
|
||||||
if("reset_log")
|
if("reset_log")
|
||||||
transaction_logs.Cut()
|
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()
|
updateDialog()
|
||||||
|
|
||||||
|
|
||||||
@@ -167,7 +172,7 @@
|
|||||||
var/obj/item/weapon/spacecash/ewallet/E = O
|
var/obj/item/weapon/spacecash/ewallet/E = O
|
||||||
scan_wallet(E)
|
scan_wallet(E)
|
||||||
else if (istype(O, /obj/item/weapon/spacecash))
|
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))
|
else if(istype(O, /obj/item/weapon/card/emag))
|
||||||
return ..()
|
return ..()
|
||||||
@@ -392,7 +397,7 @@
|
|||||||
|
|
||||||
/obj/item/device/retail_scanner/emag_act(var/remaining_charges, var/mob/user)
|
/obj/item/device/retail_scanner/emag_act(var/remaining_charges, var/mob/user)
|
||||||
if(!emagged)
|
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)
|
playsound(src, "sparks", 50, 1)
|
||||||
req_access = list()
|
req_access = list()
|
||||||
emagged = 1
|
emagged = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user