Crew Manifest: Shuttle Manifesting (#19922)

* Being added to a shuttle manifest will now update the crew manifest to
indicate that you're on an away mission on that shuttle.


![image](https://github.com/user-attachments/assets/5ba42070-1101-4e45-825c-9b15231dca39)

![image-1](https://github.com/user-attachments/assets/e2ce81b2-ed42-4c24-bc69-d44095f2f73e)

---------

Signed-off-by: Geeves <ggrobler447@gmail.com>
Co-authored-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com>
This commit is contained in:
Geeves
2024-12-18 13:30:36 +02:00
committed by GitHub
parent 6176594c48
commit ed2aa69444
5 changed files with 45 additions and 14 deletions
+7 -6
View File
@@ -138,12 +138,13 @@
// - SSrecords --
#define RECORD_GENERAL 1
#define RECORD_MEDICAL 2
#define RECORD_SECURITY 4
#define RECORD_LOCKED 8
#define RECORD_WARRANT 16
#define RECORD_VIRUS 32
#define RECORD_GENERAL BITFLAG(0)
#define RECORD_MEDICAL BITFLAG(1)
#define RECORD_SECURITY BITFLAG(2)
#define RECORD_LOCKED BITFLAG(3)
#define RECORD_WARRANT BITFLAG(4)
#define RECORD_VIRUS BITFLAG(5)
#define RECORD_SHUTTLE_MANIFEST BITFLAG(6)
// - SSjobs --
+28 -6
View File
@@ -114,6 +114,7 @@ SUBSYSTEM_DEF(records)
viruses += record
if(/datum/record/shuttle_manifest)
shuttle_manifests += record
reset_manifest()
if(/datum/record/shuttle_assignment)
shuttle_assignments += record
onCreate(record)
@@ -131,6 +132,7 @@ SUBSYSTEM_DEF(records)
viruses |= record
if(/datum/record/shuttle_manifest)
shuttle_manifests |= record
reset_manifest()
if(/datum/record/shuttle_assignment)
shuttle_assignments |= record
onModify(record)
@@ -148,6 +150,7 @@ SUBSYSTEM_DEF(records)
viruses *= record
if(/datum/record/shuttle_manifest)
shuttle_manifests -= record
reset_manifest()
if(/datum/record/shuttle_assignment)
shuttle_assignments -= record
onDelete(record)
@@ -178,6 +181,13 @@ SUBSYSTEM_DEF(records)
if(r.vars[field] == value)
return r
return
if(record_type & RECORD_SHUTTLE_MANIFEST)
for(var/datum/record/shuttle_manifest/manifest as anything in shuttle_manifests)
if(manifest.excluded_fields[field])
continue
if(manifest.vars[field] == value)
return manifest
return
for(var/datum/record/general/r in searchedList)
if(r.excluded_fields[field])
continue
@@ -243,6 +253,18 @@ SUBSYSTEM_DEF(records)
dat += "<h3>[dep]</h3><ul>[depDat]</ul>"
return dat
/// gets the activity state, which gets displayed in the crew manifest
/datum/controller/subsystem/records/proc/get_activity_state(var/datum/record/general/general_record)
// by default, we use the physical status as our activity_state
var/activity_state = general_record.physical_status
// look if we possibly have a manifest record we can use instead
var/datum/record/shuttle_manifest/manifest = find_record("name", general_record.name, RECORD_SHUTTLE_MANIFEST)
if(manifest)
return "Away Mission: " + manifest.shuttle
return activity_state
/datum/controller/subsystem/records/proc/get_manifest_list()
if(manifest.len)
return manifest
@@ -250,13 +272,13 @@ SUBSYSTEM_DEF(records)
log_world("ERROR: SSjobs not available, cannot build manifest")
return
manifest = DEPARTMENTS_LIST_INIT
for(var/datum/record/general/t in records)
var/name = sanitize(t.name, encode = FALSE)
var/rank = sanitize(t.rank, encode = FALSE)
var/real_rank = make_list_rank(t.real_rank)
for(var/datum/record/general/general_record in records)
var/name = sanitize(general_record.name, encode = FALSE)
var/rank = sanitize(general_record.rank, encode = FALSE)
var/real_rank = make_list_rank(general_record.real_rank)
var/datum/job/job = SSjobs.GetJob(real_rank)
var/isactive = t.physical_status
var/activity_state = get_activity_state(general_record)
var/list/departments
if(istype(job) && job.departments.len > 0 && all_in_list(job.departments, manifest))
@@ -266,7 +288,7 @@ SUBSYSTEM_DEF(records)
for(var/department in departments) // add them to their departments
var/supervisor = departments[department] & JOBROLE_SUPERVISOR
manifest[department][++manifest[department].len] = list("name" = name, "rank" = rank, "active" = isactive, "head" = supervisor)
manifest[department][++manifest[department].len] = list("name" = name, "rank" = rank, "active" = activity_state, "head" = supervisor)
if(supervisor) // they are a supervisor/head, put them on top
manifest[department].Swap(1, manifest[department].len)
@@ -0,0 +1,6 @@
author: Geeves
delete-after: True
changes:
- rscadd: "Being added to a shuttle manifest will now update the crew manifest to indicate that you're on an away mission on that shuttle."
@@ -57,8 +57,9 @@ export const ManifestSection = (props, context) => {
'manifest-indicator-' +
crewmate.active
.toLowerCase()
.replace(/\*/g, '')
.replace(/\s/g, '-')
.replace(/\*/g, '') // removes asterisks
.replace(/\s/g, '-') // replaces spaces with a dash
.replace(/:.*?$/, '') // matches and removes : to the end of the string, so it catches Away Mission(: ShuttleName)
}
/>
</Tooltip>
@@ -21,6 +21,7 @@ $status-colors: (
'deceased': colors.$red,
'physically-unfit': colors.$yellow,
'disabled': colors.$yellow,
'away-mission': colors.$blue,
);
@each $dept, $color in $departmental-colors {