private void SetupOverlayActionButtons(string itemId, string itemType, XmlNode assetsNode) { // Setup action buttons specific to the item type mOverlayRemoveButton.ClearOnPressedActions(); LocalAvatarEntity localAvatarEntity = GameFacade.Instance.RetrieveMediator <AvatarMediator>().LocalAvatarEntity; switch (itemType) { case ItemType.ROOM_BACKDROP: RoomManagerProxy roomManagerProxy = GameFacade.Instance.RetrieveProxy <RoomManagerProxy>(); if (roomManagerProxy.IsRoomOwner()) { ApplyImageToRoom(itemId); } else { mOverlayRemoveButton.Disable(); } break; case ItemType.TOPS: case ItemType.PANTS: case ItemType.SKIRT: case ItemType.BAGS: case ItemType.SHOES: case ItemType.MAKEUP: // Call method to apply clothing to body localAvatarEntity.ApplyTempClothingToAvatar(assetsNode); mOverlayRemoveButton.Enable(); mOverlayRemoveButton.Text = Translation.REMOVEIT; mOverlayRemoveButton.AddOnPressedAction(delegate() { //Remove clothing method. localAvatarEntity.RemoveClothingFromAvatar(assetsNode); mOverlayWindow.Showing = false; }); break; case ItemType.FACE: case ItemType.HAIR: case ItemType.BODY: // Call method to apply clothing to body localAvatarEntity.ApplyTempClothingToAvatar(assetsNode); mOverlayRemoveButton.Disable(); break; } }
private void SetupOverlayActionButtons(string itemId, string itemType, XmlNode assetsNode) { LocalAvatarEntity localAvatarEntity = GameFacade.Instance.RetrieveMediator <AvatarMediator>().LocalAvatarEntity; switch (itemType) { case ItemType.TOPS: case ItemType.PANTS: case ItemType.SKIRT: case ItemType.BAGS: case ItemType.SHOES: case ItemType.HAIR: case ItemType.BODY: case ItemType.MAKEUP: case ItemType.FACE: case ItemType.MOOD: // Call method to apply clothing to body localAvatarEntity.ApplyTempClothingToAvatar(assetsNode); break; case ItemType.EMOTE: string animationNameString = assetsNode.SelectSingleNode("Asset/AssetData/AnimationName").InnerText; animationNameString = animationNameString.Split(' ')[0]; RigAnimationName animationName = (RigAnimationName)Enum.Parse(typeof(RigAnimationName), animationNameString); GameFacade.Instance.RetrieveProxy <AnimationProxy>().SetRigAnimationAssetInfo(animationName, new ClientAssetInfo(assetsNode.SelectSingleNode("Asset"))); GameFacade.Instance.RetrieveProxy <ClientAssetRepository>().GetAsset <RigAnimationAsset>(new ClientAssetInfo(assetsNode.SelectSingleNode("Asset")), delegate(RigAnimationAsset animationAsset) { GameFacade.Instance.SendNotification(GameFacade.PLAY_EMOTE, animationNameString as object); }); break; } }