From 672ebee97e5026b9917854501ebec025b86383f1 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:15:12 +0300 Subject: [PATCH] [MIRROR] Fixes ID card bank account examine/dialog (#691) (#1763) * 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 <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com> --- code/game/objects/items/cards_ids.dm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 3e27211a86e..945c8d7e96e 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -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 @@ -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.") @@ -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) . += "There is an active civilian bounty." . += span_info("[registered_account.bounty_text()]")