@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user