mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +01:00
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:
@@ -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'>®</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()
|
||||
|
||||
Reference in New Issue
Block a user