" // Table within a table for alignment, also allows you to easily add more colomns.
+ html += ""
+ var/index = -1
- //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
- var/datum/job/lastJob
- if(!SSjobs)
- return
- for(var/datum/job/job in SSjobs.occupations)
+ //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
+ var/datum/job/lastJob
+ if(!SSjobs)
+ return
+ for(var/J in SSjobs.occupations)
+ var/datum/job/job = J
- if(job.admin_only)
- continue
+ if(job.admin_only)
+ continue
- if(job.hidden_from_job_prefs)
- continue
+ if(job.hidden_from_job_prefs)
+ continue
- index += 1
- if((index >= limit) || (job.title in splitJobs))
- if((index < limit) && (lastJob != null))
- //If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with
- //the last job's selection color. Creating a rather nice effect.
- for(var/i = 0, i < (limit - index), i += 1)
- HTML += "|   |   | "
- HTML += " | "
- index = 0
+ index += 1
+ if((index >= limit) || (job.title in splitJobs))
+ if((index < limit) && (lastJob != null))
+ // Dynamic window width
+ width += widthPerColumn
+ //If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with
+ //the last job's selection color. Creating a rather nice effect.
+ for(var/i in 1 to limit - index)
+ html += "|   |   | "
+ html += " | "
+ index = 0
- HTML += "| "
- var/rank = job.title
- lastJob = job
- if(!is_job_whitelisted(user, rank))
- HTML += "[rank] | \[KARMA] | "
- continue
- if(jobban_isbanned(user, rank))
- HTML += "[rank] \[BANNED] | "
- continue
- var/available_in_playtime = job.available_in_playtime(user.client)
- if(available_in_playtime)
- HTML += "[rank] \[ " + get_exp_format(available_in_playtime) + " as " + job.get_exp_req_type() + " \] | "
- continue
- if(job.barred_by_disability(user.client))
- HTML += "[rank] \[ DISABILITY \] | "
- continue
- if(!job.player_old_enough(user.client))
- var/available_in_days = job.available_in_days(user.client)
- HTML += "[rank] \[IN [(available_in_days)] DAYS] | "
- continue
- if((job_support_low & JOB_CIVILIAN) && (rank != "Civilian"))
- HTML += "[rank] | "
- continue
- if((rank in GLOB.command_positions) || (rank == "AI"))//Bold head jobs
- HTML += "[rank]"
- else
- HTML += "[rank]"
-
- HTML += ""
-
- var/prefLevelLabel = "ERROR"
- var/prefLevelColor = "pink"
- var/prefUpperLevel = -1 // level to assign on left click
- var/prefLowerLevel = -1 // level to assign on right click
-
- if(GetJobDepartment(job, 1) & job.flag)
- prefLevelLabel = "High"
- prefLevelColor = "slateblue"
- prefUpperLevel = 4
- prefLowerLevel = 2
- else if(GetJobDepartment(job, 2) & job.flag)
- prefLevelLabel = "Medium"
- prefLevelColor = "green"
- prefUpperLevel = 1
- prefLowerLevel = 3
- else if(GetJobDepartment(job, 3) & job.flag)
- prefLevelLabel = "Low"
- prefLevelColor = "orange"
- prefUpperLevel = 2
- prefLowerLevel = 4
- else
- prefLevelLabel = "NEVER"
- prefLevelColor = "red"
- prefUpperLevel = 3
- prefLowerLevel = 1
-
-
- HTML += ""
-
-// HTML += ""
-
- if(rank == "Civilian")//Civilian is special
- if(job_support_low & JOB_CIVILIAN)
- HTML += " \[Yes]"
- else
- HTML += " \[No]"
+ html += " | "
+ var/rank
if(job.alt_titles)
- HTML += " \[[GetPlayerAltTitle(job)]\] | "
- HTML += ""
- continue
-/*
- if(GetJobDepartment(job, 1) & job.flag)
- HTML += " \[High]"
- else if(GetJobDepartment(job, 2) & job.flag)
- HTML += " \[Medium]"
- else if(GetJobDepartment(job, 3) & job.flag)
- HTML += " \[Low]"
- else
- HTML += " \[NEVER]"
- */
- HTML += "[prefLevelLabel]"
+ rank = "[GetPlayerAltTitle(job)]"
+ else
+ rank = job.title
+ lastJob = job
+ if(!is_job_whitelisted(user, job.title))
+ html += "[rank] \[KARMA] | "
+ continue
+ if(jobban_isbanned(user, job.title))
+ html += "[rank] \[BANNED] | "
+ continue
+ var/available_in_playtime = job.available_in_playtime(user.client)
+ if(available_in_playtime)
+ html += "[rank] \[" + get_exp_format(available_in_playtime) + " as " + job.get_exp_req_type() + "\] | "
+ continue
+ if(job.barred_by_disability(user.client))
+ html += "[rank] \[DISABILITY\] | "
+ continue
+ if(!job.player_old_enough(user.client))
+ var/available_in_days = job.available_in_days(user.client)
+ html += "[rank] \[IN [(available_in_days)] DAYS] | "
+ continue
+ if((job_support_low & JOB_CIVILIAN) && (job.title != "Civilian"))
+ html += "[rank] | "
+ continue
+ if((job.title in GLOB.command_positions) || (job.title == "AI"))//Bold head jobs
+ html += "[rank]"
+ else
+ html += "[rank]"
- if(job.alt_titles)
- HTML += " \[[GetPlayerAltTitle(job)]\]"
+ html += ""
+
+ var/prefLevelLabel = "ERROR"
+ var/prefLevelColor = "pink"
+ var/prefUpperLevel = -1 // level to assign on left click
+ var/prefLowerLevel = -1 // level to assign on right click
+
+ if(GetJobDepartment(job, 1) & job.flag)
+ prefLevelLabel = "High"
+ prefLevelColor = "slateblue"
+ prefUpperLevel = 4
+ prefLowerLevel = 2
+ else if(GetJobDepartment(job, 2) & job.flag)
+ prefLevelLabel = "Medium"
+ prefLevelColor = "green"
+ prefUpperLevel = 1
+ prefLowerLevel = 3
+ else if(GetJobDepartment(job, 3) & job.flag)
+ prefLevelLabel = "Low"
+ prefLevelColor = "orange"
+ prefUpperLevel = 2
+ prefLowerLevel = 4
+ else
+ prefLevelLabel = "NEVER"
+ prefLevelColor = "red"
+ prefUpperLevel = 3
+ prefLowerLevel = 1
- HTML += " | "
+ html += ""
- for(var/i = 1, i < (limit - index), i += 1) // Finish the column so it is even
- HTML += "|   |   | "
+ // HTML += ""
- HTML += " "
+ if(job.title == "Civilian")//Civilian is special
+ if(job_support_low & JOB_CIVILIAN)
+ html += " Yes"
+ else
+ html += " No"
+ html += " |
"
+ continue
+ /*
+ if(GetJobDepartment(job, 1) & job.flag)
+ HTML += "