mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 09:34:21 +01:00
Add hair gradient customization
This commit is contained in:
@@ -210,6 +210,13 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
/// Do we want to force our runechat colour to be white?
|
||||
var/force_white_runechat = FALSE
|
||||
|
||||
// Hair gradient
|
||||
var/h_grad_style = "None"
|
||||
var/h_grad_offset_x = 0
|
||||
var/h_grad_offset_y = 0
|
||||
var/h_grad_colour = "#000000"
|
||||
var/h_grad_alpha = 255
|
||||
|
||||
/datum/preferences/New(client/C)
|
||||
parent = C
|
||||
b_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+")
|
||||
@@ -333,9 +340,18 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
dat += "<b>Hair:</b> "
|
||||
dat += "<a href='?_src_=prefs;preference=h_style;task=input'>[h_style]</a>"
|
||||
dat += "<a href='?_src_=prefs;preference=hair;task=input'>Color</a> [color_square(h_colour)]"
|
||||
// Secondary hair color
|
||||
var/datum/sprite_accessory/temp_hair_style = GLOB.hair_styles_public_list[h_style]
|
||||
if(temp_hair_style && temp_hair_style.secondary_theme && !temp_hair_style.no_sec_colour)
|
||||
dat += " <a href='?_src_=prefs;preference=secondary_hair;task=input'>Color #2</a> [color_square(h_sec_colour)]"
|
||||
// Hair gradient
|
||||
dat += "<br>"
|
||||
dat += "- <b>Gradient:</b>"
|
||||
dat += " <a href='?_src_=prefs;preference=h_grad_style;task=input'>[h_grad_style]</a>"
|
||||
dat += " <a href='?_src_=prefs;preference=h_grad_colour;task=input'>Color</a> [color_square(h_grad_colour)]"
|
||||
dat += " <a href='?_src_=prefs;preference=h_grad_alpha;task=input'>[h_grad_alpha]</a>"
|
||||
dat += "<br>"
|
||||
dat += "- <b>Gradient Offset:</b> <a href='?_src_=prefs;preference=h_grad_offset;task=input'>[h_grad_offset_x],[h_grad_offset_y]</a>"
|
||||
dat += "<br>"
|
||||
|
||||
dat += "<b>Facial Hair:</b> "
|
||||
@@ -1495,6 +1511,29 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
if(new_h_style)
|
||||
h_style = new_h_style
|
||||
|
||||
if("h_grad_style")
|
||||
var/result = input(user, "Choose your character's hair gradient style:", "Character Preference") as null|anything in GLOB.hair_gradients_list
|
||||
if(result)
|
||||
h_grad_style = result
|
||||
|
||||
if("h_grad_offset")
|
||||
var/result = input(user, "Enter your character's hair gradient offset as a comma-separated value (x,y). Example:\n0,0 (no offset)\n5,0 (5 pixels to the right)", "Character Preference") as null|text
|
||||
if(result)
|
||||
var/list/expl = splittext(result, ",")
|
||||
if(length(expl) == 2)
|
||||
h_grad_offset_x = clamp(text2num(expl[1]) || 0, -16, 16)
|
||||
h_grad_offset_y = clamp(text2num(expl[2]) || 0, -16, 16)
|
||||
|
||||
if("h_grad_colour")
|
||||
var/result = input(user, "Choose your character's hair gradient colour:", "Character Preference", h_grad_colour) as color|null
|
||||
if(result)
|
||||
h_grad_colour = result
|
||||
|
||||
if("h_grad_alpha")
|
||||
var/result = input(user, "Choose your character's hair gradient alpha:", "Character Preference", h_grad_alpha) as num|null
|
||||
if(!isnull(result))
|
||||
h_grad_alpha = clamp(result, 0, 255)
|
||||
|
||||
if("headaccessory")
|
||||
if(S.bodyflags & HAS_HEAD_ACCESSORY) //Species with head accessories.
|
||||
var/input = "Choose the colour of your your character's head accessory:"
|
||||
@@ -2200,6 +2239,12 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
H.f_style = f_style
|
||||
|
||||
H.alt_head = alt_head
|
||||
|
||||
H.h_grad_style = h_grad_style
|
||||
H.h_grad_offset_x = h_grad_offset_x
|
||||
H.h_grad_offset_y = h_grad_offset_y
|
||||
H.h_grad_colour = h_grad_colour
|
||||
H.h_grad_alpha = h_grad_alpha
|
||||
//End of head-specific.
|
||||
|
||||
character.skin_colour = s_colour
|
||||
|
||||
@@ -195,7 +195,11 @@
|
||||
socks,
|
||||
body_accessory,
|
||||
gear,
|
||||
autohiss
|
||||
autohiss,
|
||||
hair_gradient,
|
||||
hair_gradient_offset,
|
||||
hair_gradient_colour,
|
||||
hair_gradient_alpha
|
||||
FROM [format_table_name("characters")] WHERE ckey=:ckey AND slot=:slot"}, list(
|
||||
"ckey" = C.ckey,
|
||||
"slot" = slot
|
||||
@@ -276,6 +280,11 @@
|
||||
loadout_gear = params2list(query.item[51])
|
||||
autohiss_mode = text2num(query.item[52])
|
||||
|
||||
h_grad_style = query.item[53]
|
||||
h_grad_offset_x = query.item[54] // parsed down below
|
||||
h_grad_colour = query.item[55]
|
||||
h_grad_alpha = query.item[56]
|
||||
|
||||
saved = TRUE
|
||||
|
||||
qdel(query)
|
||||
@@ -331,6 +340,14 @@
|
||||
socks = sanitize_text(socks, initial(socks))
|
||||
body_accessory = sanitize_text(body_accessory, initial(body_accessory))
|
||||
|
||||
// h_grad_style =
|
||||
var/list/expl = splittext(h_grad_offset_x, ",")
|
||||
if(length(expl) == 2)
|
||||
h_grad_offset_x = text2num(expl[1]) || 0
|
||||
h_grad_offset_y = text2num(expl[2]) || 0
|
||||
h_grad_colour = sanitize_hexcolor(h_grad_colour)
|
||||
h_grad_alpha = sanitize_integer(h_grad_alpha, 0, 255, initial(h_grad_alpha))
|
||||
|
||||
// if(isnull(disabilities)) disabilities = 0
|
||||
if(!player_alt_titles) player_alt_titles = new()
|
||||
if(!organ_data) src.organ_data = list()
|
||||
@@ -421,7 +438,11 @@
|
||||
socks=:socks,
|
||||
body_accessory=:body_accessory,
|
||||
gear=:gearlist,
|
||||
autohiss=:autohiss_mode
|
||||
autohiss=:autohiss_mode,
|
||||
hair_gradient=:h_grad_style,
|
||||
hair_gradient_offset=:h_grad_offset,
|
||||
hair_gradient_colour=:h_grad_colour,
|
||||
hair_gradient_alpha=:h_grad_alpha
|
||||
WHERE ckey=:ckey
|
||||
AND slot=:slot"}, list(
|
||||
// OH GOD SO MANY PARAMETERS
|
||||
@@ -477,6 +498,10 @@
|
||||
"body_accessory" = (body_accessory ? body_accessory : ""),
|
||||
"gearlist" = (gearlist ? gearlist : ""),
|
||||
"autohiss_mode" = autohiss_mode,
|
||||
"h_grad_style" = h_grad_style,
|
||||
"h_grad_offset" = "[h_grad_offset_x],[h_grad_offset_y]",
|
||||
"h_grad_colour" = h_grad_colour,
|
||||
"h_grad_alpha" = h_grad_alpha,
|
||||
"ckey" = C.ckey,
|
||||
"slot" = default_slot
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user