Skip to content

Commit 9c6a140

Browse files
authored
Merge branch 'dev' into feat/support-scene-named-spawn-points
2 parents d7940b5 + 673bfd7 commit 9c6a140

8 files changed

Lines changed: 72 additions & 4 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Cysharp.Threading.Tasks;
2+
using DCL.Diagnostics;
3+
using DCL.RealmNavigation;
4+
using DCL.UI;
5+
using MVC;
6+
using System;
7+
using System.Threading;
8+
9+
namespace DCL.ExplorePanel
10+
{
11+
public static class BackpackDeepLinkOpener
12+
{
13+
public static async UniTaskVoid OpenBackpackWhenLandedAsync(IMVCManager mvcManager, ILoadingStatus loadingStatus, CancellationToken ct)
14+
{
15+
try
16+
{
17+
await UniTask.WaitUntil(() => loadingStatus.CurrentStage.Value == LoadingStatus.LoadingStage.Completed, cancellationToken: ct);
18+
await mvcManager.ShowAsync(ExplorePanelController.IssueCommand(new ExplorePanelParameter(ExploreSections.Backpack)), ct);
19+
}
20+
catch (OperationCanceledException) { }
21+
catch (Exception e) { ReportHub.LogException(e, ReportCategory.UI); }
22+
}
23+
}
24+
}

Explorer/Assets/DCL/ExplorePanel/BackpackDeepLinkOpener.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Explorer/Assets/DCL/Infrastructure/Global/AppArgs/AppArgsFlags.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public static class AppArgsFlags
3333
/// </summary>
3434
public const string COMMUNITY = "community";
3535

36+
public const string FORCE_OPEN_BACKPACK = "force-open-backpack";
37+
3638
// The opaque identity id delivered by the auth website's signin deep link (<c>decentraland://?signin={identityId}</c>).
3739
public const string SIGNIN = "signin";
3840

Explorer/Assets/DCL/Infrastructure/Global/Dynamic/DynamicWorldContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ await MapRendererContainer
463463

464464
// Deep link listening stays alive in every mode so browser sign-in can complete; local scene
465465
// development only opts out of navigation routing (teleports would break the scene under test).
466-
var deepLinkHandleImplementation = new DeepLinkHandle(dynamicWorldParams.StartParcel, chatContainer.ChatTeleporter, ct, communitiesDataService, bootstrapContainer.DeeplinkSigninIdentityId,
466+
var deepLinkHandleImplementation = new DeepLinkHandle(dynamicWorldParams.StartParcel, chatContainer.ChatTeleporter, ct, communitiesDataService, uiShellContainer.MvcManager, staticContainer.LoadingStatus, bootstrapContainer.DeeplinkSigninIdentityId,
467467
bootstrapContainer.DeeplinkLoginAwaitingSigninRequestId, routeNavigationDeepLinks: !appArgs.HasFlag(AppArgsFlags.LOCAL_SCENE));
468468

469469
deepLinkHandleImplementation.StartListenForDeepLinksAsync(ct).Forget();

Explorer/Assets/DCL/MarketplaceCredits/MarketplaceCreditsMenuController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,9 @@ private async UniTaskVoid CheckForSidebarButtonStateAsync(CancellationToken ct)
335335

336336
if (!creditsProgramProgressResponse.HasUserStartedProgram() || TrySetAsShownThisWeek(creditsProgramProgressResponse))
337337
{
338-
// Open the Marketplace Credits panel by default when the user didn't start the program and has landed in Genesis City.
339-
await UniTask.WaitUntil(() => loadingStatus.CurrentStage.Value == LoadingStatus.LoadingStage.Completed && realmData.IsGenesis(), cancellationToken: ct);
338+
// Open the Marketplace Credits panel by default when the user didn't start the program and has landed in Genesis City,
339+
// holding off while any other popup or fullscreen view is on screen (e.g. the backpack opened via force-open-backpack).
340+
await UniTask.WaitUntil(() => loadingStatus.CurrentStage.Value == LoadingStatus.LoadingStage.Completed && realmData.IsGenesis() && !mvcManager.IsAnyModalViewShowing(), cancellationToken: ct);
340341
await mvcManager.ShowAsync(MarketplaceCreditsMenuController.IssueCommand(new Params(isOpenedFromNotification: false)), ct);
341342
}
342343

Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ public async UniTask InitializeAsync(ExplorePanelSettings settings, Cancellation
622622

623623
if (isCommunitiesFeatureEnabled)
624624
dclInput.Shortcuts.Communities.performed += OnInputShortcutsCommunitiesPerformed;
625+
626+
if (appArgs.HasFlag(AppArgsFlags.FORCE_OPEN_BACKPACK))
627+
BackpackDeepLinkOpener.OpenBackpackWhenLandedAsync(mvcManager, loadingStatus, ct).Forget();
625628
}
626629

627630
private async UniTask<ObjectPool<PlaceElementView>> InitializePlaceElementsPoolAsync(SearchResultPanelView view, CancellationToken ct)

Explorer/Assets/DCL/RuntimeDeepLink/DeepLinkHandleImplementation.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
using Cysharp.Threading.Tasks;
33
using DCL.Chat.Commands;
44
using DCL.Communities;
5+
using DCL.ExplorePanel;
56
using DCL.Diagnostics;
67
using DCL.RealmNavigation;
78
using DCL.Utilities;
89
using Global.AppArgs;
10+
using MVC;
911
using System.Threading;
1012
using UnityEngine;
1113

@@ -17,17 +19,21 @@ public class DeepLinkHandle : IDeepLinkHandle
1719
private readonly ChatTeleporter chatTeleporter;
1820
private readonly CancellationToken token;
1921
private readonly CommunityDataService communityDataService;
22+
private readonly IMVCManager mvcManager;
23+
private readonly ILoadingStatus loadingStatus;
2024
private readonly ReactiveProperty<string?> deeplinkSigninIdentityId;
2125
private readonly IReadonlyReactiveProperty<string?> loginAwaitingSigninRequestId;
2226
private readonly bool routeNavigationDeepLinks;
2327

24-
public DeepLinkHandle(StartParcel startParcel, ChatTeleporter chatTeleporter, CancellationToken token, CommunityDataService communityDataService, ReactiveProperty<string?> deeplinkSigninIdentityId,
28+
public DeepLinkHandle(StartParcel startParcel, ChatTeleporter chatTeleporter, CancellationToken token, CommunityDataService communityDataService, IMVCManager mvcManager, ILoadingStatus loadingStatus, ReactiveProperty<string?> deeplinkSigninIdentityId,
2529
IReadonlyReactiveProperty<string?> loginAwaitingSigninRequestId, bool routeNavigationDeepLinks)
2630
{
2731
this.startParcel = startParcel;
2832
this.chatTeleporter = chatTeleporter;
2933
this.token = token;
3034
this.communityDataService = communityDataService;
35+
this.mvcManager = mvcManager;
36+
this.loadingStatus = loadingStatus;
3137
this.deeplinkSigninIdentityId = deeplinkSigninIdentityId;
3238
this.loginAwaitingSigninRequestId = loginAwaitingSigninRequestId;
3339
this.routeNavigationDeepLinks = routeNavigationDeepLinks;
@@ -91,6 +97,12 @@ public DeepLinkHandleResult HandleDeepLink(DeepLink deeplink)
9197
handled = true;
9298
}
9399

100+
if (deeplink.ValueOf(AppArgsFlags.FORCE_OPEN_BACKPACK) != null)
101+
{
102+
BackpackDeepLinkOpener.OpenBackpackWhenLandedAsync(mvcManager, loadingStatus, token).Forget();
103+
handled = true;
104+
}
105+
94106
return handled ? DeepLinkHandleResult.CONSUMED : DeepLinkHandleResult.NO_MATCHES;
95107
}
96108
}

docs/app-arguments.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,21 @@ More detailed instructions on how to test can be found in the description of rel
252252

253253
---
254254

255+
## UI Flags
256+
257+
### `force-open-backpack`
258+
**Description:** Automatically opens the Backpack panel once the user lands in the world (after authentication and the loading screen). Presence-only: any value triggers it. Also works when a deep link reaches an already-running client — the Backpack opens immediately (or once loading completes).
259+
260+
**Usage:**
261+
```bash
262+
--force-open-backpack
263+
```
264+
```
265+
decentraland://?force-open-backpack=true
266+
```
267+
268+
---
269+
255270
## Performance & Caching Flags
256271

257272
### `disable-disk-cache`

0 commit comments

Comments
 (0)