mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 11:36:24 +01:00
Does the rest of the if()'s/ else's
This commit is contained in:
@@ -41,10 +41,14 @@
|
||||
href_logfile << "<small>[time2text(world.timeofday,"hh:mm")] [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)
|
||||
|
||||
..() //redirect to hsrc.Topic()
|
||||
|
||||
@@ -306,7 +310,8 @@ var/next_external_rsc = 0
|
||||
//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
|
||||
|
||||
// Byond seemingly calls stat, each tick.
|
||||
|
||||
@@ -115,7 +115,8 @@ var/list/preferences_datums = list()
|
||||
|
||||
|
||||
/datum/preferences/proc/ShowChoices(mob/user)
|
||||
if(!user || !user.client) return
|
||||
if(!user || !user.client)
|
||||
return
|
||||
update_preview_icon()
|
||||
user << browse_rsc(preview_icon, "previewicon.png")
|
||||
var/dat = "<center>"
|
||||
@@ -140,7 +141,8 @@ var/list/preferences_datums = list()
|
||||
for(var/i=1, i<=max_save_slots, i++)
|
||||
S.cd = "/character[i]"
|
||||
S["real_name"] >> name
|
||||
if(!name) name = "Character[i]"
|
||||
if(!name)
|
||||
name = "Character[i]"
|
||||
//if(i!=1) dat += " | "
|
||||
dat += "<a style='white-space:nowrap;' href='?_src_=prefs;preference=changeslot;num=[i];' [i == default_slot ? "class='linkOn'" : ""]>[name]</a> "
|
||||
dat += "</center>"
|
||||
@@ -411,7 +413,8 @@ var/list/preferences_datums = list()
|
||||
popup.open(0)
|
||||
|
||||
/datum/preferences/proc/SetChoices(mob/user, limit = 17, list/splitJobs = list("Chief Engineer"), widthPerColumn = 295, height = 620)
|
||||
if(!SSjob) return
|
||||
if(!SSjob)
|
||||
return
|
||||
|
||||
//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.
|
||||
@@ -632,7 +635,8 @@ var/list/preferences_datums = list()
|
||||
|
||||
|
||||
/datum/preferences/proc/GetJobDepartment(datum/job/job, level)
|
||||
if(!job || !level) return 0
|
||||
if(!job || !level)
|
||||
return 0
|
||||
switch(job.department_flag)
|
||||
if(CIVILIAN)
|
||||
switch(level)
|
||||
|
||||
@@ -112,48 +112,78 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
if(current_version < 9) //an example, underwear were an index for a hardcoded list, converting to a string
|
||||
if(gender == MALE)
|
||||
switch(underwear)
|
||||
if(1) underwear = "Mens White"
|
||||
if(2) underwear = "Mens Grey"
|
||||
if(3) underwear = "Mens Green"
|
||||
if(4) underwear = "Mens Blue"
|
||||
if(5) underwear = "Mens Black"
|
||||
if(6) underwear = "Mankini"
|
||||
if(7) underwear = "Mens Hearts Boxer"
|
||||
if(8) underwear = "Mens Black Boxer"
|
||||
if(9) underwear = "Mens Grey Boxer"
|
||||
if(10) underwear = "Mens Striped Boxer"
|
||||
if(11) underwear = "Mens Kinky"
|
||||
if(12) underwear = "Mens Red"
|
||||
if(13) underwear = "Nude"
|
||||
if(1)
|
||||
underwear = "Mens White"
|
||||
if(2)
|
||||
underwear = "Mens Grey"
|
||||
if(3)
|
||||
underwear = "Mens Green"
|
||||
if(4)
|
||||
underwear = "Mens Blue"
|
||||
if(5)
|
||||
underwear = "Mens Black"
|
||||
if(6)
|
||||
underwear = "Mankini"
|
||||
if(7)
|
||||
underwear = "Mens Hearts Boxer"
|
||||
if(8)
|
||||
underwear = "Mens Black Boxer"
|
||||
if(9)
|
||||
underwear = "Mens Grey Boxer"
|
||||
if(10)
|
||||
underwear = "Mens Striped Boxer"
|
||||
if(11)
|
||||
underwear = "Mens Kinky"
|
||||
if(12)
|
||||
underwear = "Mens Red"
|
||||
if(13)
|
||||
underwear = "Nude"
|
||||
else
|
||||
switch(underwear)
|
||||
if(1) underwear = "Ladies Red"
|
||||
if(2) underwear = "Ladies White"
|
||||
if(3) underwear = "Ladies Yellow"
|
||||
if(4) underwear = "Ladies Blue"
|
||||
if(5) underwear = "Ladies Black"
|
||||
if(6) underwear = "Ladies Thong"
|
||||
if(7) underwear = "Babydoll"
|
||||
if(8) underwear = "Ladies Baby-Blue"
|
||||
if(9) underwear = "Ladies Green"
|
||||
if(10) underwear = "Ladies Pink"
|
||||
if(11) underwear = "Ladies Kinky"
|
||||
if(12) underwear = "Tankini"
|
||||
if(13) underwear = "Nude"
|
||||
if(1)
|
||||
underwear = "Ladies Red"
|
||||
if(2)
|
||||
underwear = "Ladies White"
|
||||
if(3)
|
||||
underwear = "Ladies Yellow"
|
||||
if(4)
|
||||
underwear = "Ladies Blue"
|
||||
if(5)
|
||||
underwear = "Ladies Black"
|
||||
if(6)
|
||||
underwear = "Ladies Thong"
|
||||
if(7)
|
||||
underwear = "Babydoll"
|
||||
if(8)
|
||||
underwear = "Ladies Baby-Blue"
|
||||
if(9)
|
||||
underwear = "Ladies Green"
|
||||
if(10)
|
||||
underwear = "Ladies Pink"
|
||||
if(11)
|
||||
underwear = "Ladies Kinky"
|
||||
if(12)
|
||||
underwear = "Tankini"
|
||||
if(13)
|
||||
underwear = "Nude"
|
||||
if(!(pref_species in species_list))
|
||||
pref_species = new /datum/species/human()
|
||||
return
|
||||
|
||||
/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]"
|
||||
|
||||
/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 = "/"
|
||||
|
||||
var/needs_update = savefile_needs_update(S)
|
||||
@@ -202,9 +232,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
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_MAX //updates (or failing that the sanity checks) will ensure data is not invalid at load. Assume up-to-date
|
||||
@@ -229,12 +261,16 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
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
|
||||
@@ -315,7 +351,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
real_name = reject_bad_name(real_name)
|
||||
if(!features["mcolor"] || features["mcolor"] == "#000")
|
||||
features["mcolor"] = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F")
|
||||
if(!real_name) real_name = random_unique_name(gender)
|
||||
if(!real_name)
|
||||
real_name = random_unique_name(gender)
|
||||
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
|
||||
be_random_body = sanitize_integer(be_random_body, 0, 1, initial(be_random_body))
|
||||
gender = sanitize_gender(gender)
|
||||
@@ -360,9 +397,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
return 1
|
||||
|
||||
/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]"
|
||||
|
||||
S["version"] << SAVEFILE_VERSION_MAX //load_character will sanitize any bad data, so assume up-to-date.
|
||||
|
||||
@@ -58,7 +58,8 @@
|
||||
set name = "Hear/Silence Adminhelps"
|
||||
set category = "Preferences"
|
||||
set desc = "Toggle hearing a notification when admin PMs are received"
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
return
|
||||
prefs.toggles ^= SOUND_ADMINHELP
|
||||
prefs.save_preferences()
|
||||
usr << "You will [(prefs.toggles & SOUND_ADMINHELP) ? "now" : "no longer"] hear a sound when adminhelps arrive."
|
||||
@@ -68,7 +69,8 @@
|
||||
set name = "Do/Don't Announce Login"
|
||||
set category = "Preferences"
|
||||
set desc = "Toggle if you want an announcement to admins when you login during a round"
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
return
|
||||
prefs.toggles ^= ANNOUNCE_LOGIN
|
||||
prefs.save_preferences()
|
||||
usr << "You will [(prefs.toggles & ANNOUNCE_LOGIN) ? "now" : "no longer"] have an announcement to other admins when you login."
|
||||
@@ -214,7 +216,8 @@ var/global/list/ghost_forms = list("ghost","ghostking","ghostian2","skeleghost",
|
||||
set name = "Choose Ghost Form"
|
||||
set category = "Preferences"
|
||||
set desc = "Choose your preferred ghostly appearance."
|
||||
if(!is_content_unlocked()) return
|
||||
if(!is_content_unlocked())
|
||||
return
|
||||
var/new_form = input(src, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in ghost_forms
|
||||
if(new_form)
|
||||
prefs.ghost_form = new_form
|
||||
@@ -258,7 +261,7 @@ var/global/list/ghost_orbits = list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS
|
||||
set name = "Toggle Ghost HUD"
|
||||
set category = "Preferences"
|
||||
set desc = "Hide/Show Ghost HUD"
|
||||
|
||||
|
||||
prefs.ghost_hud = !prefs.ghost_hud
|
||||
src << "Ghost HUD will now be [prefs.ghost_hud ? "visible" : "hidden"]."
|
||||
prefs.save_preferences()
|
||||
|
||||
Reference in New Issue
Block a user