From 402486c15a8244e0de8ffc2808931cd3a4fa05f8 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Sun, 14 Jan 2024 12:37:23 +0300 Subject: [PATCH] [MIRROR] Id context fix (#1541) * Id context fix (#80906) --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: NovaBot --- code/game/objects/items/cards_ids.dm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index d67b773b5a8..4157c1ae16f 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -441,14 +441,11 @@ /obj/item/card/id/add_context(atom/source, list/context, obj/item/held_item, mob/user) . = ..() - if(held_item != src) - return - context[SCREENTIP_CONTEXT_LMB] = "Show ID" context[SCREENTIP_CONTEXT_RMB] = "Project pay stand" if(isnull(registered_account) || registered_account.replaceable) //Same check we use when we check if we can assign an account - context[SCREENTIP_CONTEXT_ALT_LMB] = "Assign account" - else + context[SCREENTIP_CONTEXT_ALT_RMB] = "Assign account" + if(!registered_account.replaceable || registered_account.account_balance > 0) context[SCREENTIP_CONTEXT_ALT_LMB] = "Withdraw credits" return CONTEXTUAL_SCREENTIP_SET @@ -676,9 +673,6 @@ /obj/item/card/id/AltClick(mob/living/user) if(!alt_click_can_use_id(user)) return - if(!registered_account || registered_account.replaceable) - set_new_account(user) - return if(registered_account.account_debt) var/choice = tgui_alert(user, "Choose An Action", "Bank Account", list("Withdraw", "Pay Debt")) if(!choice || QDELETED(user) || QDELETED(src) || !alt_click_can_use_id(user) || loc != user) @@ -708,6 +702,14 @@ var/difference = amount_to_remove - registered_account.account_balance registered_account.bank_card_talk(span_warning("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal."), TRUE) +/obj/item/card/id/alt_click_secondary(mob/user) + . = ..() + if(!alt_click_can_use_id(user)) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + if(!registered_account || registered_account.replaceable) + set_new_account(user) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + /obj/item/card/id/proc/pay_debt(user) var/amount_to_pay = tgui_input_number(user, "How much do you want to pay? (Max: [registered_account.account_balance] cr)", "Debt Payment", max_value = min(registered_account.account_balance, registered_account.account_debt)) if(!amount_to_pay || QDELETED(src) || loc != user || !alt_click_can_use_id(user))