diff --git a/code/__DEFINES/jobs.dm b/code/__DEFINES/jobs.dm index d4ab59cbc1..4d7b41d3b7 100644 --- a/code/__DEFINES/jobs.dm +++ b/code/__DEFINES/jobs.dm @@ -91,3 +91,12 @@ #define JOB_DISPLAY_ORDER_DETECTIVE 32 #define JOB_DISPLAY_ORDER_SECURITY_OFFICER 33 #define JOB_DISPLAY_ORDER_PRISONER 34 + +#define DEPARTMENT_BITFLAG_SECURITY (1<<0) +#define DEPARTMENT_BITFLAG_COMMAND (1<<1) +#define DEPARTMENT_BITFLAG_SERVICE (1<<2) +#define DEPARTMENT_BITFLAG_CARGO (1<<3) +#define DEPARTMENT_BITFLAG_ENGINEERING (1<<4) +#define DEPARTMENT_BITFLAG_SCIENCE (1<<5) +#define DEPARTMENT_BITFLAG_MEDICAL (1<<6) +#define DEPARTMENT_BITFLAG_SILICON (1<<7) diff --git a/code/_globalvars/tgui.dm b/code/_globalvars/tgui.dm index 1a2c46c10d..aaaab9c5e4 100644 --- a/code/_globalvars/tgui.dm +++ b/code/_globalvars/tgui.dm @@ -1 +1,2 @@ +GLOBAL_DATUM(crew_manifest_tgui, /datum/crew_manifest) GLOBAL_DATUM(changelog_tgui, /datum/changelog) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 5aeb7626f6..8195666783 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -91,7 +91,7 @@ if(foundrecord) foundrecord.fields["rank"] = assignment -/datum/datacore/proc/get_manifest_tg() //copypasted from tg, renamed to avoid namespace conflicts +/datum/datacore/proc/get_manifest() var/list/manifest_out = list() var/list/departments = list( "Command" = GLOB.command_positions, @@ -112,12 +112,18 @@ if(rank in jobs) if(!manifest_out[department]) manifest_out[department] = list() - manifest_out[department] += list(list( - "name" = name, - "rank" = rank - )) + // Append to beginning of list if captain or department head + if (rank == "Captain" || (department != "Command" && (rank in GLOB.command_positions))) + manifest_out[department] = list(list( + "name" = name, + "rank" = rank + )) + manifest_out[department] + else + manifest_out[department] += list(list( + "name" = name, + "rank" = rank + )) has_department = TRUE - break if(!has_department) if(!manifest_out["Misc"]) manifest_out["Misc"] = list() @@ -127,114 +133,6 @@ )) return manifest_out -/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() - var/dat = {" - - - - "} - 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 += "" - for(var/name in heads) - dat += "" - even = !even - if(sec.len > 0) - dat += "" - for(var/name in sec) - dat += "" - even = !even - if(eng.len > 0) - dat += "" - for(var/name in eng) - dat += "" - even = !even - if(med.len > 0) - dat += "" - for(var/name in med) - dat += "" - even = !even - if(sci.len > 0) - dat += "" - for(var/name in sci) - dat += "" - even = !even - if(sup.len > 0) - dat += "" - for(var/name in sup) - dat += "" - even = !even - if(civ.len > 0) - dat += "" - for(var/name in civ) - dat += "" - even = !even - // in case somebody is insane and added them to the manifest, why not - if(bot.len > 0) - dat += "" - for(var/name in bot) - dat += "" - even = !even - // misc guys - if(misc.len > 0) - dat += "" - for(var/name in misc) - dat += "" - even = !even - - dat += "
NameRank
Heads
[name][heads[name]]
Security
[name][sec[name]]
Engineering
[name][eng[name]]
Medical
[name][med[name]]
Science
[name][sci[name]]
Supply
[name][sup[name]]
Civilian
[name][civ[name]]
Silicon
[name][bot[name]]
Miscellaneous
[name][misc[name]]
" - dat = replacetext(dat, "\n", "") - dat = replacetext(dat, "\t", "") - return dat - - /datum/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C, datum/preferences/prefs) set waitfor = FALSE var/static/list/show_directions = list(SOUTH, WEST) diff --git a/code/datums/station_traits/positive_traits.dm b/code/datums/station_traits/positive_traits.dm index a1deb8899c..94772966ee 100644 --- a/code/datums/station_traits/positive_traits.dm +++ b/code/datums/station_traits/positive_traits.dm @@ -149,7 +149,7 @@ trait_flags = STATION_TRAIT_ABSTRACT blacklist = list(/datum/station_trait/deathrattle_all) - var/department_head + var/department_to_apply_to var/department_name = "department" var/datum/deathrattle_group/deathrattle_group @@ -157,72 +157,65 @@ . = ..() deathrattle_group = new("[department_name] group") blacklist += subtypesof(/datum/station_trait/deathrattle_department) - type //All but ourselves + name = "deathrattled [department_name]" report_message = "All members of [department_name] have received an implant to notify each other if one of them dies. This should help improve job-safety!" RegisterSignal(SSdcs, COMSIG_GLOB_JOB_AFTER_SPAWN, PROC_REF(on_job_after_spawn)) - -/datum/station_trait/deathrattle_department/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/spawned, client/player_client) +/datum/station_trait/deathrattle_department/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/living_mob, mob/M, joined_late) SIGNAL_HANDLER - if(department_head != job.title && !(src.department_head in job.department_head)) + if(!(job.departments & department_to_apply_to)) return var/obj/item/implant/deathrattle/implant_to_give = new() deathrattle_group.register(implant_to_give) - implant_to_give.implant(spawned, spawned, TRUE, TRUE) + implant_to_give.implant(living_mob, living_mob, TRUE, TRUE) /datum/station_trait/deathrattle_department/service - name = "Deathrattled Service" trait_flags = NONE weight = 1 - department_head = "Head of Personnel" + department_to_apply_to = DEPARTMENT_BITFLAG_SERVICE department_name = "Service" /datum/station_trait/deathrattle_department/cargo - name = "Deathrattled Cargo" trait_flags = NONE - weight = 2 - department_head = "Quartermaster" + weight = 1 + department_to_apply_to = DEPARTMENT_BITFLAG_CARGO department_name = "Cargo" /datum/station_trait/deathrattle_department/engineering - name = "Deathrattled Engineering" trait_flags = NONE - weight = 2 - department_head = "Chief Engineer" + weight = 1 + department_to_apply_to = DEPARTMENT_BITFLAG_ENGINEERING department_name = "Engineering" /datum/station_trait/deathrattle_department/command - name = "Deathrattled Command" trait_flags = NONE weight = 1 - department_head = "Captain" + department_to_apply_to = DEPARTMENT_BITFLAG_COMMAND department_name = "Command" /datum/station_trait/deathrattle_department/science - name = "Deathrattled Science" trait_flags = NONE weight = 1 - department_head = "Research Director" + department_to_apply_to = DEPARTMENT_BITFLAG_SCIENCE department_name = "Science" /datum/station_trait/deathrattle_department/security - name = "Deathrattled Security" trait_flags = NONE weight = 1 - department_head = "Head of Security" + department_to_apply_to = DEPARTMENT_BITFLAG_SECURITY department_name = "Security" /datum/station_trait/deathrattle_department/medical - name = "Deathrattled Medical" trait_flags = NONE weight = 1 - department_head = "Chief Medical Officer" + department_to_apply_to = DEPARTMENT_BITFLAG_MEDICAL department_name = "Medical" /datum/station_trait/deathrattle_all - name = "Deathrattled Station" + name = "deathrattled station" trait_type = STATION_TRAIT_POSITIVE show_in_report = TRUE weight = 1 @@ -236,14 +229,12 @@ blacklist = subtypesof(/datum/station_trait/deathrattle_department) RegisterSignal(SSdcs, COMSIG_GLOB_JOB_AFTER_SPAWN, PROC_REF(on_job_after_spawn)) - -/datum/station_trait/deathrattle_all/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/spawned, client/player_client) +/datum/station_trait/deathrattle_all/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/living_mob, mob/M, joined_late) SIGNAL_HANDLER var/obj/item/implant/deathrattle/implant_to_give = new() deathrattle_group.register(implant_to_give) - implant_to_give.implant(spawned, spawned, TRUE, TRUE) - + implant_to_give.implant(living_mob, living_mob, TRUE, TRUE) /datum/station_trait/wallets name = "Wallets!" diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index 4f45af88bb..969a39b560 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -76,6 +76,9 @@ var/bounty_types = CIV_JOB_BASIC + ///Bitfield of departments this job belongs wit + var/departments = NONE + /// Goodies that can be received via the mail system. // this is a weighted list. /// Keep the _job definition for this empty and use /obj/item/mail to define general gifts. diff --git a/code/modules/jobs/job_types/ai.dm b/code/modules/jobs/job_types/ai.dm index 526f541443..2dc575145e 100644 --- a/code/modules/jobs/job_types/ai.dm +++ b/code/modules/jobs/job_types/ai.dm @@ -15,6 +15,7 @@ exp_type_department = EXP_TYPE_SILICON display_order = JOB_DISPLAY_ORDER_AI allow_bureaucratic_error = FALSE + departments = DEPARTMENT_BITFLAG_SILICON random_spawns_possible = FALSE var/do_special_check = TRUE threat = 5 diff --git a/code/modules/jobs/job_types/assistant.dm b/code/modules/jobs/job_types/assistant.dm index 90ac6be8dd..3a2335bb11 100644 --- a/code/modules/jobs/job_types/assistant.dm +++ b/code/modules/jobs/job_types/assistant.dm @@ -16,6 +16,7 @@ Assistant antag_rep = 7 paycheck = PAYCHECK_ASSISTANT // Get a job. Job reassignment changes your paycheck now. Get over it. paycheck_department = ACCOUNT_CIV + departments = DEPARTMENT_BITFLAG_SERVICE display_order = JOB_DISPLAY_ORDER_ASSISTANT dresscodecompliant = FALSE always_can_respawn_as = TRUE diff --git a/code/modules/jobs/job_types/atmospheric_technician.dm b/code/modules/jobs/job_types/atmospheric_technician.dm index 551ac63d00..4b17fc8b9f 100644 --- a/code/modules/jobs/job_types/atmospheric_technician.dm +++ b/code/modules/jobs/job_types/atmospheric_technician.dm @@ -21,12 +21,13 @@ paycheck = PAYCHECK_MEDIUM paycheck_department = ACCOUNT_ENG bounty_types = CIV_JOB_ENG + departments = DEPARTMENT_BITFLAG_ENGINEERING starting_modifiers = list(/datum/skill_modifier/job/level/wiring, /datum/skill_modifier/job/affinity/wiring) display_order = JOB_DISPLAY_ORDER_ATMOSPHERIC_TECHNICIAN threat = 0.5 - + family_heirlooms = list( /obj/item/lighter, /obj/item/lighter/greyscale, diff --git a/code/modules/jobs/job_types/bartender.dm b/code/modules/jobs/job_types/bartender.dm index bde15b24db..6d8f4256b5 100644 --- a/code/modules/jobs/job_types/bartender.dm +++ b/code/modules/jobs/job_types/bartender.dm @@ -18,6 +18,7 @@ paycheck = PAYCHECK_EASY paycheck_department = ACCOUNT_SRV bounty_types = CIV_JOB_DRINK + departments = DEPARTMENT_BITFLAG_SERVICE display_order = JOB_DISPLAY_ORDER_BARTENDER threat = 0.5 diff --git a/code/modules/jobs/job_types/botanist.dm b/code/modules/jobs/job_types/botanist.dm index fcd71d7275..f30375201e 100644 --- a/code/modules/jobs/job_types/botanist.dm +++ b/code/modules/jobs/job_types/botanist.dm @@ -17,6 +17,7 @@ paycheck = PAYCHECK_EASY paycheck_department = ACCOUNT_SRV bounty_types = CIV_JOB_GROW + departments = DEPARTMENT_BITFLAG_SERVICE display_order = JOB_DISPLAY_ORDER_BOTANIST threat = 1.5 // lol powergame diff --git a/code/modules/jobs/job_types/captain.dm b/code/modules/jobs/job_types/captain.dm index 00fb4822e2..fe594e4660 100644 --- a/code/modules/jobs/job_types/captain.dm +++ b/code/modules/jobs/job_types/captain.dm @@ -29,6 +29,7 @@ mind_traits = list(TRAIT_CAPTAIN_METABOLISM, TRAIT_DISK_VERIFIER) display_order = JOB_DISPLAY_ORDER_CAPTAIN + departments = DEPARTMENT_BITFLAG_COMMAND blacklisted_quirks = list(/datum/quirk/mute, /datum/quirk/brainproblems, /datum/quirk/insanity) threat = 5 diff --git a/code/modules/jobs/job_types/cargo_technician.dm b/code/modules/jobs/job_types/cargo_technician.dm index 823aec3078..c70e1078aa 100644 --- a/code/modules/jobs/job_types/cargo_technician.dm +++ b/code/modules/jobs/job_types/cargo_technician.dm @@ -20,6 +20,7 @@ display_order = JOB_DISPLAY_ORDER_CARGO_TECHNICIAN bounty_types = CIV_JOB_RANDOM + departments = DEPARTMENT_BITFLAG_CARGO threat = 0.2 family_heirlooms = list( diff --git a/code/modules/jobs/job_types/chaplain.dm b/code/modules/jobs/job_types/chaplain.dm index 522f022072..2d6f436cb0 100644 --- a/code/modules/jobs/job_types/chaplain.dm +++ b/code/modules/jobs/job_types/chaplain.dm @@ -18,6 +18,7 @@ paycheck_department = ACCOUNT_CIV display_order = JOB_DISPLAY_ORDER_CHAPLAIN + departments = DEPARTMENT_BITFLAG_SERVICE threat = 0.5 family_heirlooms = list( diff --git a/code/modules/jobs/job_types/chemist.dm b/code/modules/jobs/job_types/chemist.dm index be145b24b2..317b9f7a33 100644 --- a/code/modules/jobs/job_types/chemist.dm +++ b/code/modules/jobs/job_types/chemist.dm @@ -19,6 +19,7 @@ paycheck = PAYCHECK_MEDIUM paycheck_department = ACCOUNT_MED bounty_types = CIV_JOB_CHEM + departments = DEPARTMENT_BITFLAG_MEDICAL display_order = JOB_DISPLAY_ORDER_CHEMIST threat = 1.5 diff --git a/code/modules/jobs/job_types/chief_engineer.dm b/code/modules/jobs/job_types/chief_engineer.dm index 5ec4cca512..0e0083bd3c 100644 --- a/code/modules/jobs/job_types/chief_engineer.dm +++ b/code/modules/jobs/job_types/chief_engineer.dm @@ -18,6 +18,7 @@ considered_combat_role = TRUE outfit = /datum/outfit/job/ce + departments = DEPARTMENT_BITFLAG_ENGINEERING | DEPARTMENT_BITFLAG_COMMAND plasma_outfit = /datum/outfit/plasmaman/ce access = list(ACCESS_ENGINE, ACCESS_ENGINE_EQUIP, ACCESS_TECH_STORAGE, ACCESS_MAINT_TUNNELS, diff --git a/code/modules/jobs/job_types/chief_medical_officer.dm b/code/modules/jobs/job_types/chief_medical_officer.dm index ed58d67a1f..3472052b53 100644 --- a/code/modules/jobs/job_types/chief_medical_officer.dm +++ b/code/modules/jobs/job_types/chief_medical_officer.dm @@ -18,6 +18,7 @@ considered_combat_role = TRUE outfit = /datum/outfit/job/cmo + departments = DEPARTMENT_BITFLAG_MEDICAL | DEPARTMENT_BITFLAG_COMMAND plasma_outfit = /datum/outfit/plasmaman/cmo access = list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_GENETICS, ACCESS_CLONING, ACCESS_HEADS, ACCESS_MINERAL_STOREROOM, diff --git a/code/modules/jobs/job_types/clown.dm b/code/modules/jobs/job_types/clown.dm index c54fb13c0a..009560d7c7 100644 --- a/code/modules/jobs/job_types/clown.dm +++ b/code/modules/jobs/job_types/clown.dm @@ -10,6 +10,7 @@ selection_color = "#dddddd" outfit = /datum/outfit/job/clown + departments = DEPARTMENT_BITFLAG_SERVICE plasma_outfit = /datum/outfit/plasmaman/clown access = list(ACCESS_THEATRE) diff --git a/code/modules/jobs/job_types/cook.dm b/code/modules/jobs/job_types/cook.dm index 246f8d002f..b3d3180367 100644 --- a/code/modules/jobs/job_types/cook.dm +++ b/code/modules/jobs/job_types/cook.dm @@ -18,6 +18,7 @@ paycheck = PAYCHECK_EASY paycheck_department = ACCOUNT_SRV bounty_types = CIV_JOB_CHEF + departments = DEPARTMENT_BITFLAG_SERVICE display_order = JOB_DISPLAY_ORDER_COOK threat = 0.2 diff --git a/code/modules/jobs/job_types/curator.dm b/code/modules/jobs/job_types/curator.dm index e6e9394109..6b5707d76f 100644 --- a/code/modules/jobs/job_types/curator.dm +++ b/code/modules/jobs/job_types/curator.dm @@ -18,8 +18,9 @@ paycheck_department = ACCOUNT_CIV display_order = JOB_DISPLAY_ORDER_CURATOR + departments = DEPARTMENT_BITFLAG_SERVICE threat = 0.3 - + family_heirlooms = list( /obj/item/pen/fountain, /obj/item/storage/dice diff --git a/code/modules/jobs/job_types/cyborg.dm b/code/modules/jobs/job_types/cyborg.dm index 280d7616c2..97ad58d058 100644 --- a/code/modules/jobs/job_types/cyborg.dm +++ b/code/modules/jobs/job_types/cyborg.dm @@ -16,6 +16,7 @@ starting_modifiers = list(/datum/skill_modifier/job/level/wiring/basic) display_order = JOB_DISPLAY_ORDER_CYBORG + departments = DEPARTMENT_BITFLAG_SILICON /datum/job/cyborg/equip(mob/living/carbon/human/H, visualsOnly = FALSE, announce = TRUE, latejoin = FALSE, datum/outfit/outfit_override = null, client/preference_source = null) if(visualsOnly) diff --git a/code/modules/jobs/job_types/detective.dm b/code/modules/jobs/job_types/detective.dm index cfa93ecd5a..82679c4680 100644 --- a/code/modules/jobs/job_types/detective.dm +++ b/code/modules/jobs/job_types/detective.dm @@ -14,6 +14,7 @@ exp_type = EXP_TYPE_CREW outfit = /datum/outfit/job/detective + departments = DEPARTMENT_BITFLAG_SECURITY plasma_outfit = /datum/outfit/plasmaman/detective considered_combat_role = TRUE diff --git a/code/modules/jobs/job_types/geneticist.dm b/code/modules/jobs/job_types/geneticist.dm index fb830b3ece..46125339be 100644 --- a/code/modules/jobs/job_types/geneticist.dm +++ b/code/modules/jobs/job_types/geneticist.dm @@ -12,6 +12,7 @@ exp_requirements = 60 outfit = /datum/outfit/job/geneticist + departments = DEPARTMENT_BITFLAG_MEDICAL plasma_outfit = /datum/outfit/plasmaman/genetics access = list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_CHEMISTRY, ACCESS_GENETICS, ACCESS_CLONING, ACCESS_RESEARCH, ACCESS_XENOBIOLOGY, ACCESS_ROBOTICS, ACCESS_MINERAL_STOREROOM, ACCESS_TECH_STORAGE) diff --git a/code/modules/jobs/job_types/head_of_personnel.dm b/code/modules/jobs/job_types/head_of_personnel.dm index 508dcfda7b..c20e5284d1 100644 --- a/code/modules/jobs/job_types/head_of_personnel.dm +++ b/code/modules/jobs/job_types/head_of_personnel.dm @@ -17,6 +17,7 @@ exp_type_department = EXP_TYPE_SERVICE considered_combat_role = TRUE outfit = /datum/outfit/job/hop + departments = DEPARTMENT_BITFLAG_COMMAND | DEPARTMENT_BITFLAG_SERVICE plasma_outfit = /datum/outfit/plasmaman/hop access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_COURT, ACCESS_WEAPONS, diff --git a/code/modules/jobs/job_types/head_of_security.dm b/code/modules/jobs/job_types/head_of_security.dm index 15fd567a96..5f8fa7ac51 100644 --- a/code/modules/jobs/job_types/head_of_security.dm +++ b/code/modules/jobs/job_types/head_of_security.dm @@ -18,6 +18,7 @@ exp_type_department = EXP_TYPE_SECURITY outfit = /datum/outfit/job/hos + departments = DEPARTMENT_BITFLAG_SECURITY | DEPARTMENT_BITFLAG_COMMAND plasma_outfit = /datum/outfit/plasmaman/hos mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) diff --git a/code/modules/jobs/job_types/janitor.dm b/code/modules/jobs/job_types/janitor.dm index f7e79cb769..fcfbc92e40 100644 --- a/code/modules/jobs/job_types/janitor.dm +++ b/code/modules/jobs/job_types/janitor.dm @@ -18,6 +18,7 @@ paycheck_department = ACCOUNT_SRV display_order = JOB_DISPLAY_ORDER_JANITOR + departments = DEPARTMENT_BITFLAG_SERVICE threat = 0.2 family_heirlooms = list( diff --git a/code/modules/jobs/job_types/lawyer.dm b/code/modules/jobs/job_types/lawyer.dm index 4105bd4e6e..8df949a143 100644 --- a/code/modules/jobs/job_types/lawyer.dm +++ b/code/modules/jobs/job_types/lawyer.dm @@ -21,8 +21,9 @@ mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) display_order = JOB_DISPLAY_ORDER_LAWYER + departments = DEPARTMENT_BITFLAG_SERVICE threat = 0.3 - + family_heirlooms = list( /obj/item/gavelhammer, /obj/item/book/manual/wiki/security_space_law diff --git a/code/modules/jobs/job_types/medical_doctor.dm b/code/modules/jobs/job_types/medical_doctor.dm index b9a313d0e7..52a668b182 100644 --- a/code/modules/jobs/job_types/medical_doctor.dm +++ b/code/modules/jobs/job_types/medical_doctor.dm @@ -10,6 +10,7 @@ selection_color = "#74b5e0" outfit = /datum/outfit/job/doctor + departments = DEPARTMENT_BITFLAG_MEDICAL plasma_outfit = /datum/outfit/plasmaman/medical access = list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_SURGERY, ACCESS_CHEMISTRY, ACCESS_GENETICS, ACCESS_CLONING, ACCESS_VIROLOGY, ACCESS_MINERAL_STOREROOM) diff --git a/code/modules/jobs/job_types/mime.dm b/code/modules/jobs/job_types/mime.dm index 3929b22f9d..2813c32e14 100644 --- a/code/modules/jobs/job_types/mime.dm +++ b/code/modules/jobs/job_types/mime.dm @@ -18,6 +18,7 @@ paycheck_department = ACCOUNT_SRV display_order = JOB_DISPLAY_ORDER_MIME + departments = DEPARTMENT_BITFLAG_SERVICE threat = 0 diff --git a/code/modules/jobs/job_types/paramedic.dm b/code/modules/jobs/job_types/paramedic.dm index c3d42ba365..19a955ffe2 100644 --- a/code/modules/jobs/job_types/paramedic.dm +++ b/code/modules/jobs/job_types/paramedic.dm @@ -17,6 +17,7 @@ paycheck = PAYCHECK_MEDIUM paycheck_department = ACCOUNT_MED bounty_types = CIV_JOB_MED + departments = DEPARTMENT_BITFLAG_MEDICAL display_order = JOB_DISPLAY_ORDER_PARAMEDIC diff --git a/code/modules/jobs/job_types/prisoner.dm b/code/modules/jobs/job_types/prisoner.dm index 5de351573f..732ac03016 100644 --- a/code/modules/jobs/job_types/prisoner.dm +++ b/code/modules/jobs/job_types/prisoner.dm @@ -13,6 +13,7 @@ plasma_outfit = /datum/outfit/plasmaman/prisoner display_order = JOB_DISPLAY_ORDER_PRISONER + departments = DEPARTMENT_BITFLAG_SECURITY family_heirlooms = list( /obj/item/pen/blue diff --git a/code/modules/jobs/job_types/quartermaster.dm b/code/modules/jobs/job_types/quartermaster.dm index efcab13381..b0cdf94825 100644 --- a/code/modules/jobs/job_types/quartermaster.dm +++ b/code/modules/jobs/job_types/quartermaster.dm @@ -28,6 +28,7 @@ paycheck = PAYCHECK_HARD //They can already buy stuff using cargo budget, don't give em a command-level paycheck. //alright i'll agree to that -qweq paycheck_department = ACCOUNT_CAR bounty_types = CIV_JOB_RANDOM + departments = DEPARTMENT_BITFLAG_CARGO | DEPARTMENT_BITFLAG_COMMAND display_order = JOB_DISPLAY_ORDER_QUARTERMASTER blacklisted_quirks = list(/datum/quirk/mute, /datum/quirk/brainproblems, /datum/quirk/insanity) diff --git a/code/modules/jobs/job_types/research_director.dm b/code/modules/jobs/job_types/research_director.dm index f4589cae3d..89c9aafeb4 100644 --- a/code/modules/jobs/job_types/research_director.dm +++ b/code/modules/jobs/job_types/research_director.dm @@ -18,6 +18,7 @@ considered_combat_role = TRUE outfit = /datum/outfit/job/rd + departments = DEPARTMENT_BITFLAG_SCIENCE | DEPARTMENT_BITFLAG_COMMAND plasma_outfit = /datum/outfit/plasmaman/rd access = list(ACCESS_RD, ACCESS_HEADS, ACCESS_TOX, ACCESS_GENETICS, ACCESS_MORGUE, diff --git a/code/modules/jobs/job_types/roboticist.dm b/code/modules/jobs/job_types/roboticist.dm index 089e5cf506..097023e643 100644 --- a/code/modules/jobs/job_types/roboticist.dm +++ b/code/modules/jobs/job_types/roboticist.dm @@ -12,6 +12,7 @@ exp_type = EXP_TYPE_CREW outfit = /datum/outfit/job/roboticist + departments = DEPARTMENT_BITFLAG_SCIENCE plasma_outfit = /datum/outfit/plasmaman/robotics access = list(ACCESS_ROBOTICS, ACCESS_TOX, ACCESS_TOX_STORAGE, ACCESS_TECH_STORAGE, ACCESS_MORGUE, ACCESS_RESEARCH, ACCESS_MINERAL_STOREROOM, ACCESS_XENOBIOLOGY, ACCESS_GENETICS) diff --git a/code/modules/jobs/job_types/scientist.dm b/code/modules/jobs/job_types/scientist.dm index 5fcfb7e6f6..f7d5c4a11c 100644 --- a/code/modules/jobs/job_types/scientist.dm +++ b/code/modules/jobs/job_types/scientist.dm @@ -19,6 +19,7 @@ paycheck = PAYCHECK_MEDIUM paycheck_department = ACCOUNT_SCI bounty_types = CIV_JOB_SCI + departments = DEPARTMENT_BITFLAG_SCIENCE starting_modifiers = list(/datum/skill_modifier/job/level/wiring/basic) display_order = JOB_DISPLAY_ORDER_SCIENTIST threat = 1.2 diff --git a/code/modules/jobs/job_types/security_officer.dm b/code/modules/jobs/job_types/security_officer.dm index 4e338da1fa..d413d0a011 100644 --- a/code/modules/jobs/job_types/security_officer.dm +++ b/code/modules/jobs/job_types/security_officer.dm @@ -22,6 +22,7 @@ paycheck = PAYCHECK_HARD paycheck_department = ACCOUNT_SEC bounty_types = CIV_JOB_SEC + departments = DEPARTMENT_BITFLAG_SECURITY mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) diff --git a/code/modules/jobs/job_types/shaft_miner.dm b/code/modules/jobs/job_types/shaft_miner.dm index c6192280c7..7c512ecc0d 100644 --- a/code/modules/jobs/job_types/shaft_miner.dm +++ b/code/modules/jobs/job_types/shaft_miner.dm @@ -20,11 +20,12 @@ paycheck = PAYCHECK_EASY ///Not necessarily easy itself, but it can be trivial to make lot of cash on this job. paycheck_department = ACCOUNT_CAR bounty_types = CIV_JOB_MINE + departments = DEPARTMENT_BITFLAG_CARGO display_order = JOB_DISPLAY_ORDER_SHAFT_MINER threat = 1.5 - + family_heirlooms = list( /obj/item/pickaxe/mini, /obj/item/shovel diff --git a/code/modules/jobs/job_types/station_engineer.dm b/code/modules/jobs/job_types/station_engineer.dm index d8ea7e1df5..3ae4adb49b 100644 --- a/code/modules/jobs/job_types/station_engineer.dm +++ b/code/modules/jobs/job_types/station_engineer.dm @@ -21,6 +21,7 @@ paycheck = PAYCHECK_MEDIUM paycheck_department = ACCOUNT_ENG bounty_types = CIV_JOB_ENG + departments = DEPARTMENT_BITFLAG_ENGINEERING starting_modifiers = list(/datum/skill_modifier/job/level/wiring, /datum/skill_modifier/job/affinity/wiring) diff --git a/code/modules/jobs/job_types/virologist.dm b/code/modules/jobs/job_types/virologist.dm index e5c64acbc8..b9103af84b 100644 --- a/code/modules/jobs/job_types/virologist.dm +++ b/code/modules/jobs/job_types/virologist.dm @@ -19,6 +19,7 @@ paycheck = PAYCHECK_MEDIUM paycheck_department = ACCOUNT_MED bounty_types = CIV_JOB_VIRO + departments = DEPARTMENT_BITFLAG_MEDICAL display_order = JOB_DISPLAY_ORDER_VIROLOGIST diff --git a/code/modules/jobs/job_types/warden.dm b/code/modules/jobs/job_types/warden.dm index eda6257653..7ab010b356 100644 --- a/code/modules/jobs/job_types/warden.dm +++ b/code/modules/jobs/job_types/warden.dm @@ -23,6 +23,7 @@ paycheck = PAYCHECK_HARD paycheck_department = ACCOUNT_SEC bounty_types = CIV_JOB_SEC + departments = DEPARTMENT_BITFLAG_SECURITY mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) diff --git a/code/modules/mob/dead/crew_manifest.dm b/code/modules/mob/dead/crew_manifest.dm new file mode 100644 index 0000000000..c7eb369794 --- /dev/null +++ b/code/modules/mob/dead/crew_manifest.dm @@ -0,0 +1,52 @@ +/datum/crew_manifest + +/datum/crew_manifest/ui_state(mob/user) + return GLOB.always_state + +/datum/crew_manifest/ui_status(mob/user, datum/ui_state/state) + return (isnewplayer(user) || isobserver(user) || isAI(user) || ispAI(user)) ? UI_INTERACTIVE : UI_CLOSE + +/datum/crew_manifest/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if (!ui) + ui = new(user, src, "CrewManifest") + ui.open() + +/datum/crew_manifest/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + if (..()) + return + +/datum/crew_manifest/ui_data(mob/user) + var/list/positions = list( + DEPARTMENT_COMMAND = 0, + DEPARTMENT_SECURITY = 0, + DEPARTMENT_ENGINEERING = 0, + DEPARTMENT_MEDICAL = 0, + DEPARTMENT_SCIENCE = 0, + DEPARTMENT_CARGO = 0, + DEPARTMENT_SERVICE = 0, + DEPARTMENT_SILICON = 0 + ) + var/list/departments = list( + list("flag" = DEPARTMENT_BITFLAG_COMMAND, "name" = DEPARTMENT_COMMAND), + list("flag" = DEPARTMENT_BITFLAG_SECURITY, "name" = DEPARTMENT_SECURITY), + list("flag" = DEPARTMENT_BITFLAG_ENGINEERING, "name" = DEPARTMENT_ENGINEERING), + list("flag" = DEPARTMENT_BITFLAG_MEDICAL, "name" = DEPARTMENT_MEDICAL), + list("flag" = DEPARTMENT_BITFLAG_SCIENCE, "name" = DEPARTMENT_SCIENCE), + list("flag" = DEPARTMENT_BITFLAG_CARGO, "name" = DEPARTMENT_CARGO), + list("flag" = DEPARTMENT_BITFLAG_SERVICE, "name" = DEPARTMENT_SERVICE), + list("flag" = DEPARTMENT_BITFLAG_SILICON, "name" = DEPARTMENT_SILICON) + ) + + for(var/datum/job/job in SSjob.occupations) + for(var/department in departments) + // Check if the job is part of a department using its flag + // Will return true for Research Director if the department is Science or Command, for example + if(job.departments & department["flag"]) + // Add open positions to current department + positions[department["name"]] += (job.total_positions - job.current_positions) + + return list( + "manifest" = GLOB.data_core.get_manifest(), + "positions" = positions + ) diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index e76a8f5a38..b3811b8fef 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -720,11 +720,10 @@ return client.crew_manifest_delay = world.time + (1 SECONDS) - var/dat = "" - dat += "

Crew Manifest

" - dat += GLOB.data_core.get_manifest(OOC = 1) + if(!GLOB.crew_manifest_tgui) + GLOB.crew_manifest_tgui = new /datum/crew_manifest(src) - src << browse(dat, "window=manifest;size=387x420;can_close=1") + GLOB.crew_manifest_tgui.ui_interact(src) /mob/dead/new_player/Move() return FALSE diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 97f9388965..3899e788df 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -730,11 +730,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return client.crew_manifest_delay = world.time + (1 SECONDS) - var/dat - dat += "

Crew Manifest

" - dat += GLOB.data_core.get_manifest() + if(!GLOB.crew_manifest_tgui) + GLOB.crew_manifest_tgui = new /datum/crew_manifest(src) - src << browse(dat, "window=manifest;size=387x420;can_close=1") + GLOB.crew_manifest_tgui.ui_interact(src) //this is called when a ghost is drag clicked to something. /mob/dead/observer/MouseDrop(atom/over) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index f58b27a537..97831388b1 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -413,13 +413,10 @@ return client.crew_manifest_delay = world.time + (1 SECONDS) - var/dat = "Crew RosterCrew Roster:

" + if(!GLOB.crew_manifest_tgui) + GLOB.crew_manifest_tgui = new /datum/crew_manifest(src) - dat += GLOB.data_core.get_manifest() - dat += "" - - src << browse(dat, "window=airoster") - onclose(src, "airoster") + GLOB.crew_manifest_tgui.ui_interact(src) /mob/living/silicon/update_transform(do_animate) var/matrix/ntransform = matrix(transform) //aka transform.Copy() diff --git a/code/modules/modular_computers/file_system/programs/crewmanifest.dm b/code/modules/modular_computers/file_system/programs/crewmanifest.dm index 6837f315a4..bc6923773e 100644 --- a/code/modules/modular_computers/file_system/programs/crewmanifest.dm +++ b/code/modules/modular_computers/file_system/programs/crewmanifest.dm @@ -12,7 +12,7 @@ /datum/computer_file/program/crew_manifest/ui_static_data(mob/user) var/list/data = list() - data["manifest"] = GLOB.data_core.get_manifest_tg() + data["manifest"] = GLOB.data_core.get_manifest() return data /datum/computer_file/program/crew_manifest/ui_data(mob/user) diff --git a/tgstation.dme b/tgstation.dme index a201f09456..1d31780ce0 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2637,6 +2637,7 @@ #include "code\modules\mob\transform_procs.dm" #include "code\modules\mob\typing_indicator.dm" #include "code\modules\mob\camera\camera.dm" +#include "code\modules\mob\dead\crew_manifest.dm" #include "code\modules\mob\dead\dead.dm" #include "code\modules\mob\dead\new_player\login.dm" #include "code\modules\mob\dead\new_player\logout.dm" diff --git a/tgui/packages/tgui/interfaces/CrewManifest.js b/tgui/packages/tgui/interfaces/CrewManifest.js index 3befc18501..3f6f874bda 100644 --- a/tgui/packages/tgui/interfaces/CrewManifest.js +++ b/tgui/packages/tgui/interfaces/CrewManifest.js @@ -1,9 +1,9 @@ -import { classes } from 'common/react'; import { useBackend } from "../backend"; -import { Icon, Section, Table, Tooltip } from "../components"; +import { Icon, Section, Table } from "../components"; import { Window } from "../layouts"; const commandJobs = [ + "Captain", "Head of Personnel", "Head of Security", "Chief Engineer", @@ -17,13 +17,12 @@ export const CrewManifest = (props, context) => { return ( - {Object.entries(manifest).map(([dept, crew]) => ( + {Object.entries(manifest).map(([department, crew]) => (
@@ -33,57 +32,24 @@ export const CrewManifest = (props, context) => { {crewMember.name} - {positions[dept].exceptions.includes(crewMember.rank) && ( - - - - - )} - {crewMember.rank === "Captain" && ( - - - - )} {commandJobs.includes(crewMember.rank) && ( - - - + )} {crewMember.rank} diff --git a/tgui/packages/tgui/styles/interfaces/CrewManifest.scss b/tgui/packages/tgui/styles/interfaces/CrewManifest.scss index 47c23ff1a2..8291cbbd50 100644 --- a/tgui/packages/tgui/styles/interfaces/CrewManifest.scss +++ b/tgui/packages/tgui/styles/interfaces/CrewManifest.scss @@ -5,7 +5,6 @@ $department_map: ( 'Security': colors.$red, 'Engineering': colors.$orange, 'Medical': colors.$teal, - 'Misc': colors.$white, 'Science': colors.$purple, 'Supply': colors.$brown, 'Service': colors.$green, @@ -29,30 +28,14 @@ $department_map: ( &__Cell { padding: 3px 0; - &--Rank { - color: colors.$label; - } - } - - &__Icons { - padding: 3px 9px; - text-align: right; - } - - &__Icon { - color: colors.$label; - position: relative; - - &:not(:last-child) { - margin-right: 7px; - } - - &--Chevron { - padding-right: 2px; + &--Captain { + color: colors.$yellow; + padding: 3px 8px; } &--Command { color: colors.$yellow; + padding: 3px 9px; } } }