mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-13 17:08:53 +01:00
porting hair gradient (wip)
it doesn't actually seem to work at all, will continue later
This commit is contained in:
@@ -96,6 +96,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/eye_color = "000" //Eye color
|
||||
var/wing_color = "fff" //Wing color
|
||||
|
||||
var/grad_style //Hair gradient style
|
||||
var/grad_color = "FFFFFF" //Hair gradient color
|
||||
|
||||
//HS13
|
||||
var/body_size = 100 //Body Size in percent
|
||||
var/can_get_preg = 0 //if they can get preggers
|
||||
@@ -511,6 +514,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "<a href='?_src_=prefs;preference=previous_facehair_style;task=input'><</a> <a href='?_src_=prefs;preference=next_facehair_style;task=input'>></a><BR>"
|
||||
dat += "<span style='border: 1px solid #161616; background-color: #[facial_hair_color];'> </span> <a href='?_src_=prefs;preference=facial;task=input'>Change</a><BR>"
|
||||
|
||||
|
||||
dat += "<h3>Hair Gradient</h3>"
|
||||
|
||||
dat += "<a style='display:block;width:100px' href='?_src_=prefs;preference=grad_style;task=input'>[grad_style]</a>"
|
||||
dat += "<a href='?_src_=prefs;preference=previous_grad_style;task=input'><</a> <a href='?_src_=prefs;preference=next_grad_style;task=input'>></a><BR>"
|
||||
dat += "<span style='border: 1px solid #161616; background-color: #[grad_color];'> </span> <a href='?_src_=prefs;preference=grad_color;task=input'>Change</a><BR>"
|
||||
|
||||
|
||||
dat += "</td>"
|
||||
//Mutant stuff
|
||||
var/mutant_category = 0
|
||||
@@ -1868,6 +1879,26 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if("previous_facehair_style")
|
||||
facial_hair_style = previous_list_item(facial_hair_style, GLOB.facial_hair_styles_list)
|
||||
|
||||
|
||||
if("grad_color")
|
||||
var/new_grad_color = input(user, "Choose your character's gradient colour:", "Character Preference","#"+grad_color) as color|null
|
||||
if(new_grad_color)
|
||||
grad_color = sanitize_hexcolor(new_grad_color, 6)
|
||||
|
||||
if("grad_style")
|
||||
var/new_grad_style
|
||||
new_grad_style = input(user, "Choose your character's hair gradient style:", "Character Preference") as null|anything in GLOB.hair_gradients_list
|
||||
if(new_grad_style)
|
||||
grad_style = new_grad_style
|
||||
|
||||
if("next_grad_style")
|
||||
grad_style = next_list_item(grad_style, GLOB.hair_gradients_list)
|
||||
|
||||
if("previous_grad_style")
|
||||
grad_style = previous_list_item(grad_style, GLOB.hair_gradients_list)
|
||||
|
||||
|
||||
|
||||
if("cycle_bg")
|
||||
bgstate = next_list_item(bgstate, bgstate_options)
|
||||
|
||||
|
||||
@@ -531,6 +531,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
|
||||
hair_color = sanitize_hexcolor(hair_color, 3, 0)
|
||||
facial_hair_color = sanitize_hexcolor(facial_hair_color, 3, 0)
|
||||
grad_style = sanitize_inlist(grad_style, GLOB.hair_gradients_list)
|
||||
grad_color = sanitize_hexcolor(grad_color, 6, FALSE)
|
||||
eye_color = sanitize_hexcolor(eye_color, 3, 0)
|
||||
skin_tone = sanitize_inlist(skin_tone, GLOB.skin_tones)
|
||||
wing_color = sanitize_hexcolor(wing_color, 3, FALSE, "#FFFFFF")
|
||||
|
||||
@@ -833,6 +833,61 @@
|
||||
icon_state = "hair_tailhair2"
|
||||
ckeys_allowed = list("quotefox")
|
||||
|
||||
/datum/sprite_accessory/hair_gradient
|
||||
icon = 'icons/mob/hair_gradients.dmi'
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/none
|
||||
name = "None"
|
||||
icon_state = "none"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/fadeup
|
||||
name = "Fade Up"
|
||||
icon_state = "fadeup"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/fadedown
|
||||
name = "Fade Down"
|
||||
icon_state = "fadedown"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/vertical_split
|
||||
name = "Vertical Split"
|
||||
icon_state = "vsplit"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/_split
|
||||
name = "Horizontal Split"
|
||||
icon_state = "bottomflat"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/reflected
|
||||
name = "Reflected"
|
||||
icon_state = "reflected_high"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/reflected_inverse
|
||||
name = "Reflected Inverse"
|
||||
icon_state = "reflected_inverse_high"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/wavy
|
||||
name = "Wavy"
|
||||
icon_state = "wavy"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/long_fade_up
|
||||
name = "Long Fade Up"
|
||||
icon_state = "long_fade_up"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/long_fade_down
|
||||
name = "Long Fade Down"
|
||||
icon_state = "long_fade_down"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/short_fade_up
|
||||
name = "Short Fade Up"
|
||||
icon_state = "short_fade_up"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/short_fade_down
|
||||
name = "Short Fade Down"
|
||||
icon_state = "short_fade_down"
|
||||
|
||||
/datum/sprite_accessory/hair_gradient/wavy_spike
|
||||
name = "Spiked Wavy"
|
||||
icon_state = "wavy_spiked"
|
||||
|
||||
|
||||
|
||||
//Pod-people hairs
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
var/hair_color = "000"
|
||||
var/hair_style = "Bald"
|
||||
|
||||
|
||||
///Colour used for the hair gradient.
|
||||
var/grad_color = "000"
|
||||
///Style used for the hair gradient.
|
||||
var/grad_style
|
||||
|
||||
|
||||
|
||||
//Facial hair colour and style
|
||||
var/facial_hair_color = "000"
|
||||
var/facial_hair_style = "Shaved"
|
||||
@@ -74,4 +82,4 @@
|
||||
var/last_fire_update
|
||||
var/account_id
|
||||
can_be_held = "micro"
|
||||
appearance_flags = KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE
|
||||
appearance_flags = KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE
|
||||
|
||||
@@ -16,6 +16,11 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
var/hair_alpha = 255 // the alpha used by the hair. 255 is completely solid, 0 is transparent.
|
||||
var/wing_color
|
||||
|
||||
///The gradient style used for the mob's hair.
|
||||
var/grad_style
|
||||
///The gradient color used to color the gradient.
|
||||
var/grad_color
|
||||
|
||||
var/use_skintones = 0 // does it use skintones or not? (spoiler alert this is only used by humans)
|
||||
var/exotic_blood = "" // If your race wants to bleed something other than bog standard blood, change this to reagent id.
|
||||
var/exotic_bloodtype = "" //If your race uses a non standard bloodtype (A+, O-, AB-, etc)
|
||||
@@ -426,6 +431,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
|
||||
if(!hair_hidden || dynamic_hair_suffix)
|
||||
var/mutable_appearance/hair_overlay = mutable_appearance(layer = -HAIR_LAYER)
|
||||
var/mutable_appearance/gradient_overlay = mutable_appearance(layer = -HAIR_LAYER)
|
||||
if(!hair_hidden && !H.getorgan(/obj/item/organ/brain)) //Applies the debrained overlay if there is no brain
|
||||
if(!(NOBLOOD in species_traits))
|
||||
hair_overlay.icon = 'icons/mob/human_face.dmi'
|
||||
@@ -461,6 +467,20 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
hair_overlay.color = "#" + hair_color
|
||||
else
|
||||
hair_overlay.color = "#" + H.hair_color
|
||||
|
||||
|
||||
//Gradients
|
||||
grad_style = H.grad_style
|
||||
grad_color = H.grad_color
|
||||
if(grad_style)
|
||||
var/datum/sprite_accessory/gradient = GLOB.hair_gradients_list[grad_style]
|
||||
var/icon/temp = icon(gradient.icon, gradient.icon_state)
|
||||
var/icon/temp_hair = icon(hair_file, hair_state)
|
||||
temp.Blend(temp_hair, ICON_ADD)
|
||||
gradient_overlay.icon = temp
|
||||
gradient_overlay.color = "#" + grad_color
|
||||
|
||||
|
||||
else
|
||||
hair_overlay.color = forced_colour
|
||||
hair_overlay.alpha = hair_alpha
|
||||
@@ -469,6 +489,8 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
hair_overlay.pixel_y += H.dna.species.offset_features[OFFSET_FACE][2]
|
||||
if(hair_overlay.icon)
|
||||
standing += hair_overlay
|
||||
standing += gradient_overlay
|
||||
|
||||
|
||||
if(standing.len)
|
||||
H.overlays_standing[HAIR_LAYER] = standing
|
||||
|
||||
Reference in New Issue
Block a user