Show / Hide Table of Contents

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
System.Object
SharedHumanoidAppearanceSystem
HumanoidAppearanceSystem
HumanoidAppearanceSystem
Namespace: Content.Shared.Humanoid
Assembly: Content.Shared.dll
Syntax
public abstract class SharedHumanoidAppearanceSystem : EntitySystem

Fields

| Improve this Doc View Source

DefaultSpecies

Declaration
public const string DefaultSpecies = null
Field Value
Type Description
System.String

Methods

| Improve this Doc View Source

AddMarking(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

| Improve this Doc View Source

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

| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
| Improve this Doc View Source

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

| Improve this Doc View Source

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
| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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
| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾