mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Fix: Economy machinery now uses TGUI input + global bank pin range defines (#27913)
* economy machinery now uses tgui_input_number * Update code/modules/economy/economy_machinery/economy_machinery.dm Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> * pin range defines + replacing hardcoded ranges * account pin generator uses defines --------- Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: Toastical <toastical@toaster.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: Toastical <toast@toaster.com>
This commit is contained in:
@@ -33,10 +33,10 @@
|
||||
|
||||
/obj/machinery/economy/proc/attempt_account_authentification(datum/money_account/customer_account, attempted_pin, mob/user)
|
||||
var/attempt_pin = attempted_pin
|
||||
if(customer_account.security_level != ACCOUNT_SECURITY_ID && !attempted_pin)
|
||||
//if pin is not given, we'll prompt them here
|
||||
attempt_pin = input("Enter pin code", "Vendor transaction") as num
|
||||
if(!Adjacent(user))
|
||||
if(customer_account.security_level != ACCOUNT_SECURITY_ID && !attempt_pin)
|
||||
// if pin is not given, we'll prompt them here
|
||||
attempt_pin = tgui_input_number(user, "Enter pin code", "Vendor transaction", max_value = BANK_PIN_MAX, min_value = BANK_PIN_MIN)
|
||||
if(!Adjacent(user) || !attempt_pin)
|
||||
return FALSE
|
||||
var/is_admin = is_admin(user)
|
||||
if(!account_database.try_authenticate_login(customer_account, attempt_pin, restricted_bypass, FALSE, is_admin))
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
//if security level high enough, prompt for pin
|
||||
var/attempt_pin
|
||||
if(D.security_level != ACCOUNT_SECURITY_ID)
|
||||
attempt_pin = tgui_input_number(user, "Enter pin code", "EFTPOS transaction", max_value = 9999, min_value = 1000)
|
||||
attempt_pin = tgui_input_number(user, "Enter pin code", "EFTPOS transaction", max_value = BANK_PIN_MAX, min_value = BANK_PIN_MIN)
|
||||
if(!attempt_pin || !Adjacent(user))
|
||||
return
|
||||
//given the credentials, can the associated account be accessed right now?
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
security_level = _security_level
|
||||
account_number = SSeconomy.generate_account_number()
|
||||
account_type = _account_type
|
||||
account_pin = rand(10000, 99999)
|
||||
account_pin = rand(BANK_PIN_MIN, BANK_PIN_MAX) // defines are currently housed in misc_defines.dm
|
||||
//update SSeconomy stats
|
||||
SSeconomy.total_space_credits += starting_balance
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@
|
||||
error_message(user, "Incorrect Credentials")
|
||||
|
||||
/datum/data/pda/app/nanobank/proc/input_account_pin(mob/user)
|
||||
var/attempt_pin = tgui_input_number(user, "Enter pin code", "NanoBank Account Auth", max_value = 99999)
|
||||
var/attempt_pin = tgui_input_number(user, "Enter pin code", "NanoBank Account Auth", max_value = BANK_PIN_MAX, min_value = BANK_PIN_MIN)
|
||||
if(!user_account || isnull(attempt_pin))
|
||||
return
|
||||
return attempt_pin
|
||||
@@ -467,7 +467,7 @@
|
||||
var/attempt_pin = pin
|
||||
if(customer_account.security_level != ACCOUNT_SECURITY_ID && !attempt_pin)
|
||||
//if pin is not given, we'll prompt them here
|
||||
attempt_pin = tgui_input_number(user, "Enter pin code", "Vendor transaction")
|
||||
attempt_pin = tgui_input_number(user, "Enter pin code", "Vendor transaction", max_value = BANK_PIN_MAX, min_value = BANK_PIN_MIN)
|
||||
if(!attempt_pin)
|
||||
return FALSE
|
||||
var/is_admin = is_admin(user)
|
||||
|
||||
@@ -462,7 +462,7 @@
|
||||
var/attempt_pin = pin
|
||||
if(customer_account.security_level != ACCOUNT_SECURITY_ID && !attempt_pin)
|
||||
//if pin is not given, we'll prompt them here
|
||||
attempt_pin = tgui_input_number(user, "Enter pin code", "Vendor transaction", max_value = 99999)
|
||||
attempt_pin = tgui_input_number(user, "Enter pin code", "Vendor transaction", max_value = BANK_PIN_MAX, min_value = BANK_PIN_MIN)
|
||||
if(!Adjacent(user) || !attempt_pin)
|
||||
return FALSE
|
||||
var/is_admin = is_admin(user)
|
||||
|
||||
Reference in New Issue
Block a user