Fix slime hair translucent (#14478)

* fix

* move
This commit is contained in:
csqrb
2023-03-12 03:04:58 +06:00
committed by GitHub
parent 71272a81f7
commit b3a327988f
6 changed files with 16 additions and 15 deletions

View File

@@ -166,10 +166,9 @@ namespace Content.Shared.Humanoid.Markings
return true;
}
public bool MustMatchSkin(string species, HumanoidVisualLayers layer, IPrototypeManager? prototypeManager = null)
public bool MustMatchSkin(string species, HumanoidVisualLayers layer, out float alpha, IPrototypeManager? prototypeManager = null)
{
IoCManager.Resolve(ref prototypeManager);
var speciesProto = prototypeManager.Index<SpeciesPrototype>(species);
if (
!prototypeManager.TryIndex(speciesProto.SpriteSet, out HumanoidSpeciesBaseSpritesPrototype? baseSprites) ||
@@ -179,9 +178,11 @@ namespace Content.Shared.Humanoid.Markings
!sprite.MarkingsMatchSkin
)
{
alpha = 1f;
return false;
}
alpha = sprite.LayerAlpha;
return true;
}
}

View File

@@ -190,9 +190,9 @@ public sealed class MarkingSet
foreach (var marking in list)
{
if (markingManager.TryGetMarking(marking, out var prototype) &&
markingManager.MustMatchSkin(species, prototype.BodyPart, prototypeManager))
markingManager.MustMatchSkin(species, prototype.BodyPart, out var alpha, prototypeManager))
{
marking.SetColor(skinColor.Value);
marking.SetColor(skinColor.Value.WithAlpha(alpha));
}
}
}