[MIRROR] Job refactor: strings to references and typepaths [This could seriously break things :)] (#7006)

* Job refactor: strings to references and typepaths

* 0

* holy fuck

* Update preferences.dm

* Update preferences.dm

* Update preferences.dm

* Update preferences.dm

Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-07-28 22:12:42 +02:00
committed by GitHub
parent e4037532ff
commit 227b722820
229 changed files with 2026 additions and 1561 deletions
@@ -44,22 +44,33 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
..()
change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay)
/datum/computer_file/program/job_management/proc/can_edit_job(datum/job/job)
if(!job || !(job.job_flags & JOB_CREW_MEMBER) || (job.title in blacklisted) || job.veteran_only) //SKYRAT EDIT CHAGNE
return FALSE
return TRUE
/datum/computer_file/program/job_management/proc/can_open_job(datum/job/job)
if(!(job?.title in blacklisted) && !job?.veteran_only) //SKRYAT EDIT CHANGE
if((job.total_positions <= length(GLOB.player_list) * (max_relative_positions / 100)))
var/delta = (world.time / 10) - GLOB.time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] < 0))
return TRUE
if(!can_edit_job(job))
return FALSE
if((job.total_positions <= length(GLOB.player_list) * (max_relative_positions / 100)))
var/delta = (world.time / 10) - GLOB.time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] < 0))
return TRUE
return FALSE
/datum/computer_file/program/job_management/proc/can_close_job(datum/job/job)
if(!(job?.title in blacklisted) && !job?.veteran_only) //SKRYAT EDIT CHANGE
if(job.total_positions > length(GLOB.player_list) * (max_relative_positions / 100))
var/delta = (world.time / 10) - GLOB.time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] > 0))
return TRUE
if(!can_edit_job(job))
return FALSE
if(job.total_positions > length(GLOB.player_list) * (max_relative_positions / 100))
var/delta = (world.time / 10) - GLOB.time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] > 0))
return TRUE
return FALSE
/datum/computer_file/program/job_management/ui_act(action, params, datum/tgui/ui)
. = ..()
if(.)
@@ -102,7 +113,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
return
var/priority_target = params["target"]
var/datum/job/j = SSjob.GetJob(priority_target)
if(!j)
if(!j || !can_edit_job(j))
return
if(j.total_positions <= j.current_positions)
return
@@ -126,7 +137,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
data["authed"] = authed
var/list/pos = list()
for(var/j in SSjob.occupations)
for(var/j in SSjob.joinable_occupations)
var/datum/job/job = j
if(job.title in blacklisted)
continue