еще приколы

This commit is contained in:
Remuchi
2024-04-13 12:55:14 +07:00
parent f21ef6953c
commit 7ca05487a9
12 changed files with 186277 additions and 44 deletions

View File

@@ -42,7 +42,7 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem
component.BaseLayers.Clear();
// add default species layers
var bodyTypeProto = _prototypeManager.Index<BodyTypePrototype>(component.BodyType);
var bodyTypeProto = _prototypeManager.Index(component.BodyType);
foreach (var (key, id) in bodyTypeProto.Sprites)
{
oldLayers.Remove(key);

View File

@@ -42,7 +42,7 @@ namespace Content.Client.Options.UI.Tabs
var id = 0;
foreach (var layout in Enum.GetValues(typeof(ScreenType)))
{
var name = Loc.GetString($"ui-options-hud-type-{layout!.ToString()!.ToLower()}");
var name = layout.ToString()!;
HudLayoutOption.AddItem(name, id);
if (name == hudLayout)
{

View File

@@ -947,7 +947,7 @@ namespace Content.Client.Preferences.UI
}
// If current body type is not valid.
if (!_bodyTypesList.Select(proto => proto.ID).Contains(Profile.BodyType))
if (!_bodyTypesList.Select(proto => proto.ID).Contains(Profile.BodyType.Id))
{
// Then replace it with a first valid body type.
SetBodyType(_bodyTypesList.First().ID);

View File

@@ -10,7 +10,6 @@ namespace Content.Server.Humanoid;
public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem
{
[Dependency] private readonly MarkingManager _markingManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
public override void Initialize()
{
@@ -60,32 +59,6 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS
Dirty(target, targetHumanoid);
}
/// <summary>
/// Set a humanoid mob's body yupe. This will change their base sprites.
/// </summary>
/// <param name="uid">The humanoid mob's UID.</param>
/// <param name="bodyType">The body type to set the mob to. Will return if the body type prototype was invalid.</param>
/// <param name="sync">Whether to immediately synchronize this to the humanoid mob, or not.</param>
/// <param name="humanoid">Humanoid component of the entity</param>
public void SetBodyType(
EntityUid uid,
string bodyType,
bool sync = true,
HumanoidAppearanceComponent? humanoid = null)
{
if (!Resolve(uid, ref humanoid) || !_prototypeManager.TryIndex<BodyTypePrototype>(bodyType, out _))
{
return;
}
humanoid.BodyType = bodyType;
if (sync)
{
Dirty(uid, humanoid);
}
}
/// <summary>
/// Removes a marking from a humanoid by ID.
/// </summary>

View File

@@ -73,8 +73,8 @@ public sealed partial class HumanoidAppearanceComponent : Component
/// <summary>
/// Current body type.
/// </summary>
[DataField("bodyType", customTypeSerializer: typeof(PrototypeIdSerializer<BodyTypePrototype>)), AutoNetworkedField]
public string BodyType = SharedHumanoidAppearanceSystem.DefaultBodyType;
[DataField("bodyType"), AutoNetworkedField]
public ProtoId<BodyTypePrototype> BodyType = SharedHumanoidAppearanceSystem.DefaultBodyType;
[DataField, AutoNetworkedField]
public Color EyeColor = Color.Brown;
@@ -101,7 +101,9 @@ public readonly partial struct CustomBaseLayerInfo
{
public CustomBaseLayerInfo(string? id, Color? color = null)
{
DebugTools.Assert(id == null || IoCManager.Resolve<IPrototypeManager>().HasIndex<HumanoidSpeciesSpriteLayer>(id));
DebugTools.Assert(
id == null || IoCManager.Resolve<IPrototypeManager>().HasIndex<HumanoidSpeciesSpriteLayer>(id));
Id = id;
Color = color;
}
@@ -117,4 +119,4 @@ public readonly partial struct CustomBaseLayerInfo
/// </summary>
[DataField]
public Color? Color { get; init; }
}
}

View File

@@ -218,6 +218,32 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
Dirty(uid, humanoid);
}
/// <summary>
/// Set a humanoid mob's body yupe. This will change their base sprites.
/// </summary>
/// <param name="uid">The humanoid mob's UID.</param>
/// <param name="bodyType">The body type to set the mob to. Will return if the body type prototype was invalid.</param>
/// <param name="sync">Whether to immediately synchronize this to the humanoid mob, or not.</param>
/// <param name="humanoid">Humanoid component of the entity</param>
public void SetBodyType(
EntityUid uid,
ProtoId<BodyTypePrototype> bodyType,
bool sync = true,
HumanoidAppearanceComponent? humanoid = null)
{
if (!Resolve(uid, ref humanoid) || !_proto.TryIndex(bodyType, out _))
{
return;
}
humanoid.BodyType = bodyType;
if (sync)
{
Dirty(uid, humanoid);
}
}
/// <summary>
/// Sets the base layer ID of this humanoid mob. A humanoid mob's 'base layer' is
/// the skin sprite that is applied to the mob's sprite upon appearance refresh.
@@ -327,6 +353,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
humanoid.EyeColor = profile.Appearance.EyeColor;
SetSkinColor(uid, profile.Appearance.SkinColor, false);
SetBodyType(uid, profile.BodyType, false);
humanoid.MarkingSet.Clear();

View File

@@ -41,7 +41,7 @@ namespace Content.Shared.Preferences
Sex sex,
string voice,
Gender gender,
string bodyType,
ProtoId<BodyTypePrototype> bodyType,
HumanoidCharacterAppearance appearance,
ClothingPreference clothing,
BackpackPreference backpack,
@@ -270,7 +270,7 @@ namespace Content.Shared.Preferences
public Gender Gender { get; private set; }
[DataField]
public string BodyType { get; private set; }
public ProtoId<BodyTypePrototype> BodyType { get; private set; }
public ICharacterAppearance CharacterAppearance => Appearance;

View File

@@ -260,9 +260,6 @@ ui-options-net-pvs-leave-tooltip = This limits the rate at which the client will
stuttering when walking around, but could occasionally
lead to mispredicts and other issues.
ui-options-hud-type-default = Default
ui-options-hud-type-separated = Separated
## Toggle window console command
cmd-options-desc = Opens options menu, optionally with a specific tab selected.
cmd-options-help = Usage: options [tab]

View File

@@ -265,9 +265,6 @@ ui-options-net-pvs-leave-tooltip =
уменьшить "захлебывания" при ходьбе, но иногда может
привести к неправильным предугадываниям и другим проблемам.
ui-options-hud-type-default = Компактный
ui-options-hud-type-separated = Обычный
## Toggle window console command
cmd-options-desc = Открывает меню опций, опционально с конкретно выбранной вкладкой.
cmd-options-help = Использование: options [tab]

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,6 @@
maps:
- Atlas
- Bagel
- Box
- Cluster
- Core
- Fland
@@ -13,5 +12,8 @@
- Origin
- Saltern
- Packed
- Reach
- WonderBox
- Scoupidia
- Triumph
- WhiteBox
#- Train <- return after station anchoring PR is finished and merged

View File

@@ -0,0 +1,59 @@
- type: gameMap
id: WhiteBox
mapName: 'Box Station'
mapPath: /Maps/White/Whitebox.yml
minPlayers: 0
stations:
Boxstation:
stationProto: StandardNanotrasenStation
components:
- type: StationNameSetup
mapNameTemplate: '{0} Box Station {1}'
nameGenerator:
!type:NanotrasenNameGenerator
prefixCreator: 'TG'
- type: StationEmergencyShuttle
emergencyShuttlePath: /Maps/Shuttles/emergency_box.yml
- type: StationJobs
overflowJobs:
- Passenger
availableJobs:
CargoTechnician: [ 3, 3 ]
Passenger: [ -1, -1 ]
Bartender: [ 2, 2 ]
Botanist: [ 3, 3 ]
Chef: [ 2, 2 ]
Clown: [ 1, 1 ]
Janitor: [ 3, 3 ]
Mime: [ 1, 1 ]
Captain: [ 1, 1 ]
HeadOfPersonnel: [ 1, 1 ]
ChiefEngineer: [ 1, 1 ]
StationEngineer: [ 4, 4 ]
ChiefMedicalOfficer: [ 1, 1 ]
MedicalDoctor: [ 4, 4 ]
Chemist: [ 3, 3 ]
ResearchDirector: [ 1, 1 ]
Scientist: [ 5, 5 ]
HeadOfSecurity: [ 1, 1 ]
SecurityOfficer: [ 6, 6 ]
Chaplain: [ 2, 2 ]
Warden: [ 1, 1 ]
Librarian: [ 2, 2 ]
Lawyer: [ 2, 2 ]
Quartermaster: [ 1, 1 ]
SalvageSpecialist: [ 3, 3 ]
Musician: [ 2, 2 ]
AtmosphericTechnician: [ 3, 3 ]
TechnicalAssistant: [ 4, 4 ]
MedicalIntern: [ 4, 4 ]
ServiceWorker: [ 4, 4 ]
SecurityCadet: [ 4, 4 ]
Detective: [ 1, 1 ]
ResearchAssistant: [ 4, 4 ]
Paramedic: [ 2, 2 ]
SeniorOfficer: [ 1, 1 ]
SeniorResearcher: [ 1, 1 ]
SeniorPhysician: [ 1, 1 ]
SeniorEngineer: [ 1, 1 ]
SeniorSalvageSpecialist: [ 1, 1 ]