mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Removed one line ifs and elses. (#11389)
This commit is contained in:
@@ -73,10 +73,14 @@
|
||||
I.write("<small>[time_stamp()] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br />")
|
||||
|
||||
switch(href_list["_src_"])
|
||||
if("holder") hsrc = holder
|
||||
if("usr") hsrc = mob
|
||||
if("prefs") return prefs.process_link(usr,href_list)
|
||||
if("vars") return view_var_Topic(href,href_list,hsrc)
|
||||
if("holder")
|
||||
hsrc = holder
|
||||
if("usr")
|
||||
hsrc = mob
|
||||
if("prefs")
|
||||
return prefs.process_link(usr,href_list)
|
||||
if("vars")
|
||||
return view_var_Topic(href,href_list,hsrc)
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("openLink")
|
||||
@@ -138,8 +142,10 @@
|
||||
|
||||
if(connection != "seeker") //Invalid connection type.
|
||||
if(connection == "web")
|
||||
if(!holder) return null
|
||||
else return null
|
||||
if(!holder)
|
||||
return null
|
||||
else
|
||||
return null
|
||||
|
||||
if(byond_version < MIN_CLIENT_VERSION) //Out of date client.
|
||||
message_admins("[key]/[ckey] has connected with an out of date client! Their version: [byond_version]. They will be kicked shortly.")
|
||||
@@ -155,7 +161,8 @@
|
||||
// Change the way they should download resources.
|
||||
if(config.resource_urls)
|
||||
src.preload_rsc = pick(config.resource_urls)
|
||||
else src.preload_rsc = 1 // If config.resource_urls is not set, preload like normal.
|
||||
else
|
||||
src.preload_rsc = 1 // If config.resource_urls is not set, preload like normal.
|
||||
|
||||
to_chat(src, "<span class='warning'>If the title screen is black, resources are still downloading. Please be patient until the title screen appears.</span>")
|
||||
|
||||
@@ -357,7 +364,8 @@
|
||||
//checks if a client is afk
|
||||
//3000 frames = 5 minutes
|
||||
/client/proc/is_afk(duration=3000)
|
||||
if(inactivity > duration) return inactivity
|
||||
if(inactivity > duration)
|
||||
return inactivity
|
||||
return 0
|
||||
|
||||
/client/verb/resend_resources()
|
||||
|
||||
@@ -379,12 +379,14 @@ var/const/MAX_SAVE_SLOTS = 8
|
||||
}
|
||||
|
||||
function mouseUp(event,levelup,leveldown,rank){
|
||||
if(event.button == 0){
|
||||
if(event.button == 0)
|
||||
{
|
||||
//alert("left click " + levelup + " " + rank);
|
||||
setJobPrefRedirect(1, rank);
|
||||
return false;
|
||||
}
|
||||
if(event.button == 2){
|
||||
if(event.button == 2)
|
||||
{
|
||||
//alert("right click " + leveldown + " " + rank);
|
||||
setJobPrefRedirect(0, rank);
|
||||
return false;
|
||||
@@ -407,7 +409,8 @@ var/const/MAX_SAVE_SLOTS = 8
|
||||
|
||||
//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 (!job_master) return
|
||||
if (!job_master)
|
||||
return
|
||||
for(var/datum/job/job in job_master.occupations)
|
||||
index += 1
|
||||
if((index >= limit) || (job.title in splitJobs))
|
||||
@@ -527,7 +530,8 @@ var/const/MAX_SAVE_SLOTS = 8
|
||||
return
|
||||
|
||||
/datum/preferences/proc/ShowChoices(mob/user)
|
||||
if(!user || !user.client) return
|
||||
if(!user || !user.client)
|
||||
return
|
||||
update_preview_icon()
|
||||
var/preview_front = fcopy_rsc(preview_icon_front)
|
||||
var/preview_side = fcopy_rsc(preview_icon_side)
|
||||
@@ -724,7 +728,8 @@ var/const/MAX_SAVE_SLOTS = 8
|
||||
job_engsec_low = 0
|
||||
|
||||
/datum/preferences/proc/GetJobDepartment(var/datum/job/job, var/level)
|
||||
if(!job || !level) return 0
|
||||
if(!job || !level)
|
||||
return 0
|
||||
switch(job.department_flag)
|
||||
if(CIVILIAN)
|
||||
switch(level)
|
||||
@@ -753,7 +758,8 @@ var/const/MAX_SAVE_SLOTS = 8
|
||||
return 0
|
||||
|
||||
/datum/preferences/proc/SetJobDepartment(var/datum/job/job, var/level)
|
||||
if(!job || !level) return 0
|
||||
if(!job || !level)
|
||||
return 0
|
||||
switch(level)
|
||||
if(1)//Only one of these should ever be active at once so clear them all here
|
||||
job_civilian_high = 0
|
||||
@@ -1312,7 +1318,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
|
||||
)
|
||||
|
||||
var/limb_name = input(user, "Which limb do you want to change?") as null|anything in limb_input
|
||||
if(!limb_name) return
|
||||
if(!limb_name)
|
||||
return
|
||||
|
||||
var/limb = null
|
||||
var/second_limb = null // if you try to change the arm, the hand should also change
|
||||
@@ -1351,7 +1358,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
|
||||
valid_limb_states += "Hook Prosthesis"
|
||||
|
||||
var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in valid_limb_states
|
||||
if(!new_state) return
|
||||
if(!new_state)
|
||||
return
|
||||
|
||||
switch(new_state)
|
||||
if("Normal")
|
||||
@@ -1376,7 +1384,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
|
||||
|
||||
if("organs")
|
||||
var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Heart", "Eyes", "Lungs", "Liver", "Kidneys")
|
||||
if(!organ_name) return
|
||||
if(!organ_name)
|
||||
return
|
||||
|
||||
var/organ = null
|
||||
switch(organ_name)
|
||||
@@ -1392,7 +1401,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
|
||||
organ = "kidneys"
|
||||
|
||||
var/new_state = input(user, "What state do you wish the organ to be in?") as null|anything in list("Normal","Assisted","Mechanical")
|
||||
if(!new_state) return
|
||||
if(!new_state)
|
||||
return
|
||||
|
||||
switch(new_state)
|
||||
if("Normal")
|
||||
@@ -1404,7 +1414,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
|
||||
|
||||
if("skin_style")
|
||||
var/skin_style_name = input(user, "Select a new skin style") as null|anything in list("default1", "default2", "default3")
|
||||
if(!skin_style_name) return
|
||||
if(!skin_style_name)
|
||||
return
|
||||
|
||||
else
|
||||
switch(href_list["preference"])
|
||||
@@ -1432,12 +1443,14 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
|
||||
|
||||
if("UIcolor")
|
||||
var/UI_style_color_new = input(user, "Choose your UI colour, dark colours are not recommended!") as color|null
|
||||
if(!UI_style_color_new) return
|
||||
if(!UI_style_color_new)
|
||||
return
|
||||
UI_style_color = UI_style_color_new
|
||||
|
||||
if("UIalpha")
|
||||
var/UI_style_alpha_new = input(user, "Select a new alpha(transparency) parameter for UI, between 50 and 255") as num
|
||||
if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return
|
||||
if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50))
|
||||
return
|
||||
UI_style_alpha = UI_style_alpha_new
|
||||
|
||||
if("parallax")
|
||||
@@ -1591,7 +1604,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
|
||||
I.mechassist()
|
||||
else if(status == "mechanical")
|
||||
I.mechanize()
|
||||
else continue
|
||||
else
|
||||
continue
|
||||
var/datum/species/chosen_species = all_species[species]
|
||||
if( (disabilities & DISABILITY_FLAG_FAT) && (chosen_species.flags & CAN_BE_FAT) )
|
||||
character.mutations += M_FAT
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
|
||||
|
||||
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
|
||||
if(!ckey) return
|
||||
if(!ckey)
|
||||
return
|
||||
path = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/[filename]"
|
||||
savefile_version = SAVEFILE_VERSION_MAX
|
||||
|
||||
@@ -115,10 +116,13 @@
|
||||
|
||||
|
||||
/datum/preferences/proc/load_preferences()
|
||||
if(!path) return 0
|
||||
if(!fexists(path)) return 0
|
||||
if(!path)
|
||||
return 0
|
||||
if(!fexists(path))
|
||||
return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
if(!S)
|
||||
return 0
|
||||
S.cd = "/"
|
||||
|
||||
S["version"] >> savefile_version
|
||||
@@ -193,9 +197,11 @@
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_preferences()
|
||||
if(!path) return 0
|
||||
if(!path)
|
||||
return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
if(!S)
|
||||
return 0
|
||||
S.cd = "/"
|
||||
|
||||
S["version"] << savefile_version
|
||||
@@ -220,9 +226,11 @@
|
||||
|
||||
//saving volume changes
|
||||
/datum/preferences/proc/save_volume()
|
||||
if(!path) return 0
|
||||
if(!path)
|
||||
return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
if(!S)
|
||||
return 0
|
||||
S.cd = "/"
|
||||
|
||||
S["volume"] << volume
|
||||
@@ -416,10 +424,14 @@ AND players.player_slot = ? ;"}, ckey, slot)
|
||||
metadata = sanitize_text(metadata, initial(metadata))
|
||||
real_name = reject_bad_name(real_name)
|
||||
|
||||
if(isnull(species)) species = "Human"
|
||||
if(isnull(language)) language = "None"
|
||||
if(isnull(nanotrasen_relation)) nanotrasen_relation = initial(nanotrasen_relation)
|
||||
if(!real_name) real_name = random_name(gender,species)
|
||||
if(isnull(species))
|
||||
species = "Human"
|
||||
if(isnull(language))
|
||||
language = "None"
|
||||
if(isnull(nanotrasen_relation))
|
||||
nanotrasen_relation = initial(nanotrasen_relation)
|
||||
if(!real_name)
|
||||
real_name = random_name(gender,species)
|
||||
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
|
||||
gender = sanitize_gender(gender)
|
||||
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
|
||||
@@ -466,11 +478,16 @@ AND players.player_slot = ? ;"}, ckey, slot)
|
||||
WARNING("[__LINE__]: datum/preferences/load_save_sqlite has returned")
|
||||
return 0
|
||||
|
||||
if(!skills) skills = list()
|
||||
if(!used_skillpoints) used_skillpoints= 0
|
||||
if(isnull(disabilities)) disabilities = 0
|
||||
if(!player_alt_titles) player_alt_titles = new()
|
||||
if(!organ_data) src.organ_data = list()
|
||||
if(!skills)
|
||||
skills = list()
|
||||
if(!used_skillpoints)
|
||||
used_skillpoints= 0
|
||||
if(isnull(disabilities))
|
||||
disabilities = 0
|
||||
if(!player_alt_titles)
|
||||
player_alt_titles = new()
|
||||
if(!organ_data)
|
||||
src.organ_data = list()
|
||||
|
||||
if(user)
|
||||
to_chat(user, "Sucessfully loaded [real_name].")
|
||||
@@ -480,7 +497,8 @@ AND players.player_slot = ? ;"}, ckey, slot)
|
||||
|
||||
/datum/preferences/proc/load_save(dir)
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
if(!S)
|
||||
return 0
|
||||
S.cd = dir
|
||||
|
||||
//Character
|
||||
@@ -539,10 +557,14 @@ AND players.player_slot = ? ;"}, ckey, slot)
|
||||
//Sanitize
|
||||
metadata = sanitize_text(metadata, initial(metadata))
|
||||
real_name = reject_bad_name(real_name)
|
||||
if(isnull(species)) species = "Human"
|
||||
if(isnull(language)) language = "None"
|
||||
if(isnull(nanotrasen_relation)) nanotrasen_relation = initial(nanotrasen_relation)
|
||||
if(!real_name) real_name = random_name(gender,species)
|
||||
if(isnull(species))
|
||||
species = "Human"
|
||||
if(isnull(language))
|
||||
language = "None"
|
||||
if(isnull(nanotrasen_relation))
|
||||
nanotrasen_relation = initial(nanotrasen_relation)
|
||||
if(!real_name)
|
||||
real_name = random_name(gender,species)
|
||||
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
|
||||
gender = sanitize_gender(gender)
|
||||
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
|
||||
@@ -572,11 +594,16 @@ AND players.player_slot = ? ;"}, ckey, slot)
|
||||
job_engsec_med = sanitize_integer(job_engsec_med, 0, 65535, initial(job_engsec_med))
|
||||
job_engsec_low = sanitize_integer(job_engsec_low, 0, 65535, initial(job_engsec_low))
|
||||
|
||||
if(!skills) skills = list()
|
||||
if(!used_skillpoints) used_skillpoints= 0
|
||||
if(isnull(disabilities)) disabilities = 0
|
||||
if(!player_alt_titles) player_alt_titles = new()
|
||||
if(!organ_data) src.organ_data = list()
|
||||
if(!skills)
|
||||
skills = list()
|
||||
if(!used_skillpoints)
|
||||
used_skillpoints= 0
|
||||
if(isnull(disabilities))
|
||||
disabilities = 0
|
||||
if(!player_alt_titles)
|
||||
player_alt_titles = new()
|
||||
if(!organ_data)
|
||||
src.organ_data = list()
|
||||
//if(!skin_style) skin_style = "Default"
|
||||
|
||||
|
||||
@@ -596,16 +623,20 @@ AND players.player_slot = ? ;"}, ckey, slot)
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/random_character()
|
||||
if(!path) return 0
|
||||
if(!fexists(path)) return 0
|
||||
if(!path)
|
||||
return 0
|
||||
if(!fexists(path))
|
||||
return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
if(!S)
|
||||
return 0
|
||||
var/list/saves = list()
|
||||
var/name
|
||||
for(var/i=1, i<=MAX_SAVE_SLOTS, i++)
|
||||
S.cd = "/character[i]"
|
||||
S["real_name"] >> name
|
||||
if(!name) continue
|
||||
if(!name)
|
||||
continue
|
||||
saves.Add(S.cd)
|
||||
|
||||
if(!saves.len)
|
||||
@@ -616,12 +647,16 @@ AND players.player_slot = ? ;"}, ckey, slot)
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/load_character(slot)
|
||||
if(!path) return 0
|
||||
if(!fexists(path)) return 0
|
||||
if(!path)
|
||||
return 0
|
||||
if(!fexists(path))
|
||||
return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
if(!S)
|
||||
return 0
|
||||
S.cd = "/"
|
||||
if(!slot) slot = default_slot
|
||||
if(!slot)
|
||||
slot = default_slot
|
||||
slot = sanitize_integer(slot, 1, MAX_SAVE_SLOTS, initial(default_slot))
|
||||
if(slot != default_slot)
|
||||
default_slot = slot
|
||||
@@ -767,9 +802,11 @@ AND players.player_slot = ? ;"}, ckey, slot)
|
||||
/datum/preferences/proc/save_character()
|
||||
|
||||
|
||||
if(!path) return 0
|
||||
if(!path)
|
||||
return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
if(!S)
|
||||
return 0
|
||||
S.cd = "/character[default_slot]"
|
||||
|
||||
//Character + misc
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
set category = "Preferences"
|
||||
set desc = "Toggle seeing radiochatter from radios and speakers"
|
||||
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
return
|
||||
prefs.toggles ^= CHAT_RADIO
|
||||
prefs.save_preferences_sqlite(src, ckey)
|
||||
to_chat(usr, "You will [(prefs.toggles & CHAT_RADIO) ? "now" : "no longer"] see radio chatter from radios or speakers")
|
||||
@@ -51,7 +52,8 @@
|
||||
set category = "Preferences"
|
||||
set desc = "Toggle hearing a notification when admin PMs are recieved"
|
||||
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
return
|
||||
prefs.toggles ^= SOUND_ADMINHELP
|
||||
prefs.save_preferences_sqlite(src, ckey)
|
||||
to_chat(usr, "You will [(prefs.toggles & SOUND_ADMINHELP) ? "now" : "no longer"] hear a sound when adminhelps arrive.")
|
||||
@@ -159,13 +161,16 @@
|
||||
return
|
||||
|
||||
var/UI_style_new = input(usr, "Select a style, we recommend White for customization") in list("White", "Midnight", "Orange", "old")
|
||||
if(!UI_style_new) return
|
||||
if(!UI_style_new)
|
||||
return
|
||||
|
||||
var/UI_style_alpha_new = input(usr, "Select a new alpha(transparence) parametr for UI, between 50 and 255") as num
|
||||
if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return
|
||||
if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50))
|
||||
return
|
||||
|
||||
var/UI_style_color_new = input(usr, "Choose your UI color, dark colors are not recommended!") as color|null
|
||||
if(!UI_style_color_new) return
|
||||
if(!UI_style_color_new)
|
||||
return
|
||||
|
||||
//update UI
|
||||
var/list/icons = usr.hud_used.adding + usr.hud_used.other +usr.hud_used.hotkeybuttons
|
||||
@@ -191,7 +196,8 @@
|
||||
prefs.toggles ^= SOUND_STREAMING
|
||||
prefs.save_preferences_sqlite(src, ckey)
|
||||
to_chat(usr, "You will [(prefs.toggles & SOUND_STREAMING) ? "now" : "no longer"] hear streamed media.")
|
||||
if(!media) return
|
||||
if(!media)
|
||||
return
|
||||
if(prefs.toggles & SOUND_STREAMING)
|
||||
media.update_music()
|
||||
else
|
||||
@@ -205,7 +211,8 @@
|
||||
prefs.usewmp = !prefs.usewmp
|
||||
prefs.save_preferences_sqlite(src, ckey)
|
||||
to_chat(usr, "You will use [(prefs.usewmp) ? "WMP" : "VLC"] to hear streamed media.")
|
||||
if(!media) return
|
||||
if(!media)
|
||||
return
|
||||
media.stop_music()
|
||||
media.playerstyle = (prefs.usewmp ? PLAYER_OLD_HTML : PLAYER_HTML)
|
||||
if(prefs.toggles & SOUND_STREAMING)
|
||||
|
||||
Reference in New Issue
Block a user