Esempio n. 1
0
        public virtual void ClientGetHeadSlotSprites(
            [CanBeNull] IItem item,
            bool isMale,
            SkeletonResource skeletonResource,
            bool isFrontFace,
            bool isPreview,
            out string spriteFront,
            out string spriteBehind)
        {
            IReadOnlyList <SkeletonSlotAttachment> slotAttachments;

            if (this.ClientIsMustUseDefaultAppearance(item?.Container.OwnerAsCharacter,
                                                      isPreview))
            {
                slotAttachments = isMale
                                      ? ((IProtoItemEquipment)this.BaseProtoItem).SlotAttachmentsMale
                                      : ((IProtoItemEquipment)this.BaseProtoItem).SlotAttachmentsFemale;
            }
            else
            {
                slotAttachments = isMale
                                      ? this.SlotAttachmentsMale
                                      : this.SlotAttachmentsFemale;
            }

            ProtoItemEquipmentHeadHelper.ClientFindDefaultHeadSprites(
                slotAttachments,
                skeletonResource,
                isFrontFace,
                out spriteFront,
                out spriteBehind);
        }
Esempio n. 2
0
        public override void ClientGetHeadSlotSprites(
            [CanBeNull] IItem item,
            bool isMale,
            SkeletonResource skeletonResource,
            bool isFrontFace,
            bool isPreview,
            out string spriteFront,
            out string spriteBehind)
        {
            IReadOnlyList <SkeletonSlotAttachment> slotAttachments;

            if (this.ClientIsMustUseDefaultAppearance(item?.Container.OwnerAsCharacter,
                                                      isPreview))
            {
                slotAttachments = isMale
                                      ? ((IProtoItemEquipment)this.BaseProtoItem).SlotAttachmentsMale
                                      : ((IProtoItemEquipment)this.BaseProtoItem).SlotAttachmentsFemale;
            }
            else
            {
                slotAttachments = isMale
                                      ? this.SlotAttachmentsMale
                                      : this.SlotAttachmentsFemale;
            }

            var isActive = item is null || // in case of preview we want to display the active sprite
                           GetPublicState(item).IsActive;

            ProtoItemEquipmentHeadHelper.ClientFindDefaultHeadSprites(
                slotAttachments,
                skeletonResource,
                isFrontFace,
                out spriteFront,
                out spriteBehind,
                headEquipmentName: isActive
                                       ? "HeadActiveEquipment"
                                       : "HeadEquipment");

            if (isActive &&
                spriteFront is null)
            {
                // no active sprite found - fallback to default head equipment method
                base.ClientGetHeadSlotSprites(item,
                                              isMale,
                                              skeletonResource,
                                              isFrontFace,
                                              isPreview,
                                              out spriteFront,
                                              out spriteBehind);
            }
        }
        public virtual void ClientGetHeadSlotSprites(
            IItem item,
            bool isMale,
            SkeletonResource skeletonResource,
            bool isFrontFace,
            out string spriteFront,
            out string spriteBehind)
        {
            this.VerifyGameObject(item);
            var slotAttachments = isMale
                                      ? this.SlotAttachmentsMale
                                      : this.SlotAttachmentsFemale;

            ProtoItemEquipmentHeadHelper.ClientFindDefaultHeadSprites(
                slotAttachments,
                skeletonResource,
                isFrontFace,
                out spriteFront,
                out spriteBehind);
        }
        public override void ClientGetHeadSlotSprites(
            IItem item,
            bool isMale,
            SkeletonResource skeletonResource,
            bool isFrontFace,
            out string spriteFront,
            out string spriteBehind)
        {
            this.VerifyGameObject(item);
            var slotAttachments = isMale
                                      ? this.SlotAttachmentsMale
                                      : this.SlotAttachmentsFemale;

            var isActive = GetPublicState(item).IsActive;

            ProtoItemEquipmentHeadHelper.ClientFindDefaultHeadSprites(
                slotAttachments,
                skeletonResource,
                isFrontFace,
                out spriteFront,
                out spriteBehind,
                headEquipmentName: isActive
                                       ? "HeadActiveEquipment"
                                       : "HeadEquipment");

            if (isActive &&
                spriteFront == null)
            {
                // no active sprite found - fallback to default head equipment method
                base.ClientGetHeadSlotSprites(item,
                                              isMale,
                                              skeletonResource,
                                              isFrontFace,
                                              out spriteFront,
                                              out spriteBehind);
            }
        }