From eb623ebdd6bb719fec72be0f39e27cd615ea6db1 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Tue, 5 Feb 2019 19:57:26 -0600 Subject: [PATCH] Pretty late join menu memes (#7978) * initial things, need to clean up bhjin snowflake * idk how to fix it Links work, but it doesn't play nice with the loop. * Update new_player.dm don't actually need job_count, tbh I think * working as intended * deletes brazil --- .../modules/mob/dead/new_player/new_player.dm | 105 +++++++++++------- 1 file changed, 67 insertions(+), 38 deletions(-) diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 9ced3a41e8..84be6438c0 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -442,58 +442,87 @@ var/available_job_count = 0 for(var/datum/job/job in SSjob.occupations) if(job && IsJobUnavailable(job.title, TRUE) == JOB_AVAILABLE) - available_job_count++; + available_job_count++ for(var/spawner in GLOB.mob_spawners) available_job_count++ + break - for(var/datum/job/prioritized_job in SSjob.prioritized_jobs) - if(prioritized_job.current_positions >= prioritized_job.total_positions) - SSjob.prioritized_jobs -= prioritized_job + if(!available_job_count) + dat += "
There are currently no open positions!
" - if(length(SSjob.prioritized_jobs)) - dat += "
The station has flagged these jobs as high priority:
" - var/amt = length(SSjob.prioritized_jobs) - var/amt_count - for(var/datum/job/a in SSjob.prioritized_jobs) - amt_count++ - if(amt_count != amt) // checks for the last job added. - dat += " [a.title], " - else - dat += " [a.title].
" + else + dat += "
Choose from the following open positions:

" + var/list/categorizedJobs = list( + "Command" = list(jobs = list(), titles = GLOB.command_positions, color = "#aac1ee"), + "Engineering" = list(jobs = list(), titles = GLOB.engineering_positions, color = "#ffd699"), + "Supply" = list(jobs = list(), titles = GLOB.supply_positions, color = "#ead4ae"), + "Miscellaneous" = list(jobs = list(), titles = list(), color = "#ffffff", colBreak = TRUE), + "Ghost Role" = list(jobs = list(), titles = GLOB.mob_spawners, color = "#ffffff"), + "Synthetic" = list(jobs = list(), titles = GLOB.nonhuman_positions, color = "#ccffcc"), + "Service" = list(jobs = list(), titles = GLOB.civilian_positions, color = "#cccccc"), + "Medical" = list(jobs = list(), titles = GLOB.medical_positions, color = "#99ffe6", colBreak = TRUE), + "Science" = list(jobs = list(), titles = GLOB.science_positions, color = "#e6b3e6"), + "Security" = list(jobs = list(), titles = GLOB.security_positions, color = "#ff9999"), + ) + for(var/spawner in GLOB.mob_spawners) + categorizedJobs["Ghost Role"]["jobs"] += spawner - dat += "
Choose from the following open positions:

" - dat += "(G) - Ghost Role
" - dat += "
" - var/job_count = 0 - for(var/datum/job/job in SSjob.occupations) - if(job && IsJobUnavailable(job.title, TRUE) == JOB_AVAILABLE) - job_count++; - if (job_count > round(available_job_count / 2)) - dat += "
" - var/position_class = "otherPosition" - if (job.title in GLOB.command_positions) - position_class = "commandPosition" - dat += "[job.title] ([job.current_positions])
" - if(!job_count) //if there's nowhere to go, overflow opens up. for(var/datum/job/job in SSjob.occupations) - if(job.title != SSjob.overflow_role) + if(job && IsJobUnavailable(job.title, TRUE) == JOB_AVAILABLE) + var/categorized = FALSE + for(var/jobcat in categorizedJobs) + var/list/jobs = categorizedJobs[jobcat]["jobs"] + if(job.title in categorizedJobs[jobcat]["titles"]) + categorized = TRUE + if(jobcat == "Command") + + if(job.title == "Captain") // Put captain at top of command jobs + jobs.Insert(1, job) + else + jobs += job + else // Put heads at top of non-command jobs + if(job.title in GLOB.command_positions) + jobs.Insert(1, job) + else + jobs += job + if(!categorized) + categorizedJobs["Miscellaneous"]["jobs"] += job + + + dat += "
" + for(var/jobcat in categorizedJobs) + if(categorizedJobs[jobcat]["colBreak"]) + dat += "" + if(!length(categorizedJobs[jobcat]["jobs"])) continue - dat += "[job.title] ([job.current_positions])
" - break - for(var/spawner in GLOB.mob_spawners) - job_count++ - if(job_count > round(available_job_count / 2)) - dat += "[spawner] (G)
" - dat += "" + var/color = categorizedJobs[jobcat]["color"] + dat += "
" + dat += "[jobcat]" + for(var/datum/job/job in categorizedJobs[jobcat]["jobs"]) + var/position_class = "otherPosition" + if(job.title in GLOB.command_positions) + position_class = "commandPosition" + if(job in SSjob.prioritized_jobs) + dat += "[job.title] ([job.current_positions])" + else + dat += "[job.title] ([job.current_positions])" + categorizedJobs[jobcat]["jobs"] -= job + + for(var/spawner in categorizedJobs[jobcat]["jobs"]) + dat += "[spawner]" + + dat += "

" + dat += "
" + dat += "
" // Removing the old window method but leaving it here for reference //src << browse(dat, "window=latechoices;size=300x640;can_close=1") // Added the new browser window method - var/datum/browser/popup = new(src, "latechoices", "Choose Profession", 440, 500) + var/datum/browser/popup = new(src, "latechoices", "Choose Profession", 680, 580) popup.add_stylesheet("playeroptions", 'html/browser/playeroptions.css') popup.set_content(dat) - popup.open(0) // 0 is passed to open so that it doesn't use the onclose() proc + popup.open(FALSE) // FALSE is passed to open so that it doesn't use the onclose() proc /mob/dead/new_player/proc/create_character(transfer_after)