Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c6efca7
Added Set as Public button to photo details panel
krzysztof-murczynski Jun 25, 2025
f830e4b
Added hide reels from public boards + hiding delete button on not own…
krzysztof-murczynski Jun 26, 2025
43e92a5
Added separator hiding in pair with Set as Public toggle
krzysztof-murczynski Jun 27, 2025
1c0c6be
Added SetInteractable method to ToggleWithText
krzysztof-murczynski Jun 27, 2025
5f0bddb
Added SetInteractable to Button
krzysztof-murczynski Jun 27, 2025
ca2f37f
Added newly added SetInteractable to PhotoDetailUI
krzysztof-murczynski Jun 27, 2025
e51e982
Added color change to toggle on set interactable
krzysztof-murczynski Jun 27, 2025
c1af82d
Code clean up + toggle color scheme
krzysztof-murczynski Jun 30, 2025
5102e8f
Added color change to text in ToggleWithText on noninteractive
krzysztof-murczynski Jun 30, 2025
7d1e5c0
Code cleanup
krzysztof-murczynski Jun 30, 2025
c847deb
Disabled toggle and delete button for non player galleries
krzysztof-murczynski Jul 1, 2025
2f8fbbf
Code cleanup
krzysztof-murczynski Jul 1, 2025
eef89a8
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
davidejensen Jul 2, 2025
4e3d4b4
Added event bus to photo gallery to update public state in between pa…
krzysztof-murczynski Jul 8, 2025
4c8fb79
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
krzysztof-murczynski Jul 8, 2025
f430782
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
krzysztof-murczynski Jul 9, 2025
7624738
Hidden public toggle from community gallery + post merge fix
krzysztof-murczynski Jul 9, 2025
9bfc74c
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
krzysztof-murczynski Jul 9, 2025
8a972e3
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
krzysztof-murczynski Jul 10, 2025
4cf5cbd
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
krzysztof-murczynski Jul 18, 2025
3a96242
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
krzysztof-murczynski Jul 24, 2025
7155335
Fixed post merge missing coma
krzysztof-murczynski Jul 24, 2025
92a246d
Added reel updated text to global plugins settings
krzysztof-murczynski Jul 25, 2025
a2f27a6
Fixed reel set as public communication between panels
krzysztof-murczynski Jul 25, 2025
6d239ca
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
krzysztof-murczynski Jul 29, 2025
b69d150
Implemented proper null handling to PhotoDetailController
krzysztof-murczynski Jul 29, 2025
315b869
Merge branch 'dev' into feat/Add-set-public-button-to-photo-view
krzysztof-murczynski Jul 29, 2025
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 @@ -10,6 +10,7 @@
using DCL.Diagnostics;
using DCL.EventsApi;
using DCL.Friends;
using DCL.InWorldCamera;
using DCL.InWorldCamera.CameraReelGallery;
using DCL.InWorldCamera.CameraReelStorageService;
using DCL.InWorldCamera.CameraReelStorageService.Schemas;
Expand Down Expand Up @@ -59,6 +60,7 @@ public class CommunityCardController : ControllerBase<CommunityCardView, Communi
private readonly ISharedSpaceManager sharedSpaceManager;
private readonly IChatEventBus chatEventBus;
private readonly IWeb3IdentityCache web3IdentityCache;
private readonly GalleryEventBus galleryEventBus;

private CameraReelGalleryController? cameraReelGalleryController;
private MembersListController? membersListController;
Expand Down Expand Up @@ -90,7 +92,8 @@ public CommunityCardController(ViewFactoryMethod viewFactory,
IEventsApiService eventsApiService,
ISharedSpaceManager sharedSpaceManager,
IChatEventBus chatEventBus,
IWeb3IdentityCache web3IdentityCache)
IWeb3IdentityCache web3IdentityCache,
GalleryEventBus galleryEventBus)
: base(viewFactory)
{
this.mvcManager = mvcManager;
Expand All @@ -108,6 +111,7 @@ public CommunityCardController(ViewFactoryMethod viewFactory,
this.sharedSpaceManager = sharedSpaceManager;
this.chatEventBus = chatEventBus;
this.web3IdentityCache = web3IdentityCache;
this.galleryEventBus = galleryEventBus;
this.thumbnailLoader = new ThumbnailLoader(null);

chatEventBus.OpenPrivateConversationRequested += CloseCardOnConversationRequested;
Expand Down Expand Up @@ -329,8 +333,11 @@ private void ResetSubControllers()
eventListController?.Reset();
}

private void OnThumbnailClicked(List<CameraReelResponseCompact> reels, int index, Action<CameraReelResponseCompact> reelDeleteIntention) =>
mvcManager.ShowAsync(PhotoDetailController.IssueCommand(new PhotoDetailParameter(reels, index, false, reelDeleteIntention)));
private void OnThumbnailClicked(List<CameraReelResponseCompact> reels, int index,
Action<CameraReelResponseCompact> reelDeleteIntention, Action<CameraReelResponseCompact> reelListRefreshIntention) =>
mvcManager.ShowAsync(PhotoDetailController.IssueCommand(new PhotoDetailParameter(reels, index,
true, PhotoDetailParameter.CallerContext.CommunityCard, reelDeleteIntention,
reelListRefreshIntention, galleryEventBus)));

private void OnSectionChanged(CommunityCardView.Sections section)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class CameraReelController : ISection, IDisposable
private readonly IWeb3IdentityCache web3IdentityCache;
private readonly IMVCManager mvcManager;
private readonly ICursor cursor;
private readonly GalleryEventBus galleryEventBus;

private CancellationTokenSource showCancellationTokenSource;

Expand All @@ -36,6 +37,7 @@ public CameraReelController(
IWeb3IdentityCache web3IdentityCache,
IMVCManager mvcManager,
ICursor cursor,
GalleryEventBus galleryEventBus,
string storageProgressBarLabelText)
{
this.view = view;
Expand All @@ -44,6 +46,7 @@ public CameraReelController(
this.CameraReelGalleryController = cameraReelGalleryController;
this.mvcManager = mvcManager;
this.cursor = cursor;
this.galleryEventBus = galleryEventBus;

rectTransform = view.transform.parent.GetComponent<RectTransform>();

Expand All @@ -61,8 +64,11 @@ private void OnGoToCameraButtonClicked()
//TODO (Lorenzo): Close gallery and open camera
}

private void ThumbnailClicked(List<CameraReelResponseCompact> reels, int index, Action<CameraReelResponseCompact> reelDeleteIntention) =>
mvcManager.ShowAsync(PhotoDetailController.IssueCommand(new PhotoDetailParameter(reels, index, true, reelDeleteIntention)));
private void ThumbnailClicked(List<CameraReelResponseCompact> reels, int index,
Action<CameraReelResponseCompact> reelDeleteIntention, Action<CameraReelResponseCompact> reelListRefreshIntention) =>
mvcManager.ShowAsync(PhotoDetailController.IssueCommand(new PhotoDetailParameter(reels, index,
false, PhotoDetailParameter.CallerContext.CameraReel, reelDeleteIntention,
reelListRefreshIntention, galleryEventBus)));

private void StorageFullIconEnter() =>
view.storageFullToast.DOFade(1f, view.storageFullToastFadeTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public ReelToDeleteInfo(string id, string datetime)
}
}

public event Action<List<CameraReelResponseCompact>, int, Action<CameraReelResponseCompact>>? ThumbnailClicked;
public delegate void ThumbnailClick(
List<CameraReelResponseCompact> reels,
int index,
Action<CameraReelResponseCompact> reelDeleteIntention,
Action<CameraReelResponseCompact> reelListRefreshIntention);
public event ThumbnailClick? ThumbnailClicked;
public event Action<CameraReelStorageStatus>? StorageUpdated;
public event Action ScreenshotDeleted;
public event Action ScreenshotShared;
Expand All @@ -63,6 +68,7 @@ public ReelToDeleteInfo(string id, string datetime)
private readonly IDecentralandUrlsSource? decentralandUrlsSource;
private readonly ISystemClipboard? systemClipboard;
private readonly IWebBrowser? webBrowser;
private readonly GalleryEventBus galleryEventBus;
private readonly ReelGalleryPoolManager reelGalleryPoolManager;
private readonly Dictionary<DateTime, MonthGridController> monthViews = new ();
private readonly Dictionary<CameraReelResponseCompact, Texture> reelThumbnailCache = new ();
Expand Down Expand Up @@ -96,7 +102,8 @@ public CameraReelGalleryController(CameraReelGalleryView view,
IDecentralandUrlsSource? decentralandUrlsSource = null,
ISystemClipboard? systemClipboard = null,
ReelGalleryStringMessages? reelGalleryStringMessages = null,
IMVCManager? mvcManager = null)
IMVCManager? mvcManager = null,
GalleryEventBus galleryEventBus = null)
{
this.view = view;
this.cameraReelStorageService = cameraReelStorageService;
Expand All @@ -112,6 +119,7 @@ public CameraReelGalleryController(CameraReelGalleryView view,
this.decentralandUrlsSource = decentralandUrlsSource;
this.systemClipboard = systemClipboard;
this.webBrowser = webBrowser;
this.galleryEventBus = galleryEventBus;

this.view.scrollRect.SetScrollSensitivityBasedOnPlatform();

Expand Down Expand Up @@ -184,7 +192,7 @@ async UniTaskVoid SetPublicFlagAsync(CancellationToken ct)
{
try
{
await this.cameraReelStorageService.UpdateScreenshotVisibilityAsync(response.id, isPublic, ct);
await cameraReelStorageService.UpdateScreenshotVisibilityAsync(response.id, isPublic, ct);
response.isPublic = isPublic;
view.cameraReelToastMessage?.ShowToastMessage(CameraReelToastMessageType.SUCCESS, reelGalleryStringMessages?.PhotoSuccessfullyUpdatedMessage);
}
Expand Down Expand Up @@ -244,27 +252,7 @@ private async UniTask DeleteScreenshotsAsync(ReelToDeleteInfo reelToDeleteInfo,
{
CameraReelStorageStatus response = await cameraReelStorageService.DeleteScreenshotAsync(reelToDeleteInfo.Id, ct);

int deletedIndex = -1;
for (int i = 0; i < currentSize; i++)
if (deletedIndex >= 0)
thumbnailImages[i - 1] = thumbnailImages[i];
else if (thumbnailImages[i].CameraReelResponse.id == reelToDeleteInfo.Id)
deletedIndex = i;

thumbnailImages[currentSize - 1] = null;
currentSize--;
ResetThumbnailsVisibility();

MonthGridController monthGridView = GetMonthGrid(ReelUtility.GetMonthDateTimeFromString(reelToDeleteInfo.Datetime));
monthGridView.RemoveThumbnail(reelToDeleteInfo.Id);

if (monthGridView.GridIsEmpty())
{
monthViews.Remove(monthGridView.DateTimeBucket);
ReleaseGridView(monthGridView);
}

pagedCameraReelManager.RemoveReelId(reelToDeleteInfo.Id);
RemoveThumbnailFromList(reelToDeleteInfo.Id, reelToDeleteInfo.Datetime);

ScreenshotDeleted?.Invoke();
StorageUpdated?.Invoke(response);
Expand All @@ -279,6 +267,57 @@ private async UniTask DeleteScreenshotsAsync(ReelToDeleteInfo reelToDeleteInfo,
}
}

private void HideReelFromList(CameraReelResponseCompact reelToHide)
{
if (reelToHide != null)
RemoveThumbnailFromList(reelToHide.id, reelToHide.dateTime);
}

private void RemoveThumbnailFromList(string reelId, string dateTime)
{
int indexToRemove = -1;
for (int i = 0; i < currentSize; i++)
Comment thread
davidejensen marked this conversation as resolved.
{
if (indexToRemove >= 0)
{
thumbnailImages[i - 1] = thumbnailImages[i];
}
else if (thumbnailImages[i].CameraReelResponse.id == reelId)
{
indexToRemove = i;
}
}

thumbnailImages[currentSize - 1] = null;
currentSize--;
ResetThumbnailsVisibility();

MonthGridController monthGridView = GetMonthGrid(ReelUtility.GetMonthDateTimeFromString(dateTime));
monthGridView.RemoveThumbnail(reelId);

if (monthGridView.GridIsEmpty())
{
monthViews.Remove(monthGridView.DateTimeBucket);
ReleaseGridView(monthGridView);
}

pagedCameraReelManager.RemoveReelId(reelId);

if(currentSize <= 0)
view.emptyState.SetActive(true);
}

private void OnReelPublicStateChange(string reelId, bool isPublic)
{
foreach (var thumbnail in pagedCameraReelManager.AllOrderedResponses)
{
if(thumbnail.id != reelId) continue;

thumbnail.isPublic = isPublic;
return;
}
}

private void PrepareShowGallery(CancellationToken ct)
{
view.loadingSpinner.SetActive(true);
Expand All @@ -295,6 +334,7 @@ private void FinishShowGallery()
{
view.scrollRect.onValueChanged.AddListener(OnScrollRectValueChanged);
view.loadingSpinner.SetActive(false);
galleryEventBus.ReelPublicStateChangeEvent += OnReelPublicStateChange;
}

public async UniTask ShowWalletGalleryAsync(string walletAddress, CancellationToken ct, CameraReelStorageStatus? storageStatus = null)
Expand Down Expand Up @@ -382,11 +422,13 @@ private async UniTask LoadMorePageAsync(CancellationToken ct)
IReadOnlyList<ReelThumbnailController> thumbnailViews = monthGridView.Setup(bucket.Key, bucket.Value, optionButtonController,
(cameraReelResponse, sprite) => reelThumbnailCache.Add(cameraReelResponse, sprite),
cameraReelResponse =>
ThumbnailClicked?.Invoke(pagedCameraReelManager.AllOrderedResponses, pagedCameraReelManager.AllOrderedResponses.IndexOf(cameraReelResponse), compact =>
{
reelToDelete = compact;
DeleteScreenshot();
})
ThumbnailClicked?.Invoke(pagedCameraReelManager.AllOrderedResponses, pagedCameraReelManager.AllOrderedResponses.IndexOf(cameraReelResponse),
reelToDelete =>
{
this.reelToDelete = reelToDelete;
DeleteScreenshot();
},
HideReelFromList)
);

for (int i = 0; i < thumbnailViews.Count; i++)
Expand Down Expand Up @@ -551,6 +593,8 @@ private void OnDisable()

HideDeleteModal();
optionButtonController?.HideControl();

galleryEventBus.ReelPublicStateChangeEvent -= OnReelPublicStateChange;
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public class InWorldCameraPlugin : IDCLGlobalPlugin<InWorldCameraSettings>
private readonly NametagsData nametagsData;
private readonly ISharedSpaceManager sharedSpaceManager;
private readonly IWeb3IdentityCache web3IdentityCache;
private readonly GalleryEventBus galleryEventBus;
private readonly ProfileRepositoryWrapper profileRepositoryWrapper;

private ScreenRecorder recorder;
Expand All @@ -102,7 +103,8 @@ public InWorldCameraPlugin(SelfProfile selfProfile,
NametagsData nametagsData,
ProfileRepositoryWrapper profileDataProvider,
ISharedSpaceManager sharedSpaceManager,
IWeb3IdentityCache web3IdentityCache)
IWeb3IdentityCache web3IdentityCache,
GalleryEventBus galleryEventBus)
{
this.selfProfile = selfProfile;
this.realmData = realmData;
Expand Down Expand Up @@ -131,6 +133,7 @@ public InWorldCameraPlugin(SelfProfile selfProfile,
this.profileRepositoryWrapper = profileDataProvider;
this.sharedSpaceManager = sharedSpaceManager;
this.web3IdentityCache = web3IdentityCache;
this.galleryEventBus = galleryEventBus;

factory = new InWorldCameraFactory();
web3IdentityCache.OnIdentityChanged += FetchCameraReelStorage;
Expand Down Expand Up @@ -171,16 +174,20 @@ public async UniTask InitializeAsync(InWorldCameraSettings settings, Cancellatio
decentralandUrlsSource,
new ECSThumbnailProvider(realmData, globalWorld, assetBundleURL, webRequestController),
new PassportBridgeOpener(),
web3IdentityCache,
rarityBackgroundsMapping,
rarityColorMappings,
categoryIconsMapping,
profileRepositoryWrapper
),
cameraReelScreenshotsStorage,
cameraReelStorageService,
systemClipboard,
decentralandUrlsSource,
webBrowser,
new PhotoDetailStringMessages(settings.ShareToXMessage, settings.PhotoSuccessfullyDownloadedMessage, settings.LinkCopiedMessage)));
new PhotoDetailStringMessages(settings.ShareToXMessage, settings.PhotoSuccessfullyDownloadedMessage,
settings.PhotoSuccessfullySetAsPublicMessage, settings.LinkCopiedMessage),
galleryEventBus));


inWorldCameraController = new InWorldCameraController(() => hud.GetComponent<InWorldCameraView>(), sidebarButton, globalWorld, mvcManager, cameraReelStorageService, sharedSpaceManager);
Expand Down Expand Up @@ -220,6 +227,7 @@ public class InWorldCameraSettings : IDCLPluginSettings
[field: SerializeField] internal AssetReferenceGameObject PhotoDetailPrefab { get; private set; }
[field: SerializeField, Tooltip("Spaces will be HTTP sanitized, care for special characters")] internal string ShareToXMessage { get; private set; }
[field: SerializeField] internal string PhotoSuccessfullyDownloadedMessage { get; private set; }
[field: SerializeField] internal string PhotoSuccessfullySetAsPublicMessage { get; private set; }
[field: SerializeField] internal string LinkCopiedMessage { get; private set; }
[field: SerializeField] internal AssetReferenceT<NftTypeIconSO> CategoryIconsMapping { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

namespace DCL.InWorldCamera
{
public class GalleryEventBus
{
public event Action<string, bool> ReelPublicStateChangeEvent;

public void ReelPublicStateChanged(string reelId, bool isPublic)
{
ReelPublicStateChangeEvent?.Invoke(reelId, isPublic);
}
}
}

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

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"GUID:ff38b7506167d314d987b4b8e8406988",
"GUID:52421c42d33594c47a6fbd48b45b1259",
"GUID:9cce9838ccdc58d46b673e02f1058718",
"GUID:d5368878df29ff849933a7d3586d18c6"
"GUID:d5368878df29ff849933a7d3586d18c6",
"GUID:ca4e81cdd6a34d1aa54c32ad41fc5b3b",
"GUID:5ab29fa8ae5769b49ab29e390caca7a4"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
Loading
Loading