diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 45c27b756804c..82f06191aa2a1 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -717,7 +717,7 @@ if(choice == "Link Account") set_new_account(user) return CLICK_ACTION_SUCCESS - 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) +/** 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 CLICK_ACTION_BLOCKING if(!alt_click_can_use_id(user)) @@ -731,7 +731,8 @@ return CLICK_ACTION_SUCCESS else 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) + registered_account.bank_card_talk(span_warning("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal."), TRUE) **/ + else return CLICK_ACTION_BLOCKING /obj/item/card/id/click_alt_secondary(mob/user) diff --git a/modular_doppler/dopple_cash/items/autobank.dm b/modular_doppler/dopple_cash/items/autobank.dm index f097684d8abdc..104daac0baaa7 100644 --- a/modular_doppler/dopple_cash/items/autobank.dm +++ b/modular_doppler/dopple_cash/items/autobank.dm @@ -99,7 +99,7 @@ if(dosh_taken <= balance) synced_bank_account.adjust_money(-dosh_taken) say("Withdrawal complete! Have a great day!") - spawn_libres(dosh_taken, drop_location()) + spawn_libre(dosh_taken, drop_location()) playsound(src, 'sound/effects/cashregister.ogg', 50, TRUE) else say("Unable to complete transaction.") diff --git a/modular_doppler/dopple_cash/items/dopplecash.dm b/modular_doppler/dopple_cash/items/dopplecash.dm index 282abe3598b08..c3c53e89cff14 100644 --- a/modular_doppler/dopple_cash/items/dopplecash.dm +++ b/modular_doppler/dopple_cash/items/dopplecash.dm @@ -150,7 +150,31 @@ var/obj/item/libre/bundle/bundle = new(user.loc, cashamount) user.put_in_hands(bundle) -/proc/spawn_libres(sum, spawnloc, mob/living/carbon/human/H) // not my brightest coding but that's what i have you guys for :) used for certain transactions +/obj/item/libre/bundle/Initialize() + . = ..() + update_appearance() + +/obj/item/libre/bundle/c1/Initialize() + value = 1 + . = ..() + +/obj/item/libre/bundle/tiny/Initialize() // THANKS, SHIPTEST!! + value = rand(10, 100) + . = ..() + +/obj/item/libre/bundle/small/Initialize() + value = rand(100, 500) + . = ..() + +/obj/item/libre/bundle/medium/Initialize() + value = rand(500, 3000) + . = ..() + +/obj/item/libre/bundle/large/Initialize() + value = rand(2500, 6000) + . = ..() + +/proc/spawn_libre(sum, spawnloc, mob/living/carbon/human/H) // not my brightest coding but that's what i have you guys for :) used for certain transactions var/obj/item/libre/bundle/fundle = new (spawnloc) fundle.value = sum fundle.update_icon() diff --git a/tgui/packages/tgui/interfaces/AutoBank.tsx b/tgui/packages/tgui/interfaces/AutoBank.tsx new file mode 100644 index 0000000000000..ad53b3df98c2d --- /dev/null +++ b/tgui/packages/tgui/interfaces/AutoBank.tsx @@ -0,0 +1,55 @@ +import { useBackend } from '../backend'; +import { + AnimatedNumber, + LabeledList, + NoticeBox, + NumberInput, + Section, +} from '../components'; +import { formatMoney } from '../format'; +import { Window } from '../layouts'; + +type Data = { + current_balance: number; + withdrawal_amount: number; + totalcreds: number; +}; + +export const AutoBank = (props) => { + const { act, data } = useBackend(); + const { current_balance, withdrawal_amount } = data; + + return ( + + + 997473629173892347294324723. . . +
+ + + act('withdraw', { + totalcreds: value, + }) + } + /> + } + > + formatMoney(value)} + /> + {' cr'} + + +
+
+
+ ); +};