mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 14:37:04 +01:00
Overhaul, adds color2R/G/B helper procs, adds marking/head accessory/body accessory (colours included) randomization in char prefs.
Color2R/G/B helper procs and PR overhaul suggested/co-authored by Krausus.
This commit is contained in:
@@ -67,9 +67,9 @@
|
||||
if(can_change_skin_color())
|
||||
var/new_skin = input(usr, "Choose your character's skin colour: ", "Skin Color", rgb(owner.r_skin, owner.g_skin, owner.b_skin)) as color|null
|
||||
if(new_skin && can_still_topic(state))
|
||||
var/r_skin = hex2num(copytext(new_skin, 2, 4))
|
||||
var/g_skin = hex2num(copytext(new_skin, 4, 6))
|
||||
var/b_skin = hex2num(copytext(new_skin, 6, 8))
|
||||
var/r_skin = color2R(new_skin)
|
||||
var/g_skin = color2G(new_skin)
|
||||
var/b_skin = color2B(new_skin)
|
||||
if(owner.change_skin_color(r_skin, g_skin, b_skin))
|
||||
update_dna()
|
||||
return 1
|
||||
@@ -82,9 +82,9 @@
|
||||
if(can_change(APPEARANCE_HAIR_COLOR))
|
||||
var/new_hair = input("Please select hair color.", "Hair Color", rgb(head_organ.r_hair, head_organ.g_hair, head_organ.b_hair)) as color|null
|
||||
if(new_hair && can_still_topic(state))
|
||||
var/r_hair = hex2num(copytext(new_hair, 2, 4))
|
||||
var/g_hair = hex2num(copytext(new_hair, 4, 6))
|
||||
var/b_hair = hex2num(copytext(new_hair, 6, 8))
|
||||
var/r_hair = color2R(new_hair)
|
||||
var/g_hair = color2G(new_hair)
|
||||
var/b_hair = color2B(new_hair)
|
||||
if(owner.change_hair_color(r_hair, g_hair, b_hair))
|
||||
update_dna()
|
||||
return 1
|
||||
@@ -92,9 +92,9 @@
|
||||
if(can_change(APPEARANCE_SECONDARY_HAIR_COLOR))
|
||||
var/new_hair = input("Please select secondary hair color.", "Secondary Hair Color", rgb(head_organ.r_hair_sec, head_organ.g_hair_sec, head_organ.b_hair_sec)) as color|null
|
||||
if(new_hair && can_still_topic(state))
|
||||
var/r_hair_sec = hex2num(copytext(new_hair, 2, 4))
|
||||
var/g_hair_sec = hex2num(copytext(new_hair, 4, 6))
|
||||
var/b_hair_sec = hex2num(copytext(new_hair, 6, 8))
|
||||
var/r_hair_sec = color2R(new_hair)
|
||||
var/g_hair_sec = color2G(new_hair)
|
||||
var/b_hair_sec = color2B(new_hair)
|
||||
if(owner.change_hair_color(r_hair_sec, g_hair_sec, b_hair_sec, 1))
|
||||
update_dna()
|
||||
return 1
|
||||
@@ -107,9 +107,9 @@
|
||||
if(can_change(APPEARANCE_FACIAL_HAIR_COLOR))
|
||||
var/new_facial = input("Please select facial hair color.", "Facial Hair Color", rgb(head_organ.r_facial, head_organ.g_facial, head_organ.b_facial)) as color|null
|
||||
if(new_facial && can_still_topic(state))
|
||||
var/r_facial = hex2num(copytext(new_facial, 2, 4))
|
||||
var/g_facial = hex2num(copytext(new_facial, 4, 6))
|
||||
var/b_facial = hex2num(copytext(new_facial, 6, 8))
|
||||
var/r_facial = color2R(new_facial)
|
||||
var/g_facial = color2G(new_facial)
|
||||
var/b_facial = color2B(new_facial)
|
||||
if(owner.change_facial_hair_color(r_facial, g_facial, b_facial))
|
||||
update_dna()
|
||||
return 1
|
||||
@@ -117,9 +117,9 @@
|
||||
if(can_change(APPEARANCE_SECONDARY_FACIAL_HAIR_COLOR))
|
||||
var/new_facial = input("Please select secondary facial hair color.", "Secondary Facial Hair Color", rgb(head_organ.r_facial_sec, head_organ.g_facial_sec, head_organ.b_facial_sec)) as color|null
|
||||
if(new_facial && can_still_topic(state))
|
||||
var/r_facial_sec = hex2num(copytext(new_facial, 2, 4))
|
||||
var/g_facial_sec = hex2num(copytext(new_facial, 4, 6))
|
||||
var/b_facial_sec = hex2num(copytext(new_facial, 6, 8))
|
||||
var/r_facial_sec = color2R(new_facial)
|
||||
var/g_facial_sec = color2G(new_facial)
|
||||
var/b_facial_sec = color2B(new_facial)
|
||||
if(owner.change_facial_hair_color(r_facial_sec, g_facial_sec, b_facial_sec, 1))
|
||||
update_dna()
|
||||
return 1
|
||||
@@ -127,9 +127,9 @@
|
||||
if(can_change(APPEARANCE_EYE_COLOR))
|
||||
var/new_eyes = input("Please select eye color.", "Eye Color", rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes)) as color|null
|
||||
if(new_eyes && can_still_topic(state))
|
||||
var/r_eyes = hex2num(copytext(new_eyes, 2, 4))
|
||||
var/g_eyes = hex2num(copytext(new_eyes, 4, 6))
|
||||
var/b_eyes = hex2num(copytext(new_eyes, 6, 8))
|
||||
var/r_eyes = color2R(new_eyes)
|
||||
var/g_eyes = color2G(new_eyes)
|
||||
var/b_eyes = color2B(new_eyes)
|
||||
if(owner.change_eye_color(r_eyes, g_eyes, b_eyes))
|
||||
update_dna()
|
||||
return 1
|
||||
@@ -142,9 +142,9 @@
|
||||
if(can_change_head_accessory())
|
||||
var/new_head_accessory = input("Please select head accessory color.", "Head Accessory Color", rgb(head_organ.r_headacc, head_organ.g_headacc, head_organ.b_headacc)) as color|null
|
||||
if(new_head_accessory && can_still_topic(state))
|
||||
var/r_headacc = hex2num(copytext(new_head_accessory, 2, 4))
|
||||
var/g_headacc = hex2num(copytext(new_head_accessory, 4, 6))
|
||||
var/b_headacc = hex2num(copytext(new_head_accessory, 6, 8))
|
||||
var/r_headacc = color2R(new_head_accessory)
|
||||
var/g_headacc = color2G(new_head_accessory)
|
||||
var/b_headacc = color2B(new_head_accessory)
|
||||
if(owner.change_head_accessory_color(r_headacc, g_headacc, b_headacc))
|
||||
update_dna()
|
||||
return 1
|
||||
@@ -155,9 +155,7 @@
|
||||
return 1
|
||||
if(href_list["head_marking_color"])
|
||||
if(can_change_markings("head"))
|
||||
var/list/marking_colours = params2list(owner.m_colours)
|
||||
marking_colours["head"] = sanitize_hexcolor(marking_colours["head"])
|
||||
var/new_markings = input("Please select head marking color.", "Marking Color", rgb(hex2num(copytext(marking_colours["head"], 2, 4)), hex2num(copytext(marking_colours["head"], 4, 6)), hex2num(copytext(marking_colours["head"], 6, 8)))) as color|null
|
||||
var/new_markings = input("Please select head marking color.", "Marking Color", owner.m_colours["head"]) as color|null
|
||||
if(new_markings && can_still_topic(state))
|
||||
if(owner.change_marking_color(new_markings, "head"))
|
||||
update_dna()
|
||||
@@ -169,9 +167,7 @@
|
||||
return 1
|
||||
if(href_list["body_marking_color"])
|
||||
if(can_change_markings("body"))
|
||||
var/list/marking_colours = params2list(owner.m_colours)
|
||||
marking_colours["body"] = sanitize_hexcolor(marking_colours["body"])
|
||||
var/new_markings = input("Please select body marking color.", "Marking Color", rgb(hex2num(copytext(marking_colours["body"], 2, 4)), hex2num(copytext(marking_colours["body"], 4, 6)), hex2num(copytext(marking_colours["body"], 6, 8)))) as color|null
|
||||
var/new_markings = input("Please select body marking color.", "Marking Color", owner.m_colours["body"]) as color|null
|
||||
if(new_markings && can_still_topic(state))
|
||||
if(owner.change_marking_color(new_markings, "body"))
|
||||
update_dna()
|
||||
@@ -183,9 +179,7 @@
|
||||
return 1
|
||||
if(href_list["tail_marking_color"])
|
||||
if(can_change_markings("tail"))
|
||||
var/list/marking_colours = params2list(owner.m_colours)
|
||||
marking_colours["tail"] = sanitize_hexcolor(marking_colours["tail"])
|
||||
var/new_markings = input("Please select tail marking color.", "Marking Color", rgb(hex2num(copytext(marking_colours["tail"], 2, 4)), hex2num(copytext(marking_colours["tail"], 4, 6)), hex2num(copytext(marking_colours["tail"], 6, 8)))) as color|null
|
||||
var/new_markings = input("Please select tail marking color.", "Marking Color", owner.m_colours["tail"]) as color|null
|
||||
if(new_markings && can_still_topic(state))
|
||||
if(owner.change_marking_color(new_markings, "tail"))
|
||||
update_dna()
|
||||
@@ -246,8 +240,7 @@
|
||||
|
||||
data["change_head_markings"] = can_change_markings("head")
|
||||
if(data["change_head_markings"])
|
||||
var/list/marking_styles = params2list(owner.m_styles)
|
||||
var/m_style = marking_styles["head"]
|
||||
var/m_style = owner.m_styles["head"]
|
||||
var/head_marking_styles[0]
|
||||
for(var/head_marking_style in valid_head_marking_styles)
|
||||
head_marking_styles[++head_marking_styles.len] = list("headmarkingstyle" = head_marking_style)
|
||||
@@ -256,8 +249,7 @@
|
||||
|
||||
data["change_body_markings"] = can_change_markings("body")
|
||||
if(data["change_body_markings"])
|
||||
var/list/marking_styles = params2list(owner.m_styles)
|
||||
var/m_style = marking_styles["body"]
|
||||
var/m_style = owner.m_styles["body"]
|
||||
var/body_marking_styles[0]
|
||||
for(var/body_marking_style in valid_body_marking_styles)
|
||||
body_marking_styles[++body_marking_styles.len] = list("bodymarkingstyle" = body_marking_style)
|
||||
@@ -266,8 +258,7 @@
|
||||
|
||||
data["change_tail_markings"] = can_change_markings("tail")
|
||||
if(data["change_tail_markings"])
|
||||
var/list/marking_styles = params2list(owner.m_styles)
|
||||
var/m_style = marking_styles["tail"]
|
||||
var/m_style = owner.m_styles["tail"]
|
||||
var/tail_marking_styles[0]
|
||||
for(var/tail_marking_style in valid_tail_marking_styles)
|
||||
tail_marking_styles[++tail_marking_styles.len] = list("tailmarkingstyle" = tail_marking_style)
|
||||
|
||||
Reference in New Issue
Block a user