diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm
index de410f7102c..7a2c6b1ec18 100644
--- a/code/modules/mob/new_player/preferences.dm
+++ b/code/modules/mob/new_player/preferences.dm
@@ -214,14 +214,48 @@ datum/preferences
user << browse(dat, "window=preferences;size=300x710")
- proc/SetChoices(mob/user, changedjob)
+ proc/SetChoices(mob/user, limit = 17, list/splitJobs, width = 550, height = 500)
+ //limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice.
+ //splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice.
+ //width - Screen' width. Defaults to 550 to make it look nice.
+ //height - Screen's height. Defaults to 500 to make it look nice.
+
+ // Modify this if you added more jobs and it looks like a mess. Add the jobs in the splitJobs that you want to trigger and intitate a new table.
+
+ if(splitJobs == null)
+ if (ticker.current_state >= GAME_STATE_PLAYING
+)
+ splitJobs = list()
+ else
+ splitJobs = list("Chief Engineer")
+
+
var/HTML = "
"
HTML += ""
- HTML += "Choose occupation chances
Unavailable occupations are in red.
"
- HTML += ""
+ HTML += "Choose occupation chances
Unavailable occupations are in red.
"
+ HTML += "\[Done\]
" // Easier to press up here.
+ HTML += "" // 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
+
for(var/datum/job/job in job_master.occupations)
+
+ 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
+
HTML += "| "
var/rank = job.title
+ lastJob = job
if(jobban_isbanned(user, rank))
HTML += "[rank] | \[BANNED] | "
continue
@@ -255,12 +289,12 @@ datum/preferences
HTML += " \[NEVER]"
HTML += ""
- HTML += " "
- HTML += "\[Done\]"
+ HTML += " |
|
"
+
HTML += ""
user << browse(null, "window=preferences")
- user << browse(HTML, "window=mob_occupation;size=320x600")
+ user << browse(HTML, "window=mob_occupation;size=[width]x[height]")
return