private void SetTab(Framework.UIElement button)
        {
            if (button == btnDay)
            {
                SelectedTab = VMPersonSuits.DefaultDaywear;
            }
            else if (button == btnSleep)
            {
                SelectedTab = VMPersonSuits.DefaultSleepwear;
            }
            else if (button == btnSwim)
            {
                SelectedTab = VMPersonSuits.DefaultSwimwear;
            }
            else if (button == btnDecorHead)
            {
                SelectedTab = VMPersonSuits.DecorationHead;
            }
            else if (button == btnDecorBack)
            {
                SelectedTab = VMPersonSuits.DecorationBack;
            }
            else if (button == btnDecorShoes)
            {
                SelectedTab = VMPersonSuits.DecorationShoes;
            }
            else if (button == btnDecorTail)
            {
                SelectedTab = VMPersonSuits.DecorationTail;
            }

            UpdateDataProvider();
            UpdateUIState();
        }
 public override void Deserialize(BinaryReader reader)
 {
     base.Deserialize(reader);
     UID    = reader.ReadUInt32();
     Scope  = (VMPersonSuits)reader.ReadInt16();
     Outfit = reader.ReadUInt64();
 }
Exemple #3
0
        public static ulong GetValue(VMAvatar avatar, VMPersonSuits type)
        {
            switch (type)
            {
            case VMPersonSuits.DefaultDaywear:
                return(avatar.DefaultSuits.Daywear.ID);

            case VMPersonSuits.DefaultSleepwear:
                return(avatar.DefaultSuits.Sleepwear.ID);

            case VMPersonSuits.DefaultSwimwear:
                return(avatar.DefaultSuits.Swimwear.ID);

            case VMPersonSuits.DynamicCostume:
                return(avatar.DynamicSuits.Costume);

            case VMPersonSuits.DynamicDaywear:
                return(avatar.DynamicSuits.Daywear);

            case VMPersonSuits.DynamicSleepwear:
                return(avatar.DynamicSuits.Sleepwear);

            case VMPersonSuits.DynamicSwimwear:
                return(avatar.DynamicSuits.Swimwear);
            }
            return(0);
        }
Exemple #4
0
        private void StoreDefaultSuit(VMEODClient client, VMPersonSuits category, uint outfitId)
        {
            GetOutfit(client.vm, outfitId, outfit => {
                if (outfit == null)
                {
                    //You don't own this outfit!
                    return;
                }

                if (outfit.outfit_type != (byte)category)
                {
                    //Wrong category, no swimming in PJs!
                    return;
                }

                //Set the default in the vm, this will be persisted on exit avatar persist
                client.vm.SendCommand(new VMNetSetOutfitCmd {
                    UID    = client.Avatar.PersistID,
                    Scope  = category,
                    Outfit = outfit.asset_id
                });

                //Have the UI update the default
                client.Send("dresser_refresh_default", "");
            });
        }
 public void BindOutfit(VMPersonSuits type, Outfit oft)
 {
     lock (AnimationRequests)
     {
         AnimationRequests.Enqueue(new UIAvatarAnimatorRequest(UIAvatarAnimatorRequestType.Outfit, new Tuple <VMPersonSuits, Outfit>(type, oft)));
     }
 }
Exemple #6
0
 public static bool IsDefaultSuit(VMPersonSuits type)
 {
     if (type != VMPersonSuits.DefaultDaywear &&
         type != VMPersonSuits.DefaultSleepwear &&
         type != VMPersonSuits.DefaultSwimwear)
     {
         return(false);
     }
     return(true);
 }
Exemple #7
0
 public static bool IsDecoration(VMPersonSuits suit)
 {
     if (suit == VMPersonSuits.DecorationHead ||
         suit == VMPersonSuits.DecorationBack ||
         suit == VMPersonSuits.DecorationShoes ||
         suit == VMPersonSuits.DecorationTail)
     {
         return(true);
     }
     return(false);
 }
Exemple #8
0
        private void ChangeOutfit(string evt, string data, VMEODClient client)
        {
            uint outfitId = 0;

            if (!uint.TryParse(data, out outfitId))
            {
                return;
            }

            GetOutfit(client.vm, outfitId, outfit =>
            {
                if (outfit == null)
                {
                    return;
                }
                var type = (VMPersonSuits)outfit.outfit_type;

                VMPersonSuits storageType = VMPersonSuits.DynamicDaywear;
                VMDresserOutfitTypes dresserOutfitType = VMDresserOutfitTypes.DynamicDaywear;

                switch (type)
                {
                case VMPersonSuits.DefaultDaywear:
                    storageType       = VMPersonSuits.DynamicDaywear;
                    dresserOutfitType = VMDresserOutfitTypes.DynamicDaywear;
                    break;

                case VMPersonSuits.DefaultSleepwear:
                    storageType       = VMPersonSuits.DynamicSleepwear;
                    dresserOutfitType = VMDresserOutfitTypes.DynamicSleepwear;
                    break;

                case VMPersonSuits.DefaultSwimwear:
                    storageType       = VMPersonSuits.DynamicSwimwear;
                    dresserOutfitType = VMDresserOutfitTypes.DynamicSwimwear;
                    break;

                case VMPersonSuits.DecorationHead:
                    storageType       = VMPersonSuits.DecorationHead;
                    dresserOutfitType = VMDresserOutfitTypes.DecorationHead;
                    break;

                case VMPersonSuits.DecorationBack:
                    storageType       = VMPersonSuits.DecorationBack;
                    dresserOutfitType = VMDresserOutfitTypes.DecorationBack;
                    break;

                case VMPersonSuits.DecorationShoes:
                    storageType       = VMPersonSuits.DecorationShoes;
                    dresserOutfitType = VMDresserOutfitTypes.DecorationShoes;
                    break;

                case VMPersonSuits.DecorationTail:
                    storageType       = VMPersonSuits.DecorationTail;
                    dresserOutfitType = VMDresserOutfitTypes.DecorationTail;
                    break;
                }

                client.vm.SendCommand(new VMNetSetOutfitCmd
                {
                    UID    = client.Avatar.PersistID,
                    Scope  = storageType,
                    Outfit = outfit.asset_id
                });
                client.SendOBJEvent(new VMEODEvent((short)VMEODDresserEvent.ChangeClothes, (short)dresserOutfitType));
            });
        }
Exemple #9
0
 public void BindOutfit(VMPersonSuits type, Outfit oft)
 {
     EnsureReady();
     Renderer.BindOutfit(type, oft);
 }