mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
tgui-next ntos card console (#48938)
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 /🆑
This commit is contained in:
+52
-94
@@ -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 = {"
|
||||
<head><style>
|
||||
.manifest {border-collapse:collapse;}
|
||||
@@ -142,84 +170,14 @@
|
||||
<table class="manifest" width='350px'>
|
||||
<tr class='head'><th>Name</th><th>Rank</th></tr>
|
||||
"}
|
||||
var/even = 0
|
||||
// sort mobs
|
||||
for(var/datum/data/record/t in GLOB.data_core.general)
|
||||
var/name = t.fields["name"]
|
||||
var/rank = t.fields["rank"]
|
||||
var/department = 0
|
||||
if(rank in GLOB.command_positions)
|
||||
heads[name] = rank
|
||||
department = 1
|
||||
if(rank in GLOB.security_positions)
|
||||
sec[name] = rank
|
||||
department = 1
|
||||
if(rank in GLOB.engineering_positions)
|
||||
eng[name] = rank
|
||||
department = 1
|
||||
if(rank in GLOB.medical_positions)
|
||||
med[name] = rank
|
||||
department = 1
|
||||
if(rank in GLOB.science_positions)
|
||||
sci[name] = rank
|
||||
department = 1
|
||||
if(rank in GLOB.supply_positions)
|
||||
sup[name] = rank
|
||||
department = 1
|
||||
if(rank in GLOB.civilian_positions)
|
||||
civ[name] = rank
|
||||
department = 1
|
||||
if(rank in GLOB.nonhuman_positions)
|
||||
bot[name] = rank
|
||||
department = 1
|
||||
if(!department && !(name in heads))
|
||||
misc[name] = rank
|
||||
if(heads.len > 0)
|
||||
dat += "<tr><th colspan=3>Heads</th></tr>"
|
||||
for(var/name in heads)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[heads[name]]</td></tr>"
|
||||
even = !even
|
||||
if(sec.len > 0)
|
||||
dat += "<tr><th colspan=3>Security</th></tr>"
|
||||
for(var/name in sec)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sec[name]]</td></tr>"
|
||||
even = !even
|
||||
if(eng.len > 0)
|
||||
dat += "<tr><th colspan=3>Engineering</th></tr>"
|
||||
for(var/name in eng)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[eng[name]]</td></tr>"
|
||||
even = !even
|
||||
if(med.len > 0)
|
||||
dat += "<tr><th colspan=3>Medical</th></tr>"
|
||||
for(var/name in med)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[med[name]]</td></tr>"
|
||||
even = !even
|
||||
if(sci.len > 0)
|
||||
dat += "<tr><th colspan=3>Science</th></tr>"
|
||||
for(var/name in sci)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sci[name]]</td></tr>"
|
||||
even = !even
|
||||
if(sup.len > 0)
|
||||
dat += "<tr><th colspan=3>Supply</th></tr>"
|
||||
for(var/name in sup)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sup[name]]</td></tr>"
|
||||
even = !even
|
||||
if(civ.len > 0)
|
||||
dat += "<tr><th colspan=3>Civilian</th></tr>"
|
||||
for(var/name in civ)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[civ[name]]</td></tr>"
|
||||
even = !even
|
||||
// in case somebody is insane and added them to the manifest, why not
|
||||
if(bot.len > 0)
|
||||
dat += "<tr><th colspan=3>Silicon</th></tr>"
|
||||
for(var/name in bot)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[bot[name]]</td></tr>"
|
||||
even = !even
|
||||
// misc guys
|
||||
if(misc.len > 0)
|
||||
dat += "<tr><th colspan=3>Miscellaneous</th></tr>"
|
||||
for(var/name in misc)
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[misc[name]]</td></tr>"
|
||||
for(var/department in manifest)
|
||||
var/list/entries = manifest[department]
|
||||
dat += "<tr><th colspan=3>[department]</th></tr>"
|
||||
//JUST
|
||||
var/even = FALSE
|
||||
for(var/entry in entries)
|
||||
var/list/entry_list = entry
|
||||
dat += "<tr[even ? " class='alt'" : ""]><td>[entry_list["name"]]</td><td>[entry_list["rank"]]</td></tr>"
|
||||
even = !even
|
||||
|
||||
dat += "</table>"
|
||||
|
||||
Reference in New Issue
Block a user