De-enumify humanoid species skin colours (#39175)

* De-enumify humanoid species skin colours

* Change index to resolve

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
pathetic meowmeow
2025-09-14 01:30:17 -04:00
committed by GitHub
parent 2820882754
commit d9c24b3d10
8 changed files with 365 additions and 355 deletions

View File

@@ -1088,10 +1088,11 @@ namespace Content.Client.Lobby.UI
if (Profile is null) return;
var skin = _prototypeManager.Index<SpeciesPrototype>(Profile.Species).SkinColoration;
var strategy = _prototypeManager.Index(skin).Strategy;
switch (skin)
switch (strategy.InputType)
{
case HumanoidSkinColor.HumanToned:
case SkinColorationStrategyInput.Unary:
{
if (!Skin.Visible)
{
@@ -1099,39 +1100,14 @@ namespace Content.Client.Lobby.UI
RgbSkinColorContainer.Visible = false;
}
var color = SkinColor.HumanSkinTone((int) Skin.Value);
Markings.CurrentSkinColor = color;
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));//
break;
}
case HumanoidSkinColor.Hues:
{
if (!RgbSkinColorContainer.Visible)
{
Skin.Visible = false;
RgbSkinColorContainer.Visible = true;
}
Markings.CurrentSkinColor = _rgbSkinColorSelector.Color;
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(_rgbSkinColorSelector.Color));
break;
}
case HumanoidSkinColor.TintedHues:
{
if (!RgbSkinColorContainer.Visible)
{
Skin.Visible = false;
RgbSkinColorContainer.Visible = true;
}
var color = SkinColor.TintedHues(_rgbSkinColorSelector.Color);
var color = strategy.FromUnary(Skin.Value);
Markings.CurrentSkinColor = color;
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));
break;
}
case HumanoidSkinColor.VoxFeathers:
case SkinColorationStrategyInput.Color:
{
if (!RgbSkinColorContainer.Visible)
{
@@ -1139,10 +1115,11 @@ namespace Content.Client.Lobby.UI
RgbSkinColorContainer.Visible = true;
}
var color = SkinColor.ClosestVoxColor(_rgbSkinColorSelector.Color);
var color = strategy.ClosestSkinColor(_rgbSkinColorSelector.Color);
Markings.CurrentSkinColor = color;
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));
break;
}
}
@@ -1321,10 +1298,11 @@ namespace Content.Client.Lobby.UI
return;
var skin = _prototypeManager.Index<SpeciesPrototype>(Profile.Species).SkinColoration;
var strategy = _prototypeManager.Index(skin).Strategy;
switch (skin)
switch (strategy.InputType)
{
case HumanoidSkinColor.HumanToned:
case SkinColorationStrategyInput.Unary:
{
if (!Skin.Visible)
{
@@ -1332,11 +1310,11 @@ namespace Content.Client.Lobby.UI
RgbSkinColorContainer.Visible = false;
}
Skin.Value = SkinColor.HumanSkinToneFromColor(Profile.Appearance.SkinColor);
Skin.Value = strategy.ToUnary(Profile.Appearance.SkinColor);
break;
}
case HumanoidSkinColor.Hues:
case SkinColorationStrategyInput.Color:
{
if (!RgbSkinColorContainer.Visible)
{
@@ -1344,36 +1322,11 @@ namespace Content.Client.Lobby.UI
RgbSkinColorContainer.Visible = true;
}
// set the RGB values to the direct values otherwise
_rgbSkinColorSelector.Color = Profile.Appearance.SkinColor;
break;
}
case HumanoidSkinColor.TintedHues:
{
if (!RgbSkinColorContainer.Visible)
{
Skin.Visible = false;
RgbSkinColorContainer.Visible = true;
}
// set the RGB values to the direct values otherwise
_rgbSkinColorSelector.Color = Profile.Appearance.SkinColor;
break;
}
case HumanoidSkinColor.VoxFeathers:
{
if (!RgbSkinColorContainer.Visible)
{
Skin.Visible = false;
RgbSkinColorContainer.Visible = true;
}
_rgbSkinColorSelector.Color = SkinColor.ClosestVoxColor(Profile.Appearance.SkinColor);
_rgbSkinColorSelector.Color = strategy.ClosestSkinColor(Profile.Appearance.SkinColor);
break;
}
}
}
public void UpdateSpeciesGuidebookIcon()