First commit of manual port of BS12

#13042
and
#13086
This commit is contained in:
Jon
2016-05-29 00:56:11 +01:00
parent 9fba5882d7
commit 21f898e047
20 changed files with 215 additions and 639 deletions

View File

@@ -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

View File

@@ -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"])
@@ -473,7 +479,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 +517,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 ..()

View File

@@ -55,32 +55,32 @@
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
return TOPIC_REFRESH_UPDATE_PREVIEW
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
return TOPIC_REFRESH_UPDATE_PREVIEW
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
return TOPIC_REFRESH_UPDATE_PREVIEW
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
return TOPIC_REFRESH_UPDATE_PREVIEW
else 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

View File

@@ -160,10 +160,10 @@
var/choice = input("Choose an title for [job.title].", "Choose Title", pref.GetPlayerAltTitle(job)) as anything in choices|null
if(choice && CanUseTopic(user))
SetPlayerAltTitle(job, choice)
return TOPIC_REFRESH
return (pref.dress_mob ? TOPIC_REFRESH_UPDATE_PREVIEW : TOPIC_REFRESH)
else if(href_list["set_job"])
if(SetJob(user, href_list["set_job"])) return TOPIC_REFRESH
if(SetJob(user, href_list["set_job"])) return (pref.dress_mob ? TOPIC_REFRESH_UPDATE_PREVIEW : TOPIC_REFRESH)
return ..()

View File

@@ -1,7 +1,8 @@
// These are not flags, binary operations not intended
#define TOPIC_NOACTION 0
#define TOPIC_HANDLED 1
#define TOPIC_REFRESH 2
#define TOPIC_UPDATE_PREVIEW 4
#define TOPIC_REFRESH_UPDATE_PREVIEW (TOPIC_REFRESH|TOPIC_UPDATE_PREVIEW)
/datum/category_group/player_setup_category/general_preferences
name = "General"
@@ -217,7 +218,9 @@
return 1
. = OnTopic(href, href_list, usr)
if(. == TOPIC_REFRESH)
if(. & TOPIC_UPDATE_PREVIEW)
pref_mob.client.prefs.preview_icon = null
if(. & TOPIC_REFRESH)
pref_mob.client.prefs.ShowChoices(usr)
/datum/category_item/player_setup_item/CanUseTopic(var/mob/user)