mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 11:38:12 +01:00
Merge remote-tracking branch 'polaris/master' into sink
# Conflicts: # code/_onclick/item_attack.dm # code/modules/client/preferences.dm # code/modules/mob/living/carbon/human/examine.dm # code/modules/mob/living/simple_animal/hostile/hostile.dm # code/modules/mob/new_player/preferences_setup.dm # nano/images/nanomap_z1.png # vorestation.dme
This commit is contained in:
@@ -80,7 +80,7 @@ datum/preferences/proc/set_biological_gender(var/gender)
|
||||
var/new_gender = input(user, "Choose your character's biological gender:", "Character Preference", pref.biological_gender) as null|anything in get_genders()
|
||||
if(new_gender && CanUseTopic(user))
|
||||
pref.set_biological_gender(new_gender)
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["id_gender"])
|
||||
var/new_gender = input(user, "Choose your character's identifying gender:", "Character Preference", pref.identifying_gender) as null|anything in all_genders_define_list
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-")
|
||||
|
||||
/datum/preferences
|
||||
var/dress_mob = TRUE
|
||||
|
||||
/datum/category_item/player_setup_item/general/body
|
||||
name = "Body"
|
||||
sort_order = 3
|
||||
@@ -25,6 +28,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
S["disabilities"] >> pref.disabilities
|
||||
S["organ_data"] >> pref.organ_data
|
||||
S["rlimb_data"] >> pref.rlimb_data
|
||||
pref.preview_icon = null
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/save_character(var/savefile/S)
|
||||
S["species"] << pref.species
|
||||
@@ -74,10 +78,9 @@ 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)
|
||||
. = list()
|
||||
pref.update_preview_icon()
|
||||
if(pref.preview_icon_front && pref.preview_icon_side)
|
||||
user << browse_rsc(pref.preview_icon_front, "preview_icon.png")
|
||||
user << browse_rsc(pref.preview_icon_side, "preview_icon2.png")
|
||||
if(!pref.preview_icon)
|
||||
pref.update_preview_icon()
|
||||
user << browse_rsc(pref.preview_icon, "previewicon.png")
|
||||
|
||||
var/mob_species = all_species[pref.species]
|
||||
. += "<table><tr style='vertical-align:top'><td><b>Body</b> "
|
||||
@@ -167,7 +170,10 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else
|
||||
. += "<br><br>"
|
||||
|
||||
. += "</td><td><b>Preview</b><br><img src=preview_icon.png height=64 width=64><img src=preview_icon2.png height=64 width=64>"
|
||||
. += "</td><td><b>Preview</b><br>"
|
||||
. += "<div class='statusDisplay'><center><img src=previewicon.png width=[pref.preview_icon.Width()] height=[pref.preview_icon.Height()]></center></div>"
|
||||
. += "<br><a href='?src=\ref[src];toggle_clothing=1'>[pref.dress_mob ? "Hide equipment" : "Show equipment"]</a>"
|
||||
|
||||
. += "</td></tr></table>"
|
||||
|
||||
. += "<b>Hair</b><br>"
|
||||
@@ -196,8 +202,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/datum/species/mob_species = all_species[pref.species]
|
||||
|
||||
if(href_list["random"])
|
||||
pref.randomize_appearance_for()
|
||||
return TOPIC_REFRESH
|
||||
pref.randomize_appearance_and_body_for()
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["blood_type"])
|
||||
var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in valid_bloodtypes
|
||||
@@ -274,7 +280,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
pref.age = max(min(pref.age, S.max_age), S.min_age)
|
||||
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["hair_color"])
|
||||
if(!has_flag(mob_species, HAS_HAIR_COLOR))
|
||||
@@ -284,7 +290,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.r_hair = hex2num(copytext(new_hair, 2, 4))
|
||||
pref.g_hair = hex2num(copytext(new_hair, 4, 6))
|
||||
pref.b_hair = hex2num(copytext(new_hair, 6, 8))
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["hair_style"])
|
||||
var/list/valid_hairstyles = list()
|
||||
@@ -298,7 +304,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/new_h_style = input(user, "Choose your character's hair style:", "Character Preference", pref.h_style) as null|anything in valid_hairstyles
|
||||
if(new_h_style && CanUseTopic(user))
|
||||
pref.h_style = new_h_style
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["facial_color"])
|
||||
if(!has_flag(mob_species, HAS_HAIR_COLOR))
|
||||
@@ -308,7 +314,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.r_facial = hex2num(copytext(new_facial, 2, 4))
|
||||
pref.g_facial = hex2num(copytext(new_facial, 4, 6))
|
||||
pref.b_facial = hex2num(copytext(new_facial, 6, 8))
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["eye_color"])
|
||||
if(!has_flag(mob_species, HAS_EYE_COLOR))
|
||||
@@ -318,7 +324,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.r_eyes = hex2num(copytext(new_eyes, 2, 4))
|
||||
pref.g_eyes = hex2num(copytext(new_eyes, 4, 6))
|
||||
pref.b_eyes = hex2num(copytext(new_eyes, 6, 8))
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["skin_tone"])
|
||||
if(!has_flag(mob_species, HAS_SKIN_TONE))
|
||||
@@ -326,7 +332,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference", (-pref.s_tone) + 35) as num|null
|
||||
if(new_s_tone && has_flag(mob_species, HAS_SKIN_TONE) && CanUseTopic(user))
|
||||
pref.s_tone = 35 - max(min( round(new_s_tone), 220),1)
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["skin_color"])
|
||||
if(!has_flag(mob_species, HAS_SKIN_COLOR))
|
||||
@@ -336,7 +342,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.r_skin = hex2num(copytext(new_skin, 2, 4))
|
||||
pref.g_skin = hex2num(copytext(new_skin, 4, 6))
|
||||
pref.b_skin = hex2num(copytext(new_skin, 6, 8))
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["facial_style"])
|
||||
var/list/valid_facialhairstyles = list()
|
||||
@@ -354,11 +360,11 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/new_f_style = input(user, "Choose your character's facial-hair style:", "Character Preference", pref.f_style) as null|anything in valid_facialhairstyles
|
||||
if(new_f_style && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
|
||||
pref.f_style = new_f_style
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["reset_limbs"])
|
||||
reset_limbs()
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["limbs"])
|
||||
|
||||
@@ -419,7 +425,6 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
switch(new_state)
|
||||
if("Normal")
|
||||
|
||||
if(limb == BP_TORSO)
|
||||
for(var/other_limb in BP_ALL - BP_TORSO)
|
||||
pref.organ_data[other_limb] = null
|
||||
@@ -444,6 +449,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/list/usable_manufacturers = list()
|
||||
for(var/company in chargen_robolimbs)
|
||||
var/datum/robolimb/M = chargen_robolimbs[company]
|
||||
if(!(limb in M.parts))
|
||||
continue
|
||||
if(tmp_species in M.species_cannot_use)
|
||||
continue
|
||||
usable_manufacturers[company] = M
|
||||
@@ -473,7 +480,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
for(var/internal_organ in list(O_HEART,O_EYES))
|
||||
pref.organ_data[internal_organ] = "mechanical"
|
||||
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["organs"])
|
||||
|
||||
@@ -511,7 +518,11 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else if(href_list["disabilities"])
|
||||
var/disability_flag = text2num(href_list["disabilities"])
|
||||
pref.disabilities ^= disability_flag
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["toggle_clothing"])
|
||||
pref.dress_mob = !pref.dress_mob
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -1,90 +1,75 @@
|
||||
/datum/preferences
|
||||
var/list/all_underwear
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment
|
||||
name = "Clothing"
|
||||
sort_order = 4
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment/load_character(var/savefile/S)
|
||||
S["underwear_top"] >> pref.underwear_top
|
||||
S["underwear_bottom"] >> pref.underwear_bottom
|
||||
S["undershirt"] >> pref.undershirt
|
||||
S["socks"] >> pref.socks
|
||||
S["all_underwear"] >> pref.all_underwear
|
||||
S["backbag"] >> pref.backbag
|
||||
S["pdachoice"] >> pref.pdachoice
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment/save_character(var/savefile/S)
|
||||
S["underwear_top"] << pref.underwear_top
|
||||
S["underwear_bottom"] << pref.underwear_bottom
|
||||
S["undershirt"] << pref.undershirt
|
||||
S["socks"] << pref.socks
|
||||
S["all_underwear"] << pref.all_underwear
|
||||
S["backbag"] << pref.backbag
|
||||
S["pdachoice"] << pref.pdachoice
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment/sanitize_character()
|
||||
if(!islist(pref.gear)) pref.gear = list()
|
||||
|
||||
if(!istype(pref.all_underwear))
|
||||
pref.all_underwear = list()
|
||||
|
||||
for(var/datum/category_group/underwear/WRC in global_underwear.categories)
|
||||
for(var/datum/category_item/underwear/WRI in WRC.items)
|
||||
if(WRI.is_default(pref.identifying_gender ? pref.identifying_gender : MALE))
|
||||
pref.all_underwear[WRC.name] = WRI.name
|
||||
break
|
||||
|
||||
for(var/underwear_category in pref.all_underwear)
|
||||
var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[underwear_category]
|
||||
if(!UWC)
|
||||
pref.all_underwear -= UWC
|
||||
else
|
||||
var/datum/category_item/underwear/UWI = UWC.items_by_name[pref.all_underwear[underwear_category]]
|
||||
if(!UWI)
|
||||
pref.all_underwear -= UWC
|
||||
|
||||
pref.backbag = sanitize_integer(pref.backbag, 1, backbaglist.len, initial(pref.backbag))
|
||||
pref.pdachoice = sanitize_integer(pref.pdachoice, 1, pdachoicelist.len, initial(pref.pdachoice))
|
||||
|
||||
if(!islist(pref.gear)) pref.gear = list()
|
||||
|
||||
var/undies_top = get_undies_top()
|
||||
var/undies_bottom = get_undies_bottom()
|
||||
if(!get_key_by_value(undies_top, pref.underwear_top))
|
||||
pref.underwear_top = undies_top[1]
|
||||
if(!get_key_by_value(undies_bottom, pref.underwear_bottom))
|
||||
pref.underwear_bottom = undies_bottom[1]
|
||||
if(!get_key_by_value(undershirt_t, pref.undershirt))
|
||||
pref.undershirt = undershirt_t[1]
|
||||
if(!get_key_by_value(socks_t, pref.socks))
|
||||
pref.socks = socks_t[1]
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment/content()
|
||||
. = list()
|
||||
. += "<b>Equipment:</b><br>"
|
||||
. += "Underwear Top: <a href='?src=\ref[src];change_underwear_top=1'><b>[get_key_by_value(get_undies_top(),pref.underwear_top)]</b></a><br>"
|
||||
. += "Underwear Bottom: <a href='?src=\ref[src];change_underwear_bottom=1'><b>[get_key_by_value(get_undies_bottom(),pref.underwear_bottom)]</b></a><br>"
|
||||
. += "Undershirt: <a href='?src=\ref[src];change_undershirt=1'><b>[get_key_by_value(undershirt_t,pref.undershirt)]</b></a><br>"
|
||||
. += "Socks: <a href='?src=\ref[src];change_socks=1'><b>[get_key_by_value(socks_t,pref.socks)]</b></a><br>"
|
||||
for(var/datum/category_group/underwear/UWC in global_underwear.categories)
|
||||
var/item_name = pref.all_underwear[UWC.name] ? pref.all_underwear[UWC.name] : "None"
|
||||
. += "[UWC.name]: <a href='?src=\ref[src];change_underwear=[UWC.name]'><b>[item_name]</b></a><br>"
|
||||
. += "Backpack Type: <a href='?src=\ref[src];change_backpack=1'><b>[backbaglist[pref.backbag]]</b></a><br>"
|
||||
. += "PDA Type: <a href='?src=\ref[src];change_pda=1'><b>[pdachoicelist[pref.pdachoice]]</b></a><br>"
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment/proc/get_undies_top()
|
||||
return underwear_top_t
|
||||
/datum/category_item/player_setup_item/general/equipment/proc/get_undies_bottom()
|
||||
return underwear_bottom_t
|
||||
return jointext(.)
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment/OnTopic(var/href,var/list/href_list, var/mob/user)
|
||||
if(href_list["change_underwear_top"])
|
||||
var/underwear_top_options = get_undies_top()
|
||||
var/new_underwear_top = input(user, "Choose your character's top underwear:", "Character Preference", get_key_by_value(get_undies_top(),pref.underwear_top)) as null|anything in underwear_top_options
|
||||
if(!isnull(new_underwear_top) && CanUseTopic(user))
|
||||
pref.underwear_top = underwear_top_options[new_underwear_top]
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["change_underwear_bottom"])
|
||||
var/underwear_bottom_options = get_undies_bottom()
|
||||
var/new_underwear_bottom = input(user, "Choose your character's bottom underwear:", "Character Preference", get_key_by_value(get_undies_bottom(),pref.underwear_bottom)) as null|anything in underwear_bottom_options
|
||||
if(!isnull(new_underwear_bottom) && CanUseTopic(user))
|
||||
pref.underwear_bottom = underwear_bottom_options[new_underwear_bottom]
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["change_undershirt"])
|
||||
var/new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference", get_key_by_value(undershirt_t,pref.undershirt)) as null|anything in undershirt_t
|
||||
if(!isnull(new_undershirt) && CanUseTopic(user))
|
||||
pref.undershirt = undershirt_t[new_undershirt]
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["change_socks"])
|
||||
var/new_socks = input(user, "Choose your character's socks:", "Character Preference", get_key_by_value(socks_t,pref.socks)) as null|anything in socks_t
|
||||
if(!isnull(new_socks) && CanUseTopic(user))
|
||||
pref.socks = socks_t[new_socks]
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["change_backpack"])
|
||||
if(href_list["change_backpack"])
|
||||
var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference", backbaglist[pref.backbag]) as null|anything in backbaglist
|
||||
if(!isnull(new_backbag) && CanUseTopic(user))
|
||||
pref.backbag = backbaglist.Find(new_backbag)
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["change_pda"])
|
||||
var/new_pdachoice = input(user, "Choose your character's style of PDA:", "Character Preference", pdachoicelist[pref.pdachoice]) as null|anything in pdachoicelist
|
||||
if(!isnull(new_pdachoice) && CanUseTopic(user))
|
||||
pref.pdachoice = pdachoicelist.Find(new_pdachoice)
|
||||
return TOPIC_REFRESH
|
||||
return ..()
|
||||
|
||||
else if(href_list["change_underwear"])
|
||||
var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[href_list["change_underwear"]]
|
||||
if(!UWC)
|
||||
return
|
||||
var/datum/category_item/underwear/selected_underwear = input(user, "Choose underwear:", "Character Preference", pref.all_underwear[UWC.name]) as null|anything in UWC.items
|
||||
if(selected_underwear && CanUseTopic(user))
|
||||
pref.all_underwear[UWC.name] = selected_underwear.name
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
return ..()
|
||||
Reference in New Issue
Block a user