mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 07:59:01 +01:00
Ports body markings from polaris (#2607)
Ports the body marking system from polaris. And I think I got all the SQL related procs.
This commit is contained in:
@@ -25,6 +25,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
|
||||
S["body_markings"] >> pref.body_markings
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/save_character(var/savefile/S)
|
||||
S["species"] << pref.species
|
||||
@@ -47,6 +48,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
|
||||
S["body_markings"] << pref.body_markings
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/gather_load_query()
|
||||
return list("ss13_characters" = list("vars" = list("species",
|
||||
@@ -60,7 +62,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
"b_type",
|
||||
"disabilities",
|
||||
"organs_data" = "organ_data",
|
||||
"organs_robotic" = "rlimb_data"),
|
||||
"organs_robotic" = "rlimb_data",
|
||||
"body_markings"),
|
||||
"args" = list("id")))
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/gather_load_parameters()
|
||||
@@ -79,6 +82,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
"disabilities",
|
||||
"organs_data",
|
||||
"organs_robotic",
|
||||
"body_markings",
|
||||
"id" = 1,
|
||||
"ckey" = 1))
|
||||
|
||||
@@ -95,6 +99,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
"disabilities" = pref.disabilities,
|
||||
"organs_data" = list2params(pref.organ_data),
|
||||
"organs_robotic"= list2params(pref.rlimb_data),
|
||||
"body_markings" = json_encode(pref.body_markings),
|
||||
"id" = pref.current_character,
|
||||
"ckey" = pref.client.ckey)
|
||||
|
||||
@@ -131,6 +136,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.organ_data = params2list(pref.organ_data)
|
||||
if (pref.rlimb_data)
|
||||
pref.rlimb_data = params2list(pref.rlimb_data)
|
||||
if (pref.body_markings)
|
||||
pref.body_markings = json_decode(pref.body_markings)
|
||||
|
||||
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))
|
||||
@@ -154,6 +161,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.organ_data = list()
|
||||
if (!pref.rlimb_data || !islist(pref.rlimb_data))
|
||||
pref.rlimb_data = list()
|
||||
if (!pref.body_markings || !islist(pref.body_markings))
|
||||
pref.body_markings = list()
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/content(var/mob/user)
|
||||
pref.update_preview_icon()
|
||||
@@ -269,6 +278,12 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
. += "<br><b>Body Color</b><br>"
|
||||
. += "<a href='?src=\ref[src];skin_color=1'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(pref.r_skin, 2)][num2hex(pref.g_skin, 2)][num2hex(pref.b_skin, 2)]'><table style='display:inline;' bgcolor='#[num2hex(pref.r_skin, 2)][num2hex(pref.g_skin, 2)][num2hex(pref.b_skin, 2)]'><tr><td>__</td></tr></table></font><br>"
|
||||
|
||||
. += "<br><a href='?src=\ref[src];marking_style=1'>Body Markings +</a><br>"
|
||||
for(var/M in pref.body_markings)
|
||||
. += "[M] <a href='?src=\ref[src];marking_remove=[M]'>-</a> <a href='?src=\ref[src];marking_color=[M]'>Color</a>"
|
||||
. += "<font face='fixedsys' size='3' color='[pref.body_markings[M]]'><table style='display:inline;' bgcolor='[pref.body_markings[M]]'><tr><td>__</td></tr></table></font>"
|
||||
. += "<br>"
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/proc/has_flag(var/datum/species/mob_species, var/flag)
|
||||
return mob_species && (mob_species.appearance_flags & flag)
|
||||
|
||||
@@ -350,6 +365,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
pref.organ_data.Cut()
|
||||
pref.rlimb_data.Cut()
|
||||
pref.body_markings.Cut()
|
||||
|
||||
return TOPIC_REFRESH
|
||||
|
||||
@@ -437,6 +453,32 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.f_style = new_f_style
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["marking_style"])
|
||||
var/list/usable_markings = pref.body_markings.Copy() ^ body_marking_styles_list.Copy()
|
||||
for(var/M in usable_markings)
|
||||
var/datum/sprite_accessory/S = usable_markings[M]
|
||||
if(!S.species_allowed.len)
|
||||
continue
|
||||
else if(!(pref.species in S.species_allowed))
|
||||
usable_markings -= M
|
||||
|
||||
var/new_marking = input(user, "Choose a body marking:", "Character Preference") as null|anything in usable_markings
|
||||
if(new_marking && CanUseTopic(user))
|
||||
pref.body_markings[new_marking] = "#000000" //New markings start black
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["marking_remove"])
|
||||
var/M = href_list["marking_remove"]
|
||||
pref.body_markings -= M
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["marking_color"])
|
||||
var/M = href_list["marking_color"]
|
||||
var/mark_color = input(user, "Choose the [M] color: ", "Character Preference", pref.body_markings[M]) as color|null
|
||||
if(mark_color && CanUseTopic(user))
|
||||
pref.body_markings[M] = "[mark_color]"
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["limbs"])
|
||||
var/list/acceptable_organ_input = list("Left Leg","Right Leg","Left Arm","Right Arm","Left Foot","Right Foot","Left Hand","Right Hand")
|
||||
var/limb_name = input(user, "Which limb do you want to change?") as null|anything in acceptable_organ_input
|
||||
|
||||
Reference in New Issue
Block a user