From d3feb2305de422ee9aa40f7d80b86a01c4d1754a Mon Sep 17 00:00:00 2001 From: PhantornRU Date: Sat, 18 Nov 2023 04:53:29 +1000 Subject: [PATCH] Fix: novice_jobs --- modular_ss220/jobs/code/cards_ids.dm | 34 ++++++++++++++++++- .../jobs/code/job/engineering_jobs.dm | 5 --- modular_ss220/jobs/code/job/medical_jobs.dm | 5 --- modular_ss220/jobs/code/job/science_jobs.dm | 5 --- modular_ss220/jobs/code/job/security_jobs.dm | 5 --- 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/modular_ss220/jobs/code/cards_ids.dm b/modular_ss220/jobs/code/cards_ids.dm index 5eec7f64ea30..df196b9d0352 100644 --- a/modular_ss220/jobs/code/cards_ids.dm +++ b/modular_ss220/jobs/code/cards_ids.dm @@ -1,6 +1,7 @@ // Для отрисовки ХУД'ов. GLOBAL_LIST_INIT(Jobs_SS220, list("intern", "cadet", "trainee", "student")) -GLOBAL_LIST_INIT(Jobs_titles_SS220, list("Intern", "Security Cadet", "Trainee Engineer", "Student Scientist")) +GLOBAL_LIST_INIT(Jobs_titles_SS220, Jobs_novice_titles_SS220) +GLOBAL_LIST_INIT(Jobs_novice_titles_SS220, list("Intern", "Security Cadet", "Trainee Engineer", "Student Scientist")) /proc/get_all_medical_novice_titles() return list("Intern", "Medical Assistant", "Student Medical Doctor") @@ -58,8 +59,39 @@ GLOBAL_LIST_INIT(Jobs_titles_SS220, list("Intern", "Security Cadet", "Trainee En return data /obj/machinery/computer/card/ui_act(action, params) + var/is_alt_title_rewrite = FALSE + var/job_alt_tittle + switch(action) + if("assign") // transfer to a new job + if(!modify) + return + + job_alt_tittle = params["assign_target"] + if(job_alt_tittle in GLOB.Jobs_novice_titles_SS220) + //for fast find job without check all jobs (!!!for alt_titles job with icon like novice roles!!!) + var/list/dictionary = list( + "Intern" = /datum/job/doctor, + "Security Cadet" = /datum/job/officer, + "Trainee Engineer" = /datum/job/engineer, + "Student Scientist" = /datum/job/scientist, + ) + var/job_type = dictionary[job_alt_tittle] + var/datum/job/job + if(!job_type) // gatto + return + job = new job_type + + if(job && length(job.alt_titles) && (job_alt_tittle in job.alt_titles)) + params["assign_target"] = job.title + is_alt_title_rewrite = TRUE + qdel(job) + . = ..() + if(is_alt_title_rewrite) + modify.assignment = job_alt_tittle + regenerate_id_name() + switch(action) if("skin") if(!modify) diff --git a/modular_ss220/jobs/code/job/engineering_jobs.dm b/modular_ss220/jobs/code/job/engineering_jobs.dm index 8b472cde20cf..e91ffaee5558 100644 --- a/modular_ss220/jobs/code/job/engineering_jobs.dm +++ b/modular_ss220/jobs/code/job/engineering_jobs.dm @@ -30,8 +30,3 @@ head = /obj/item/clothing/head/soft/orange if("Engineer Student") head = /obj/item/clothing/head/beret/eng - -// Identification jobs for console -/datum/job/engineer/trainee - title = "Trainee Engineer" - hidden_from_job_prefs = TRUE diff --git a/modular_ss220/jobs/code/job/medical_jobs.dm b/modular_ss220/jobs/code/job/medical_jobs.dm index c1f674bb28c7..f0c5a25961d1 100644 --- a/modular_ss220/jobs/code/job/medical_jobs.dm +++ b/modular_ss220/jobs/code/job/medical_jobs.dm @@ -30,8 +30,3 @@ if("Student Medical Doctor") head = /obj/item/clothing/head/surgery/green/light uniform = /obj/item/clothing/under/rank/medical/scrubs/green/light - -// Identification jobs for console -/datum/job/doctor/intern - title = "Intern" - hidden_from_job_prefs = TRUE diff --git a/modular_ss220/jobs/code/job/science_jobs.dm b/modular_ss220/jobs/code/job/science_jobs.dm index b3387f831acc..b57786de1e8f 100644 --- a/modular_ss220/jobs/code/job/science_jobs.dm +++ b/modular_ss220/jobs/code/job/science_jobs.dm @@ -20,8 +20,3 @@ uniform = /obj/item/clothing/under/rank/scientist/student/assistant if(H.gender == FEMALE) uniform = /obj/item/clothing/under/rank/scientist/student/assistant/skirt - -// Identification jobs for console -/datum/job/scientist/student - title = "Student Scientist" - hidden_from_job_prefs = TRUE diff --git a/modular_ss220/jobs/code/job/security_jobs.dm b/modular_ss220/jobs/code/job/security_jobs.dm index 6b5e68ba1cea..5ac303c3ad96 100644 --- a/modular_ss220/jobs/code/job/security_jobs.dm +++ b/modular_ss220/jobs/code/job/security_jobs.dm @@ -24,8 +24,3 @@ uniform = /obj/item/clothing/under/rank/security/cadet/assistant/skirt if("Security Graduate") head = /obj/item/clothing/head/beret/sec - -// Identification jobs for console -/datum/job/officer/cadet - title = "Security Cadet" - hidden_from_job_prefs = TRUE