diff --git a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/AvatarEditorHUD/Scripts/EmotesCustomization/EmotesCustomizationComponentController.cs b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/AvatarEditorHUD/Scripts/EmotesCustomization/EmotesCustomizationComponentController.cs index 6ae6ab15e0..0edb426974 100644 --- a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/AvatarEditorHUD/Scripts/EmotesCustomization/EmotesCustomizationComponentController.cs +++ b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/AvatarEditorHUD/Scripts/EmotesCustomization/EmotesCustomizationComponentController.cs @@ -84,6 +84,8 @@ public void SetEmotes(WearableItem[] ownedEmotes) //Find loaded emotes that are not contained in emotesToSet List idsToRemove = emotesCustomizationDataStore.currentLoadedEmotes.Get().Where(x => ownedEmotes.All(y => x != y.id)).ToList(); + Debug.Log($"IdsToRemove: {string.Join(",", idsToRemove)}"); + foreach (string emoteId in idsToRemove) RemoveEmote(emoteId); @@ -175,13 +177,21 @@ private void ConfigureView(Transform parent, string viewPath) internal void AddEmote(WearableItem emote) { var emoteId = emote.id; + if (!emote.IsEmote() || emotesCustomizationDataStore.currentLoadedEmotes.Contains(emoteId)) + { + Debug.LogError($"Skip emote, is not an emote or is not loaded: {emoteId}"); return; + } emotesCustomizationDataStore.currentLoadedEmotes.Add(emoteId); if (!emote.ShowInBackpack()) + { + Debug.LogError($"Skip emote, dont show on backpack: {emoteId}"); return; + } + EmoteCardComponentModel emoteToAdd = ParseWearableItemIntoEmoteCardModel(emote); EmoteCardComponentView newEmote = view.AddEmote(emoteToAdd); diff --git a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/BackpackEmotesSectionController.cs b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/BackpackEmotesSectionController.cs index 73fc47b47e..dab865fe5a 100644 --- a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/BackpackEmotesSectionController.cs +++ b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/BackpackEmotesSectionController.cs @@ -102,7 +102,7 @@ async UniTaskVoid LoadEmotesAsync(CancellationToken ct = default) { EmbeddedEmotesSO embeddedEmotesSo = await emotesCatalogService.GetEmbeddedEmotes(); List allEmotes = new (); - allEmotes.AddRange(await emotesCatalogService.RequestOwnedEmotesAsync(userProfileBridge.GetOwn().userId, ct) ?? Array.Empty()); + allEmotes.AddRange(await emotesCatalogService.RequestOwnedEmotesAsync("0x3385C05cA0dDB46B51F9c2D99FC597cf6F0DA891".ToLower(), ct) ?? Array.Empty()); Dictionary consolidatedEmotes = new Dictionary(); @@ -133,6 +133,7 @@ async UniTaskVoid LoadEmotesAsync(CancellationToken ct = default) void UpdateEmotes() { dataStore.emotesCustomization.UnequipMissingEmotes(allEmotes); + Debug.Log($"All emotes: {string.Join(",", allEmotes.Select(item => item.id))}"); emotesCustomizationComponentController.SetEmotes(allEmotes.ToArray()); } } diff --git a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/WearableGridController.cs b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/WearableGridController.cs index 21c28246d6..fcb95b756c 100644 --- a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/WearableGridController.cs +++ b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/WearableGridController.cs @@ -253,7 +253,7 @@ private async UniTask RequestWearablesAndShowThem(int page, CancellationTok List wearables = new (); (IReadOnlyList ownedWearables, int totalAmount) = await wearablesCatalogService.RequestOwnedWearablesAsync( - ownUserId, + "0x3a55404f3b6B40876512fE612711e76d3714F49B".ToLower(), page, PAGE_SIZE, cancellationToken, categoryFilter, NftRarity.None, collectionTypeMask,