Ports the TG globals controller and converts globals. (#18057)

* SDQL2 update

* fix that verb

* cl

* fix that

* toworld

* this is pointless

* update info

* siiiiick..

* vv edit update

* fix that

* fix editing vars

* fix VV

* Port the /TG/ globals controller.

* part 1

* part 2

* oops

* part 3

* Hollow Purple

* sadas

* bsbsdb

* muda na agaki ta

* ids 1-15

* 16-31

* 41-75

* bring me back to how things used to be before i lost it all

* the strength of mayhem

* final touches

* cl

* protect some vars

* update sdql2 to use glob

* stuff?

* forgot that is not defined there

* whoops

* observ

* but it never gets better

* a

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2023-12-26 01:16:02 +00:00
committed by GitHub
co-authored by Matt Atlas
parent 19292f01d3
commit cadd19beac
966 changed files with 4785 additions and 4784 deletions
@@ -42,8 +42,8 @@
"<table>"
)
var/is_global_banned = jobban_isbanned(preference_mob(), "Antagonist")
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if(antag.flags & ANTAG_NO_ROUNDSTART_SPAWN)
continue
dat += "<tr><td>[antag.role_text]: </td><td>"
@@ -52,7 +52,7 @@
dat += "<span class='danger'>\[IN [player_old_enough_for_role(preference_mob(), antag.bantype)] DAYS\]</span><br>"
else if(is_global_banned || ban_reason)
dat += "<span class='danger'>\[<a href='?src=\ref[user.client];view_jobban=[is_global_banned ? "Antagonist" : "[antag.bantype]"];'>BANNED</a>\]</span><br>"
else if(establish_db_connection(dbcon) && antag.required_age && antag.required_age > user.client?.player_age)
else if(establish_db_connection(GLOB.dbcon) && antag.required_age && antag.required_age > user.client?.player_age)
dat += "<span class='notice'>ACC TOO YOUNG</span><br>"
else if(antag.role_type in pref.be_special_role)
dat += "<b>Yes</b> / <a href='?src=\ref[src];del_special=[antag.role_type]'>No</a></br>"
@@ -78,8 +78,8 @@
/datum/category_item/player_setup_item/antagonism/candidacy/proc/valid_special_roles()
var/list/private_valid_special_roles = list()
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
private_valid_special_roles += antag.role_type
return private_valid_special_roles
@@ -13,7 +13,7 @@
S["OOC_Notes"] >> pref.metadata
S["floating_chat_color"] >> pref.floating_chat_color
S["speech_bubble_type"] >> pref.speech_bubble_type
if(istype(all_species[pref.species], /datum/species/machine))
if(istype(GLOB.all_species[pref.species], /datum/species/machine))
S["ipc_tag_status"] >> pref.machine_tag_status
S["ipc_serial_number"] >> pref.machine_serial_number
S["ipc_ownership_status"] >> pref.machine_ownership_status
@@ -29,7 +29,7 @@
S["OOC_Notes"] << pref.metadata
S["floating_chat_color"] << pref.floating_chat_color
S["speech_bubble_type"] << pref.speech_bubble_type
if(istype(all_species[pref.species], /datum/species/machine))
if(istype(GLOB.all_species[pref.species], /datum/species/machine))
S["ipc_tag_status"] << pref.machine_tag_status
S["ipc_serial_number"] << pref.machine_serial_number
S["ipc_ownership_status"] << pref.machine_ownership_status
@@ -119,19 +119,19 @@
pref.can_edit_name = TRUE
pref.can_edit_ipc_tag = TRUE
if (config.sql_saves && pref.current_character)
if (!establish_db_connection(dbcon))
if (GLOB.config.sql_saves && pref.current_character)
if (!establish_db_connection(GLOB.dbcon))
return
// Called /after/ loading and /before/ sanitization.
// So we have pref.current_character. It's just in text format.
var/DBQuery/query = dbcon.NewQuery("SELECT DATEDIFF(NOW(), created_at) AS DiffDate FROM ss13_characters WHERE id = :id:")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT DATEDIFF(NOW(), created_at) AS DiffDate FROM ss13_characters WHERE id = :id:")
query.Execute(list("id" = text2num(pref.current_character)))
if (query.NextRow())
if (text2num(query.item[1]) > 5)
pref.can_edit_name = FALSE
if(config.ipc_timelock_active)
if(GLOB.config.ipc_timelock_active)
pref.can_edit_ipc_tag = FALSE
else
log_world("ERROR: SQL CHARACTER LOAD: Logic error, general/basic/load_special() didn't return any rows when it should have. Character ID: [pref.current_character].")
@@ -140,8 +140,8 @@
if(!pref.species)
pref.species = SPECIES_HUMAN
var/is_in_playable_species = FALSE
for(var/thing in playable_species)
if(pref.species in playable_species[thing])
for(var/thing in GLOB.playable_species)
if(pref.species in GLOB.playable_species[thing])
is_in_playable_species = TRUE
if(!is_in_playable_species)
pref.species = SPECIES_HUMAN
@@ -156,7 +156,7 @@
pref.spawnpoint = sanitize_inlist(pref.spawnpoint, SSatlas.spawn_locations, initial(pref.spawnpoint))
pref.machine_tag_status = text2num(pref.machine_tag_status) // SQL queries return as text, so make this a num
pref.floating_chat_color = sanitize_hexcolor(pref.floating_chat_color, get_random_colour(0, 160, 230))
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
if(!pref.speech_bubble_type || !(pref.speech_bubble_type in S.possible_speech_bubble_types))
if(istype(S))
pref.speech_bubble_type = S.possible_speech_bubble_types[1]
@@ -173,7 +173,7 @@
dat += "(<a href='?src=\ref[src];random_name=1'>Random Name</A>)"
dat += "<br>"
dat += "<b>Sex:</b> <a href='?src=\ref[src];gender=1'><b>[capitalize(lowertext(pref.gender))]</b></a><br>"
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
if(length(S.selectable_pronouns))
dat += "<b>Pronouns:</b> <a href='?src=\ref[src];pronouns=1'><b>[capitalize_first_letters(pref.pronouns)]</b></a><br>"
dat += "<b>Age:</b> <a href='?src=\ref[src];age=1'>[pref.age]</a><br>"
@@ -197,7 +197,7 @@
else
dat += "<b>Serial Number:</b> [pref.machine_serial_number] (<a href='?src=\ref[src];namehelp=1'>?</a>)<br>"
dat += "<b>Ownership Status:</b> [pref.machine_ownership_status] (<a href='?src=\ref[src];namehelp=1'>?</a>)<br>"
if(config.allow_Metadata)
if(GLOB.config.allow_Metadata)
dat += "<b>OOC Notes:</b> <a href='?src=\ref[src];metadata=1'> Edit </a><br>"
. = dat.Join()
@@ -217,9 +217,9 @@
if(new_name)
if(new_name == pref.real_name)
return TOPIC_NOACTION //If the name is the same do nothing
if(config.sql_saves)
if(GLOB.config.sql_saves)
//Check if the player already has a character with the same name. (We dont have to account for the current char in that query, as that is already handled by the condition above)
var/DBQuery/query = dbcon.NewQuery("SELECT COUNT(*) FROM ss13_characters WHERE ckey = :ckey: and name = :char_name:")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT COUNT(*) FROM ss13_characters WHERE ckey = :ckey: and name = :char_name:")
query.Execute(list("ckey" = user.client.ckey, "char_name" = new_name))
query.NextRow()
var/count = text2num(query.item[1])
@@ -255,13 +255,13 @@
return TOPIC_REFRESH
else if(href_list["speech_bubble_type"])
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
pref.speech_bubble_type = next_in_list(pref.speech_bubble_type, S.possible_speech_bubble_types)
return TOPIC_REFRESH
else if(href_list["gender"])
var/datum/species/S = all_species[pref.species]
pref.gender = next_in_list(pref.gender, valid_player_genders & S.default_genders)
var/datum/species/S = GLOB.all_species[pref.species]
pref.gender = next_in_list(pref.gender, GLOB.valid_player_genders & S.default_genders)
pref.pronouns = pref.gender
var/datum/category_item/player_setup_item/general/equipment/equipment_item = category.items[4]
@@ -269,7 +269,7 @@
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["pronouns"])
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
var/selectable_pronouns = list() // this only exists to uppercase the first letters, otherwise it is uggo
for(var/pronoun in S.selectable_pronouns)
selectable_pronouns += capitalize_first_letters(pronoun)
@@ -286,7 +286,7 @@
return TOPIC_REFRESH
else if(href_list["height"])
var/datum/species/char_spec = all_species[pref.species]
var/datum/species/char_spec = GLOB.all_species[pref.species]
var/new_height = input(user, "Choose your character's height: (Values in Centimetres. [char_spec.name] height range [pref.getMinHeight()] - [pref.getMaxHeight()])", "Character Preference", pref.height) as num|null
if(new_height && CanUseTopic(user))
pref.height = max(min(round(text2num(new_height)), pref.getMaxHeight()),pref.getMinHeight())
@@ -53,7 +53,7 @@
// Nothing to validate. Leave.
return
var/datum/species/S = all_species[pref.species] || all_species[SPECIES_HUMAN]
var/datum/species/S = GLOB.all_species[pref.species] || GLOB.all_species[SPECIES_HUMAN]
if (pref.alternate_languages.len > S.num_alternate_languages)
if(pref.client)
@@ -62,9 +62,9 @@
return
var/list/langs = S.secondary_langs.Copy()
for (var/L in all_languages)
var/datum/language/lang = all_languages[L]
if (pref.client && !(lang.flags & RESTRICTED) && (!config.usealienwhitelist || is_alien_whitelisted(pref.client.mob, L) || !(lang.flags & WHITELISTED)))
for (var/L in GLOB.all_languages)
var/datum/language/lang = GLOB.all_languages[L]
if (pref.client && !(lang.flags & RESTRICTED) && (!GLOB.config.usealienwhitelist || is_alien_whitelisted(pref.client.mob, L) || !(lang.flags & WHITELISTED)))
langs |= L
var/list/bad_langs = pref.alternate_languages - langs
@@ -82,7 +82,7 @@
/datum/category_item/player_setup_item/general/language/content(var/mob/user)
var/list/dat = list("<b>Languages</b><br>")
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
if(S.language)
dat += "- [S.language]<br>"
if(S.default_language && S.default_language != S.language)
@@ -113,14 +113,14 @@
return TOPIC_REFRESH
else if(href_list["add_language"])
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
if(pref.alternate_languages.len >= S.num_alternate_languages)
alert(user, "You have already selected the maximum number of alternate languages for this species!")
else
var/list/available_languages = S.secondary_langs.Copy()
for(var/L in all_languages)
var/datum/language/lang = all_languages[L]
if(!(lang.flags & RESTRICTED) && (!config.usealienwhitelist || is_alien_whitelisted(user, L) || !(lang.flags & WHITELISTED)))
for(var/L in GLOB.all_languages)
var/datum/language/lang = GLOB.all_languages[L]
if(!(lang.flags & RESTRICTED) && (!GLOB.config.usealienwhitelist || is_alien_whitelisted(user, L) || !(lang.flags & WHITELISTED)))
available_languages |= L
// make sure we don't let them waste slots on the default languages
@@ -184,7 +184,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
LOG_DEBUG("DISABILITIES: Caught [e]. Initial value: [before]")
pref.disabilities = list()
var/datum/species/mob_species = all_species[pref.species]
var/datum/species/mob_species = GLOB.all_species[pref.species]
pref.r_hair = sanitize_integer(pref.r_hair, 0, 255, initial(pref.r_hair))
pref.g_hair = sanitize_integer(pref.g_hair, 0, 255, initial(pref.g_hair))
@@ -197,9 +197,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
pref.g_skin = sanitize_integer(pref.g_skin, 0, 255, initial(pref.g_skin))
pref.b_skin = sanitize_integer(pref.b_skin, 0, 255, initial(pref.b_skin))
pref.tail_style = sanitize_inlist(pref.tail_style, mob_species.selectable_tails, mob_species.tail)
pref.h_style = sanitize_inlist(pref.h_style, hair_styles_list, initial(pref.h_style))
pref.f_style = sanitize_inlist(pref.f_style, facial_hair_styles_list, initial(pref.f_style))
pref.g_style = sanitize_inlist(pref.g_style, hair_gradient_styles_list, initial(pref.g_style))
pref.h_style = sanitize_inlist(pref.h_style, GLOB.hair_styles_list, initial(pref.h_style))
pref.f_style = sanitize_inlist(pref.f_style, GLOB.facial_hair_styles_list, initial(pref.f_style))
pref.g_style = sanitize_inlist(pref.g_style, GLOB.hair_gradient_styles_list, initial(pref.g_style))
pref.r_eyes = sanitize_integer(pref.r_eyes, 0, 255, initial(pref.r_eyes))
pref.g_eyes = sanitize_integer(pref.g_eyes, 0, 255, initial(pref.g_eyes))
pref.b_eyes = sanitize_integer(pref.b_eyes, 0, 255, initial(pref.b_eyes))
@@ -220,7 +220,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
/datum/category_item/player_setup_item/general/body/content(var/mob/user)
var/list/out = list()
var/datum/species/mob_species = all_species[pref.species]
var/datum/species/mob_species = GLOB.all_species[pref.species]
out += "<table><tr style='vertical-align:top'><td><b>Body</b> "
out += "(<a href='?src=\ref[src];random=1'>&reg;</A>)"
out += "<br>"
@@ -246,19 +246,19 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if(status == "cyborg")
var/datum/robolimb/R
if(pref.rlimb_data[name] && all_robolimbs[pref.rlimb_data[name]])
R = all_robolimbs[pref.rlimb_data[name]]
if(pref.rlimb_data[name] && GLOB.all_robolimbs[pref.rlimb_data[name]])
R = GLOB.all_robolimbs[pref.rlimb_data[name]]
else
R = basic_robolimb
R = GLOB.basic_robolimb
out += "<li>- [R.company] [capitalize_first_letters(parse_zone(organ_name))] Prosthesis</li>"
else if(status == "amputated")
out += "<li>- Amputated [capitalize_first_letters(parse_zone(organ_name))]</li>"
else if(status == "mechanical")
var/datum/robolimb/R
if(pref.rlimb_data[name] && all_robolimbs[pref.rlimb_data[name]])
R = all_robolimbs[pref.rlimb_data[name]]
if(pref.rlimb_data[name] && GLOB.all_robolimbs[pref.rlimb_data[name]])
R = GLOB.all_robolimbs[pref.rlimb_data[name]]
else
R = basic_robolimb
R = GLOB.basic_robolimb
out += "<li>- [R.company] Mechanical [capitalize_first_letters(parse_zone(organ_name))]</li>"
else if(status == "nymph")
out += "<li>- Diona Nymph [capitalize_first_letters(parse_zone(organ_name))]</li>"
@@ -334,7 +334,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return mob_species && (mob_species.appearance_flags & flag)
/datum/category_item/player_setup_item/general/body/OnTopic(var/href,var/list/href_list, var/mob/user)
var/datum/species/mob_species = all_species[pref.species]
var/datum/species/mob_species = GLOB.all_species[pref.species]
if(href_list["random"])
pref.randomize_appearance_for()
@@ -348,14 +348,14 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["show_species"])
// Actual whitelist checks are handled elsewhere, this is just for accessing the preview window.
var/species_choice = tgui_input_list(usr, "Which species would you like to look at?", "Species Selection", playable_species)
var/species_choice = tgui_input_list(usr, "Which species would you like to look at?", "Species Selection", GLOB.playable_species)
if(!species_choice)
return
var/choice
if(length(playable_species[species_choice]) == 1)
choice = playable_species[species_choice][1]
if(length(GLOB.playable_species[species_choice]) == 1)
choice = GLOB.playable_species[species_choice][1]
else
choice = tgui_input_list(usr, "Which subspecies would you like to look at?", "Sub-species Selection", playable_species[species_choice])
choice = tgui_input_list(usr, "Which subspecies would you like to look at?", "Sub-species Selection", GLOB.playable_species[species_choice])
if(!choice)
return
choice = html_decode(choice)
@@ -366,13 +366,13 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["set_species"])
user << browse(null, "window=species")
if(!pref.species_preview || !(pref.species_preview in all_species))
if(!pref.species_preview || !(pref.species_preview in GLOB.all_species))
return TOPIC_NOACTION
var/prev_species = pref.species
pref.species = html_decode(href_list["set_species"])
if(prev_species != pref.species)
mob_species = all_species[pref.species]
mob_species = GLOB.all_species[pref.species]
pref.gender = sanitize_gender(pref.gender, pref.species)
//var/bodytype = mob_species.get_bodytype()
@@ -381,20 +381,20 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
var/list/valid_hairstyles = list()
// Snowflake check for industrials - they're an IPC bodytype but don't have IPC screens.
for(var/hairstyle in hair_styles_list)
var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
for(var/hairstyle in GLOB.hair_styles_list)
var/datum/sprite_accessory/S = GLOB.hair_styles_list[hairstyle]
if(pref.gender == MALE && S.gender == FEMALE)
continue
if(pref.gender == FEMALE && S.gender == MALE)
continue
if(!(mob_species.type in S.species_allowed))
continue
valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
valid_hairstyles[hairstyle] = GLOB.hair_styles_list[hairstyle]
if(valid_hairstyles.len)
pref.h_style = pick(valid_hairstyles)
else // Species has no hair, or something fucked up.
pref.h_style = hair_styles_list["Bald"]
pref.h_style = GLOB.hair_styles_list["Bald"]
if(length(mob_species.selectable_tails))
pref.tail_style = pick(mob_species.selectable_tails)
@@ -403,8 +403,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
//grab one of the valid facial hair styles for the newly chosen species
var/list/valid_facialhairstyles = list()
for(var/facialhairstyle in facial_hair_styles_list)
var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
for(var/facialhairstyle in GLOB.facial_hair_styles_list)
var/datum/sprite_accessory/S = GLOB.facial_hair_styles_list[facialhairstyle]
if(pref.gender == MALE && S.gender == FEMALE)
continue
if(pref.gender == FEMALE && S.gender == MALE)
@@ -412,17 +412,17 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if(!(mob_species.type in S.species_allowed))
continue
valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
valid_facialhairstyles[facialhairstyle] = GLOB.facial_hair_styles_list[facialhairstyle]
if(valid_facialhairstyles.len)
pref.f_style = pick(valid_facialhairstyles)
else
//this shouldn't happen
pref.f_style = facial_hair_styles_list["Shaved"]
pref.f_style = GLOB.facial_hair_styles_list["Shaved"]
var/list/valid_hair_gradients = list()
for(var/hair_gradient in hair_gradient_styles_list)
var/datum/sprite_accessory/S = hair_gradient_styles_list[hair_gradient]
for(var/hair_gradient in GLOB.hair_gradient_styles_list)
var/datum/sprite_accessory/S = GLOB.hair_gradient_styles_list[hair_gradient]
if(pref.gender == MALE && S.gender == FEMALE)
continue
if(pref.gender == FEMALE && S.gender == MALE)
@@ -463,13 +463,13 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if(!valid_gradients[mob_species.type])
valid_gradients[mob_species.type] = list()
for(var/gradient in hair_gradient_styles_list)
var/datum/sprite_accessory/S = hair_gradient_styles_list[gradient]
for(var/gradient in GLOB.hair_gradient_styles_list)
var/datum/sprite_accessory/S = GLOB.hair_gradient_styles_list[gradient]
if(mob_species.type in S.species_allowed)
valid_gradients[mob_species.type] += gradient
if(!(pref.g_style in valid_gradients[mob_species.type]))
pref.g_style = hair_gradient_styles_list["None"]
pref.g_style = GLOB.hair_gradient_styles_list["None"]
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -506,8 +506,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return
//var/bodytype = mob_species.get_bodytype()
var/list/valid_hairstyles = list()
for(var/hairstyle in hair_styles_list)
var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
for(var/hairstyle in GLOB.hair_styles_list)
var/datum/sprite_accessory/S = GLOB.hair_styles_list[hairstyle]
if(pref.gender == MALE && S.gender == FEMALE)
continue
if(pref.gender == FEMALE && S.gender == MALE)
@@ -515,7 +515,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if(!(mob_species.type in S.species_allowed))
continue
valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
valid_hairstyles[hairstyle] = GLOB.hair_styles_list[hairstyle]
var/new_h_style = tgui_input_list(user, "Choose your character's hair style.", "Character Preference", valid_hairstyles, pref.h_style)
if(new_h_style && CanUseTopic(user))
@@ -524,12 +524,12 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["gradient_style"])
var/list/valid_gradients = list()
for(var/gradstyle in hair_gradient_styles_list)
var/datum/sprite_accessory/S = hair_gradient_styles_list[gradstyle]
for(var/gradstyle in GLOB.hair_gradient_styles_list)
var/datum/sprite_accessory/S = GLOB.hair_gradient_styles_list[gradstyle]
if(!(mob_species.type in S.species_allowed))
continue
valid_gradients[gradstyle] = hair_gradient_styles_list[gradstyle]
valid_gradients[gradstyle] = GLOB.hair_gradient_styles_list[gradstyle]
var/new_g_style = tgui_input_list(user, "Choose a color pattern for your hair.", "Character Preference", valid_gradients, pref.g_style)
if(new_g_style && CanUseTopic(user))
@@ -588,8 +588,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return
var/list/valid_facialhairstyles = list()
//var/bodytype = mob_species.get_bodytype()
for(var/facialhairstyle in facial_hair_styles_list)
var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
for(var/facialhairstyle in GLOB.facial_hair_styles_list)
var/datum/sprite_accessory/S = GLOB.facial_hair_styles_list[facialhairstyle]
if(pref.gender == MALE && S.gender == FEMALE)
continue
if(pref.gender == FEMALE && S.gender == MALE)
@@ -597,7 +597,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if(!(mob_species.type in S.species_allowed))
continue
valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
valid_facialhairstyles[facialhairstyle] = GLOB.facial_hair_styles_list[facialhairstyle]
var/new_f_style = tgui_input_list(user, "Choose your character's facial-hair style:", "Character Preference", valid_facialhairstyles, pref.f_style)
if(new_f_style && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
@@ -605,8 +605,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["marking_style"])
var/list/usable_markings = pref.body_markings ^ body_marking_styles_list
var/datum/species/species = global.all_species[pref.species]
var/list/usable_markings = pref.body_markings ^ GLOB.body_marking_styles_list
var/datum/species/species = GLOB.all_species[pref.species]
for(var/M in usable_markings)
var/datum/sprite_accessory/S = usable_markings[M]
if(!S.species_allowed.len)
@@ -726,8 +726,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if("Prosthesis")
var/tmp_species = pref.species ? pref.species : SPECIES_HUMAN
var/list/usable_manufacturers = list()
for(var/company in chargen_robolimbs)
var/datum/robolimb/M = chargen_robolimbs[company]
for(var/company in GLOB.chargen_robolimbs)
var/datum/robolimb/M = GLOB.chargen_robolimbs[company]
if(!(tmp_species in M.species_can_use))
continue
usable_manufacturers[company] = M
@@ -781,8 +781,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
var/tmp_species = pref.species ? pref.species : SPECIES_HUMAN
var/list/usable_manufacturers = list()
for(var/company in internal_robolimbs)
var/datum/robolimb/M = chargen_robolimbs[company]
for(var/company in GLOB.internal_robolimbs)
var/datum/robolimb/M = GLOB.chargen_robolimbs[company]
if(!(tmp_species in M.species_can_use))
continue
usable_manufacturers[company] = M
@@ -793,7 +793,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return
var/datum/robolimb/R = all_robolimbs[choice]
var/datum/robolimb/R = GLOB.all_robolimbs[choice]
if(!(organ_name in R.allowed_internal_organs))
alert(user, "You can not select this manufacturer for this organ.")
return
@@ -812,7 +812,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["trait_add"])
var/list/available_disabilities = pref.disabilities ^ chargen_disabilities_list
var/list/available_disabilities = pref.disabilities ^ GLOB.chargen_disabilities_list
var/new_trait = tgui_input_list(user, "Choose a disability.", "Character Preference", available_disabilities)
if(new_trait && CanUseTopic(user))
@@ -842,9 +842,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return ..()
/datum/category_item/player_setup_item/general/body/proc/SetSpecies(mob/user)
if(!pref.species_preview || !(pref.species_preview in all_species))
if(!pref.species_preview || !(pref.species_preview in GLOB.all_species))
pref.species_preview = SPECIES_HUMAN
var/datum/species/current_species = all_species[pref.species_preview]
var/datum/species/current_species = GLOB.all_species[pref.species_preview]
var/list/dat = list(
"<center><h2>[current_species.name] \[<a href='?src=\ref[src];show_species=1'>change</a>\]</h2></center><hr/>",
"<table padding='8px'>",
@@ -888,7 +888,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
dat += "</table><center><hr/>"
var/restricted = 0
if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
if(GLOB.config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
if(!(current_species.spawn_flags & CAN_JOIN))
restricted = 2
else if((current_species.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(preference_mob(),current_species.name))
@@ -134,14 +134,14 @@
if(!(underwear_metadata in pref.all_underwear))
pref.all_underwear_metadata -= underwear_metadata
pref.backbag = sanitize_integer(pref.backbag, 1, backbaglist.len, initial(pref.backbag))
pref.backbag_style = sanitize_integer(pref.backbag_style, 1, backbagstyles.len, initial(pref.backbag_style))
pref.backbag_color = sanitize_integer(pref.backbag_color, 1, backbagcolors.len, initial(pref.backbag_color))
pref.backbag_strap = sanitize_integer(pref.backbag_strap, 1, backbagstrap.len, initial(pref.backbag_strap))
pref.pda_choice = sanitize_integer(pref.pda_choice, 1, pdalist.len, initial(pref.pda_choice))
pref.headset_choice = sanitize_integer(pref.headset_choice, 1, headsetlist.len, initial(pref.headset_choice))
if(!(pref.primary_radio_slot in primary_radio_slot_choice))
pref.primary_radio_slot = primary_radio_slot_choice[1]
pref.backbag = sanitize_integer(pref.backbag, 1, GLOB.backbaglist.len, initial(pref.backbag))
pref.backbag_style = sanitize_integer(pref.backbag_style, 1, GLOB.backbagstyles.len, initial(pref.backbag_style))
pref.backbag_color = sanitize_integer(pref.backbag_color, 1, GLOB.backbagcolors.len, initial(pref.backbag_color))
pref.backbag_strap = sanitize_integer(pref.backbag_strap, 1, GLOB.backbagstrap.len, initial(pref.backbag_strap))
pref.pda_choice = sanitize_integer(pref.pda_choice, 1, GLOB.pdalist.len, initial(pref.pda_choice))
pref.headset_choice = sanitize_integer(pref.headset_choice, 1, GLOB.headsetlist.len, initial(pref.headset_choice))
if(!(pref.primary_radio_slot in GLOB.primary_radio_slot_choice))
pref.primary_radio_slot = GLOB.primary_radio_slot_choice[1]
pref.sensor_setting = sanitize_inlist(pref.sensor_setting, SUIT_SENSOR_MODES, get_key_by_index(SUIT_SENSOR_MODES, 0))
/datum/category_item/player_setup_item/general/equipment/content(var/mob/user)
@@ -158,13 +158,13 @@
. += "<br>"
. += "Backpack Type: <a href='?src=\ref[src];change_backpack=1'><b>[backbaglist[pref.backbag]]</b></a><br>"
. += "Backpack Style: <a href='?src=\ref[src];change_backpack_style=1'><b>[backbagstyles[pref.backbag_style]]</b></a><br>"
. += "Backpack Type: <a href='?src=\ref[src];change_backpack=1'><b>[GLOB.backbaglist[pref.backbag]]</b></a><br>"
. += "Backpack Style: <a href='?src=\ref[src];change_backpack_style=1'><b>[GLOB.backbagstyles[pref.backbag_style]]</b></a><br>"
if(pref.backbag == OUTFIT_SATCHEL_ALT || pref.backbag == OUTFIT_RUCKSACK || pref.backbag == OUTFIT_POCKETBOOK) // Hardcoded. Sucks, I know.
. += "Backpack Color: <a href='?src=\ref[src];change_backpack_color=1'><b>[backbagcolors[pref.backbag_color]]</b></a><br>"
. += "Backpack Strap: <a href='?src=\ref[src];change_backbag_strap=1'><b>[backbagstrap[pref.backbag_strap]]</b></a><br>"
. += "PDA Type: <a href='?src=\ref[src];change_pda=1'><b>[pdalist[pref.pda_choice]]</b></a><br>"
. += "Headset Type: <a href='?src=\ref[src];change_headset=1'><b>[headsetlist[pref.headset_choice]]</b></a><br>"
. += "Backpack Color: <a href='?src=\ref[src];change_backpack_color=1'><b>[GLOB.backbagcolors[pref.backbag_color]]</b></a><br>"
. += "Backpack Strap: <a href='?src=\ref[src];change_backbag_strap=1'><b>[GLOB.backbagstrap[pref.backbag_strap]]</b></a><br>"
. += "PDA Type: <a href='?src=\ref[src];change_pda=1'><b>[GLOB.pdalist[pref.pda_choice]]</b></a><br>"
. += "Headset Type: <a href='?src=\ref[src];change_headset=1'><b>[GLOB.headsetlist[pref.headset_choice]]</b></a><br>"
. += "Primary Radio Slot: <a href='?src=\ref[src];change_radio_slot=1'><b>[pref.primary_radio_slot]</b></a><br>"
. += "Suit Sensor Setting: <a href='?src=\ref[src];change_sensor_setting=1'><b>[pref.sensor_setting]</b></a><br/>"
@@ -188,43 +188,43 @@
/datum/category_item/player_setup_item/general/equipment/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["change_backpack"])
var/new_backbag = tgui_input_list(user, "Choose your character's bag type.", "Character Preference", backbaglist, backbaglist[pref.backbag])
var/new_backbag = tgui_input_list(user, "Choose your character's bag type.", "Character Preference", GLOB.backbaglist, GLOB.backbaglist[pref.backbag])
if(!isnull(new_backbag) && CanUseTopic(user))
pref.backbag = backbaglist.Find(new_backbag)
pref.backbag = GLOB.backbaglist.Find(new_backbag)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_backpack_style"])
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag.", "Character Preference", backbagstyles, backbagstyles[pref.backbag_style])
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag.", "Character Preference", GLOB.backbagstyles, GLOB.backbagstyles[pref.backbag_style])
if(!isnull(new_backbag) && CanUseTopic(user))
pref.backbag_style = backbagstyles.Find(new_backbag)
pref.backbag_style = GLOB.backbagstyles.Find(new_backbag)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_backpack_color"])
var/new_backbag = tgui_input_list(user, "Choose your character's color of bag.", "Character Preference", backbagcolors, backbagcolors[pref.backbag_color])
var/new_backbag = tgui_input_list(user, "Choose your character's color of bag.", "Character Preference", GLOB.backbagcolors, GLOB.backbagcolors[pref.backbag_color])
if(!isnull(new_backbag) && CanUseTopic(user))
pref.backbag_color = backbagcolors.Find(new_backbag)
pref.backbag_color = GLOB.backbagcolors.Find(new_backbag)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_backbag_strap"])
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag strap.", "Character Preference", backbagstrap, backbagstrap[pref.backbag_strap])
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag strap.", "Character Preference", GLOB.backbagstrap, GLOB.backbagstrap[pref.backbag_strap])
if(!isnull(new_backbag) && CanUseTopic(user))
pref.backbag_strap = backbagstrap.Find(new_backbag)
pref.backbag_strap = GLOB.backbagstrap.Find(new_backbag)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_pda"])
var/new_pda = tgui_input_list(user, "Choose your character's PDA type.", "Character Preference", pdalist, pdalist[pref.pda_choice])
var/new_pda = tgui_input_list(user, "Choose your character's PDA type.", "Character Preference", GLOB.pdalist, GLOB.pdalist[pref.pda_choice])
if(!isnull(new_pda) && CanUseTopic(user))
pref.pda_choice = pdalist.Find(new_pda)
pref.pda_choice = GLOB.pdalist.Find(new_pda)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_headset"])
var/new_headset = tgui_input_list(user, "Choose your character's headset type.", "Character Preference", headsetlist, headsetlist[pref.headset_choice])
var/new_headset = tgui_input_list(user, "Choose your character's headset type.", "Character Preference", GLOB.headsetlist, GLOB.headsetlist[pref.headset_choice])
if(!isnull(new_headset) && CanUseTopic(user))
pref.headset_choice = headsetlist.Find(new_headset)
pref.headset_choice = GLOB.headsetlist.Find(new_headset)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["change_radio_slot"])
var/new_slot = tgui_input_list(user, "Choose which radio will be spoken into first if multiple slots are occupied.", "Character Preference", primary_radio_slot_choice, pref.primary_radio_slot)
var/new_slot = tgui_input_list(user, "Choose which radio will be spoken into first if multiple slots are occupied.", "Character Preference", GLOB.primary_radio_slot_choice, pref.primary_radio_slot)
if(!isnull(new_slot) && CanUseTopic(user))
pref.primary_radio_slot = new_slot
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -15,7 +15,7 @@
//Flavour text for robots.
S["flavour_texts_robot_Default"] >> pref.flavour_texts_robot["Default"]
for(var/module in robot_module_types)
for(var/module in GLOB.robot_module_types)
S["flavour_texts_robot_[module]"] >> pref.flavour_texts_robot[module]
S["signature"] >> pref.signature
@@ -33,7 +33,7 @@
S["flavor_texts_feet"] << pref.flavor_texts["feet"]
S["flavour_texts_robot_Default"] << pref.flavour_texts_robot["Default"]
for(var/module in robot_module_types)
for(var/module in GLOB.robot_module_types)
S["flavour_texts_robot_[module]"] << pref.flavour_texts_robot[module]
S["signature"] << pref.signature
@@ -55,7 +55,7 @@
"signature_font" = "signfont"
)
for (var/module in robot_module_types)
for (var/module in GLOB.robot_module_types)
var_list["robot_[lowertext(module)]"] = "flavour_texts_robot/[module]"
return list(
@@ -85,7 +85,7 @@
"char_id" = 1
)
for (var/module in robot_module_types)
for (var/module in GLOB.robot_module_types)
var_list += "robot_[lowertext(module)]"
return list("ss13_characters_flavour" = var_list)
@@ -107,7 +107,7 @@
"signature_font" = pref.signfont
)
for (var/module in robot_module_types)
for (var/module in GLOB.robot_module_types)
var_list["robot_[lowertext(module)]"] += pref.flavour_texts_robot[module]
return var_list
@@ -255,7 +255,7 @@
HTML += "<a href='?src=\ref[src];flavour_text_robot=Default'>Default:</a> "
HTML += TextPreview(pref.flavour_texts_robot["Default"])
HTML += "<hr />"
for(var/module in robot_module_types)
for(var/module in GLOB.robot_module_types)
HTML += "<a href='?src=\ref[src];flavour_text_robot=[module]'>[module]:</a> "
HTML += TextPreview(pref.flavour_texts_robot[module])
HTML += "<br>"
@@ -60,7 +60,7 @@
pref.psionics = list()
/datum/category_item/player_setup_item/general/psionics/sanitize_character(var/sql_load = 0)
var/datum/species/mob_species = all_species[pref.species]
var/datum/species/mob_species = GLOB.all_species[pref.species]
if(length(pref.psionics) && !mob_species.has_psionics)
to_chat(pref.client, SPAN_WARNING("This species does not have psionics! Resetting..."))
pref.psionics = list()
@@ -83,7 +83,7 @@
pref.psionics = list()
/datum/category_item/player_setup_item/general/psionics/content(var/mob/user)
var/datum/species/mob_species = all_species[pref.species]
var/datum/species/mob_species = GLOB.all_species[pref.species]
if(!(mob_species.has_psionics))
return
var/list/bought_psionic_powers = list()
@@ -108,7 +108,7 @@
return TOPIC_REFRESH
else if(href_list["add_psi_power"])
var/datum/species/mob_species = all_species[pref.species]
var/datum/species/mob_species = GLOB.all_species[pref.species]
var/total_psi_points = mob_species.character_creation_psi_points
var/list/available_psionics = list()
var/list/psionic_map = list()
@@ -202,4 +202,4 @@
return ..()
/datum/category_item/player_setup_item/player_global/ui/proc/can_select_ooc_color(var/mob/user)
return config.allow_admin_ooccolor && check_rights(R_ADMIN, 0, user)
return GLOB.config.allow_admin_ooccolor && check_rights(R_ADMIN, 0, user)
@@ -71,7 +71,7 @@
pref.current_character = validate_current_character()
pref.lastchangelog = sanitize_text(pref.lastchangelog, initial(pref.lastchangelog))
pref.default_slot = sanitize_integer(text2num(pref.default_slot), 1, config.character_slots, initial(pref.default_slot))
pref.default_slot = sanitize_integer(text2num(pref.default_slot), 1, GLOB.config.character_slots, initial(pref.default_slot))
pref.toggles = sanitize_integer(text2num(pref.toggles), 0, BITFIELDMAX, initial(pref.toggles))
pref.sfx_toggles = sanitize_integer(text2num(pref.sfx_toggles), 0, BITFIELDMAX, initial(pref.toggles))
pref.motd_hash = sanitize_text(pref.motd_hash, initial(pref.motd_hash))
@@ -112,10 +112,10 @@
return ..()
/datum/category_item/player_setup_item/player_global/settings/proc/validate_current_character()
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
return pref.current_character
var/DBQuery/is_ours = dbcon.NewQuery("SELECT COUNT(*) as valid_id FROM ss13_characters WHERE ckey = :ckey: AND id = :curr_char: AND deleted_at IS NULL")
var/DBQuery/is_ours = GLOB.dbcon.NewQuery("SELECT COUNT(*) as valid_id FROM ss13_characters WHERE ckey = :ckey: AND id = :curr_char: AND deleted_at IS NULL")
is_ours.Execute(list("ckey" = pref.client.ckey, "curr_char" = pref.current_character))
if (!is_ours.NextRow())
@@ -129,10 +129,10 @@
return pref.current_character
/datum/category_item/player_setup_item/player_global/settings/proc/select_default_character()
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
return 0
var/DBQuery/first_char = dbcon.NewQuery("SELECT id FROM ss13_characters WHERE ckey = :ckey: AND deleted_at IS NULL LIMIT 1")
var/DBQuery/first_char = GLOB.dbcon.NewQuery("SELECT id FROM ss13_characters WHERE ckey = :ckey: AND deleted_at IS NULL LIMIT 1")
first_char.Execute(list("ckey" = pref.client.ckey))
if (!first_char.NextRow())
@@ -25,7 +25,7 @@
pref.language_prefixes = params2list(pref.language_prefixes)
if (isnull(pref.language_prefixes) || !pref.language_prefixes.len)
pref.language_prefixes = config.language_prefixes.Copy()
pref.language_prefixes = GLOB.config.language_prefixes.Copy()
/datum/category_item/player_setup_item/player_global/language/content(var/mob/user)
. += "<b>Language Keys</b><br>"
@@ -55,7 +55,7 @@
return TOPIC_REFRESH
else if(href_list["reset_prefix"])
pref.language_prefixes = config.language_prefixes.Copy()
pref.language_prefixes = GLOB.config.language_prefixes.Copy()
return TOPIC_REFRESH
return ..()
@@ -69,8 +69,8 @@ var/list/gear_datums = list()
var/list/whitelist_cache = list()
if(preference_mob)
for(var/species in global.all_species)
var/datum/species/S = global.all_species[species]
for(var/species in GLOB.all_species)
var/datum/species/S = GLOB.all_species[species]
if(is_alien_whitelisted(preference_mob, S))
whitelist_cache += S.name
@@ -337,14 +337,14 @@ var/list/gear_datums = list()
if(href_list["next_slot"])
//change the current slot number
pref.gear_slot = pref.gear_slot+1
if(pref.gear_slot > config.loadout_slots)
if(pref.gear_slot > GLOB.config.loadout_slots)
pref.gear_slot = 1
//If we're moving down a slot..
else if(href_list["prev_slot"])
//change current slot one down
pref.gear_slot = pref.gear_slot-1
if(pref.gear_slot < 1)
pref.gear_slot = config.loadout_slots
pref.gear_slot = GLOB.config.loadout_slots
// Set the currently selected gear to whatever's in the new slot
if(pref.gear_list["[pref.gear_slot]"])
pref.gear = pref.gear_list["[pref.gear_slot]"]
@@ -188,7 +188,7 @@
dat += "<del>[dispRank]</del></td><td><b> \[<a href='?src=\ref[user.client];view_jobban=[rank];'>BANNED</a>]</b></td></tr>"
continue
if(job.blacklisted_species) // check for restricted species
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
if(S.name in job.blacklisted_species)
dat += "<del>[dispRank]</del></td><td><b> \[SPECIES RESTRICTED]</b></td></tr>"
continue
@@ -483,7 +483,7 @@
if (!job)
return
var/choices = list(job.title) + job.alt_titles
if((global.all_species[src.species].spawn_flags & NO_AGE_MINIMUM))
if((GLOB.all_species[src.species].spawn_flags & NO_AGE_MINIMUM))
return choices
for(var/t in choices)
if (src.age >= (job.get_alt_character_age(species, t) || job.get_minimum_character_age(species)))
@@ -67,7 +67,7 @@
)
/datum/category_item/player_setup_item/origin/sanitize_character(var/sql_load = 0)
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
if(!istext(pref.culture) || !ispath(text2path(pref.culture), /singleton/origin_item/culture))
var/singleton/origin_item/culture/CI = S.possible_cultures[1]
pref.culture = "[CI]"
@@ -121,7 +121,7 @@
. = dat.Join()
/datum/category_item/player_setup_item/origin/OnTopic(href, href_list, user)
var/datum/species/S = all_species[pref.species]
var/datum/species/S = GLOB.all_species[pref.species]
if(href_list["open_culture_menu"])
var/list/options = list()
var/list/possible_cultures = Singletons.GetMap(S.possible_cultures)
@@ -7,9 +7,9 @@
pref.ccia_actions = list()
//Special Aurora Snowflake to load in the ccia actions and persistant incidents
if (config.sql_saves) // Doesnt work without db
if (GLOB.config.sql_saves) // Doesnt work without db
//Load in the CCIA Actions
var/DBQuery/ccia_action_query = dbcon.NewQuery({"SELECT
var/DBQuery/ccia_action_query = GLOB.dbcon.NewQuery({"SELECT
act.title,
act.type,
act.issuedby,
@@ -39,7 +39,7 @@
pref.ccia_actions.Add(list(action))
//Load in the infractions
var/DBQuery/char_infraction_query = dbcon.NewQuery({"SELECT
var/DBQuery/char_infraction_query = GLOB.dbcon.NewQuery({"SELECT
id, char_id, UID, datetime, notes, charges, evidence, arbiters, brig_sentence, fine, felony
FROM ss13_character_incidents
WHERE
@@ -145,7 +145,7 @@
/datum/category_group/player_setup_category/proc/load_character(var/savefile/S)
// Load all data, then sanitize it.
// Need due to, for example, the 01_basic module relying on species having been loaded to sanitize correctly but that isn't loaded until module 03_body.
if (!config.sql_saves || !establish_db_connection(dbcon))
if (!GLOB.config.sql_saves || !establish_db_connection(GLOB.dbcon))
for(var/datum/category_item/player_setup_item/PI in items)
PI.load_character(S)
else
@@ -154,14 +154,14 @@
for(var/datum/category_item/player_setup_item/PI in items)
PI.load_special(S)
PI.sanitize_character(config.sql_saves)
PI.sanitize_character(GLOB.config.sql_saves)
/datum/category_group/player_setup_category/proc/save_character(var/savefile/S)
// Sanitize all data, then save it
for (var/datum/category_item/player_setup_item/PI in items)
PI.sanitize_character()
if (!config.sql_saves || !establish_db_connection(dbcon))
if (!GLOB.config.sql_saves || !establish_db_connection(GLOB.dbcon))
for (var/datum/category_item/player_setup_item/PI in items)
PI.save_character(S)
else if (modified)
@@ -170,20 +170,20 @@
modified = 0
/datum/category_group/player_setup_category/proc/load_preferences(var/savefile/S)
if (!config.sql_saves || !establish_db_connection(dbcon))
if (!GLOB.config.sql_saves || !establish_db_connection(GLOB.dbcon))
for (var/datum/category_item/player_setup_item/PI in items)
PI.load_preferences(S)
else
handle_sql_loading(SQL_PREFERENCES)
for (var/datum/category_item/player_setup_item/PI in items)
PI.sanitize_preferences(config.sql_saves)
PI.sanitize_preferences(GLOB.config.sql_saves)
/datum/category_group/player_setup_category/proc/save_preferences(var/savefile/S)
for (var/datum/category_item/player_setup_item/PI in items)
PI.sanitize_preferences()
if (!config.sql_saves || !establish_db_connection(dbcon))
if (!GLOB.config.sql_saves || !establish_db_connection(GLOB.dbcon))
for (var/datum/category_item/player_setup_item/PI in items)
PI.save_preferences(S)
else
@@ -94,7 +94,7 @@
#endif
for (var/query_text in query_cache[type])
var/DBQuery/query = dbcon.NewQuery(query_text)
var/DBQuery/query = GLOB.dbcon.NewQuery(query_text)
query.Execute(arg_list)
if (query.ErrorMsg())
log_world("ERROR: SQL CHARACTER LOAD: SQL query error: [query.ErrorMsg()]")
@@ -211,7 +211,7 @@
// Typecast the collection so we can access its preferences var.
var/datum/category_collection/player_setup_collection/cc = collection
for (var/query_text in query_cache[type])
var/DBQuery/query = dbcon.NewQuery(query_text)
var/DBQuery/query = GLOB.dbcon.NewQuery(query_text)
query.Execute(arg_list)
if (query.ErrorMsg())
@@ -228,7 +228,7 @@
if ((role_type & SQL_CHARACTER) && !cc.preferences.current_character)
// No current character, means we're doing insert queries.
// Quickly nab the new ID and substitute it within the args.
query = dbcon.NewQuery("SELECT LAST_INSERT_ID() AS new_id")
query = GLOB.dbcon.NewQuery("SELECT LAST_INSERT_ID() AS new_id")
query.Execute()
if (query.NextRow())