Added preferences backend (#465)
* Added preferences backend * Gender -> Sex * ClientPreferencesManager properties * Username validation * Fixed client init * WIP db * Actually working sqlite db * Dropped shitty sqlite libraries, dropped DbUp, added MigrationManager * Added profile deletion, test * Docs, sanity, tests, cleanup * Cleaned up profile and appearance, fixed running on .net core Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
committed by
Pieter-Jan Briers
parent
c1b9bb348d
commit
f19795edaf
42
Content.Shared/Preferences/HumanoidCharacterAppearance.cs
Normal file
42
Content.Shared/Preferences/HumanoidCharacterAppearance.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Preferences
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public class HumanoidCharacterAppearance : ICharacterAppearance
|
||||
{
|
||||
public string HairStyleName { get; set; }
|
||||
public Color HairColor { get; set; }
|
||||
public string FacialHairStyleName { get; set; }
|
||||
public Color FacialHairColor { get; set; }
|
||||
public Color EyeColor { get; set; }
|
||||
public Color SkinColor { get; set; }
|
||||
|
||||
public static HumanoidCharacterAppearance Default()
|
||||
{
|
||||
return new HumanoidCharacterAppearance
|
||||
{
|
||||
HairStyleName = "Bald",
|
||||
HairColor = Color.Black,
|
||||
FacialHairStyleName = "Shaved",
|
||||
FacialHairColor = Color.Black,
|
||||
EyeColor = Color.Black,
|
||||
SkinColor = Color.Black
|
||||
};
|
||||
}
|
||||
|
||||
public bool MemberwiseEquals(ICharacterAppearance maybeOther)
|
||||
{
|
||||
if (!(maybeOther is HumanoidCharacterAppearance other)) return false;
|
||||
if (HairStyleName != other.HairStyleName) return false;
|
||||
if (HairColor != other.HairColor) return false;
|
||||
if (FacialHairStyleName != other.FacialHairStyleName) return false;
|
||||
if (FacialHairColor != other.FacialHairColor) return false;
|
||||
if (EyeColor != other.EyeColor) return false;
|
||||
if (SkinColor != other.SkinColor) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user