Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Port] Departmental Refactor #11209

Merged
merged 9 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#include "code\__DEFINES\cooldowns.dm"
#include "code\__DEFINES\cult.dm"
#include "code\__DEFINES\database.dm"
#include "code\__DEFINES\departments.dm"
#include "code\__DEFINES\department.dm"
#include "code\__DEFINES\devices.dm"
#include "code\__DEFINES\directional.dm"
#include "code\__DEFINES\diseases.dm"
Expand Down Expand Up @@ -324,7 +324,6 @@
#include "code\_globalvars\lists\ambience.dm"
#include "code\_globalvars\lists\client.dm"
#include "code\_globalvars\lists\flavor_misc.dm"
#include "code\_globalvars\lists\jobs.dm"
#include "code\_globalvars\lists\maintenance_loot.dm"
#include "code\_globalvars\lists\mapping.dm"
#include "code\_globalvars\lists\mobs.dm"
Expand Down Expand Up @@ -422,6 +421,7 @@
#include "code\controllers\subsystem\communications.dm"
#include "code\controllers\subsystem\dbcore.dm"
#include "code\controllers\subsystem\dcs.dm"
#include "code\controllers\subsystem\department.dm"
#include "code\controllers\subsystem\disease.dm"
#include "code\controllers\subsystem\early_assets.dm"
#include "code\controllers\subsystem\economy.dm"
Expand Down
60 changes: 60 additions & 0 deletions code/__DEFINES/department.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// station departments
#define DEPT_NAME_COMMAND "Command"
#define DEPT_BITFLAG_COM (1<<0)
#define DEPT_NAME_CIVILIAN "Civilian"
#define DEPT_BITFLAG_CIV (1<<1)
#define DEPT_NAME_SERVICE "Service"
#define DEPT_BITFLAG_SRV (1<<2)
#define DEPT_NAME_CARGO "Cargo"
#define DEPT_BITFLAG_CAR (1<<3)
#define DEPT_NAME_SCIENCE "Science"
#define DEPT_BITFLAG_SCI (1<<4)
#define DEPT_NAME_ENGINEERING "Engineering"
#define DEPT_BITFLAG_ENG (1<<5)
#define DEPT_NAME_MEDICAL "Medical"
#define DEPT_BITFLAG_MED (1<<6)
#define DEPT_NAME_SECURITY "Security"
#define DEPT_BITFLAG_SEC (1<<7)
#define DEPT_NAME_VIP "VIP"
#define DEPT_BITFLAG_VIP (1<<8)
#define DEPT_NAME_SILICON "Silicon"
#define DEPT_BITFLAG_SILICON (1<<9)
#define DEPT_NAME_UNASSIGNED "Misc"
#define DEPT_BITFLAG_UNASSIGNED (1<<10)

#define DEPT_NAME_CENTCOM "CentCom"
#define DEPT_BITFLAG_CENTCOM (1<<11)
#define DEPT_NAME_OTHER "Other"
#define DEPT_BITFLAG_OTHER (1<<12)

// not real department. These exist for pref grouping
#define DEPT_NAME_ASSISTANT "Assistant"
#define DEPT_NAME_CAPTAIN "Captain"


// Crew Manifest will show crew data in this order
// in favour of our downstreams, sort order is increased by 10, so that they can add anything between these (i.e NSV munition dept)
#define DEPT_MANIFEST_ORDER_COMMAND 10
#define DEPT_MANIFEST_ORDER_CENTCOM 13 // generally it won't be used
#define DEPT_MANIFEST_ORDER_VIP 16
#define DEPT_MANIFEST_ORDER_SECURITY 20
#define DEPT_MANIFEST_ORDER_ENGINEERING 30
#define DEPT_MANIFEST_ORDER_MEDICAL 40
#define DEPT_MANIFEST_ORDER_SCIENCE 50
#define DEPT_MANIFEST_ORDER_CARGO 60
#define DEPT_MANIFEST_ORDER_SERVICE 70
#define DEPT_MANIFEST_ORDER_CIVILIAN 80
#define DEPT_MANIFEST_ORDER_SILICON 90
#define DEPT_MANIFEST_ORDER_UNASSIGNED 666 // dummy department for people with no department


// used for /mob/dead/new_player/proc/LateChoices()
#define DEPT_PREF_ORDER_COMMAND 10
#define DEPT_PREF_ORDER_SECURITY 20
#define DEPT_PREF_ORDER_ENGINEERING 30
#define DEPT_PREF_ORDER_MEDICAL 40
#define DEPT_PREF_ORDER_SCIENCE 50
#define DEPT_PREF_ORDER_CARGO 60
#define DEPT_PREF_ORDER_SERVICE 70
#define DEPT_PREF_ORDER_CIVILIAN 80
#define DEPT_PREF_ORDER_SILICON 90
9 changes: 0 additions & 9 deletions code/__DEFINES/departments.dm

This file was deleted.

14 changes: 0 additions & 14 deletions code/__DEFINES/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,6 @@
#define JOB_DISPLAY_ORDER_AI 33
#define JOB_DISPLAY_ORDER_CYBORG 34


#define DEPT_BITFLAG_COM (1<<0)
#define DEPT_BITFLAG_CIV (1<<1)
#define DEPT_BITFLAG_SRV (1<<2)
#define DEPT_BITFLAG_CAR (1<<3)
#define DEPT_BITFLAG_SCI (1<<4)
#define DEPT_BITFLAG_ENG (1<<5)
#define DEPT_BITFLAG_MED (1<<6)
#define DEPT_BITFLAG_SEC (1<<7)
#define DEPT_BITFLAG_VIP (1<<8)
#define DEPT_BITFLAG_SILICON (1<<9)
#define DEPT_BITFLAG_CAPTAIN (1<<10)
#define DEPT_BITFLAG_ASSISTANT (1<<11)

// should check the ones in `\_DEFINES\economy.dm`
// It's true that bitflags shouldn't be separated in two DEFINES if these are same, but just in case the system can be devided, it's remained separated.

Expand Down
7 changes: 4 additions & 3 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@
#define INIT_ORDER_RESEARCH 75
#define INIT_ORDER_ORBITS 74 //Other things use the orbital map, so it needs to be made early on.
#define INIT_ORDER_STATION 73 //This is high priority because it manipulates a lot of the subsystems that will initialize after it.
#define INIT_ORDER_QUIRKS 72
#define INIT_ORDER_JOBS 71 //Must initialize before events for holidays
#define INIT_ORDER_EVENTS 70
#define INIT_ORDER_DEPARTMENT 72 //This is important: it has access distributing code, so should be initialized quickly
#define INIT_ORDER_QUIRKS 71
#define INIT_ORDER_JOBS 70 //Must initialize before events for holidays
#define INIT_ORDER_EVENTS 69
#define INIT_ORDER_AI_MOVEMENT 56 //We need the movement setup
#define INIT_ORDER_AI_CONTROLLERS 55 //So the controller can get the ref
#define INIT_ORDER_TICKER 55
Expand Down
10 changes: 0 additions & 10 deletions code/__HELPERS/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,3 @@ GLOBAL_LIST_INIT(command_huds, list(
JOB_HUD_UNKNOWN = JOB_CHATCOLOR_UNKNOWN
)
return hud_to_chatcolor[jobname] || JOB_CHATCOLOR_UNKNOWN

/proc/get_job_departments(field)
. = list()
for(var/flag in GLOB.bitflags)
var/key = "[flag]"
var/department = GLOB.dept_bitflag_to_name[key]
if(!department || !GLOB.departments[department])
continue
if(CHECK_BITFIELD(field, flag))
. += department
30 changes: 0 additions & 30 deletions code/_globalvars/lists/jobs.dm

This file was deleted.

Loading
Loading