mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-22 04:24:20 +01:00
Merge pull request #11384 from Kyep/no_free_jobs
Adds error message when trying to join with no free job slots
This commit is contained in:
@@ -464,8 +464,7 @@
|
||||
dat += " [a.title]. </font><br>"
|
||||
|
||||
|
||||
dat += "Choose from the following open positions:<br><br>"
|
||||
|
||||
var/num_jobs_available = 0
|
||||
var/list/activePlayers = list()
|
||||
var/list/categorizedJobs = list(
|
||||
"Command" = list(jobs = list(), titles = command_positions, color = "#aac1ee"),
|
||||
@@ -480,6 +479,7 @@
|
||||
)
|
||||
for(var/datum/job/job in SSjobs.occupations)
|
||||
if(job && IsJobAvailable(job.title) && !job.barred_by_disability(client))
|
||||
num_jobs_available++
|
||||
activePlayers[job] = 0
|
||||
var/categorized = 0
|
||||
// Only players with the job assigned and AFK for less than 10 minutes count as active
|
||||
@@ -502,23 +502,27 @@
|
||||
if(!categorized)
|
||||
categorizedJobs["Miscellaneous"]["jobs"] += job
|
||||
|
||||
dat += "<table><tr><td valign='top'>"
|
||||
for(var/jobcat in categorizedJobs)
|
||||
if(categorizedJobs[jobcat]["colBreak"])
|
||||
dat += "</td><td valign='top'>"
|
||||
if(length(categorizedJobs[jobcat]["jobs"]) < 1)
|
||||
continue
|
||||
var/color = categorizedJobs[jobcat]["color"]
|
||||
dat += "<fieldset style='border: 2px solid [color]; display: inline'>"
|
||||
dat += "<legend align='center' style='color: [color]'>[jobcat]</legend>"
|
||||
for(var/datum/job/job in categorizedJobs[jobcat]["jobs"])
|
||||
if(job in SSjobs.prioritized_jobs)
|
||||
dat += "<a href='byond://?src=[UID()];SelectedJob=[job.title]'><font color='lime'><B>[job.title] ([job.current_positions]) (Active: [activePlayers[job]])</B></font></a><br>"
|
||||
else
|
||||
dat += "<a href='byond://?src=[UID()];SelectedJob=[job.title]'>[job.title] ([job.current_positions]) (Active: [activePlayers[job]])</a><br>"
|
||||
dat += "</fieldset><br>"
|
||||
if(num_jobs_available)
|
||||
dat += "Choose from the following open positions:<br><br>"
|
||||
dat += "<table><tr><td valign='top'>"
|
||||
for(var/jobcat in categorizedJobs)
|
||||
if(categorizedJobs[jobcat]["colBreak"])
|
||||
dat += "</td><td valign='top'>"
|
||||
if(length(categorizedJobs[jobcat]["jobs"]) < 1)
|
||||
continue
|
||||
var/color = categorizedJobs[jobcat]["color"]
|
||||
dat += "<fieldset style='border: 2px solid [color]; display: inline'>"
|
||||
dat += "<legend align='center' style='color: [color]'>[jobcat]</legend>"
|
||||
for(var/datum/job/job in categorizedJobs[jobcat]["jobs"])
|
||||
if(job in SSjobs.prioritized_jobs)
|
||||
dat += "<a href='byond://?src=[UID()];SelectedJob=[job.title]'><font color='lime'><B>[job.title] ([job.current_positions]) (Active: [activePlayers[job]])</B></font></a><br>"
|
||||
else
|
||||
dat += "<a href='byond://?src=[UID()];SelectedJob=[job.title]'>[job.title] ([job.current_positions]) (Active: [activePlayers[job]])</a><br>"
|
||||
dat += "</fieldset><br>"
|
||||
|
||||
dat += "</td></tr></table></center>"
|
||||
dat += "</td></tr></table></center>"
|
||||
else
|
||||
dat += "<br><br><center>Unfortunately, there are no job slots free currently.<BR>Wait a few minutes, then try again.<BR>Or, try observing the round.</center>"
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user