mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
budget viewer program (#15528)
* budget viewer * fix indentation * Update budgetviewer.dm
This commit is contained in:
@@ -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
tgui/packages/tgui/interfaces/NtosBudgetMonitor.js
Normal file
29
tgui/packages/tgui/interfaces/NtosBudgetMonitor.js
Normal file
@@ -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>
|
||||
);
|
||||
};
|
||||
@@ -2674,6 +2674,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"
|
||||
|
||||
Reference in New Issue
Block a user