Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/datum/computer_file/program/budget_monitor
filename = "budgetmonitor"
filedesc = "Budget Monitor"
category = PROGRAM_CATEGORY_CMD
program_icon_state = "id"
extended_desc = "This program will allow you to view the financial status of your department(s)."
transfer_access = ACCESS_HEADS
usage_flags = PROGRAM_ALL
requires_ntnet = 1
size = 3
tgui_id = "NtosBudgetMonitor"
program_icon = "id-card"

/datum/computer_file/program/budget_monitor/ui_data()
var/list/data = get_header_data()

var/list/budgets = list()
for(var/A in SSeconomy.department_accounts)
var/datum/bank_account/acc = SSeconomy.get_dep_account(A)
var/name = acc.account_holder
var/money = acc.account_balance || "0"
budgets += list(list("name" = name, "money" = money))

data["budgets"] = budgets

return data

29 changes: 29 additions & 0 deletions tgui/packages/tgui/interfaces/NtosBudgetMonitor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { useBackend } from '../backend';
import { LabeledList, Section } from '../components';
import { NtosWindow } from '../layouts';

export const NtosBudgetMonitor = (props, context) => {
const { act, data } = useBackend(context);
const {
budgets,
} = data;
return (
<NtosWindow
width={400}
height={480}
resizable>
<NtosWindow.Content>
<Section title="Budgets">
<LabeledList>
{budgets.map((budget, index) =>
(
<LabeledList.Item label={budget["name"]} key={index}>
{budget["money"] + "cr"}
</LabeledList.Item>
))}
</LabeledList>
</Section>
</NtosWindow.Content>
</NtosWindow>
);
};
1 change: 1 addition & 0 deletions yogstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2673,6 +2673,7 @@
#include "code\modules\modular_computers\file_system\programs\antagonist\contract_uplink.dm"
#include "code\modules\modular_computers\file_system\programs\antagonist\dos.dm"
#include "code\modules\modular_computers\file_system\programs\antagonist\revelation.dm"
#include "code\modules\modular_computers\file_system\programs\command\budgetviewer.dm"
#include "code\modules\modular_computers\file_system\programs\command\card.dm"
#include "code\modules\modular_computers\file_system\programs\command\crewmanifest.dm"
#include "code\modules\modular_computers\file_system\programs\command\jobmanagement.dm"
Expand Down