Outfits collect together the light-, medium-, and dark-skinned versions of an appearance and associate them collectively with a hand group and a body region (head or body).
상속: IDisposable
예제 #1
0
        /// <summary>
        /// Container for grouping together outfits and appearances.
        /// </summary>
        /// <param name="OFT">An outfit from which to create this container.</param>
        public OutfitContainer(Outfit OFT)
        {
            Oft = OFT;
            Appearance Apr = FileManager.GetAppearance(Oft.LightAppearance.UniqueID);

            if (Apr.ThumbnailID.TypeID != 0)
                LightAppearance = Apr;
            Apr = FileManager.GetAppearance(Oft.MediumAppearance.UniqueID);
            if (Apr.ThumbnailID.TypeID != 0)
                MediumAppearance = Apr;
            Apr = FileManager.GetAppearance(Oft.DarkAppearance.UniqueID);
            if (Apr.ThumbnailID.TypeID != 0)
                DarkAppearance = Apr;
        }
예제 #2
0
        /// <summary>
        /// Sets this avatar's head outfit.
        /// </summary>
        public void SetHead(Outfit HeadOutfit, SkinType Type)
        {
            Appearance Apr;

            switch (Type)
            {
                case SkinType.Light:
                    Apr = FileManager.GetAppearance(HeadOutfit.LightAppearance.UniqueID);
                    break;
                case SkinType.Medium:
                    Apr = FileManager.GetAppearance(HeadOutfit.MediumAppearance.UniqueID);
                    break;
                case SkinType.Dark:
                    Apr = FileManager.GetAppearance(HeadOutfit.DarkAppearance.UniqueID);
                    break;
                default:
                    Apr = FileManager.GetAppearance(HeadOutfit.LightAppearance.UniqueID);
                    break;
            }

            AccessoryMesh = null;
            AccessoryTexture = null;

            //I think that heads are always 0...
            Binding Bnd = FileManager.GetBinding(Apr.BindingIDs[0].UniqueID);

            HeadMesh = FileManager.GetMesh(Bnd.MeshID.UniqueID);
            HeadTexture = FileManager.GetTexture(Bnd.TextureID.UniqueID);

            if(Apr.BindingIDs.Count > 1) //This head has accessories.
                Bnd = FileManager.GetBinding(Apr.BindingIDs[1].UniqueID);
        }
예제 #3
0
        /// <summary>
        /// Changes this avatar's outfit.
        /// </summary>
        public void ChangeOutfit(Outfit Oft, SkinType Type)
        {
            Binding[] Bindings;

            AccessoryMesh = null;
            AccessoryTexture = null;

            if (Oft.HandgroupID.FileID != 0)
            {
                HandGroup Hag = FileManager.GetHandgroup(Oft.HandgroupID.UniqueID);
                Appearance LeftHandApr, RightHandApr;

                switch (Type)
                {
                    case SkinType.Light:
                        LeftHandApr = FileManager.GetAppearance(Hag.Light.Left.Idle.AppearanceID.UniqueID);
                        RightHandApr = FileManager.GetAppearance(Hag.Light.Right.Idle.AppearanceID.UniqueID);
                        break;
                    case SkinType.Medium:
                        LeftHandApr = FileManager.GetAppearance(Hag.Medium.Left.Idle.AppearanceID.UniqueID);
                        RightHandApr = FileManager.GetAppearance(Hag.Medium.Right.Idle.AppearanceID.UniqueID);
                        break;
                    case SkinType.Dark:
                        LeftHandApr = FileManager.GetAppearance(Hag.Dark.Left.Idle.AppearanceID.UniqueID);
                        RightHandApr = FileManager.GetAppearance(Hag.Dark.Right.Idle.AppearanceID.UniqueID);
                        break;
                    default:
                        LeftHandApr = FileManager.GetAppearance(Hag.Light.Left.Idle.AppearanceID.UniqueID);
                        RightHandApr = FileManager.GetAppearance(Hag.Light.Right.Idle.AppearanceID.UniqueID);
                        break;
                }

                Bindings = FileManager.GetBindings(LeftHandApr.BindingIDs);

                foreach (Binding Bnd in Bindings)
                {
                    switch (Bnd.Bone)
                    {
                        case "L_HAND":
                            LeftHandMesh = FileManager.GetMesh(Bnd.MeshID.UniqueID);
                            LeftHandTexture = FileManager.GetTexture(Bnd.TextureID.UniqueID);
                            break;
                    }
                }

                Bindings = FileManager.GetBindings(RightHandApr.BindingIDs);

                foreach (Binding Bnd in Bindings)
                {
                    switch (Bnd.Bone)
                    {
                        case "R_HAND":
                            RightHandMesh = FileManager.GetMesh(Bnd.MeshID.UniqueID);
                            RightHandTexture = FileManager.GetTexture(Bnd.TextureID.UniqueID);
                            break;
                    }
                }
            }

            Appearance Apr;

            switch (Type)
            {
                case SkinType.Light:
                    Apr = FileManager.GetAppearance(Oft.LightAppearance.UniqueID);
                    break;
                case SkinType.Medium:
                    Apr = FileManager.GetAppearance(Oft.MediumAppearance.UniqueID);
                    break;
                case SkinType.Dark:
                    Apr = FileManager.GetAppearance(Oft.DarkAppearance.UniqueID);
                    break;
                default:
                    Apr = FileManager.GetAppearance(Oft.LightAppearance.UniqueID);
                    break;
            }

            Bindings = FileManager.GetBindings(Apr.BindingIDs);

            if(Oft.Region == OutfitRegion.Head)
                HeadMesh = null; //IMPORTANT: Reset the head mesh before loading a new one.

            foreach (Binding Bnd in Bindings)
            {
                switch (Bnd.Bone)
                {
                    case "PELVIS":
                        BodyMesh = FileManager.GetMesh(Bnd.MeshID.UniqueID);
                        BodyTexture = FileManager.GetTexture(Bnd.TextureID.UniqueID);
                        break;
                    case "HEAD":
                        if (HeadMesh == null)
                        {
                            HeadMesh = FileManager.GetMesh(Bnd.MeshID.UniqueID);
                            HeadTexture = FileManager.GetTexture(Bnd.TextureID.UniqueID);
                        }
                        else
                        {
                            AccessoryMesh = FileManager.GetMesh(Bnd.MeshID.UniqueID);
                            AccessoryTexture = FileManager.GetTexture(Bnd.TextureID.UniqueID);
                        }
                        break;
                }
            }
        }
예제 #4
0
 /// <summary>
 /// Sets the head for this Sim.
 /// </summary>
 /// <param name="Head">The Appearance of the head to set.</param>
 public void Head(Outfit Head, SkinType Type)
 {
     m_Avatar.SetHead(Head, Type);
 }
예제 #5
0
 /// <summary>
 /// Change the outfit for this Sim.
 /// </summary>
 /// <param name="Oft">The outfit to change into.</param>
 /// <param name="Skin">The sim's skin type.</param>
 public void ChangeOutfit(Outfit Oft, SkinType Skin)
 {
     m_Avatar.ChangeOutfit(Oft, Skin);
 }