Class SharedHumanoidAppearanceSystem
HumanoidSystem. Primarily deals with the appearance and visual data of a humanoid entity. HumanoidVisualizer is what deals with actually organizing the sprites and setting up the sprite component's layers.
This is a shared system, because while it is server authoritative, you still need a local copy so that players can set up their characters.
Inheritance
Namespace: Content.Shared.Humanoid
Assembly: Content.Shared.dll
Syntax
public abstract class SharedHumanoidAppearanceSystem : EntitySystem
Fields
| Improve this Doc View SourceDefaultSpecies
Declaration
public const string DefaultSpecies = null
Field Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceAddMarking(EntityUid, String, IReadOnlyList<Color>, Boolean, Boolean, HumanoidAppearanceComponent)
Declaration
public void AddMarking(EntityUid uid, string marking, IReadOnlyList<Color> colors, bool sync = true, bool forced = false, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | Humanoid mob's UID |
System.String | marking | Marking ID to use |
IReadOnlyList<Color> | colors | Colors to apply against this marking's set of sprites. |
System.Boolean | sync | Whether to immediately sync this marking or not |
System.Boolean | forced | If this marking was forced (ignores marking points) |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |
AddMarking(EntityUid, String, Nullable<Color>, Boolean, Boolean, HumanoidAppearanceComponent)
Adds a marking to this humanoid.
Declaration
public void AddMarking(EntityUid uid, string marking, Color? color = null, bool sync = true, bool forced = false, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | Humanoid mob's UID |
System.String | marking | Marking ID to use |
System.Nullable<Color> | color | Color to apply to all marking layers of this marking |
System.Boolean | sync | Whether to immediately sync this marking or not |
System.Boolean | forced | If this marking was forced (ignores marking points) |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |
Initialize()
Declaration
public override void Initialize()
LoadProfile(EntityUid, HumanoidCharacterProfile, HumanoidAppearanceComponent)
Loads a humanoid character profile directly onto this humanoid mob.
Declaration
public virtual void LoadProfile(EntityUid uid, HumanoidCharacterProfile profile, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The mob's entity UID. |
HumanoidCharacterProfile | profile | The character profile to load. |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |
SetBaseLayerColor(EntityUid, HumanoidVisualLayers, Nullable<Color>, Boolean, HumanoidAppearanceComponent)
Sets the color of this humanoid mob's base layer. See SetBaseLayerId(EntityUid, HumanoidVisualLayers, Nullable<String>, Boolean, HumanoidAppearanceComponent) for a description of how base layers work.
Declaration
public void SetBaseLayerColor(EntityUid uid, HumanoidVisualLayers layer, Color? color, bool sync = true, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The humanoid mob's UID. |
HumanoidVisualLayers | layer | The layer to target on this humanoid mob. |
System.Nullable<Color> | color | The color to set this base layer to. |
System.Boolean | sync | |
HumanoidAppearanceComponent | humanoid |
SetBaseLayerId(EntityUid, HumanoidVisualLayers, Nullable<String>, Boolean, HumanoidAppearanceComponent)
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.
Declaration
public void SetBaseLayerId(EntityUid uid, HumanoidVisualLayers layer, string? id, bool sync = true, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The humanoid mob's UID. |
HumanoidVisualLayers | layer | The layer to target on this humanoid mob. |
System.Nullable<System.String> | id | The ID of the sprite to use. See HumanoidSpeciesSpriteLayer. |
System.Boolean | sync | Whether to synchronize this to the humanoid mob, or not. |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |
SetLayersVisibility(EntityUid, IEnumerable<HumanoidVisualLayers>, Boolean, Boolean, HumanoidAppearanceComponent)
Sets the visibility for multiple layers at once on a humanoid's sprite.
Declaration
public void SetLayersVisibility(EntityUid uid, IEnumerable<HumanoidVisualLayers> layers, bool visible, bool permanent = false, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | Humanoid mob's UID |
IEnumerable<HumanoidVisualLayers> | layers | An enumerable of all sprite layers that are going to have their visibility set |
System.Boolean | visible | The visibility state of the layers given |
System.Boolean | permanent | If this is a permanent change, or temporary. Permanent layers are stored in their own hash set. |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |
SetLayerVisibility(EntityUid, HumanoidAppearanceComponent, HumanoidVisualLayers, Boolean, Boolean, ref Boolean)
Declaration
protected virtual void SetLayerVisibility(EntityUid uid, HumanoidAppearanceComponent humanoid, HumanoidVisualLayers layer, bool visible, bool permanent, ref bool dirty)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
HumanoidAppearanceComponent | humanoid | |
HumanoidVisualLayers | layer | |
System.Boolean | visible | |
System.Boolean | permanent | |
System.Boolean | dirty |
SetLayerVisibility(EntityUid, HumanoidVisualLayers, Boolean, Boolean, HumanoidAppearanceComponent)
Toggles a humanoid's sprite layer visibility.
Declaration
public void SetLayerVisibility(EntityUid uid, HumanoidVisualLayers layer, bool visible, bool permanent = false, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | Humanoid mob's UID |
HumanoidVisualLayers | layer | Layer to toggle visibility for |
System.Boolean | visible | |
System.Boolean | permanent | |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |
SetSex(EntityUid, Sex, Boolean, HumanoidAppearanceComponent)
Set a humanoid mob's sex. This will not change their gender.
Declaration
public void SetSex(EntityUid uid, Sex sex, bool sync = true, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The humanoid mob's UID. |
Sex | sex | The sex to set the mob to. |
System.Boolean | sync | Whether to immediately synchronize this to the humanoid mob, or not. |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |
SetSkinColor(EntityUid, Color, Boolean, Boolean, HumanoidAppearanceComponent)
Sets the skin color of this humanoid mob. Will only affect base layers that are not custom, custom base layers should use SetBaseLayerColor(EntityUid, HumanoidVisualLayers, Nullable<Color>, Boolean, HumanoidAppearanceComponent) instead.
Declaration
public virtual void SetSkinColor(EntityUid uid, Color skinColor, bool sync = true, bool verify = true, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The humanoid mob's UID. |
Color | skinColor | Skin color to set on the humanoid mob. |
System.Boolean | sync | Whether to synchronize this to the humanoid mob, or not. |
System.Boolean | verify | Whether to verify the skin color can be set on this humanoid or not |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |
SetSpecies(EntityUid, String, Boolean, HumanoidAppearanceComponent)
Set a humanoid mob's species. This will change their base sprites, as well as their current set of markings to fit against the mob's new species.
Declaration
public void SetSpecies(EntityUid uid, string species, bool sync = true, HumanoidAppearanceComponent humanoid = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The humanoid mob's UID. |
System.String | species | The species to set the mob to. Will return if the species prototype was invalid. |
System.Boolean | sync | Whether to immediately synchronize this to the humanoid mob, or not. |
HumanoidAppearanceComponent | humanoid | Humanoid component of the entity |