Skip to content

Commit

Permalink
[MIRROR] Fixes ID card bank account examine/dialog (#691) (#1763)
Browse files Browse the repository at this point in the history
* Fixes ID card bank account examine/dialog (#81156)

## About The Pull Request

Assigning a bank account to an ID was moved to alt-right-click but no
examine text indicates this change. Adds examine text and a dialog to
set the bank account from the player's memory if the card is unassigned.

## Why It's Good For The Game

Less screaming at HoP "how I set ID!"

## Changelog

:cl: LT3
fix: ID card examine text shows how to set your linked bank account
fix: ID card withdrawal from an unassigned account will ask if you want
to link an account
/:cl:

* Fixes ID card bank account examine/dialog

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: lessthanthree <[email protected]>
  • Loading branch information
3 people authored Jan 31, 2024
1 parent e2f8dd3 commit 672ebee
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,13 @@
if(loc != user)
to_chat(user, span_warning("You must be holding the ID to continue!"))
return
if(registered_account.replaceable && !registered_account.account_balance)
var/choice = tgui_alert(user, "This card's account is unassigned. Would you like to link a bank account?", "Bank Account", list("Link Account", "Leave Unassigned"))
if(!choice || QDELETED(user) || QDELETED(src) || !alt_click_can_use_id(user) || loc != user)
return
if(choice == "Link Account")
set_new_account(user)
return
var/amount_to_remove = tgui_input_number(user, "How much do you want to withdraw? (Max: [registered_account.account_balance] cr)", "Withdraw Funds", max_value = registered_account.account_balance)
if(!amount_to_remove || QDELETED(user) || QDELETED(src) || issilicon(user) || loc != user)
return
Expand Down Expand Up @@ -728,11 +735,13 @@
if(!user.can_read(src))
return

if(registered_account)
if(registered_account && !isnull(registered_account.account_id))
. += "The account linked to the ID belongs to '[registered_account.account_holder]' and reports a balance of [registered_account.account_balance] cr."
if(ACCESS_COMMAND in access)
var/datum/bank_account/linked_dept = SSeconomy.get_dep_account(registered_account.account_job.paycheck_department)
. += "The [linked_dept.account_holder] linked to the ID reports a balance of [linked_dept.account_balance] cr."
else
. += span_notice("Alt-Right-Click the ID to set the linked bank account.")

if(HAS_TRAIT(user, TRAIT_ID_APPRAISER))
. += HAS_TRAIT(src, TRAIT_JOB_FIRST_ID_CARD) ? span_boldnotice("Hmm... yes, this ID was issued from Central Command!") : span_boldnotice("This ID was created in this sector, not by Central Command.")
Expand Down Expand Up @@ -779,6 +788,8 @@
. += "The [D.account_holder] reports a balance of [D.account_balance] cr."
. += span_info("Alt-Click the ID to pull money from the linked account in the form of holochips.")
. += span_info("You can insert credits into the linked account by pressing holochips, cash, or coins against the ID.")
if(registered_account.replaceable)
. += span_info("Alt-Right-Click the ID to change the linked bank account.")
if(registered_account.civilian_bounty)
. += "<span class='info'><b>There is an active civilian bounty.</b>"
. += span_info("<i>[registered_account.bounty_text()]</i>")
Expand Down

0 comments on commit 672ebee

Please sign in to comment.