From c795acc648286b1743637a13660b140124ebebcc Mon Sep 17 00:00:00 2001 From: Darth Sidious Date: Thu, 14 Nov 2024 16:54:52 +0400 Subject: [PATCH 1/3] =?UTF-8?q?=D0=93=D0=BE=D1=82=D0=BE=D0=B2=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/controllers/subsystem/jobs.dm | 3 + code/game/jobs/job/job.dm | 2 + code/game/machinery/computer/card.dm | 65 +++++++++++++++++++ .../modules/mob/dead/new_player/new_player.dm | 13 +++- nano/templates/identification_computer.tmpl | 21 +++++- 5 files changed, 99 insertions(+), 5 deletions(-) diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm index afaaf5e2a345..eb912d5bc623 100644 --- a/code/controllers/subsystem/jobs.dm +++ b/code/controllers/subsystem/jobs.dm @@ -93,6 +93,9 @@ SUBSYSTEM_DEF(job) player.mind.role_alt_title = GetPlayerAltTitle(player, rank) unassigned -= player job.current_positions++ + + if(job.quota == 1) + job.quota = 0 return TRUE Debug("AR has failed, Player: [player], Rank: [rank]") return FALSE diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index a000609deef8..7bb612c59ec2 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -76,6 +76,8 @@ var/flags = 0 + var/quota = 0 //0 is neutral, 1 is wanted, 2 is unwanted + /datum/job/proc/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) return diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index f1830548e4af..932c66e685ab 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -118,6 +118,53 @@ data["fast_modify_region"] = is_skill_competent(user, list(/datum/skill/command = SKILL_LEVEL_PRO)) data["fast_full_access"] = is_skill_competent(user, list(/datum/skill/command = SKILL_LEVEL_MASTER)) + if(mode == 2) + var/list/jobsCategories = list( + "Command" = list(titles = command_positions, color = "#aac1ee"), + "NT Representatives" = list(titles = centcom_positions, color = "#6c7391"), + "Engineering" = list(titles = engineering_positions, color = "#ffd699"), + "Security" = list(titles = security_positions, color = "#ff9999"), + "Miscellaneous" = list(titles = list(), color = "#ffffff"), + "Synthetic" = list(titles = nonhuman_positions, color = "#ccffcc"), + "Service" = list(titles = civilian_positions, color = "#cccccc"), + "Medical" = list(titles = medical_positions, color = "#99ffe6"), + "Science" = list(titles = science_positions, color = "#e6b3e6"), + ) + var/list/categorizedJobs = list() + var/list/categorizedJobsToFront = list() + + for(var/datum/job/job in SSjob.occupations) + if(!job) + continue + var/list/jobList = list(list("name" = job.title, "type" = job.type, "quota" = job.quota)) + var/categorized = FALSE + for(var/jobcat in jobsCategories) + if(!categorizedJobs[jobcat]) + categorizedJobs[jobcat] = list("title" = jobcat, "jobs" = list(), color = jobsCategories[jobcat]["color"]) + var/list/jobs = categorizedJobs[jobcat]["jobs"] + if(job.title in jobsCategories[jobcat]["titles"]) + categorized = TRUE + if(jobcat == "Command") + + if(job.title == "Captain") // Put captain at top of command jobs + jobs.Insert(1, jobList) + else + jobs += jobList + else // Put heads at top of non-command jobs + if(job.title in command_positions) + jobs.Insert(1, jobList) + else + jobs += jobList + if(!categorized) + categorizedJobs["Miscellaneous"]["jobs"] += jobList + + for(var/category in categorizedJobs) + if(!length(categorizedJobs[category]["jobs"])) + continue + categorizedJobsToFront += list(categorizedJobs[category]) + + data["all_jobs"] = categorizedJobsToFront + if (modify && is_centcom()) var/list/all_centcom_access = list() for(var/access in get_all_centcom_access()) @@ -323,6 +370,24 @@ if(datum_account) datum_account.set_salary(0) //no salary + if ("up_quota") + var/job_type = text2path(href_list["quotajob_type"]) + var/datum/job/Job = SSjob.type_occupations[job_type] + if(Job) + if(Job.quota == 1) + Job.quota = 0 + else + Job.quota = 1 + + if ("down_quota") + var/job_type = text2path(href_list["quotajob_type"]) + var/datum/job/Job = SSjob.type_occupations[job_type] + if(Job) + if(Job.quota == 2) + Job.quota = 0 + else + Job.quota = 2 + if (modify) modify.name = text("[modify.registered_name]'s ID Card ([modify.assignment])") diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index bb47108ccf06..b66037c40336 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -393,11 +393,20 @@ for(var/mob/M in player_list) // Only players with the job assigned and AFK for less than 10 minutes count as active if(M.mind && M.client && M.mind.assigned_role == job.title && M.client.inactivity <= 10 * 60 * 10) active++ + var/priority = 0 + var/priority_color = "#ffffff" + switch(job.quota) + if(1) + priority = "!+" + priority_color = "#83bf47" + if(2) + priority = "¡-" + priority_color = "#ee0000" if(job.current_positions && active < job.current_positions) - dat += "[job.title] ([job.current_positions])
(Active: [active])
" + dat += "[priority ? priority : ""] [job.title] ([job.current_positions])
(Active: [active])
" number_of_extra_line_breaks++ else - dat += "[job.title] ([job.current_positions])" + dat += "[priority ? priority : ""] [job.title] ([job.current_positions])" categorizedJobs[jobcat]["jobs"] -= job dat += "
" diff --git a/nano/templates/identification_computer.tmpl b/nano/templates/identification_computer.tmpl index 7a5c517c25ca..2044973dbff3 100644 --- a/nano/templates/identification_computer.tmpl +++ b/nano/templates/identification_computer.tmpl @@ -7,17 +7,32 @@ Thank you for your patience!

{{else}} - {{:helper.link('Access Modification', 'home', {'choice' : 'mode', 'mode_target' : 0}, !data.mode ? 'disabled' : null)}} - {{:helper.link('Crew Manifest', 'folder-open', {'choice' : 'mode', 'mode_target' : 1}, data.mode ? 'disabled' : null)}} + {{:helper.link('Access Modification', 'home', {'choice' : 'mode', 'mode_target' : 0}, data.mode == 0 ? 'disabled' : null)}} + {{:helper.link('Crew Manifest', 'folder-open', {'choice' : 'mode', 'mode_target' : 1}, data.mode == 1 ? 'disabled' : null)}} + {{:helper.link('Quotas', 'star', {'choice' : 'mode', 'mode_target' : 2}, data.mode == 2 ? 'disabled' : null)}} {{:helper.link('Print', 'print', {'choice' : 'print'}, (data.mode || data.has_modify) ? null : 'disabled')}} - {{if data.mode}} + {{if data.mode == 1}}

Crew Manifest

{{:data.manifest}}
+ {{else data.mode == 2}} +
+ {{for data.all_jobs:category:categ_num}} +
{{:category.title}} + {{for data.all_jobs[categ_num].jobs:job}} +
+ {{:helper.link('', 'arrowthick-1-n', {'choice' : "up_quota", 'quotajob_type' : job.type}, null, job.quota == 1 ? 'selected' : null, null)}} + {{:helper.link('', 'arrowthick-1-s', {'choice' : "down_quota", 'quotajob_type' : job.type}, null, job.quota == 2 ? 'selected' : null, null)}} + {{:job.name}} +
+ {{/for}} +

+ {{/for}} +
{{else}}

Access Modification

From 884bec77f1ad2aa727851f81778014eeb61870a8 Mon Sep 17 00:00:00 2001 From: Darth Sidious Date: Fri, 15 Nov 2024 18:36:54 +0400 Subject: [PATCH 2/3] =?UTF-8?q?=D0=92=D1=81=D0=BF=D0=BB=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D1=8E=D1=89=D0=B0=D1=8F=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0?= =?UTF-8?q?=D0=B7=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Сделал всплывающую подсказку что появляется при наведении на профессии что "требуются" или "не требуются". --- code/modules/mob/dead/new_player/new_player.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index b66037c40336..691f5d97a21b 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -394,19 +394,22 @@ if(M.mind && M.client && M.mind.assigned_role == job.title && M.client.inactivity <= 10 * 60 * 10) active++ var/priority = 0 + var/priorityMessage = "" var/priority_color = "#ffffff" switch(job.quota) if(1) priority = "!+" priority_color = "#83bf47" + priorityMessage = "Требуется" if(2) priority = "¡-" priority_color = "#ee0000" + priorityMessage = "Не требуется" if(job.current_positions && active < job.current_positions) - dat += "[priority ? priority : ""] [job.title] ([job.current_positions])
(Active: [active])
" + dat += "[priority ? priority : ""] [job.title] ([job.current_positions])
(Active: [active])
" number_of_extra_line_breaks++ else - dat += "[priority ? priority : ""] [job.title] ([job.current_positions])" + dat += "[priority ? priority : ""] [job.title] ([job.current_positions])" categorizedJobs[jobcat]["jobs"] -= job dat += "
" From 083c5baceae4b896b4e2c8434d1414c79607cca2 Mon Sep 17 00:00:00 2001 From: Darth Sidious Date: Tue, 26 Nov 2024 18:12:50 +0400 Subject: [PATCH 3/3] =?UTF-8?q?=D0=92=D1=8B=D0=B4=D0=B5=D0=BB=D0=B8=D0=BB?= =?UTF-8?q?=20=D1=86=D0=B8=D1=84=D0=B5=D1=80=D0=BA=D0=B8=20=D0=BA=D0=B2?= =?UTF-8?q?=D0=BE=D1=82=D1=8B=20=D0=B2=20=D0=94=D0=B5=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Убрал цифры в Дефайн. --- code/__DEFINES/misc.dm | 4 ++++ code/controllers/subsystem/jobs.dm | 4 ++-- code/game/jobs/job/job.dm | 2 +- code/game/machinery/computer/card.dm | 12 ++++++------ code/modules/mob/dead/new_player/new_player.dm | 4 ++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 0dfee4494782..9aea1ef82eca 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -415,3 +415,7 @@ #define SMOOTH_ADAPTERS_WALLS_FOR_WALLS list( \ /obj/machinery/door/airlock = "wall", \ ) + +#define QUOTA_NEUTRAL 0 +#define QUOTA_WANTED 1 +#define QUOTA_UNWANTED 2 diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm index eb912d5bc623..3f6802897e13 100644 --- a/code/controllers/subsystem/jobs.dm +++ b/code/controllers/subsystem/jobs.dm @@ -94,8 +94,8 @@ SUBSYSTEM_DEF(job) unassigned -= player job.current_positions++ - if(job.quota == 1) - job.quota = 0 + if(job.quota == QUOTA_WANTED) + job.quota = QUOTA_NEUTRAL return TRUE Debug("AR has failed, Player: [player], Rank: [rank]") return FALSE diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 7bb612c59ec2..abae22694fd7 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -76,7 +76,7 @@ var/flags = 0 - var/quota = 0 //0 is neutral, 1 is wanted, 2 is unwanted + var/quota = QUOTA_NEUTRAL /datum/job/proc/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) return diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 932c66e685ab..b9e8a5a31778 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -374,19 +374,19 @@ var/job_type = text2path(href_list["quotajob_type"]) var/datum/job/Job = SSjob.type_occupations[job_type] if(Job) - if(Job.quota == 1) - Job.quota = 0 + if(Job.quota == QUOTA_WANTED) + Job.quota = QUOTA_NEUTRAL else - Job.quota = 1 + Job.quota = QUOTA_WANTED if ("down_quota") var/job_type = text2path(href_list["quotajob_type"]) var/datum/job/Job = SSjob.type_occupations[job_type] if(Job) - if(Job.quota == 2) - Job.quota = 0 + if(Job.quota == QUOTA_UNWANTED) + Job.quota = QUOTA_NEUTRAL else - Job.quota = 2 + Job.quota = QUOTA_UNWANTED if (modify) modify.name = text("[modify.registered_name]'s ID Card ([modify.assignment])") diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 691f5d97a21b..44274ea94e99 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -397,11 +397,11 @@ var/priorityMessage = "" var/priority_color = "#ffffff" switch(job.quota) - if(1) + if(QUOTA_WANTED) priority = "!+" priority_color = "#83bf47" priorityMessage = "Требуется" - if(2) + if(QUOTA_UNWANTED) priority = "¡-" priority_color = "#ee0000" priorityMessage = "Не требуется"