New tiefling hue (#155)
* Добавлен отдельный тип цвета кожи для тифлингов * Немного чистки * Автоматом поправил, будет мешать при мердже
This commit is contained in:
@@ -8,6 +8,7 @@ using Content.Client.Lobby.UI.Roles;
|
||||
using Content.Client.Message;
|
||||
using Content.Client.Players.PlayTimeTracking;
|
||||
using Content.Client.UserInterface.Systems.Guidebook;
|
||||
using Content.Shared._CP14.Humanoid;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.GameTicking;
|
||||
@@ -1015,6 +1016,22 @@ namespace Content.Client.Lobby.UI
|
||||
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));
|
||||
break;
|
||||
}
|
||||
// CP14 - Custom HumanoidSkinColor - Start
|
||||
case HumanoidSkinColor.TieflingHues:
|
||||
{
|
||||
if (!RgbSkinColorContainer.Visible)
|
||||
{
|
||||
Skin.Visible = false;
|
||||
RgbSkinColorContainer.Visible = true;
|
||||
}
|
||||
|
||||
var color = CP14SkinColor.MakeTieflingHueValid(_rgbSkinColorSelector.Color);
|
||||
|
||||
Markings.CurrentSkinColor = color;
|
||||
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));
|
||||
break;
|
||||
}
|
||||
// CP14 - Custom HumanoidSkinColor - End
|
||||
}
|
||||
|
||||
SetDirty();
|
||||
@@ -1231,6 +1248,19 @@ namespace Content.Client.Lobby.UI
|
||||
|
||||
break;
|
||||
}
|
||||
// CP14 - Custom HumanoidSkinColor - Start
|
||||
case HumanoidSkinColor.TieflingHues:
|
||||
{
|
||||
if (!RgbSkinColorContainer.Visible)
|
||||
{
|
||||
Skin.Visible = false;
|
||||
RgbSkinColorContainer.Visible = true;
|
||||
}
|
||||
|
||||
_rgbSkinColorSelector.Color = CP14SkinColor.MakeTieflingHueValid(Profile.Appearance.SkinColor);
|
||||
break;
|
||||
}
|
||||
// CP14 - Custom HumanoidSkinColor - End
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Shared._CP14.Humanoid;
|
||||
using Content.Shared.Humanoid.Markings;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -164,6 +165,11 @@ public sealed partial class HumanoidCharacterAppearance : ICharacterAppearance,
|
||||
case HumanoidSkinColor.VoxFeathers:
|
||||
newSkinColor = Humanoid.SkinColor.ProportionalVoxColor(newSkinColor);
|
||||
break;
|
||||
// CP14 - Custom HumanoidSkinColor - Start
|
||||
case HumanoidSkinColor.TieflingHues:
|
||||
newSkinColor = CP14SkinColor.TieflingHues(newSkinColor);
|
||||
break;
|
||||
// CP14 - Custom HumanoidSkinColor - End
|
||||
}
|
||||
|
||||
return new HumanoidCharacterAppearance(newHairStyle, newHairColor, newFacialHairStyle, newHairColor, newEyeColor, newSkinColor, new ());
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Security.Cryptography;
|
||||
using Content.Shared._CP14.Humanoid;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
|
||||
namespace Content.Shared.Humanoid;
|
||||
@@ -234,6 +235,9 @@ public static class SkinColor
|
||||
HumanoidSkinColor.TintedHues => VerifyTintedHues(color),
|
||||
HumanoidSkinColor.Hues => VerifyHues(color),
|
||||
HumanoidSkinColor.VoxFeathers => VerifyVoxFeathers(color),
|
||||
// CP14 - Custom HumanoidSkinColor - Start
|
||||
HumanoidSkinColor.TieflingHues => CP14SkinColor.VerifyTieflingHues(color),
|
||||
// CP14 - Custom HumanoidSkinColor - End
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
@@ -246,6 +250,9 @@ public static class SkinColor
|
||||
HumanoidSkinColor.TintedHues => ValidTintedHuesSkinTone(color),
|
||||
HumanoidSkinColor.Hues => MakeHueValid(color),
|
||||
HumanoidSkinColor.VoxFeathers => ClosestVoxColor(color),
|
||||
// CP14 - Custom HumanoidSkinColor - Start
|
||||
HumanoidSkinColor.TieflingHues => CP14SkinColor.MakeTieflingHueValid(color),
|
||||
// CP14 - Custom HumanoidSkinColor - End
|
||||
_ => color
|
||||
};
|
||||
}
|
||||
@@ -257,4 +264,7 @@ public enum HumanoidSkinColor : byte
|
||||
Hues,
|
||||
VoxFeathers, // Vox feathers are limited to a specific color range
|
||||
TintedHues, //This gives a color tint to a humanoid's skin (10% saturation with full hue range).
|
||||
// CP14 - Custom HumanoidSkinColor - Start
|
||||
TieflingHues,
|
||||
// CP14 - Custom HumanoidSkinColor - End
|
||||
}
|
||||
|
||||
38
Content.Shared/_CP14/Humanoid/CP14SkinColor.cs
Normal file
38
Content.Shared/_CP14/Humanoid/CP14SkinColor.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
namespace Content.Shared._CP14.Humanoid;
|
||||
|
||||
public static class CP14SkinColor
|
||||
{
|
||||
public const float MinTieflingHuesLightness = 10f / 100f;
|
||||
public const float MaxTieflingHuesLightness = 35f / 100f;
|
||||
|
||||
public static Color TieflingHues(Color color)
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
public static Color MakeTieflingHueValid(Color color)
|
||||
{
|
||||
color.G = Math.Min(color.G, color.B);
|
||||
|
||||
var hsl = Color.ToHsl(color);
|
||||
hsl.Z = Math.Clamp(hsl.Z, MinTieflingHuesLightness, MaxTieflingHuesLightness);
|
||||
|
||||
return Color.FromHsl(hsl);
|
||||
}
|
||||
|
||||
public static bool VerifyTieflingHues(Color color)
|
||||
{
|
||||
var hsl = Color.ToHsl(color);
|
||||
var lightness = hsl.Z;
|
||||
|
||||
// Allows you to use shades of green, but not make green tieflings
|
||||
if (color.G > color.B)
|
||||
return false;
|
||||
|
||||
// No black or white holes instead of tieflings
|
||||
if (lightness is < MinTieflingHuesLightness or > MaxTieflingHuesLightness)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
sprites: CP14MobTieflingSprites
|
||||
markingLimits: CP14MobTieflingMarkingLimits
|
||||
dollPrototype: CP14MobTieflingDummy
|
||||
skinColoration: Hues
|
||||
skinColoration: TieflingHues
|
||||
maleFirstNames: CP14_Names_Tiefling_Male_First
|
||||
femaleFirstNames: CP14_Names_Tiefling_Female_First
|
||||
lastNames: CP14_Names_Tiefling_Last
|
||||
|
||||
Reference in New Issue
Block a user