- add: database for genitals

This commit is contained in:
2024-02-16 21:21:19 +03:00
parent 52628d0393
commit c3e8e64fb8
14 changed files with 3907 additions and 14 deletions

View File

@@ -41,6 +41,7 @@ namespace Content.Server.Database
.Include(p => p.Profiles).ThenInclude(h => h.Jobs)
.Include(p => p.Profiles).ThenInclude(h => h.Antags)
.Include(p => p.Profiles).ThenInclude(h => h.Traits)
.Include(p => p.Profiles).ThenInclude(h => h.Genitals)
.AsSingleQuery()
.SingleOrDefaultAsync(p => p.UserId == userId.UserId);
@@ -89,6 +90,7 @@ namespace Content.Server.Database
.Include(p => p.Jobs)
.Include(p => p.Antags)
.Include(p => p.Traits)
.Include(p => p.Genitals)
.AsSplitQuery()
.SingleOrDefault(h => h.Slot == slot);
@@ -214,6 +216,11 @@ namespace Content.Server.Database
}
}
Console.WriteLine(profile.Genitals.Count + "<><>");
var genitals = profile.Genitals.Select(genital =>
new Shared._Amour.Hole.Genital(genital.GenitalPrototype,
string.IsNullOrEmpty(genital.Color) ? null : Color.FromHex(genital.Color)));
return new HumanoidCharacterProfile(
profile.CharacterName,
profile.ClownName,
@@ -233,7 +240,7 @@ namespace Content.Server.Database
Color.FromHex(profile.FacialHairColor),
Color.FromHex(profile.EyeColor),
Color.FromHex(profile.SkinColor),
markings, new List<Genital>() //TEMP
markings, genitals.ToList() // Amour edit
),
clothing,
backpack,
@@ -297,6 +304,17 @@ namespace Content.Server.Database
.Select(t => new Trait {TraitName = t})
);
profile.Genitals.Clear();
profile.Genitals.AddRange(
appearance.Genitals.Select(t => new Genital()
{
GenitalPrototype = t.GenitalId,
Color = t.Color?.ToHex() ?? ""
}));
Console.WriteLine(profile.Genitals);
Console.WriteLine(profile.Antags);
return profile;
}
#endregion