mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-03 22:13:24 +00:00
reworks handling of transparent limbs (#8947)
* reworks handling of transparent limbs * fixing the icon operation error
This commit is contained in:
@@ -256,12 +256,14 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
if(head)
|
||||
if(!istype(head, /obj/item/organ/external/stump))
|
||||
icon_key += "[head.eye_icon]"
|
||||
var/wholeicontransparent = TRUE
|
||||
for(var/organ_tag in species.has_limbs)
|
||||
var/obj/item/organ/external/part = organs_by_name[organ_tag]
|
||||
if(isnull(part) || part.is_stump())
|
||||
icon_key += "0"
|
||||
continue
|
||||
if(part)
|
||||
wholeicontransparent &&= part.nonsolid
|
||||
icon_key += "[part.species.get_race_key(part.owner)]"
|
||||
icon_key += "[part.dna.GetUIState(DNA_UI_GENDER)]"
|
||||
icon_key += "[part.s_tone]"
|
||||
@@ -296,14 +298,17 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
else
|
||||
//BEGIN CACHED ICON GENERATION.
|
||||
var/obj/item/organ/external/chest = get_organ(BP_TORSO)
|
||||
base_icon = chest.get_icon()
|
||||
base_icon = chest.get_icon(skeleton, !wholeicontransparent)
|
||||
|
||||
var/apply_extra_transparency_leg = organs_by_name[BP_L_LEG] && organs_by_name[BP_R_LEG]
|
||||
var/apply_extra_transparency_foot = organs_by_name[BP_L_FOOT] && organs_by_name[BP_R_FOOT]
|
||||
|
||||
var/icon/Cutter = null
|
||||
|
||||
for(var/obj/item/organ/external/part in organs)
|
||||
if(isnull(part) || part.is_stump())
|
||||
if(isnull(part) || part.is_stump() || part == chest)
|
||||
continue
|
||||
var/icon/temp = part.get_icon(skeleton)
|
||||
var/icon/temp = part.get_icon(skeleton, !wholeicontransparent)
|
||||
|
||||
if((part.organ_tag in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT)) && Cutter)
|
||||
temp.Blend(Cutter, ICON_AND, x = -16)
|
||||
@@ -319,16 +324,26 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
if(!(part.icon_position & RIGHT))
|
||||
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
|
||||
base_icon.Blend(temp2, ICON_OVERLAY)
|
||||
temp2.Insert(temp2,"blank",dir=NORTH) //faaaaairly certain this is more efficient than reloading temp2, doing this so we don't blend the icons twice (it matters more in transparent limbs)
|
||||
temp2.Insert(temp2,"blank",dir=SOUTH)
|
||||
temp2.Insert(temp2,"blank",dir=EAST)
|
||||
temp2.Insert(temp2,"blank",dir=WEST)
|
||||
if(part.icon_position & LEFT)
|
||||
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
|
||||
if(part.icon_position & RIGHT)
|
||||
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
|
||||
if (part.nonsolid && !wholeicontransparent) //apply a little (a lot) extra transparency to make it look better
|
||||
if ((istype(part, /obj/item/organ/external/leg) && apply_extra_transparency_leg) || (istype(part, /obj/item/organ/external/foot) && apply_extra_transparency_foot)) //maybe
|
||||
temp2 += rgb(,,,30)
|
||||
base_icon.Blend(temp2, ICON_UNDERLAY)
|
||||
else if(part.icon_position & UNDER)
|
||||
base_icon.Blend(temp, ICON_UNDERLAY)
|
||||
else
|
||||
base_icon.Blend(temp, ICON_OVERLAY)
|
||||
|
||||
if (wholeicontransparent) //because, I mean. It's basically never gonna happen that you'll have just one non-transparent limb but if you do your icon will look meh. Still good but meh, will have some areas with higher transparencies unless you're literally just a torso and a head
|
||||
base_icon += rgb(,,,180)
|
||||
|
||||
if(!skeleton)
|
||||
if(husk)
|
||||
base_icon.ColorTone(husk_color_mod)
|
||||
@@ -354,7 +369,6 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
update_tail_showing()
|
||||
update_wing_showing()
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/update_skin()
|
||||
if(QDESTROYING(src))
|
||||
return
|
||||
@@ -462,10 +476,13 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
|
||||
face_standing.Blend(hair_s, ICON_OVERLAY)
|
||||
|
||||
var/icon/ears_s = get_ears_overlay()
|
||||
|
||||
if(head_organ.nonsolid || head_organ.transparent)
|
||||
face_standing += rgb(,,,120)
|
||||
if (ears_s)
|
||||
ears_s += rgb(,,,180)
|
||||
|
||||
var/icon/ears_s = get_ears_overlay()
|
||||
if(ears_s)
|
||||
face_standing.Blend(ears_s, ICON_OVERLAY)
|
||||
|
||||
@@ -506,6 +523,9 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
else
|
||||
eyes_icon.Blend(rgb(128,0,0), ICON_ADD)
|
||||
|
||||
if (head_organ.nonsolid)
|
||||
eyes_icon += rgb(,,,180)
|
||||
|
||||
var/image/eyes_image = image(eyes_icon)
|
||||
eyes_image.plane = PLANE_LIGHTING_ABOVE
|
||||
eyes_image.appearance_flags = appearance_flags
|
||||
@@ -907,11 +927,14 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
remove_layer(TAIL_NORTH_LAYER)
|
||||
remove_layer(TAIL_SOUTH_LAYER)
|
||||
|
||||
var/obj/item/organ/external/chest = organs_by_name[BP_TORSO]
|
||||
|
||||
var/tail_layer = GET_TAIL_LAYER
|
||||
|
||||
var/image/tail_image = get_tail_image()
|
||||
if(tail_image)
|
||||
tail_image.layer = BODY_LAYER+tail_layer
|
||||
tail_image.alpha = chest?.nonsolid ? 180 : 255
|
||||
overlays_standing[tail_layer] = tail_image
|
||||
apply_layer(tail_layer)
|
||||
return
|
||||
@@ -921,7 +944,9 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
//This one is actually not that bad I guess.
|
||||
if(species_tail && !(wear_suit && wear_suit.flags_inv & HIDETAIL))
|
||||
var/icon/tail_s = get_tail_icon()
|
||||
overlays_standing[tail_layer] = image(icon = tail_s, icon_state = "[species_tail]_s", layer = BODY_LAYER+tail_layer)
|
||||
tail_image = image(icon = tail_s, icon_state = "[species_tail]_s", layer = BODY_LAYER+tail_layer)
|
||||
tail_image.alpha = chest?.nonsolid ? 180 : 255
|
||||
overlays_standing[tail_layer] = tail_image
|
||||
animate_tail_reset()
|
||||
|
||||
//TODO: Is this the appropriate place for this, and not on species...?
|
||||
@@ -1015,9 +1040,12 @@ var/global/list/_index_extended_clothing_icon_cache= list()
|
||||
|
||||
remove_layer(WING_LAYER)
|
||||
|
||||
var/obj/item/organ/external/chest = organs_by_name[BP_TORSO]
|
||||
|
||||
var/image/wing_image = get_wing_image()
|
||||
if(wing_image)
|
||||
wing_image.layer = BODY_LAYER+WING_LAYER
|
||||
wing_image.alpha = chest?.nonsolid ? 180 : 255
|
||||
overlays_standing[WING_LAYER] = wing_image
|
||||
|
||||
apply_layer(WING_LAYER)
|
||||
|
||||
@@ -79,12 +79,14 @@ var/global/list/limb_icon_cache = list()
|
||||
|
||||
return res
|
||||
|
||||
/obj/item/organ/external/proc/get_icon(var/skeletal)
|
||||
/obj/item/organ/external/proc/get_icon(var/skeletal, var/can_apply_transparency = TRUE)
|
||||
|
||||
var/gender = "m"
|
||||
if(owner && owner.gender == FEMALE)
|
||||
gender = "f"
|
||||
|
||||
var/should_apply_transparency = FALSE
|
||||
|
||||
if(!force_icon_key)
|
||||
icon_cache_key = "[icon_name]_[species ? species.name : SPECIES_HUMAN]"
|
||||
else
|
||||
@@ -109,9 +111,11 @@ var/global/list/limb_icon_cache = list()
|
||||
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else if (robotic >= ORGAN_ROBOT)
|
||||
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
|
||||
should_apply_transparency = TRUE
|
||||
apply_colouration(mob_icon)
|
||||
else
|
||||
mob_icon = new /icon(species.get_icobase(owner, (status & ORGAN_MUTATED)), "[icon_name][gender ? "_[gender]" : ""]")
|
||||
should_apply_transparency = TRUE
|
||||
apply_colouration(mob_icon)
|
||||
|
||||
//Body markings, actually does not include head this time. Done separately above.
|
||||
@@ -134,6 +138,7 @@ var/global/list/limb_icon_cache = list()
|
||||
|
||||
if(model)
|
||||
icon_cache_key += "_model_[model]"
|
||||
should_apply_transparency = TRUE
|
||||
apply_colouration(mob_icon)
|
||||
if(owner && owner.synth_markings)
|
||||
for(var/M in markings)
|
||||
@@ -144,6 +149,9 @@ var/global/list/limb_icon_cache = list()
|
||||
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
|
||||
icon_cache_key += "[M][markings[M]["color"]]"
|
||||
|
||||
if (nonsolid && !istype(src,/obj/item/organ/external/head) && can_apply_transparency && should_apply_transparency)
|
||||
mob_icon += rgb(,,,180) //do it here so any markings become transparent as well
|
||||
|
||||
dir = EAST
|
||||
icon = mob_icon
|
||||
return mob_icon
|
||||
@@ -173,9 +181,6 @@ var/global/list/limb_icon_cache = list()
|
||||
applying.Blend(rgb(s_col[1], s_col[2], s_col[3]), blend)
|
||||
icon_cache_key += "_color_[s_col[1]]_[s_col[2]]_[s_col[3]]_[blend]"
|
||||
|
||||
// Translucency.
|
||||
if(nonsolid) applying += rgb(,,,180) // SO INTUITIVE TY BYOND
|
||||
|
||||
return applying
|
||||
|
||||
/obj/item/organ/external/var/icon_cache_key
|
||||
|
||||
@@ -336,7 +336,7 @@
|
||||
"<span class='notice'>You make \the [I] kiss \the [src]!.</span>")
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/external/head/get_icon()
|
||||
/obj/item/organ/external/head/get_icon(var/skeletal, var/can_apply_transparency = TRUE)
|
||||
..()
|
||||
|
||||
//The overlays are not drawn on the mob, they are used for if the head is removed and becomes an item
|
||||
@@ -387,6 +387,9 @@
|
||||
|
||||
add_overlay(get_hair_icon())
|
||||
|
||||
if (nonsolid && can_apply_transparency)
|
||||
mob_icon += rgb(,,,180) //do it here so any markings become transparent as well
|
||||
|
||||
return mob_icon
|
||||
|
||||
/obj/item/organ/external/head/skrell
|
||||
|
||||
Reference in New Issue
Block a user