From 257678a9f8a20ef776cf409b5b533200b991331f Mon Sep 17 00:00:00 2001 From: nickup9 Date: Wed, 18 May 2022 21:07:35 -0400 Subject: [PATCH] Makes departmental budget accounts visible on command IDs, makes departmental budget mechanic more obvious in general (#67035) * Head ID reports dep budget * Adds Dep. Budget shorthand name to ID examine where applicable * Cleaner & more readable ingame and codewise * Modifies Cargo requests console js to allow title modification, IRN modifies titles where applicable * Better way of doing things * QM gets Cargo's budget on ID Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> * pain peko Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> --- code/game/objects/items/cards_ids.dm | 4 ++++ code/modules/cargo/orderconsole.dm | 1 + .../modular_computers/file_system/programs/budgetordering.dm | 4 ++++ tgui/packages/tgui/interfaces/Cargo.js | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index f5de7a6b719..b1382484b4f 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -683,6 +683,10 @@ . = ..() if(registered_account) . += "The account linked to the ID belongs to '[registered_account.account_holder]' and reports a balance of [registered_account.account_balance] cr." + if((ACCESS_HEADS in access) || (ACCESS_QM in access)) + var/datum/bank_account/linked_dept = SSeconomy.get_dep_account(registered_account.account_job.paycheck_department) + . += "The [linked_dept.account_holder] linked to the ID reports a balance of [linked_dept.account_balance] cr." + if(HAS_TRAIT(user, TRAIT_ID_APPRAISER)) . += HAS_TRAIT(src, TRAIT_JOB_FIRST_ID_CARD) ? span_boldnotice("Hmm... yes, this ID was issued from Central Command!") : span_boldnotice("This ID was created in this sector, not by Central Command.") . += span_notice("There's more information below, you can look again to take a closer look...") diff --git a/code/modules/cargo/orderconsole.dm b/code/modules/cargo/orderconsole.dm index 31a4550dfdf..543f5c09c06 100644 --- a/code/modules/cargo/orderconsole.dm +++ b/code/modules/cargo/orderconsole.dm @@ -98,6 +98,7 @@ /obj/machinery/computer/cargo/ui_data() var/list/data = list() + data["department"] = "Cargo" // Hardcoded here, for customization in budgetordering.dm AKA NT IRN data["location"] = SSshuttle.supply.getStatusText() var/datum/bank_account/D = SSeconomy.get_dep_account(cargo_account) if(D) diff --git a/code/modules/modular_computers/file_system/programs/budgetordering.dm b/code/modules/modular_computers/file_system/programs/budgetordering.dm index d1508116544..0cd9609fe0e 100644 --- a/code/modules/modular_computers/file_system/programs/budgetordering.dm +++ b/code/modules/modular_computers/file_system/programs/budgetordering.dm @@ -68,6 +68,7 @@ . = ..() var/list/data = get_header_data() data["location"] = SSshuttle.supply.getStatusText() + data["department"] = "Cargo" var/datum/bank_account/buyer = SSeconomy.get_dep_account(cargo_account) var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD] var/obj/item/card/id/id_card = card_slot?.GetID() @@ -79,6 +80,9 @@ else requestonly = TRUE can_approve_requests = FALSE + if(ACCESS_HEADS in id_card.access) + // If buyer is a departmental budget, replaces "Cargo" with that budget - we're not using the cargo budget here + data["department"] = addtext(buyer.account_holder, " Requisitions") else requestonly = TRUE if(buyer) diff --git a/tgui/packages/tgui/interfaces/Cargo.js b/tgui/packages/tgui/interfaces/Cargo.js index f1186f1dd45..1afc6112487 100644 --- a/tgui/packages/tgui/interfaces/Cargo.js +++ b/tgui/packages/tgui/interfaces/Cargo.js @@ -85,6 +85,7 @@ export const CargoContent = (props, context) => { const CargoStatus = (props, context) => { const { act, data } = useBackend(context); const { + department, grocery, away, docked, @@ -98,7 +99,7 @@ const CargoStatus = (props, context) => { } = data; return (