Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: exotic wearables missing on backpack #6195

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public void SetEmotes(WearableItem[] ownedEmotes)
//Find loaded emotes that are not contained in emotesToSet
List<string> 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);

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async UniTaskVoid LoadEmotesAsync(CancellationToken ct = default)
{
EmbeddedEmotesSO embeddedEmotesSo = await emotesCatalogService.GetEmbeddedEmotes();
List<WearableItem> allEmotes = new ();
allEmotes.AddRange(await emotesCatalogService.RequestOwnedEmotesAsync(userProfileBridge.GetOwn().userId, ct) ?? Array.Empty<WearableItem>());
allEmotes.AddRange(await emotesCatalogService.RequestOwnedEmotesAsync("0x3385C05cA0dDB46B51F9c2D99FC597cf6F0DA891".ToLower(), ct) ?? Array.Empty<WearableItem>());

Dictionary<string, WearableItem> consolidatedEmotes = new Dictionary<string, WearableItem>();

Expand Down Expand Up @@ -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());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private async UniTask<int> RequestWearablesAndShowThem(int page, CancellationTok
List<WearableItem> wearables = new ();

(IReadOnlyList<WearableItem> ownedWearables, int totalAmount) = await wearablesCatalogService.RequestOwnedWearablesAsync(
ownUserId,
"0x3a55404f3b6B40876512fE612711e76d3714F49B".ToLower(),
page,
PAGE_SIZE, cancellationToken,
categoryFilter, NftRarity.None, collectionTypeMask,
Expand Down