From d0d51222e1f2dd54cf092591dc7306a082c9cd7a Mon Sep 17 00:00:00 2001 From: VitrescentTortoise Date: Sun, 26 May 2013 18:18:41 -0700 Subject: [PATCH 1/3] Allows players to return to lobby if job prefernces unavailable --- code/game/gamemodes/gameticker.dm | 2 ++ code/game/jobs/job_controller.dm | 17 ++++++++++--- code/modules/client/preferences.dm | 27 ++++++++++++++++----- code/modules/client/preferences_savefile.dm | 6 ++--- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 305687656be..a06678a92da 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -264,6 +264,8 @@ var/global/datum/controller/gameticker/ticker if(player.mind.assigned_role=="AI") player.close_spawn_windows() player.AIize() + else if(!player.mind.assigned_role) + continue else player.create_character() del(player) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 1dea42fe849..4585837f802 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -1,5 +1,9 @@ var/global/datum/controller/occupations/job_master +#define GET_RANDOM_JOB 0 +#define BE_ASSISTANT 1 +#define RETURN_TO_LOBBY 2 + /datum/controller/occupations //List of all jobs var/list/occupations = list() @@ -270,9 +274,8 @@ var/global/datum/controller/occupations/job_master // Hand out random jobs to the people who didn't get any in the last check // Also makes sure that they got their preference correct for(var/mob/new_player/player in unassigned) - if(player.client.prefs.userandomjob) + if(player.client.prefs.alternate_option == GET_RANDOM_JOB) GiveRandomJob(player) - /* Old job system for(var/level = 1 to 3) @@ -297,8 +300,14 @@ var/global/datum/controller/occupations/job_master // For those who wanted to be assistant if their preferences were filled, here you go. for(var/mob/new_player/player in unassigned) - Debug("AC2 Assistant located, Player: [player]") - AssignRole(player, "Assistant") + if(player.client.prefs.alternate_option == BE_ASSISTANT) + Debug("AC2 Assistant located, Player: [player]") + AssignRole(player, "Assistant") + + //For ones returning to lobby + for(var/mob/new_player/player in unassigned) + if(player.client.prefs.alternate_option == RETURN_TO_LOBBY) + unassigned -= player return 1 diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 4799dcffbc4..20a45e3da7e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -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 += "" - HTML += "

Get random job if preferences unavailable" : "red>Be assistant if preference unavailable"]

" + switch(alternate_option) + if(GET_RANDOM_JOB) + HTML += "

Get random job if preferences unavailable

" + if(BE_ASSISTANT) + HTML += "

Be assistant if preference unavailable

" + if(RETURN_TO_LOBBY) + HTML += "

Return to lobby if prefernce unavailable

" + else return; + HTML += "
\[Reset\]
" HTML += "" @@ -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"]) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index bb6718e3dd5..d151999e654 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -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 From aa68ac375a2b69ddaa9de444ef4bc176e60188ab Mon Sep 17 00:00:00 2001 From: VitrescentTortoise Date: Sun, 26 May 2013 19:00:55 -0700 Subject: [PATCH 2/3] Edited changelog, made small edit. --- code/modules/client/preferences.dm | 1 - html/changelog.html | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 20a45e3da7e..8f15102cdd1 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -450,7 +450,6 @@ datum/preferences HTML += "

Be assistant if preference unavailable

" if(RETURN_TO_LOBBY) HTML += "

Return to lobby if prefernce unavailable

" - else return; HTML += "
\[Reset\]
" HTML += "" diff --git a/html/changelog.html b/html/changelog.html index 30d9f62c640..914b512281f 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -58,6 +58,13 @@ Stuff which is in development and not yet visible to players or just code relate should be listed in the changelog upon commit though. Thanks. -->
+
+

May 26th, 2013

+

VitrescentTortoise updated:

+
    +
  • Added a third option for not getting any job preferences. It allows you to return to the lobby instead of joining.
  • +
+

21 May 2013

From dd083ae97ce6d1894e7d74362fb3ea1d86c3fd15 Mon Sep 17 00:00:00 2001 From: VitrescentTortoise Date: Sun, 26 May 2013 19:30:49 -0700 Subject: [PATCH 3/3] Fixing changelog. --- html/changelog.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/changelog.html b/html/changelog.html index 01fee615d04..a0872df444b 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -57,8 +57,9 @@ Stuff which is in development and not yet visible to players or just code relate (ie. code improvements for expandability, etc.) should not be listed here. They should be listed in the changelog upon commit though. Thanks. --> -<<<<<<< HEAD - + + +

26th May 2013

Chinsky updated:

@@ -94,7 +95,6 @@ should be listed in the changelog upon commit though. Thanks. -->
  • Added lock down buttons to the wardens office.
  • The randomized barsign has made a return.
  • Syndicate Agent ID's external airlock access restored.
  • ->>>>>>> bleeding-edge-freeze