mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Allows players to return to lobby if job prefernces unavailable
This commit is contained in:
@@ -19,6 +19,10 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set
|
||||
|
||||
var/const/MAX_SAVE_SLOTS = 10
|
||||
|
||||
//used for alternate_option
|
||||
#define GET_RANDOM_JOB 0
|
||||
#define BE_ASSISTANT 1
|
||||
#define RETURN_TO_LOBBY 2
|
||||
|
||||
datum/preferences
|
||||
//doohickeys for savefiles
|
||||
@@ -32,7 +36,6 @@ datum/preferences
|
||||
var/last_ip
|
||||
var/last_id
|
||||
|
||||
|
||||
//game-preferences
|
||||
var/lastchangelog = "" //Saved changlog filesize to detect if there was a change
|
||||
var/ooccolor = "#b82e00"
|
||||
@@ -79,9 +82,8 @@ datum/preferences
|
||||
var/job_engsec_med = 0
|
||||
var/job_engsec_low = 0
|
||||
|
||||
// Want randomjob if preferences already filled - Donkie
|
||||
var/userandomjob = 1 //defaults to 1 for fewer assistants
|
||||
|
||||
//Keeps track of preferrence for not getting any wanted jobs
|
||||
var/alternate_option = 0
|
||||
|
||||
var/used_skillpoints = 0
|
||||
var/skill_specialization = null
|
||||
@@ -441,7 +443,15 @@ datum/preferences
|
||||
|
||||
HTML += "</center></table>"
|
||||
|
||||
HTML += "<center><br><u><a href='?_src_=prefs;preference=job;task=random'><font color=[userandomjob ? "green>Get random job if preferences unavailable" : "red>Be assistant if preference unavailable"]</font></a></u></center><br>"
|
||||
switch(alternate_option)
|
||||
if(GET_RANDOM_JOB)
|
||||
HTML += "<center><br><u><a href='?_src_=prefs;preference=job;task=random'><font color=green>Get random job if preferences unavailable</font></a></u></center><br>"
|
||||
if(BE_ASSISTANT)
|
||||
HTML += "<center><br><u><a href='?_src_=prefs;preference=job;task=random'><font color=red>Be assistant if preference unavailable</font></a></u></center><br>"
|
||||
if(RETURN_TO_LOBBY)
|
||||
HTML += "<center><br><u><a href='?_src_=prefs;preference=job;task=random'><font color=purple>Return to lobby if prefernce unavailable</font></a></u></center><br>"
|
||||
else return;
|
||||
|
||||
HTML += "<center><a href='?_src_=prefs;preference=job;task=reset'>\[Reset\]</a></center>"
|
||||
HTML += "</tt>"
|
||||
|
||||
@@ -641,7 +651,12 @@ datum/preferences
|
||||
ResetJobs()
|
||||
SetChoices(user)
|
||||
if("random")
|
||||
userandomjob = !userandomjob
|
||||
if(alternate_option == GET_RANDOM_JOB || alternate_option == BE_ASSISTANT)
|
||||
alternate_option += 1
|
||||
else if(alternate_option == RETURN_TO_LOBBY)
|
||||
alternate_option = 0
|
||||
else
|
||||
return 0
|
||||
SetChoices(user)
|
||||
if ("alt_title")
|
||||
var/datum/job/job = locate(href_list["job"])
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
S["b_type"] >> b_type
|
||||
|
||||
//Jobs
|
||||
S["userandomjob"] >> userandomjob
|
||||
S["alternate_option"] >> alternate_option
|
||||
S["job_civilian_high"] >> job_civilian_high
|
||||
S["job_civilian_med"] >> job_civilian_med
|
||||
S["job_civilian_low"] >> job_civilian_low
|
||||
@@ -173,7 +173,7 @@
|
||||
backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag))
|
||||
b_type = sanitize_text(b_type, initial(b_type))
|
||||
|
||||
userandomjob = sanitize_integer(userandomjob, 0, 1, initial(userandomjob))
|
||||
alternate_option = sanitize_integer(alternate_option, 0, 2, initial(alternate_option))
|
||||
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
|
||||
job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med))
|
||||
job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low))
|
||||
@@ -223,7 +223,7 @@
|
||||
S["b_type"] << b_type
|
||||
|
||||
//Jobs
|
||||
S["userandomjob"] << userandomjob
|
||||
S["alternate_option"] << alternate_option
|
||||
S["job_civilian_high"] << job_civilian_high
|
||||
S["job_civilian_med"] << job_civilian_med
|
||||
S["job_civilian_low"] << job_civilian_low
|
||||
|
||||
Reference in New Issue
Block a user