Merge pull request #13582 from timothyteakettle/i-hate-mcolor
adds advanced colouring mode: allows you to individually colour mutant parts
This commit is contained in:
@@ -175,6 +175,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
|
||||
//Called when cloning, copies some vars that should be kept
|
||||
/datum/species/proc/copy_properties_from(datum/species/old_species)
|
||||
mutant_bodyparts["limbs_id"] = old_species.mutant_bodyparts["limbs_id"]
|
||||
return
|
||||
|
||||
//Please override this locally if you want to define when what species qualifies for what rank if human authority is enforced.
|
||||
@@ -746,14 +747,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
)
|
||||
|
||||
var/g = (H.dna.features["body_model"] == FEMALE) ? "f" : "m"
|
||||
var/list/colorlist = list()
|
||||
var/husk = HAS_TRAIT(H, TRAIT_HUSK)
|
||||
colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features["mcolor"]]00")
|
||||
colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features["mcolor2"]]00")
|
||||
colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features["mcolor3"]]00")
|
||||
colorlist += husk ? list(0, 0, 0) : list(0, 0, 0, hair_alpha)
|
||||
for(var/index in 1 to colorlist.len)
|
||||
colorlist[index] /= 255
|
||||
|
||||
for(var/layer in relevant_layers)
|
||||
var/list/standing = list()
|
||||
@@ -775,6 +769,22 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
if(S.center)
|
||||
accessory_overlay = center_image(accessory_overlay, S.dimension_x, S.dimension_y)
|
||||
|
||||
var/advanced_color_system = (H.dna.features["color_scheme"] == ADVANCED_CHARACTER_COLORING)
|
||||
|
||||
var/mutant_string = S.mutant_part_string
|
||||
if(mutant_string == "tailwag") //wagging tails should be coloured the same way as your tail
|
||||
mutant_string = "tail"
|
||||
var/primary_string = advanced_color_system ? "[mutant_string]_primary" : "mcolor"
|
||||
var/secondary_string = advanced_color_system ? "[mutant_string]_secondary" : "mcolor2"
|
||||
var/tertiary_string = advanced_color_system ? "[mutant_string]_tertiary" : "mcolor3"
|
||||
//failsafe: if there's no value for any of these, set it to white
|
||||
if(!H.dna.features[primary_string])
|
||||
H.dna.features[primary_string] = advanced_color_system ? H.dna.features["mcolor"] : "FFFFFF"
|
||||
if(!H.dna.features[secondary_string])
|
||||
H.dna.features[secondary_string] = advanced_color_system ? H.dna.features["mcolor2"] : "FFFFFF"
|
||||
if(!H.dna.features[tertiary_string])
|
||||
H.dna.features[tertiary_string] = advanced_color_system ? H.dna.features["mcolor3"] : "FFFFFF"
|
||||
|
||||
if(!husk)
|
||||
if(!forced_colour)
|
||||
switch(S.color_src)
|
||||
@@ -784,20 +794,36 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
if(fixed_mut_color)
|
||||
accessory_overlay.color = "#[fixed_mut_color]"
|
||||
else
|
||||
accessory_overlay.color = "#[H.dna.features["mcolor"]]"
|
||||
accessory_overlay.color = "#[H.dna.features[primary_string]]"
|
||||
if(MUTCOLORS2)
|
||||
if(fixed_mut_color2)
|
||||
accessory_overlay.color = "#[fixed_mut_color2]"
|
||||
else
|
||||
accessory_overlay.color = "#[H.dna.features["mcolor2"]]"
|
||||
accessory_overlay.color = "#[H.dna.features[primary_string]]"
|
||||
if(MUTCOLORS3)
|
||||
if(fixed_mut_color3)
|
||||
accessory_overlay.color = "#[fixed_mut_color3]"
|
||||
else
|
||||
accessory_overlay.color = "#[H.dna.features["mcolor3"]]"
|
||||
accessory_overlay.color = "#[H.dna.features[primary_string]]"
|
||||
|
||||
if(MATRIXED)
|
||||
accessory_overlay.color = list(colorlist)
|
||||
var/list/accessory_colorlist = list()
|
||||
if(S.matrixed_sections == MATRIX_RED || S.matrixed_sections == MATRIX_RED_GREEN || S.matrixed_sections == MATRIX_RED_BLUE || S.matrixed_sections == MATRIX_ALL)
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features[primary_string]]00")
|
||||
else
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("00000000")
|
||||
if(S.matrixed_sections == MATRIX_GREEN || S.matrixed_sections == MATRIX_RED_GREEN || S.matrixed_sections == MATRIX_GREEN_BLUE || S.matrixed_sections == MATRIX_ALL)
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features[secondary_string]]00")
|
||||
else
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("00000000")
|
||||
if(S.matrixed_sections == MATRIX_BLUE || S.matrixed_sections == MATRIX_RED_BLUE || S.matrixed_sections == MATRIX_GREEN_BLUE || S.matrixed_sections == MATRIX_ALL)
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features[tertiary_string]]00")
|
||||
else
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("00000000")
|
||||
accessory_colorlist += husk ? list(0, 0, 0) : list(0, 0, 0, hair_alpha)
|
||||
for(var/index in 1 to accessory_colorlist.len)
|
||||
accessory_colorlist[index] /= 255
|
||||
accessory_overlay.color = list(accessory_colorlist)
|
||||
|
||||
if(HAIR)
|
||||
if(hair_color == "mutcolor")
|
||||
@@ -820,7 +846,14 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
if(bodypart == "tail")
|
||||
accessory_overlay.icon_state = "m_tail_husk_[layertext]"
|
||||
if(S.color_src == MATRIXED)
|
||||
accessory_overlay.color = colorlist
|
||||
var/list/accessory_colorlist = list()
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features[primary_string]]00")
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features[secondary_string]]00")
|
||||
accessory_colorlist += husk ? ReadRGB("#a3a3a3") : ReadRGB("[H.dna.features[tertiary_string]]00")
|
||||
accessory_colorlist += husk ? list(0, 0, 0) : list(0, 0, 0, hair_alpha)
|
||||
for(var/index in 1 to accessory_colorlist.len)
|
||||
accessory_colorlist[index] /= 255
|
||||
accessory_overlay.color = list(accessory_colorlist)
|
||||
|
||||
if(OFFSET_MUTPARTS in H.dna.species.offset_features)
|
||||
accessory_overlay.pixel_x += H.dna.species.offset_features[OFFSET_MUTPARTS][1]
|
||||
@@ -837,23 +870,22 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
if(S.center)
|
||||
extra_accessory_overlay = center_image(extra_accessory_overlay, S.dimension_x, S.dimension_y)
|
||||
|
||||
|
||||
switch(S.extra_color_src) //change the color of the extra overlay
|
||||
if(MUTCOLORS)
|
||||
if(fixed_mut_color)
|
||||
extra_accessory_overlay.color = "#[fixed_mut_color]"
|
||||
else
|
||||
extra_accessory_overlay.color = "#[H.dna.features["mcolor"]]"
|
||||
extra_accessory_overlay.color = "#[H.dna.features[secondary_string]]"
|
||||
if(MUTCOLORS2)
|
||||
if(fixed_mut_color2)
|
||||
extra_accessory_overlay.color = "#[fixed_mut_color2]"
|
||||
else
|
||||
extra_accessory_overlay.color = "#[H.dna.features["mcolor2"]]"
|
||||
extra_accessory_overlay.color = "#[H.dna.features[secondary_string]]"
|
||||
if(MUTCOLORS3)
|
||||
if(fixed_mut_color3)
|
||||
extra_accessory_overlay.color = "#[fixed_mut_color3]"
|
||||
else
|
||||
extra_accessory_overlay.color = "#[H.dna.features["mcolor3"]]"
|
||||
extra_accessory_overlay.color = "#[H.dna.features[secondary_string]]"
|
||||
if(HAIR)
|
||||
if(hair_color == "mutcolor")
|
||||
extra_accessory_overlay.color = "#[H.dna.features["mcolor3"]]"
|
||||
@@ -889,17 +921,17 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
if(fixed_mut_color)
|
||||
extra2_accessory_overlay.color = "#[fixed_mut_color]"
|
||||
else
|
||||
extra2_accessory_overlay.color = "#[H.dna.features["mcolor"]]"
|
||||
extra2_accessory_overlay.color = "#[H.dna.features[tertiary_string]]"
|
||||
if(MUTCOLORS2)
|
||||
if(fixed_mut_color2)
|
||||
extra2_accessory_overlay.color = "#[fixed_mut_color2]"
|
||||
else
|
||||
extra2_accessory_overlay.color = "#[H.dna.features["mcolor2"]]"
|
||||
extra2_accessory_overlay.color = "#[H.dna.features[tertiary_string]]"
|
||||
if(MUTCOLORS3)
|
||||
if(fixed_mut_color3)
|
||||
extra2_accessory_overlay.color = "#[fixed_mut_color3]"
|
||||
else
|
||||
extra2_accessory_overlay.color = "#[H.dna.features["mcolor3"]]"
|
||||
extra2_accessory_overlay.color = "#[H.dna.features[tertiary_string]]"
|
||||
if(HAIR)
|
||||
if(hair_color == "mutcolor3")
|
||||
extra2_accessory_overlay.color = "#[H.dna.features["mcolor"]]"
|
||||
@@ -916,7 +948,6 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
|
||||
standing += extra2_accessory_overlay
|
||||
|
||||
|
||||
H.overlays_standing[layernum] = standing
|
||||
|
||||
H.apply_overlay(BODY_BEHIND_LAYER)
|
||||
|
||||
@@ -669,6 +669,7 @@ use_mob_overlay_icon: if FALSE, it will always use the default_icon_file even if
|
||||
//produces a key based on the human's limbs
|
||||
/mob/living/carbon/human/generate_icon_render_key()
|
||||
. = "[dna.species.mutant_bodyparts["limbs_id"]]"
|
||||
. += "[dna.features["color_scheme"]]"
|
||||
|
||||
if(dna.check_mutation(HULK))
|
||||
. += "-coloured-hulk"
|
||||
@@ -708,6 +709,11 @@ use_mob_overlay_icon: if FALSE, it will always use the default_icon_file even if
|
||||
. += "-[BP.dmg_overlay_type]"
|
||||
if(BP.body_markings)
|
||||
. += "-[BP.body_markings]"
|
||||
if(length(BP.markings_color) && length(BP.markings_color[1]))
|
||||
for(var/color in BP.markings_color[1])
|
||||
. += "-[color]"
|
||||
if(BP.icon)
|
||||
. += "-[BP.icon]"
|
||||
else
|
||||
. += "-no_marking"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user