From 62d1a3941ccc77abedb720ccb1e8491abc785d8a Mon Sep 17 00:00:00 2001 From: Rob Bailey Date: Fri, 31 Jan 2020 23:47:36 -0800 Subject: [PATCH] tgui-next ntos card console (#48938) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit About The Pull Request A PR now several weeks in the making that spiraled ridiculously out of control for something not many even use. What else is new in NTOS hell? I spent several days doing nothing but playing escape from tarkov so this took longer than expected I valiantly spent all night and day working on this, and barely finished it before The Deadline the card ntos program was split into three programs, manifest, job management, and id card modification. It didn't make much sense for them all to be the same program imo, and made the project a bit more managable. Airlock electronics saw some improvements as well since it uses this new access control section as well. Yet again some new functionality and improvements to core components. Buttons now have an "altSelected" feature where instead of changing the color it adds a small white marker, among some other things. There were a couple of small changes in inconsequential ways in other places, and datacore was refactored a tiny bit. Probably some other stuff I don't remember. I would replace the old card console with a modular computer right now, but I know a few people actually use this program and want a bit of time to iron out bugs and inconsistencies before replacing the main job console with it. Changelog 🆑 add: tgui-next NTOS card console, job manager, and crew manifest tweak: airlock electronics interface is a little fancier /🆑 --- code/datums/datacore.dm | 146 ++-- .../machinery/doors/airlock_electronics.dm | 43 +- .../modules/mob/dead/new_player/new_player.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/living/silicon/silicon.dm | 2 +- .../modular_computers/file_system/program.dm | 59 +- .../programs/antagonist/contract_uplink.dm | 1 - .../file_system/programs/antagonist/dos.dm | 1 - .../programs/antagonist/revelation.dm | 1 - .../file_system/programs/card.dm | 712 ++++++++---------- .../file_system/programs/crewmanifest.dm | 50 ++ .../file_system/programs/jobmanagement.dm | 141 ++++ tgstation.dme | 2 + tgui-next/README.md | 2 + tgui-next/packages/tgui/components/Tabs.js | 6 +- .../tgui/interfaces/AirlockElectronics.js | 97 +-- .../packages/tgui/interfaces/KitchenSink.js | 1 + .../packages/tgui/interfaces/NtosCard.js | 129 ++++ .../tgui/interfaces/NtosCrewManifest.js | 46 ++ .../tgui/interfaces/NtosJobManager.js | 84 +++ .../packages/tgui/interfaces/NtosMain.js | 2 + .../tgui/interfaces/common/AccessList.js | 117 +++ .../packages/tgui/public/tgui.bundle.css | 2 +- tgui-next/packages/tgui/public/tgui.bundle.js | 4 +- tgui-next/packages/tgui/routes.js | 21 + .../tgui/styles/components/Button.scss | 24 + 26 files changed, 1064 insertions(+), 633 deletions(-) create mode 100644 code/modules/modular_computers/file_system/programs/crewmanifest.dm create mode 100644 code/modules/modular_computers/file_system/programs/jobmanagement.dm create mode 100644 tgui-next/packages/tgui/interfaces/NtosCard.js create mode 100644 tgui-next/packages/tgui/interfaces/NtosCrewManifest.js create mode 100644 tgui-next/packages/tgui/interfaces/NtosJobManager.js create mode 100644 tgui-next/packages/tgui/interfaces/common/AccessList.js diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 14963229cc6..23b19d08141 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -1,13 +1,13 @@ - +//TODO: someone please get rid of this shit /datum/datacore - var/medical[] = list() + var/list/medical = list() var/medicalPrintCount = 0 - var/general[] = list() - var/security[] = list() + var/list/general = list() + var/list/security = list() var/securityPrintCount = 0 var/securityCrimeCounter = 0 - //This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). - var/locked[] = list() + ///This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). + var/list/locked = list() /datum/data var/name = "data" @@ -121,16 +121,44 @@ if(foundrecord) foundrecord.fields["rank"] = assignment -/datum/datacore/proc/get_manifest(monochrome, OOC) - var/list/heads = list() - var/list/sec = list() - var/list/eng = list() - var/list/med = list() - var/list/sci = list() - var/list/sup = list() - var/list/civ = list() - var/list/bot = list() - var/list/misc = list() +/datum/datacore/proc/get_manifest() + var/list/manifest_out = list() + var/list/departments = list( + "Command" = GLOB.command_positions, + "Security" = GLOB.security_positions, + "Engineering" = GLOB.engineering_positions, + "Medical" = GLOB.medical_positions, + "Science" = GLOB.science_positions, + "Supply" = GLOB.supply_positions, + "Civilian" = GLOB.civilian_positions, + "Silicon" = GLOB.nonhuman_positions + ) + for(var/datum/data/record/t in GLOB.data_core.general) + var/name = t.fields["name"] + var/rank = t.fields["rank"] + var/has_department = FALSE + for(var/department in departments) + var/list/jobs = departments[department] + if(rank in jobs) + if(!manifest_out[department]) + manifest_out[department] = list() + manifest_out[department] += list(list( + "name" = name, + "rank" = rank + )) + has_department = TRUE + break + if(!has_department) + if(!manifest_out["Misc"]) + manifest_out["Misc"] = list() + manifest_out["Misc"] += list(list( + "name" = name, + "rank" = rank + )) + return manifest_out + +/datum/datacore/proc/get_manifest_html(monochrome = FALSE) + var/list/manifest = get_manifest() var/dat = {"