Skip to content

Commit

Permalink
straight up 'working it'
Browse files Browse the repository at this point in the history
  • Loading branch information
crunchypretzels committed Oct 19, 2024
1 parent 28adf72 commit ac2fb49
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 4 deletions.
5 changes: 3 additions & 2 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modular_doppler/dopple_cash/items/autobank.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
26 changes: 25 additions & 1 deletion modular_doppler/dopple_cash/items/dopplecash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
55 changes: 55 additions & 0 deletions tgui/packages/tgui/interfaces/AutoBank.tsx
Original file line number Diff line number Diff line change
@@ -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<Data>();
const { current_balance, withdrawal_amount } = data;

return (
<Window width={350} height={155}>
<Window.Content>
<NoticeBox danger>997473629173892347294324723. . .</NoticeBox>
<Section title={'Port Authority Currency Terminal'}>
<LabeledList>
<LabeledList.Item
label="CURRENT BALANCE"
buttons={
<NumberInput
value={0}
minValue={0}
maxValue={100000}
step={1}
onChange={(value) =>
act('withdraw', {
totalcreds: value,
})
}
/>
}
>
<AnimatedNumber
value={current_balance}
format={(value) => formatMoney(value)}
/>
{' cr'}
</LabeledList.Item>
</LabeledList>
</Section>
</Window.Content>
</Window>
);
};

0 comments on commit ac2fb49

Please sign in to comment.