Skip to content

Commit

Permalink
Merge pull request #2582 from decentraland/dev
Browse files Browse the repository at this point in the history
release: 24-10-24 (v39)
  • Loading branch information
aixaCode authored Oct 24, 2024
2 parents 90ef1f2 + 9ad45d5 commit 81ee33e
Show file tree
Hide file tree
Showing 53 changed files with 567 additions and 375 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-unitycloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

ref: 'main'

- name: Get version
id: get_version
if: ${{ github.event.inputs.version == '' && inputs.version == '' }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using Arch.Core;
using CommunicationData.URLHelpers;
using Cysharp.Threading.Tasks;
using DCL.AvatarRendering.Loading.Components;
using DCL.AvatarRendering.Wearables.Components;
using DCL.AvatarRendering.Wearables.Helpers;
using ECS.Prioritization.Components;
using ECS.StreamableLoading.Common;
using Global.AppArgs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using WearablePromise = ECS.StreamableLoading.Common.AssetPromise<DCL.AvatarRendering.Wearables.Components.WearablesResolution,
DCL.AvatarRendering.Wearables.Components.Intentions.GetWearablesByPointersIntention>;

namespace DCL.AvatarRendering.Wearables
{
public class ApplicationParametersWearablesProvider : IWearablesProvider
{
private readonly IAppArgs applicationParametersParser;
private readonly IWearablesProvider source;
private readonly World world;
private readonly string[] allWearableCategories = WearablesConstants.CATEGORIES_PRIORITY.ToArray();
private readonly List<IWearable> resultWearablesBuffer = new ();

public ApplicationParametersWearablesProvider(IAppArgs applicationParametersParser,
IWearablesProvider source,
World world)
{
this.applicationParametersParser = applicationParametersParser;
this.source = source;
this.world = world;
}

public async UniTask<(IReadOnlyList<IWearable> results, int totalAmount)> GetAsync(int pageSize, int pageNumber, CancellationToken ct,
IWearablesProvider.SortingField sortingField = IWearablesProvider.SortingField.Date,
IWearablesProvider.OrderBy orderBy = IWearablesProvider.OrderBy.Descending,
string? category = null,
IWearablesProvider.CollectionType collectionType = IWearablesProvider.CollectionType.All,
string? name = null,
List<IWearable>? results = null)
{
if (!applicationParametersParser.TryGetValue("self-preview-wearables", out string? wearablesCsv))
return await source.GetAsync(pageSize, pageNumber, ct, sortingField, orderBy, category, collectionType, name, results);

URN[] pointers = wearablesCsv!.Split(',', StringSplitOptions.RemoveEmptyEntries)
.Select(s => new URN(s)).ToArray();

IReadOnlyCollection<IWearable>? maleWearables = await RequestPointersAsync(pointers, BodyShape.MALE, ct);
IReadOnlyCollection<IWearable>? femaleWearables = await RequestPointersAsync(pointers, BodyShape.FEMALE, ct);

lock (resultWearablesBuffer)
{
resultWearablesBuffer.Clear();

if (maleWearables != null)
resultWearablesBuffer.AddRange(maleWearables);

if (femaleWearables != null)
resultWearablesBuffer.AddRange(femaleWearables);

int pageIndex = pageNumber - 1;
return (resultWearablesBuffer.Skip(pageIndex * pageSize).Take(pageSize).ToArray(), resultWearablesBuffer.Count);
}
}

private async UniTask<IReadOnlyCollection<IWearable>?> RequestPointersAsync(IReadOnlyCollection<URN> pointers,
BodyShape bodyShape,
CancellationToken ct)
{
var promise = WearablePromise.Create(world,
// We pass all categories as force renderer to force the download of all of them
// Otherwise they will be skipped if any wearable is hiding the category
WearableComponentsUtils.CreateGetWearablesByPointersIntention(bodyShape, pointers, allWearableCategories),
PartitionComponent.TOP_PRIORITY);

promise = await promise.ToUniTaskAsync(world, cancellationToken: ct);

if (!promise.TryGetResult(world, out var result))
return null;

if (!result.Succeeded)
return null;

return result.Asset.Wearables;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 34 additions & 34 deletions Explorer/Assets/DCL/AvatarRendering/Wearables/Wearables.asmdef
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"name": "Wearables",
"rootNamespace": "",
"references": [
"GUID:9e314663ce958b746873cb22d57ede55",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:286980af24684da6acc1caa413039811",
"GUID:1b8e1e1bd01505f478f0369c04a4fb2f",
"GUID:fa7b3fdbb04d67549916da7bd2af58ab",
"GUID:101b8b6ebaf64668909b49c4b7a1420d",
"GUID:3c7b57a14671040bd8c549056adc04f5",
"GUID:e0eedfa2deb9406daf86fd8368728e39",
"GUID:8322ea9340a544c59ddc56d4793eac74",
"GUID:4794e238ed0f65142a4aea5848b513e5",
"GUID:3640f3c0b42946b0b8794a1ed8e06ca5",
"GUID:275e22790c04e9b47a5085d7b0c4432a",
"GUID:4a12c0b1b77ec6b418a8d7bd5c925be3",
"GUID:b46779583a009f04ba9f5f31d0e7e6ac",
"GUID:56e8195b069a4dca9c4c4f313c65f526",
"GUID:e25ef972de004615a22937e739de2def",
"GUID:ca4e81cdd6a34d1aa54c32ad41fc5b3b",
"GUID:5ab29fa8ae5769b49ab29e390caca7a4",
"GUID:91cf8206af184dac8e30eb46747e9939",
"GUID:543b8f091a5947a3880b7f2bca2358bd",
"GUID:e5a23cdae0ef4d86aafc237a73280975"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
"name": "Wearables",
"rootNamespace": "",
"references": [
"GUID:9e314663ce958b746873cb22d57ede55",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:286980af24684da6acc1caa413039811",
"GUID:1b8e1e1bd01505f478f0369c04a4fb2f",
"GUID:fa7b3fdbb04d67549916da7bd2af58ab",
"GUID:3c7b57a14671040bd8c549056adc04f5",
"GUID:e0eedfa2deb9406daf86fd8368728e39",
"GUID:8322ea9340a544c59ddc56d4793eac74",
"GUID:4794e238ed0f65142a4aea5848b513e5",
"GUID:3640f3c0b42946b0b8794a1ed8e06ca5",
"GUID:275e22790c04e9b47a5085d7b0c4432a",
"GUID:4a12c0b1b77ec6b418a8d7bd5c925be3",
"GUID:b46779583a009f04ba9f5f31d0e7e6ac",
"GUID:56e8195b069a4dca9c4c4f313c65f526",
"GUID:e25ef972de004615a22937e739de2def",
"GUID:ca4e81cdd6a34d1aa54c32ad41fc5b3b",
"GUID:5ab29fa8ae5769b49ab29e390caca7a4",
"GUID:91cf8206af184dac8e30eb46747e9939",
"GUID:543b8f091a5947a3880b7f2bca2358bd",
"GUID:e5a23cdae0ef4d86aafc237a73280975",
"GUID:8baf705856414dad9a73b3f382f1bc8b"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class BackpackBusController : IDisposable
private readonly IBackpackCommandBus backpackCommandBus;
private readonly IEquippedEmotes equippedEmotes;
private readonly IEmoteStorage emoteStorage;
private readonly HashSet<string> forceRender = new (15);

private int currentEmoteSlot = -1;
private readonly IReadOnlyEquippedWearables equippedWearables;
Expand Down Expand Up @@ -190,6 +191,9 @@ private void HandleUnEquipWearableCommand(BackpackUnEquipWearableCommand command
}

backpackEventBus.SendUnEquipWearable(wearable);

forceRender.Remove(wearable.GetCategory());
backpackEventBus.SendForceRender(forceRender);
}

private void HandleUnEquipEmoteCommand(BackpackUnEquipEmoteCommand command)
Expand Down Expand Up @@ -218,6 +222,11 @@ private void HandleSelectEmoteCommand(BackpackSelectEmoteCommand command)

private void HandleHideCommand(BackpackHideCommand command)
{
forceRender.Clear();

foreach (string category in command.ForceRender)
forceRender.Add(category);

backpackEventBus.SendForceRender(command.ForceRender);
}

Expand Down
6 changes: 1 addition & 5 deletions Explorer/Assets/DCL/Backpack/BackpackSlotsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ public BackpackSlotsController(
avatarSlotView.OnSlotButtonPressed += OnSlotButtonPressed;
avatarSlotView.OverrideHide.onClick.AddListener(() => RemoveForceRender(avatarSlotView.Category));
avatarSlotView.NoOverride.onClick.AddListener(() => AddForceRender(avatarSlotView.Category));
avatarSlotView.UnequipButton.onClick.AddListener(() =>
{
RemoveForceRender(avatarSlotView.Category);
backpackCommandBus.SendCommand(new BackpackUnEquipWearableCommand(avatarSlotView.SlotWearableUrn));
});
avatarSlotView.UnequipButton.onClick.AddListener(() => backpackCommandBus.SendCommand(new BackpackUnEquipWearableCommand(avatarSlotView.SlotWearableUrn)));
}
}

Expand Down
6 changes: 3 additions & 3 deletions Explorer/Assets/DCL/Chat/Assets/Chat.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 2680055985081135439}
m_HandleRect: {fileID: 7426884741399343867}
m_Direction: 2
m_Value: 1
m_Value: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
Expand Down Expand Up @@ -505,7 +505,7 @@ MonoBehaviour:
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 1
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
Expand Down Expand Up @@ -1379,7 +1379,7 @@ MonoBehaviour:
m_CaretBlinkRate: 0.85
m_CaretWidth: 2
m_ReadOnly: 0
m_RichText: 1
m_RichText: 0
m_GlobalFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_OnFocusSelectAll: 0
m_ResetOnDeActivation: 1
Expand Down
2 changes: 1 addition & 1 deletion Explorer/Assets/DCL/Chat/Assets/ChatEntry.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ MonoBehaviour:
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
Expand Down
2 changes: 1 addition & 1 deletion Explorer/Assets/DCL/Chat/Assets/ChatEntryOwn.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ MonoBehaviour:
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_isRichText: 0
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
Expand Down
6 changes: 3 additions & 3 deletions Explorer/Assets/DCL/Chat/ChatController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ IInputBlock inputBlock
protected override void OnViewInstantiated()
{
cameraEntity = world.CacheCamera();

//We start processing messages once the view is ready
chatMessagesBus.MessageAdded += OnMessageAdded;
chatHistory.OnMessageAdded += CreateChatEntry;
chatHistory.OnCleared += ChatHistoryOnOnCleared;

viewInstance!.OnChatViewPointerEnter += OnChatViewPointerEnter;
viewInstance.OnChatViewPointerExit += OnChatViewPointerExit;
viewInstance.CharacterCounter.SetMaximumLength(viewInstance.InputField.characterLimit);
Expand All @@ -124,7 +124,7 @@ protected override void OnViewInstantiated()
viewInstance.InputField.onDeselect.AddListener(OnInputDeselected);
viewInstance.CloseChatButton.onClick.AddListener(CloseChat);
viewInstance.LoopList.InitListView(0, OnGetItemByIndex);
emojiPanelController = new EmojiPanelController(viewInstance.EmojiPanel, emojiPanelConfiguration, emojiMappingJson, emojiSectionViewPrefab, emojiButtonPrefab, inputBlock);
emojiPanelController = new EmojiPanelController(viewInstance.EmojiPanel, emojiPanelConfiguration, emojiMappingJson, emojiSectionViewPrefab, emojiButtonPrefab);
emojiPanelController.OnEmojiSelected += AddEmojiToInput;

emojiSuggestionPanelController = new EmojiSuggestionPanel(viewInstance.EmojiSuggestionPanel, emojiSuggestionViewPrefab, dclInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
using DCL.ECSComponents;
using DCL.Optimization.Pools;
using DCL.Profiles;
using Decentraland.Kernel.Apis;
using ECS.Abstract;
using ECS.Prioritization;
using ECS.Prioritization.Components;
using ECS.Unity.Systems;
using ECS.Unity.Transforms.Components;
using UnityEngine;

// ReSharper disable once CheckNamespace (Code generation issues)
Expand Down
5 changes: 2 additions & 3 deletions Explorer/Assets/DCL/EmojiPanel/EmojiPanelController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ public EmojiPanelController(
EmojiPanelConfigurationSO emojiPanelConfiguration,
TextAsset emojiMappingJson,
EmojiSectionView emojiSectionPrefab,
EmojiButton emojiButtonPrefab,
IInputBlock inputBlock)
EmojiButton emojiButtonPrefab)
{
this.view = view;
this.emojiPanelConfiguration = emojiPanelConfiguration;
this.emojiSectionPrefab = emojiSectionPrefab;
this.emojiButtonPrefab = emojiButtonPrefab;
emojiSearchController = new EmojiSearchController(view.SearchPanelView, view.EmojiSearchedContent, emojiButtonPrefab, inputBlock);
emojiSearchController = new EmojiSearchController(view.SearchPanelView, view.EmojiSearchedContent, emojiButtonPrefab);
emojiSearchController.OnSearchTextChanged += OnSearchTextChanged;
emojiSearchController.OnEmojiSelected += emoji => OnEmojiSelected?.Invoke(emoji);
foreach (var emojiData in JsonConvert.DeserializeObject<Dictionary<string, string>>(emojiMappingJson.text))
Expand Down
21 changes: 1 addition & 20 deletions Explorer/Assets/DCL/EmojiPanel/EmojiSearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@ public class EmojiSearchController
private CancellationTokenSource cts;
private readonly IObjectPool<EmojiButton> searchItemsPool;
private readonly List<EmojiButton> usedPoolItems = new ();
private readonly IInputBlock inputBlock;

public EmojiSearchController(SearchBarView view, Transform parent, EmojiButton emojiButton, IInputBlock inputBlock)
public EmojiSearchController(SearchBarView view, Transform parent, EmojiButton emojiButton)
{
this.view = view;
this.inputBlock = inputBlock;

view.inputField.onValueChanged.AddListener(OnValueChanged);
view.inputField.onSelect.AddListener(BlockUnwantedInputs);
view.inputField.onDeselect.AddListener(UnblockUnwantedInputs);
view.clearSearchButton.onClick.AddListener(ClearSearch);
view.clearSearchButton.gameObject.SetActive(false);

Expand All @@ -44,24 +40,9 @@ public void Dispose()
{
ReleaseAllSearchResults();
view.inputField.onValueChanged.RemoveListener(OnValueChanged);
view.inputField.onSelect.RemoveListener(BlockUnwantedInputs);
view.inputField.onDeselect.RemoveListener(UnblockUnwantedInputs);
view.clearSearchButton.onClick.RemoveListener(ClearSearch);
}

private void BlockUnwantedInputs(string _)
{
inputBlock.Disable(InputMapComponent.Kind.SHORTCUTS , InputMapComponent.Kind.PLAYER);
}

private void UnblockUnwantedInputs(string _) =>
UnblockUnwantedInputs();

private void UnblockUnwantedInputs()
{
inputBlock.Enable(InputMapComponent.Kind.SHORTCUTS , InputMapComponent.Kind.PLAYER);
}

private EmojiButton CreatePoolElements(Transform parent, EmojiButton emojiButton)
{
EmojiButton poolElement = Object.Instantiate(emojiButton, parent);
Expand Down
4 changes: 2 additions & 2 deletions Explorer/Assets/DCL/Input/Assets/Cursor.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Explorer/Assets/DCL/Input/Assets/CursorInteractive.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 81ee33e

Please sign in to comment.