From 85235067f42d8381f37d4e4b4d1d63c75c8790eb Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Fri, 3 Jan 2025 09:27:50 +0100 Subject: [PATCH 01/36] wip --- .../AssetGroups/Essentials.asset | 5 + .../Assets/ContextMenu.prefab | 1116 +++++------------ .../DCL/PluginSystem/DCL.Plugins.asmdef | 3 +- .../PluginSystem/GenericContextMenuPlugin.cs | 55 + .../GenericContextMenuPlugin.cs.meta | 3 + .../Global/Global Plugins Settings.asset | 9 + .../Assets/DCL/UI/GenericContextMenu.meta | 8 + .../DCL/UI/GenericContextMenu/Controls.meta | 3 + .../Controls/ContextMenuControlTypes.cs | 9 + .../Controls/ContextMenuControlTypes.cs.meta | 3 + .../Controls/GenericContextMenuConfig.cs | 21 + .../Controls/GenericContextMenuConfig.cs.meta | 3 + .../GenericContextMenu/ControlsPoolManager.cs | 20 + .../ControlsPoolManager.cs.meta | 3 + .../GenericContextMenu.asmdef | 17 + .../GenericContextMenu.asmdef.meta | 7 + .../GenericContextMenuController.cs | 33 + .../GenericContextMenuController.cs.meta | 3 + .../GenericContextMenuParameter.cs | 14 + .../GenericContextMenuParameter.cs.meta | 3 + .../GenericContextMenuView.cs | 25 + .../GenericContextMenuView.cs.meta | 3 + .../DCL/UI/GenericContextMenu/Prefabs.meta | 8 + .../Prefabs/ButtonWithTextAndIcon.prefab | 335 +++++ .../Prefabs/ButtonWithTextAndIcon.prefab.meta | 7 + .../Prefabs/GenericContextMenu.prefab | 359 ++++++ .../Prefabs/GenericContextMenu.prefab.meta | 7 + .../Prefabs/Separator.prefab | 77 ++ .../Prefabs/Separator.prefab.meta | 7 + .../Prefabs/ToggleWithText.prefab | 335 +++++ .../Prefabs/ToggleWithText.prefab.meta | 7 + .../Global/Dynamic/DynamicWorldContainer.cs | 1 + 32 files changed, 1738 insertions(+), 771 deletions(-) create mode 100644 Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs create mode 100644 Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab.meta diff --git a/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset b/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset index 71954dc37e..f834c6e3cb 100644 --- a/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset +++ b/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset @@ -157,6 +157,11 @@ MonoBehaviour: m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 5ef9c85ff80df42e88f2946a299f1102 + m_Address: Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 5f2c1af519efc4b82b87b887f93077fc m_Address: Assets/DCL/MapRenderer/Addressables/Favorite.prefab m_ReadOnly: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab index 53d182bdac..9459cb19d8 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab @@ -523,81 +523,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!1 &1914945514108218687 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8782351705486195469} - - component: {fileID: 2564782811409646300} - - component: {fileID: 7058362902122898413} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &8782351705486195469 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1914945514108218687} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 7373416871451464613} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 19.099854, y: 0} - m_SizeDelta: {x: 22, y: 22} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2564782811409646300 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1914945514108218687} - m_CullTransparentMesh: 1 ---- !u!114 &7058362902122898413 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1914945514108218687} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 4c97cd3c67403471d8fe75c5fc348e58, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 --- !u!1 &3005944233306849445 GameObject: m_ObjectHideFlags: 0 @@ -1128,7 +1053,7 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &5698349346155858172 +--- !u!1 &6170344280183481015 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1136,23 +1061,23 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 3837476989312074693} - - component: {fileID: 5155274603279523313} - - component: {fileID: 7442011822630108720} + - component: {fileID: 5265644956865833266} + - component: {fileID: 5528744821385994656} + - component: {fileID: 1311081189620797229} m_Layer: 5 - m_Name: Div + m_Name: EmptyDiv m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &3837476989312074693 +--- !u!224 &5265644956865833266 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5698349346155858172} + m_GameObject: {fileID: 6170344280183481015} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -1162,31 +1087,31 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 178, y: -45} - m_SizeDelta: {x: 170, y: 1} + m_AnchoredPosition: {x: 178, y: -39} + m_SizeDelta: {x: 170, y: 5} m_Pivot: {x: 1, y: 1} ---- !u!222 &5155274603279523313 +--- !u!222 &5528744821385994656 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5698349346155858172} + m_GameObject: {fileID: 6170344280183481015} m_CullTransparentMesh: 1 ---- !u!114 &7442011822630108720 +--- !u!114 &1311081189620797229 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5698349346155858172} + m_GameObject: {fileID: 6170344280183481015} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.050980393} + m_Color: {r: 1, g: 1, b: 1, a: 0} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -1203,7 +1128,7 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!1 &6170344280183481015 +--- !u!1 &7230772624285820676 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1211,64 +1136,64 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 5265644956865833266} - - component: {fileID: 5528744821385994656} - - component: {fileID: 1311081189620797229} + - component: {fileID: 7307299007369133304} + - component: {fileID: 2473259701612753141} + - component: {fileID: 6791961596621133630} m_Layer: 5 - m_Name: EmptyDiv + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &5265644956865833266 +--- !u!224 &7307299007369133304 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6170344280183481015} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_GameObject: {fileID: 7230772624285820676} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 6960825954358028589} + m_Father: {fileID: 8942640797296534233} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 178, y: -39} - m_SizeDelta: {x: 170, y: 5} - m_Pivot: {x: 1, y: 1} ---- !u!222 &5528744821385994656 + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 19.099854, y: 0} + m_SizeDelta: {x: 22, y: 22} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2473259701612753141 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6170344280183481015} + m_GameObject: {fileID: 7230772624285820676} m_CullTransparentMesh: 1 ---- !u!114 &1311081189620797229 +--- !u!114 &6791961596621133630 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6170344280183481015} + m_GameObject: {fileID: 7230772624285820676} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 0} + m_Sprite: {fileID: 21300000, guid: 3bffb1589fb814c70b23fbce43ba6736, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -1278,7 +1203,7 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!1 &6231522288517973043 +--- !u!1 &7562641137747796985 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1286,9 +1211,9 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 6876220497163163017} - - component: {fileID: 241797199010795621} - - component: {fileID: 980920712333396531} + - component: {fileID: 6944871212798502140} + - component: {fileID: 2849153206787035192} + - component: {fileID: 2967499417837278662} m_Layer: 5 m_Name: Text (TMP) m_TagString: Untagged @@ -1296,40 +1221,40 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &6876220497163163017 +--- !u!224 &6944871212798502140 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6231522288517973043} + m_GameObject: {fileID: 7562641137747796985} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 6953358313008442297} + m_Father: {fileID: 5024033747866302706} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -7.8, y: 0} + m_AnchoredPosition: {x: -11.4001465, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &241797199010795621 +--- !u!222 &2849153206787035192 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6231522288517973043} + m_GameObject: {fileID: 7562641137747796985} m_CullTransparentMesh: 1 ---- !u!114 &980920712333396531 +--- !u!114 &2967499417837278662 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6231522288517973043} + m_GameObject: {fileID: 7562641137747796985} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} @@ -1343,9 +1268,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 'Set as Public - -' + m_text: Delete m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} @@ -1354,8 +1277,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294769916 - m_fontColor: {r: 0.9882353, g: 0.9882353, b: 0.9882353, a: 1} + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -1410,13 +1333,13 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 17.085876, y: 0, z: 0.9236145, w: 0.46179962} + m_margin: {x: 49.872375, y: 0, z: 0, w: 0} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &7221002432020692288 +--- !u!1 &8824995693078906424 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1424,59 +1347,60 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 6953358313008442297} - - component: {fileID: 2896733421239182772} - - component: {fileID: 5727867682077279955} + - component: {fileID: 8942640797296534233} + - component: {fileID: 3636992482128772401} + - component: {fileID: 8940596167260727821} + - component: {fileID: 9172762623700419208} m_Layer: 5 - m_Name: SetAsPublic + m_Name: CopyLink m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &6953358313008442297 +--- !u!224 &8942640797296534233 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7221002432020692288} + m_GameObject: {fileID: 8824995693078906424} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 6876220497163163017} - - {fileID: 589832036151254691} + - {fileID: 7307299007369133304} + - {fileID: 8781575534993125610} m_Father: {fileID: 6960825954358028589} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 93, y: -21} + m_AnchoredPosition: {x: 93, y: -105} m_SizeDelta: {x: 170, y: 34} m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2896733421239182772 +--- !u!222 &3636992482128772401 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7221002432020692288} + m_GameObject: {fileID: 8824995693078906424} m_CullTransparentMesh: 1 ---- !u!114 &5727867682077279955 +--- !u!114 &8940596167260727821 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7221002432020692288} + m_GameObject: {fileID: 8824995693078906424} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -1492,720 +1416,367 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 3 ---- !u!1 &7230772624285820676 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7307299007369133304} - - component: {fileID: 2473259701612753141} - - component: {fileID: 6791961596621133630} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &7307299007369133304 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7230772624285820676} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 8942640797296534233} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 19.099854, y: 0} - m_SizeDelta: {x: 22, y: 22} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2473259701612753141 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7230772624285820676} - m_CullTransparentMesh: 1 ---- !u!114 &6791961596621133630 + m_PixelsPerUnitMultiplier: 2.2 +--- !u!114 &9172762623700419208 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7230772624285820676} + m_GameObject: {fileID: 8824995693078906424} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} + m_HighlightedColor: {r: 0.2627451, g: 0.2509804, b: 0.2901961, a: 1} + m_PressedColor: {r: 0, g: 0, b: 0, a: 1} + m_SelectedColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} + m_DisabledColor: {r: 0.5176471, g: 0.5176471, b: 0.5176471, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 8940596167260727821} + m_OnClick: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 3bffb1589fb814c70b23fbce43ba6736, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &7562641137747796985 -GameObject: +--- !u!1001 &3968898043218984690 +PrefabInstance: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6944871212798502140} - - component: {fileID: 2849153206787035192} - - component: {fileID: 2967499417837278662} - m_Layer: 5 - m_Name: Text (TMP) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6944871212798502140 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7562641137747796985} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 5024033747866302706} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -11.4001465, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2849153206787035192 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7562641137747796985} - m_CullTransparentMesh: 1 ---- !u!114 &2967499417837278662 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7562641137747796985} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Delete - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 0 - m_ActiveFontFeatures: 6e72656b - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_EmojiFallbackSupport: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 49.872375, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &7968654869685205187 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7373416871451464613} - - component: {fileID: 482789204384021032} - - component: {fileID: 1047371591071446722} - - component: {fileID: 8569663302546971867} - m_Layer: 5 - m_Name: ShareOnX - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &7373416871451464613 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7968654869685205187} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 8782351705486195469} - - {fileID: 102655467929550499} - m_Father: {fileID: 6960825954358028589} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 93, y: -70} - m_SizeDelta: {x: 170, y: 34} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &482789204384021032 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7968654869685205187} - m_CullTransparentMesh: 1 ---- !u!114 &1047371591071446722 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7968654869685205187} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 12dd1efc4e826764f9b02be515a9a033, type: 3} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 2.2 ---- !u!114 &8569663302546971867 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7968654869685205187} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_HighlightedColor: {r: 0.2627451, g: 0.2509804, b: 0.2901961, a: 1} - m_PressedColor: {r: 0, g: 0, b: 0, a: 1} - m_SelectedColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_DisabledColor: {r: 0.5176471, g: 0.5176471, b: 0.5176471, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1047371591071446722} - m_OnClick: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &8806858081520157906 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 102655467929550499} - - component: {fileID: 6253935279160737787} - - component: {fileID: 5695554413945088016} - m_Layer: 5 - m_Name: Text (TMP) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &102655467929550499 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8806858081520157906} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 7373416871451464613} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -11.4, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &6253935279160737787 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8806858081520157906} - m_CullTransparentMesh: 1 ---- !u!114 &5695554413945088016 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8806858081520157906} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Share on X - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 0 - m_ActiveFontFeatures: 6e72656b - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_EmojiFallbackSupport: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 49.872375, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &8824995693078906424 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8942640797296534233} - - component: {fileID: 3636992482128772401} - - component: {fileID: 8940596167260727821} - - component: {fileID: 9172762623700419208} - m_Layer: 5 - m_Name: CopyLink - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &8942640797296534233 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 6960825954358028589} + m_Modifications: + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_SizeDelta.x + value: 170 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_SizeDelta.y + value: 34 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_AnchoredPosition.x + value: 93 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_AnchoredPosition.y + value: -70 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6449720775875921457, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + propertyPath: m_Name + value: ShareOnX + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} +--- !u!224 &7373416871451464613 stripped RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8824995693078906424} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 7307299007369133304} - - {fileID: 8781575534993125610} - m_Father: {fileID: 6960825954358028589} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 93, y: -105} - m_SizeDelta: {x: 170, y: 34} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &3636992482128772401 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8824995693078906424} - m_CullTransparentMesh: 1 ---- !u!114 &8940596167260727821 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + m_PrefabInstance: {fileID: 3968898043218984690} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8824995693078906424} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 12dd1efc4e826764f9b02be515a9a033, type: 3} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 2.2 ---- !u!114 &9172762623700419208 +--- !u!114 &8569663302546971867 stripped MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 4754064954679370281, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} + m_PrefabInstance: {fileID: 3968898043218984690} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8824995693078906424} + m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} m_Name: m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_HighlightedColor: {r: 0.2627451, g: 0.2509804, b: 0.2901961, a: 1} - m_PressedColor: {r: 0, g: 0, b: 0, a: 1} - m_SelectedColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_DisabledColor: {r: 0.5176471, g: 0.5176471, b: 0.5176471, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 8940596167260727821} - m_OnClick: - m_PersistentCalls: - m_Calls: [] ---- !u!1001 &5957619402523405321 +--- !u!1001 &5733446806677757515 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 6953358313008442297} + m_TransformParent: {fileID: 6960825954358028589} m_Modifications: - - target: {fileID: 977034302134673057, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} - propertyPath: k__BackingField - value: 1 + - target: {fileID: 37667019366274743, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} + propertyPath: m_Name + value: Div objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_Pivot.x value: 1 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_Pivot.y - value: 0.5 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_AnchorMax.x - value: 0.5 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_AnchorMax.y - value: 0.5 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_AnchorMin.x - value: 0.5 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_AnchorMin.y - value: 0.5 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_SizeDelta.x - value: 32 + value: 170 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_SizeDelta.y - value: 18 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_AnchoredPosition.x - value: 74.4 + value: 178 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -45 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6975587278961672583, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} - propertyPath: m_Color.b - value: 0.4862745 + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} +--- !u!224 &3837476989312074693 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} + m_PrefabInstance: {fileID: 5733446806677757515} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7791296854210631837 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 6960825954358028589} + m_Modifications: + - target: {fileID: 582679870921041373, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_Name + value: SetAsPublic + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_AnchorMin.y + value: 1 objectReference: {fileID: 0} - - target: {fileID: 6975587278961672583, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} - propertyPath: m_Color.g - value: 0.41960785 + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_SizeDelta.x + value: 170 objectReference: {fileID: 0} - - target: {fileID: 6975587278961672583, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} - propertyPath: m_Color.r - value: 0.44313726 + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_SizeDelta.y + value: 34 objectReference: {fileID: 0} - - target: {fileID: 7225474628005434785, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} - propertyPath: m_Name - value: Toggle + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_AnchoredPosition.x + value: 93 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_AnchoredPosition.y + value: -21 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} ---- !u!224 &589832036151254691 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} - m_PrefabInstance: {fileID: 5957619402523405321} - m_PrefabAsset: {fileID: 0} + m_SourcePrefab: {fileID: 100100000, guid: 60ec312971597448e978368a5382c0f1, type: 3} --- !u!114 &4285643018510730201 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 7625753975028379600, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} - m_PrefabInstance: {fileID: 5957619402523405321} + m_CorrespondingSourceObject: {fileID: 6294227615655975748, guid: 60ec312971597448e978368a5382c0f1, type: 3} + m_PrefabInstance: {fileID: 7791296854210631837} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 @@ -2213,3 +1784,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!224 &6953358313008442297 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} + m_PrefabInstance: {fileID: 7791296854210631837} + m_PrefabAsset: {fileID: 0} diff --git a/Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef b/Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef index 5f51bee7b3..2b57f23f59 100644 --- a/Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef +++ b/Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef @@ -146,7 +146,8 @@ "GUID:b5762faee0fa644b38047f2b625378a1", "GUID:c6e727f7851314e679212856f4ce3e53", "GUID:0f5ab34acaa8744d8a22d7dc4c45a487", - "GUID:134508e23dba8457db8766637d1d33ec" + "GUID:134508e23dba8457db8766637d1d33ec", + "GenericContextMenu" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs b/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs new file mode 100644 index 0000000000..3b58dc339c --- /dev/null +++ b/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs @@ -0,0 +1,55 @@ +using Arch.SystemGroups; +using Cysharp.Threading.Tasks; +using DCL.AssetsProvision; +using DCL.PluginSystem.Global; +using DCL.UI.GenericContextMenu; +using MVC; +using System.Threading; +using UnityEngine; +using UnityEngine.AddressableAssets; + +namespace DCL.PluginSystem +{ + public class GenericContextMenuPlugin : IDCLGlobalPlugin + { + private readonly IAssetsProvisioner assetsProvisioner; + private readonly IMVCManager mvcManager; + + private GenericContextMenuController? genericContextMenuController; + + public GenericContextMenuPlugin( + IAssetsProvisioner assetsProvisioner, + IMVCManager mvcManager) + { + this.assetsProvisioner = assetsProvisioner; + this.mvcManager = mvcManager; + } + + public void Dispose() + { + genericContextMenuController?.Dispose(); + } + + public void InjectToWorld(ref ArchSystemsWorldBuilder builder, in GlobalPluginArguments arguments) + { + // No need to inject anything into the world + } + + public async UniTask InitializeAsync(GenericContextMenuSettings settings, CancellationToken ct) + { + GenericContextMenuView panelViewAsset = (await assetsProvisioner.ProvideMainAssetValueAsync(settings.GenericContextMenuPrefab, ct: ct)).GetComponent(); + ControllerBase.ViewFactoryMethod viewFactoryMethod = GenericContextMenuController.Preallocate(panelViewAsset, null, out GenericContextMenuView panelView); + + genericContextMenuController = new GenericContextMenuController(viewFactoryMethod); + mvcManager.RegisterController(genericContextMenuController); + } + + public class GenericContextMenuSettings : IDCLPluginSettings + { + [field: Header(nameof(GenericContextMenuPlugin) + "." + nameof(GenericContextMenuSettings))] + [field: Space] + [field: SerializeField] + public AssetReferenceGameObject GenericContextMenuPrefab; + } + } +} diff --git a/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs.meta b/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs.meta new file mode 100644 index 0000000000..d4ae173455 --- /dev/null +++ b/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 183625227f9d47019bb68dca224a01d7 +timeCreated: 1735829473 \ No newline at end of file diff --git a/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset b/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset index 398abcea43..4ec7242667 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset +++ b/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset @@ -47,6 +47,7 @@ MonoBehaviour: - rid: 2799748226177040387 - rid: 2799748311381442562 - rid: 6849204606292983808 + - rid: 4782308287844188162 references: version: 2 RefIds: @@ -532,6 +533,14 @@ MonoBehaviour: m_SubObjectName: m_SubObjectType: m_EditorAssetChanged: 0 + - rid: 4782308287844188162 + type: {class: GenericContextMenuPlugin/GenericContextMenuSettings, ns: DCL.PluginSystem, asm: DCL.Plugins} + data: + GenericContextMenuPrefab: + m_AssetGUID: 5ef9c85ff80df42e88f2946a299f1102 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 - rid: 5215741520409264128 type: {class: AvatarPlugin/AvatarShapeSettings, ns: DCL.PluginSystem.Global, asm: DCL.Plugins} data: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu.meta b/Explorer/Assets/DCL/UI/GenericContextMenu.meta new file mode 100644 index 0000000000..67a2a6dbc3 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5a08d22c35ce449a391f81725d17bc3c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls.meta new file mode 100644 index 0000000000..84a2598df7 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 906868bc8e9943d2840a94faa7becaaf +timeCreated: 1735833318 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs new file mode 100644 index 0000000000..92d1b48647 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs @@ -0,0 +1,9 @@ +namespace DCL.UI.GenericContextMenu.Controls +{ + public enum ContextMenuControlTypes + { + BUTTON_WITH_TEXT_AND_ICON, + TOGGLE_WITH_TEXT, + SEPARATOR, + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs.meta new file mode 100644 index 0000000000..473b75d175 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9fd3b581133547cba80f4bb3ca569cab +timeCreated: 1735833944 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs new file mode 100644 index 0000000000..50390a0906 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace DCL.UI.GenericContextMenu.Controls +{ + [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/GenericContextMenuSettings")] + [Serializable] + public class GenericContextMenuConfig : ScriptableObject + { + [SerializeField] private List contextMenuSettings = new (); + } + + [Serializable] + public class ContextMenuControlSettings + { + public ContextMenuControlTypes controlTypeType; + public string text; + public Sprite icon; + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs.meta new file mode 100644 index 0000000000..0eeaa89710 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7f94b35778914b3085d26ae60acea3be +timeCreated: 1735833389 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs new file mode 100644 index 0000000000..764b43a6a9 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -0,0 +1,20 @@ +using System; + +namespace DCL.UI.GenericContextMenu +{ + public class ControlsPoolManager : IDisposable + { + + public ControlsPoolManager() + { + + } + + + + public void Dispose() + { + + } + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs.meta new file mode 100644 index 0000000000..55c8304ea9 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bb529d3f5ff94775bd71fa402ce74f84 +timeCreated: 1735835134 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef new file mode 100644 index 0000000000..eeb380e50c --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef @@ -0,0 +1,17 @@ +{ + "name": "GenericContextMenu", + "rootNamespace": "", + "references": [ + "GUID:45f6fff651a0a514f8edfdaf9cce45af", + "GUID:f51ebe6a0ceec4240a699833d6309b23" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef.meta new file mode 100644 index 0000000000..88a560c66e --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5462d37de7d4344df8aade58a45b403e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs new file mode 100644 index 0000000000..4ca1437d56 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -0,0 +1,33 @@ +using Cysharp.Threading.Tasks; +using MVC; +using System.Threading; + +namespace DCL.UI.GenericContextMenu +{ + public class GenericContextMenuController : ControllerBase + { + public override CanvasOrdering.SortingLayer Layer => CanvasOrdering.SortingLayer.Popup; + + private bool isClosing; + + public GenericContextMenuController(ViewFactoryMethod viewFactory) : base(viewFactory) + { + } + + protected override void OnViewInstantiated() + { + viewInstance!.BackgroundCloseButtonClicked += BackgroundCloseButtonClicked; + } + + protected override void OnViewShow() + { + isClosing = false; + + } + + private void BackgroundCloseButtonClicked() => isClosing = true; + + protected override UniTask WaitForCloseIntentAsync(CancellationToken ct) => + UniTask.WhenAny(UniTask.WaitUntil(() => isClosing, cancellationToken: ct)); + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs.meta new file mode 100644 index 0000000000..6fea7ed513 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b9bb9460f0ef459d8d8d9df960dbb5f3 +timeCreated: 1735829141 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs new file mode 100644 index 0000000000..f1df90f1a4 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs @@ -0,0 +1,14 @@ +using DCL.UI.GenericContextMenu.Controls; + +namespace DCL.UI.GenericContextMenu +{ + public struct GenericContextMenuParameter + { + public readonly GenericContextMenuConfig config; + + public GenericContextMenuParameter(GenericContextMenuConfig config) + { + this.config = config; + } + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs.meta new file mode 100644 index 0000000000..af596eec64 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e7cdfbcce68340b8b2082a10d62458f7 +timeCreated: 1735829184 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs new file mode 100644 index 0000000000..767c28d277 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs @@ -0,0 +1,25 @@ +using MVC; +using System; +using UnityEngine; +using UnityEngine.UI; + +namespace DCL.UI.GenericContextMenu +{ + public class GenericContextMenuView : ViewBase, IView, IDisposable + { + [field: SerializeField] public RectTransform ControlsContainer { get; private set; } + [field: SerializeField] public Button BackgroundCloseButton { get; private set; } + + public event Action BackgroundCloseButtonClicked; + + private void Awake() + { + BackgroundCloseButton?.onClick.AddListener(() => BackgroundCloseButtonClicked?.Invoke()); + } + + public void Dispose() + { + BackgroundCloseButton?.onClick.RemoveAllListeners(); + } + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs.meta new file mode 100644 index 0000000000..8c61c69365 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 12cb81c17ab44f7cbf2880ba8247c375 +timeCreated: 1735829108 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs.meta new file mode 100644 index 0000000000..41c17215ba --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39efc666c59614aeb9332deabfb7f967 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab new file mode 100644 index 0000000000..421a88c3c1 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab @@ -0,0 +1,335 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3280621027375879117 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5689583333307287039} + - component: {fileID: 1478214069186395182} + - component: {fileID: 6260016763612421407} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5689583333307287039 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3280621027375879117} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5856922699228769623} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 19.099854, y: 0} + m_SizeDelta: {x: 22, y: 22} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1478214069186395182 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3280621027375879117} + m_CullTransparentMesh: 1 +--- !u!114 &6260016763612421407 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3280621027375879117} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 4c97cd3c67403471d8fe75c5fc348e58, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5560931233070250528 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3925150027445321809} + - component: {fileID: 7052121060252565769} + - component: {fileID: 8655627310085805794} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3925150027445321809 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5560931233070250528} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5856922699228769623} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -11.4, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7052121060252565769 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5560931233070250528} + m_CullTransparentMesh: 1 +--- !u!114 &8655627310085805794 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5560931233070250528} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Share on X + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} + m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 14 + m_fontSizeBase: 14 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 49.872375, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &6449720775875921457 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5856922699228769623} + - component: {fileID: 3577948846086194394} + - component: {fileID: 4151572650133112880} + - component: {fileID: 4754064954679370281} + m_Layer: 5 + m_Name: ButtonWithTextAndIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5856922699228769623 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6449720775875921457} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5689583333307287039} + - {fileID: 3925150027445321809} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 93, y: -70} + m_SizeDelta: {x: 170, y: 34} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3577948846086194394 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6449720775875921457} + m_CullTransparentMesh: 1 +--- !u!114 &4151572650133112880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6449720775875921457} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 12dd1efc4e826764f9b02be515a9a033, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 2.2 +--- !u!114 &4754064954679370281 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6449720775875921457} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} + m_HighlightedColor: {r: 0.2627451, g: 0.2509804, b: 0.2901961, a: 1} + m_PressedColor: {r: 0, g: 0, b: 0, a: 1} + m_SelectedColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} + m_DisabledColor: {r: 0.5176471, g: 0.5176471, b: 0.5176471, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4151572650133112880} + m_OnClick: + m_PersistentCalls: + m_Calls: [] diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab.meta new file mode 100644 index 0000000000..22fa06661d --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3c3c8d365c6ef4acfa3665168b5737a9 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab new file mode 100644 index 0000000000..35c49cb5af --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab @@ -0,0 +1,359 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6813303210795024876 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 197116971752332369} + - component: {fileID: 6591100080399325240} + - component: {fileID: 8933511582906037065} + - component: {fileID: 8522526520946479007} + - component: {fileID: 5127276684776322220} + m_Layer: 5 + m_Name: GenericContextMenu + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &197116971752332369 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6813303210795024876} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 503480967888987234} + - {fileID: 2932465032679087180} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &6591100080399325240 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6813303210795024876} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &8933511582906037065 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6813303210795024876} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 1 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &8522526520946479007 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6813303210795024876} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &5127276684776322220 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6813303210795024876} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 12cb81c17ab44f7cbf2880ba8247c375, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: {fileID: 6591100080399325240} + k__BackingField: {fileID: 8522526520946479007} + k__BackingField: {fileID: 2932465032679087180} + k__BackingField: {fileID: 3243245791156245727} +--- !u!1 &7170495978923432429 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2932465032679087180} + - component: {fileID: 8909096000382750580} + - component: {fileID: 2092678444378256676} + - component: {fileID: 5384044999603412779} + - component: {fileID: 8118084516005904575} + m_Layer: 5 + m_Name: Controls + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2932465032679087180 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7170495978923432429} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 197116971752332369} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!222 &8909096000382750580 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7170495978923432429} + m_CullTransparentMesh: 1 +--- !u!114 &2092678444378256676 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7170495978923432429} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 14d01e642387749e482a6f14133c57b8, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 2 +--- !u!114 &5384044999603412779 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7170495978923432429} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 4 + m_Bottom: 12 + m_ChildAlignment: 1 + m_Spacing: 1 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!114 &8118084516005904575 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7170495978923432429} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 +--- !u!1 &8356711805427779659 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 503480967888987234} + - component: {fileID: 7636819472055252989} + - component: {fileID: 5113297092000709205} + - component: {fileID: 3243245791156245727} + m_Layer: 5 + m_Name: BackgroundCloseButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &503480967888987234 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356711805427779659} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 197116971752332369} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7636819472055252989 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356711805427779659} + m_CullTransparentMesh: 1 +--- !u!114 &5113297092000709205 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356711805427779659} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &3243245791156245727 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356711805427779659} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 5113297092000709205} + m_OnClick: + m_PersistentCalls: + m_Calls: [] diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab.meta new file mode 100644 index 0000000000..4f8b49b0b8 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5ef9c85ff80df42e88f2946a299f1102 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab new file mode 100644 index 0000000000..0112483b40 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &37667019366274743 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8849643100579995022} + - component: {fileID: 583917151655658426} + - component: {fileID: 2942571485186744443} + m_Layer: 5 + m_Name: Separator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8849643100579995022 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 37667019366274743} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 178, y: -45} + m_SizeDelta: {x: 170, y: 1} + m_Pivot: {x: 1, y: 1} +--- !u!222 &583917151655658426 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 37667019366274743} + m_CullTransparentMesh: 1 +--- !u!114 &2942571485186744443 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 37667019366274743} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0.050980393} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab.meta new file mode 100644 index 0000000000..f3635eaa0e --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 52bc5c5fe83f743cdba8dab60b247e96 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab new file mode 100644 index 0000000000..c57b61c12a --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab @@ -0,0 +1,335 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &582679870921041373 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 891560713975722788} + - component: {fileID: 4905401340599041321} + - component: {fileID: 2548270455446298190} + m_Layer: 5 + m_Name: ToggleWithText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &891560713975722788 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582679870921041373} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3696612145626893588} + - {fileID: 7210190615658038846} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 93, y: -21} + m_SizeDelta: {x: 170, y: 34} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4905401340599041321 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582679870921041373} + m_CullTransparentMesh: 1 +--- !u!114 &2548270455446298190 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582679870921041373} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 12dd1efc4e826764f9b02be515a9a033, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 3 +--- !u!1 &4204936758877281454 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3696612145626893588} + - component: {fileID: 8033074215218235640} + - component: {fileID: 7042733739484598958} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3696612145626893588 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4204936758877281454} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 891560713975722788} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -7.8, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8033074215218235640 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4204936758877281454} + m_CullTransparentMesh: 1 +--- !u!114 &7042733739484598958 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4204936758877281454} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 'Set as Public + +' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} + m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294769916 + m_fontColor: {r: 0.9882353, g: 0.9882353, b: 0.9882353, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 14 + m_fontSizeBase: 14 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 17.085876, y: 0, z: 0.9236145, w: 0.46179962} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1001 &4507408873941251220 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 891560713975722788} + m_Modifications: + - target: {fileID: 977034302134673057, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: k__BackingField + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_Pivot.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_SizeDelta.x + value: 32 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_SizeDelta.y + value: 18 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_AnchoredPosition.x + value: 74.4 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6975587278961672583, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_Color.b + value: 0.4862745 + objectReference: {fileID: 0} + - target: {fileID: 6975587278961672583, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_Color.g + value: 0.41960785 + objectReference: {fileID: 0} + - target: {fileID: 6975587278961672583, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_Color.r + value: 0.44313726 + objectReference: {fileID: 0} + - target: {fileID: 7225474628005434785, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + propertyPath: m_Name + value: Toggle + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} +--- !u!224 &7210190615658038846 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + m_PrefabInstance: {fileID: 4507408873941251220} + m_PrefabAsset: {fileID: 0} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab.meta new file mode 100644 index 0000000000..959f23c0a1 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 60ec312971597448e978368a5382c0f1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs b/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs index 50610d8a2c..f84a2e9509 100644 --- a/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs +++ b/Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs @@ -737,6 +737,7 @@ static IMultiPool MultiPoolFactory() => playerEntity, includeCameraReel ), + new GenericContextMenuPlugin(assetsProvisioner, mvcManager), }; globalPlugins.AddRange(staticContainer.SharedPlugins); From e3ab56367bd2494cb88014a090e68d7b7eda7afb Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Fri, 3 Jan 2025 11:40:11 +0100 Subject: [PATCH 02/36] wip --- .../Controls/GenericContextMenuConfig.cs | 26 +++- .../GenericContextMenu/ControlsPoolManager.cs | 21 +++ .../GenericContextMenuController.cs | 131 +++++++++++++++++- .../GenericContextMenuParameter.cs | 13 +- 4 files changed, 181 insertions(+), 10 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs index 50390a0906..ac30f86453 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs @@ -8,14 +8,32 @@ namespace DCL.UI.GenericContextMenu.Controls [Serializable] public class GenericContextMenuConfig : ScriptableObject { - [SerializeField] private List contextMenuSettings = new (); + public List ContextMenuSettings { get; private set; } = new (); + public Vector2 OffsetFromTarget { get; private set; } = Vector2.zero; } [Serializable] - public class ContextMenuControlSettings + public class ContextMenuControlSettings : ScriptableObject { public ContextMenuControlTypes controlTypeType; - public string text; - public Sprite icon; + } + + [Serializable] + public class ButtonContextMenuControlSettings : ContextMenuControlSettings + { + public string buttonText; + public Sprite buttonIcon; + } + + [Serializable] + public class ToggleContextMenuControlSettings : ContextMenuControlSettings + { + public string buttonText; + public Sprite buttonIcon; + } + + [Serializable] + public class SeparatorContextMenuControlSettings : ContextMenuControlSettings + { } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index 764b43a6a9..ac6d100748 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -1,4 +1,7 @@ +using DCL.UI.GenericContextMenu.Controls; using System; +using UnityEngine; +using UnityEngine.UI; namespace DCL.UI.GenericContextMenu { @@ -10,11 +13,29 @@ public ControlsPoolManager() } + public GameObject GetSeparator() + { + throw new NotImplementedException(); + } + + public Button GetButton(ButtonContextMenuControlSettings settings) + { + throw new NotImplementedException(); + } + public Toggle GetToggle(ToggleContextMenuControlSettings settings) + { + throw new NotImplementedException(); + } public void Dispose() { } + + public void ReleaseAllCurrentControls() + { + throw new NotImplementedException(); + } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 4ca1437d56..2f4623e78b 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -1,31 +1,156 @@ using Cysharp.Threading.Tasks; +using DCL.UI.GenericContextMenu.Controls; using MVC; +using System; +using System.Collections.Generic; using System.Threading; +using UnityEngine; +using UnityEngine.UI; namespace DCL.UI.GenericContextMenu { public class GenericContextMenuController : ControllerBase { + private enum ContextMenuOpenDirection + { + BOTTOM_RIGHT, + BOTTOM_LEFT, + TOP_LEFT, + TOP_RIGHT + } + public override CanvasOrdering.SortingLayer Layer => CanvasOrdering.SortingLayer.Popup; + private readonly ControlsPoolManager controlsPoolManager; + + private RectTransform viewRectTransform; private bool isClosing; public GenericContextMenuController(ViewFactoryMethod viewFactory) : base(viewFactory) { + controlsPoolManager = new ControlsPoolManager(); } protected override void OnViewInstantiated() { - viewInstance!.BackgroundCloseButtonClicked += BackgroundCloseButtonClicked; + viewRectTransform = viewInstance!.GetComponent(); + + viewInstance!.BackgroundCloseButtonClicked += TriggerContextMenuClose; } - protected override void OnViewShow() + protected override void OnBeforeViewShow() { isClosing = false; + ConfigureContextMenu(); } - private void BackgroundCloseButtonClicked() => isClosing = true; + private void ConfigureContextMenu() + { + for (var i = 0; i < inputData.Config.ContextMenuSettings.Count; i++) + { + ContextMenuControlSettings config = inputData.Config.ContextMenuSettings[i]; + + switch (config.controlTypeType) + { + case ContextMenuControlTypes.SEPARATOR: + controlsPoolManager.GetSeparator(); + break; + case ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON: + Button button = controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings); + button.onClick.AddListener(inputData.ControlsActions[i] as UnityEngine.Events.UnityAction); + button.onClick.AddListener(TriggerContextMenuClose); + break; + case ContextMenuControlTypes.TOGGLE_WITH_TEXT: + Toggle toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings); + toggle.onValueChanged.AddListener(inputData.ControlsActions[i] as UnityEngine.Events.UnityAction); + toggle.onValueChanged.AddListener((toggleValue) => TriggerContextMenuClose()); + break; + } + } + + viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.OffsetFromTarget); + } + + private Vector2 GetOffsetByDirection(ContextMenuOpenDirection direction, Vector2 offsetFromTarget) + { + return direction switch + { + ContextMenuOpenDirection.BOTTOM_RIGHT => offsetFromTarget, + ContextMenuOpenDirection.BOTTOM_LEFT => new Vector2(-offsetFromTarget.x - viewInstance!.ControlsContainer.rect.width, offsetFromTarget.y), + ContextMenuOpenDirection.TOP_RIGHT => new Vector2(offsetFromTarget.x, -offsetFromTarget.y + viewInstance!.ControlsContainer.rect.height), + ContextMenuOpenDirection.TOP_LEFT => new Vector2(-offsetFromTarget.x - viewInstance!.ControlsContainer.rect.width, -offsetFromTarget.y + viewInstance!.ControlsContainer.rect.height), + _ => Vector3.zero + }; + } + + private Vector3 GetControlsPosition(Vector2 anchorPosition, Vector2 offsetFromTarget) + { + Vector3 position = viewRectTransform.InverseTransformPoint(anchorPosition); + position.x += viewInstance!.ControlsContainer.rect.width / 2; + position.y -= viewInstance!.ControlsContainer.rect.height / 2; + + Vector3 newPosition = Vector3.zero; + float minNonOverlappingArea = float.MaxValue; + foreach (ContextMenuOpenDirection enumVal in Enum.GetValues(typeof(ContextMenuOpenDirection))) + { + Vector2 offsetByDirection = GetOffsetByDirection(enumVal, offsetFromTarget); + Vector3 currentPosition = position + new Vector3(offsetByDirection.x, offsetByDirection.y, 0); + float nonOverlappingArea = CalculateNonOverlappingArea(viewRectTransform.rect, GetProjectedRect(currentPosition)); + if (nonOverlappingArea < minNonOverlappingArea) + { + newPosition = currentPosition; + minNonOverlappingArea = nonOverlappingArea; + } + } + + return newPosition; + } + + private float CalculateNonOverlappingArea(Rect rect1, Rect rect2) + { + float area1 = rect1.width * rect1.height; + float area2 = rect2.width * rect2.height; + + Rect intersection = Rect.MinMaxRect( + Mathf.Max(rect1.xMin, rect2.xMin), + Mathf.Max(rect1.yMin, rect2.yMin), + Mathf.Min(rect1.xMax, rect2.xMax), + Mathf.Min(rect1.yMax, rect2.yMax) + ); + + float intersectionArea = 0; + + if (intersection is { width: > 0, height: > 0 }) + intersectionArea = intersection.width * intersection.height; + + return area1 + area2 - intersectionArea; + } + + private Rect GetProjectedRect(Vector3 newPosition) + { + Vector3 originalPosition = viewInstance!.ControlsContainer.localPosition; + viewInstance!.ControlsContainer.localPosition = newPosition; + Rect rect = GetWorldRect(viewInstance!.ControlsContainer); + viewInstance!.ControlsContainer.localPosition = originalPosition; + + return rect; + } + + private static Rect GetWorldRect(RectTransform rectTransform) + { + var corners = new Vector3[4]; + rectTransform.GetWorldCorners(corners); + Vector2 min = corners[0]; + Vector2 max = corners[2]; + Vector2 size = max - min; + return new Rect(min, size); + } + + protected override void OnViewClose() => + controlsPoolManager.ReleaseAllCurrentControls(); + + private void TriggerContextMenuClose() => isClosing = true; protected override UniTask WaitForCloseIntentAsync(CancellationToken ct) => UniTask.WhenAny(UniTask.WaitUntil(() => isClosing, cancellationToken: ct)); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs index f1df90f1a4..6b0413f97c 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs @@ -1,14 +1,21 @@ using DCL.UI.GenericContextMenu.Controls; +using System; +using System.Collections.Generic; +using UnityEngine; namespace DCL.UI.GenericContextMenu { public struct GenericContextMenuParameter { - public readonly GenericContextMenuConfig config; + public readonly GenericContextMenuConfig Config; + public readonly Dictionary ControlsActions; + public readonly Vector2 AnchorPosition; - public GenericContextMenuParameter(GenericContextMenuConfig config) + public GenericContextMenuParameter(GenericContextMenuConfig config, Dictionary controlsActions, Vector2 anchorPosition) { - this.config = config; + this.Config = config; + this.ControlsActions = controlsActions; + this.AnchorPosition = anchorPosition; } } } From 5943bbda56110bcb463d1ed203ef139ce30e0d16 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Fri, 3 Jan 2025 14:25:10 +0100 Subject: [PATCH 03/36] wip --- .../AssetGroups/Essentials.asset | 15 ++++ .../PluginSystem/GenericContextMenuPlugin.cs | 17 +++- .../Global/Global Plugins Settings.asset | 15 ++++ .../GenericContextMenuButtonWithTextView.cs | 23 +++++ ...nericContextMenuButtonWithTextView.cs.meta | 3 + .../Controls/GenericContextMenuConfig.cs | 11 +-- .../GenericContextMenuSeparatorView.cs | 18 ++++ .../GenericContextMenuSeparatorView.cs.meta | 3 + .../Controls/GenericContextMenuToggleView.cs | 21 +++++ .../GenericContextMenuToggleView.cs.meta | 3 + .../Controls/IGenericContextMenuComponent.cs | 8 ++ .../IGenericContextMenuComponent.cs.meta | 3 + .../GenericContextMenu/ControlsPoolManager.cs | 68 +++++++++++++-- .../GenericContextMenu.asmdef | 3 +- .../GenericContextMenuController.cs | 27 +++--- .../GenericContextMenuParameter.cs | 4 +- .../Prefabs/ButtonWithTextAndIcon.prefab | 16 ++++ .../Prefabs/Separator.prefab | 86 ++++++++++++++++++- .../Prefabs/ToggleWithText.prefab | 26 ++++++ 19 files changed, 337 insertions(+), 33 deletions(-) create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs.meta diff --git a/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset b/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset index f834c6e3cb..b62009934f 100644 --- a/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset +++ b/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset @@ -102,6 +102,11 @@ MonoBehaviour: m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 3c3c8d365c6ef4acfa3665168b5737a9 + m_Address: Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 3efe8a48fc3905f47a0648abd6859394 m_Address: MapCameraObject m_ReadOnly: 0 @@ -122,6 +127,11 @@ MonoBehaviour: m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 52bc5c5fe83f743cdba8dab60b247e96 + m_Address: Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 53b70d09c4a814878a30c68582ad4523 m_Address: Assets/DCL/MapRenderer/Addressables/HotUserMarkerObject.prefab m_ReadOnly: 0 @@ -172,6 +182,11 @@ MonoBehaviour: m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 60ec312971597448e978368a5382c0f1 + m_Address: Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 62f68ba25f6c905428b36a081b072566 m_Address: EmoteAudioSource m_ReadOnly: 0 diff --git a/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs b/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs index 3b58dc339c..51209abe94 100644 --- a/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs +++ b/Explorer/Assets/DCL/PluginSystem/GenericContextMenuPlugin.cs @@ -3,6 +3,7 @@ using DCL.AssetsProvision; using DCL.PluginSystem.Global; using DCL.UI.GenericContextMenu; +using DCL.UI.GenericContextMenu.Controls; using MVC; using System.Threading; using UnityEngine; @@ -40,7 +41,12 @@ public async UniTask InitializeAsync(GenericContextMenuSettings settings, Cancel GenericContextMenuView panelViewAsset = (await assetsProvisioner.ProvideMainAssetValueAsync(settings.GenericContextMenuPrefab, ct: ct)).GetComponent(); ControllerBase.ViewFactoryMethod viewFactoryMethod = GenericContextMenuController.Preallocate(panelViewAsset, null, out GenericContextMenuView panelView); - genericContextMenuController = new GenericContextMenuController(viewFactoryMethod); + GenericContextMenuSeparatorView separatorPrefab = (await assetsProvisioner.ProvideMainAssetValueAsync(settings.GenericContextMenuSeparatorPrefab, ct)).GetComponent(); + GenericContextMenuButtonWithTextView buttonPrefab = (await assetsProvisioner.ProvideMainAssetValueAsync(settings.GenericContextMenuButtonPrefab, ct)).GetComponent(); + GenericContextMenuToggleView togglePrefab = (await assetsProvisioner.ProvideMainAssetValueAsync(settings.GenericContextMenuTogglePrefab, ct)).GetComponent(); + + genericContextMenuController = new GenericContextMenuController(viewFactoryMethod, + new ControlsPoolManager(panelView.ControlsContainer, separatorPrefab, buttonPrefab, togglePrefab)); mvcManager.RegisterController(genericContextMenuController); } @@ -50,6 +56,15 @@ public class GenericContextMenuSettings : IDCLPluginSettings [field: Space] [field: SerializeField] public AssetReferenceGameObject GenericContextMenuPrefab; + + [field: Header("Controls prefabs")] + [field: Space] + [field: SerializeField] + public AssetReferenceGameObject GenericContextMenuSeparatorPrefab; + [field: SerializeField] + public AssetReferenceGameObject GenericContextMenuButtonPrefab; + [field: SerializeField] + public AssetReferenceGameObject GenericContextMenuTogglePrefab; } } } diff --git a/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset b/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset index 4ec7242667..1a8155db8e 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset +++ b/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset @@ -541,6 +541,21 @@ MonoBehaviour: m_SubObjectName: m_SubObjectType: m_EditorAssetChanged: 0 + GenericContextMenuSeparatorPrefab: + m_AssetGUID: 52bc5c5fe83f743cdba8dab60b247e96 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + GenericContextMenuButtonPrefab: + m_AssetGUID: 3c3c8d365c6ef4acfa3665168b5737a9 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + GenericContextMenuTogglePrefab: + m_AssetGUID: 60ec312971597448e978368a5382c0f1 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 - rid: 5215741520409264128 type: {class: AvatarPlugin/AvatarShapeSettings, ns: DCL.PluginSystem.Global, asm: DCL.Plugins} data: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs new file mode 100644 index 0000000000..034c6ffa11 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -0,0 +1,23 @@ +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +namespace DCL.UI.GenericContextMenu.Controls +{ + public class GenericContextMenuButtonWithTextView : MonoBehaviour, IGenericContextMenuComponent + { + [field: SerializeField] public Button ButtonComponent { get; private set; } + [field: SerializeField] public TMP_Text TextComponent { get; private set; } + [field: SerializeField] public Image ImageComponent { get; private set; } + + public void Configure(ContextMenuControlSettings settings) + { + ButtonContextMenuControlSettings buttonSettings = settings as ButtonContextMenuControlSettings; + TextComponent.SetText(buttonSettings!.ButtonText); + ImageComponent.sprite = buttonSettings.ButtonIcon; + } + + public void UnregisterListeners() => + ButtonComponent.onClick.RemoveAllListeners(); + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs.meta new file mode 100644 index 0000000000..86dd47f2be --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d0cb01ddb93349c98fd84395a98b77f9 +timeCreated: 1735901546 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs index ac30f86453..638a5b69c8 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs @@ -10,30 +10,31 @@ public class GenericContextMenuConfig : ScriptableObject { public List ContextMenuSettings { get; private set; } = new (); public Vector2 OffsetFromTarget { get; private set; } = Vector2.zero; + public float Width { get; private set; } = 170; } [Serializable] public class ContextMenuControlSettings : ScriptableObject { - public ContextMenuControlTypes controlTypeType; + public ContextMenuControlTypes ControlTypeType { get; private set; } } [Serializable] public class ButtonContextMenuControlSettings : ContextMenuControlSettings { - public string buttonText; - public Sprite buttonIcon; + public string ButtonText { get; private set; } + public Sprite ButtonIcon { get; private set; } } [Serializable] public class ToggleContextMenuControlSettings : ContextMenuControlSettings { - public string buttonText; - public Sprite buttonIcon; + public string ToggleText { get; private set; } } [Serializable] public class SeparatorContextMenuControlSettings : ContextMenuControlSettings { + public int Height { get; private set; } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs new file mode 100644 index 0000000000..56e5cb874b --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace DCL.UI.GenericContextMenu.Controls +{ + public class GenericContextMenuSeparatorView : MonoBehaviour, IGenericContextMenuComponent + { + [field: SerializeField] public LayoutElement LayoutElementComponent { get; private set; } + + public void Configure(ContextMenuControlSettings settings) + { + SeparatorContextMenuControlSettings separatorSettings = settings as SeparatorContextMenuControlSettings; + LayoutElementComponent.preferredHeight = separatorSettings!.Height; + } + + public void UnregisterListeners(){} + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs.meta new file mode 100644 index 0000000000..32e1ec8824 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 83940472056b404bb53ff806ae8bb4bc +timeCreated: 1735901825 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs new file mode 100644 index 0000000000..48e281c970 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -0,0 +1,21 @@ +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +namespace DCL.UI.GenericContextMenu.Controls +{ + public class GenericContextMenuToggleView : MonoBehaviour, IGenericContextMenuComponent + { + [field: SerializeField] public Toggle ToggleComponent { get; private set; } + [field: SerializeField] public TMP_Text TextComponent { get; private set; } + + public void Configure(ContextMenuControlSettings settings) + { + ToggleContextMenuControlSettings toggleSettings = settings as ToggleContextMenuControlSettings; + TextComponent.SetText(toggleSettings!.ToggleText); + } + + public void UnregisterListeners() => + ToggleComponent.onValueChanged.RemoveAllListeners(); + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs.meta new file mode 100644 index 0000000000..fe78d974b1 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e8f35c553d944f99854691517619b0e3 +timeCreated: 1735901080 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs new file mode 100644 index 0000000000..6c4f619d84 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs @@ -0,0 +1,8 @@ +namespace DCL.UI.GenericContextMenu.Controls +{ + public interface IGenericContextMenuComponent + { + void Configure(ContextMenuControlSettings settings); + void UnregisterListeners(); + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs.meta new file mode 100644 index 0000000000..fedce32038 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9910d7a5b2134ee6b2e395f007a3eeda +timeCreated: 1735901392 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index ac6d100748..b80b81042d 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -1,31 +1,65 @@ using DCL.UI.GenericContextMenu.Controls; using System; +using System.Collections.Generic; using UnityEngine; -using UnityEngine.UI; +using UnityEngine.Pool; namespace DCL.UI.GenericContextMenu { public class ControlsPoolManager : IDisposable { + private readonly IObjectPool separatorPool; + private readonly IObjectPool buttonPool; + private readonly IObjectPool togglePool; + private readonly List currentControls = new (); - public ControlsPoolManager() + public ControlsPoolManager( + Transform controlsParent, + GenericContextMenuSeparatorView separatorPrefab, + GenericContextMenuButtonWithTextView buttonPrefab, + GenericContextMenuToggleView togglePrefab) { + separatorPool = new ObjectPool( + createFunc: () => GameObject.Instantiate(separatorPrefab, controlsParent), + actionOnGet: separatorView => separatorView.gameObject.SetActive(true), + actionOnRelease: separatorView => separatorView.gameObject.SetActive(false), + actionOnDestroy: separatorView => GameObject.Destroy(separatorView.gameObject)); + buttonPool = new ObjectPool( + createFunc: () => GameObject.Instantiate(buttonPrefab, controlsParent), + actionOnGet: buttonView => buttonView.gameObject.SetActive(true), + actionOnRelease: buttonView => buttonView.gameObject.SetActive(false), + actionOnDestroy: buttonView => GameObject.Destroy(buttonView.gameObject)); + + togglePool = new ObjectPool( + createFunc: () => GameObject.Instantiate(togglePrefab, controlsParent), + actionOnGet: toggleView => toggleView.gameObject.SetActive(true), + actionOnRelease: toggleView => toggleView.gameObject.SetActive(false), + actionOnDestroy: toggleView => GameObject.Destroy(toggleView.gameObject)); } - public GameObject GetSeparator() + public GenericContextMenuSeparatorView GetSeparator(SeparatorContextMenuControlSettings settings) { - throw new NotImplementedException(); + GenericContextMenuSeparatorView separatorView = separatorPool.Get(); + separatorView.Configure(settings); + currentControls.Add(separatorView); + return separatorView; } - public Button GetButton(ButtonContextMenuControlSettings settings) + public GenericContextMenuButtonWithTextView GetButton(ButtonContextMenuControlSettings settings) { - throw new NotImplementedException(); + GenericContextMenuButtonWithTextView buttonView = buttonPool.Get(); + buttonView.Configure(settings); + currentControls.Add(buttonView); + return buttonView; } - public Toggle GetToggle(ToggleContextMenuControlSettings settings) + public GenericContextMenuToggleView GetToggle(ToggleContextMenuControlSettings settings) { - throw new NotImplementedException(); + GenericContextMenuToggleView toggleView = togglePool.Get(); + toggleView.Configure(settings); + currentControls.Add(toggleView); + return toggleView; } public void Dispose() @@ -35,7 +69,23 @@ public void Dispose() public void ReleaseAllCurrentControls() { - throw new NotImplementedException(); + foreach (IGenericContextMenuComponent control in currentControls) + { + control.UnregisterListeners(); + + switch (control) + { + case GenericContextMenuSeparatorView separatorView: + separatorPool.Release(separatorView); + break; + case GenericContextMenuButtonWithTextView buttonView: + buttonPool.Release(buttonView); + break; + case GenericContextMenuToggleView toggleView: + togglePool.Release(toggleView); + break; + } + } } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef index eeb380e50c..d6d25ef85d 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef @@ -3,7 +3,8 @@ "rootNamespace": "", "references": [ "GUID:45f6fff651a0a514f8edfdaf9cce45af", - "GUID:f51ebe6a0ceec4240a699833d6309b23" + "GUID:f51ebe6a0ceec4240a699833d6309b23", + "GUID:6055be8ebefd69e48b49212b09b47b2f" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 2f4623e78b..b86b7cfa2a 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -26,9 +26,10 @@ private enum ContextMenuOpenDirection private RectTransform viewRectTransform; private bool isClosing; - public GenericContextMenuController(ViewFactoryMethod viewFactory) : base(viewFactory) + public GenericContextMenuController(ViewFactoryMethod viewFactory, + ControlsPoolManager controlsPoolManager) : base(viewFactory) { - controlsPoolManager = new ControlsPoolManager(); + this.controlsPoolManager = controlsPoolManager; } protected override void OnViewInstantiated() @@ -51,25 +52,25 @@ private void ConfigureContextMenu() { ContextMenuControlSettings config = inputData.Config.ContextMenuSettings[i]; - switch (config.controlTypeType) + switch (config.ControlTypeType) { case ContextMenuControlTypes.SEPARATOR: - controlsPoolManager.GetSeparator(); + controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings); break; case ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON: - Button button = controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings); - button.onClick.AddListener(inputData.ControlsActions[i] as UnityEngine.Events.UnityAction); - button.onClick.AddListener(TriggerContextMenuClose); + GenericContextMenuButtonWithTextView button = controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings); + button.ButtonComponent.onClick.AddListener(inputData.ControlsActions[i] as UnityEngine.Events.UnityAction); + button.ButtonComponent.onClick.AddListener(TriggerContextMenuClose); break; case ContextMenuControlTypes.TOGGLE_WITH_TEXT: - Toggle toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings); - toggle.onValueChanged.AddListener(inputData.ControlsActions[i] as UnityEngine.Events.UnityAction); - toggle.onValueChanged.AddListener((toggleValue) => TriggerContextMenuClose()); + GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings); + toggle.ToggleComponent.onValueChanged.AddListener(inputData.ControlsActions[i] as UnityEngine.Events.UnityAction); + toggle.ToggleComponent.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); break; } } - viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.OffsetFromTarget); + viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.OffsetFromTarget, inputData.OverlapRect); } private Vector2 GetOffsetByDirection(ContextMenuOpenDirection direction, Vector2 offsetFromTarget) @@ -84,7 +85,7 @@ private Vector2 GetOffsetByDirection(ContextMenuOpenDirection direction, Vector2 }; } - private Vector3 GetControlsPosition(Vector2 anchorPosition, Vector2 offsetFromTarget) + private Vector3 GetControlsPosition(Vector2 anchorPosition, Vector2 offsetFromTarget, Rect? overlapRect) { Vector3 position = viewRectTransform.InverseTransformPoint(anchorPosition); position.x += viewInstance!.ControlsContainer.rect.width / 2; @@ -96,7 +97,7 @@ private Vector3 GetControlsPosition(Vector2 anchorPosition, Vector2 offsetFromTa { Vector2 offsetByDirection = GetOffsetByDirection(enumVal, offsetFromTarget); Vector3 currentPosition = position + new Vector3(offsetByDirection.x, offsetByDirection.y, 0); - float nonOverlappingArea = CalculateNonOverlappingArea(viewRectTransform.rect, GetProjectedRect(currentPosition)); + float nonOverlappingArea = CalculateNonOverlappingArea(overlapRect ?? viewRectTransform.rect, GetProjectedRect(currentPosition)); if (nonOverlappingArea < minNonOverlappingArea) { newPosition = currentPosition; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs index 6b0413f97c..513c58300c 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs @@ -10,12 +10,14 @@ public struct GenericContextMenuParameter public readonly GenericContextMenuConfig Config; public readonly Dictionary ControlsActions; public readonly Vector2 AnchorPosition; + public readonly Rect? OverlapRect; - public GenericContextMenuParameter(GenericContextMenuConfig config, Dictionary controlsActions, Vector2 anchorPosition) + public GenericContextMenuParameter(GenericContextMenuConfig config, Dictionary controlsActions, Vector2 anchorPosition, Rect? overlapRect = null) { this.Config = config; this.ControlsActions = controlsActions; this.AnchorPosition = anchorPosition; + this.OverlapRect = overlapRect; } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab index 421a88c3c1..1869776813 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab @@ -223,6 +223,7 @@ GameObject: - component: {fileID: 3577948846086194394} - component: {fileID: 4151572650133112880} - component: {fileID: 4754064954679370281} + - component: {fileID: 2380315831848862698} m_Layer: 5 m_Name: ButtonWithTextAndIcon m_TagString: Untagged @@ -333,3 +334,18 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: [] +--- !u!114 &2380315831848862698 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6449720775875921457} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0cb01ddb93349c98fd84395a98b77f9, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: {fileID: 4754064954679370281} + k__BackingField: {fileID: 8655627310085805794} + k__BackingField: {fileID: 6260016763612421407} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab index 0112483b40..4b7b64eaf2 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab @@ -10,7 +10,8 @@ GameObject: m_Component: - component: {fileID: 8849643100579995022} - component: {fileID: 583917151655658426} - - component: {fileID: 2942571485186744443} + - component: {fileID: 39844814625538630} + - component: {fileID: 8471297342254466779} m_Layer: 5 m_Name: Separator m_TagString: Untagged @@ -29,7 +30,8 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 5484227918230232229} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} @@ -45,7 +47,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 37667019366274743} m_CullTransparentMesh: 1 ---- !u!114 &2942571485186744443 +--- !u!114 &39844814625538630 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -54,6 +56,84 @@ MonoBehaviour: m_GameObject: {fileID: 37667019366274743} m_Enabled: 1 m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 83940472056b404bb53ff806ae8bb4bc, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: {fileID: 8471297342254466779} +--- !u!114 &8471297342254466779 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 37667019366274743} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: 1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!1 &5532609801677578509 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5484227918230232229} + - component: {fileID: 6335380415044474706} + - component: {fileID: 4654596782223285790} + m_Layer: 5 + m_Name: Graphics + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5484227918230232229 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5532609801677578509} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8849643100579995022} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6335380415044474706 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5532609801677578509} + m_CullTransparentMesh: 1 +--- !u!114 &4654596782223285790 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5532609801677578509} + m_Enabled: 1 + m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab index c57b61c12a..61c391e01e 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab @@ -11,6 +11,7 @@ GameObject: - component: {fileID: 891560713975722788} - component: {fileID: 4905401340599041321} - component: {fileID: 2548270455446298190} + - component: {fileID: 7162056934107790529} m_Layer: 5 m_Name: ToggleWithText m_TagString: Untagged @@ -77,6 +78,20 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 3 +--- !u!114 &7162056934107790529 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582679870921041373} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8f35c553d944f99854691517619b0e3, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: {fileID: 6294227615655975748} + k__BackingField: {fileID: 7042733739484598958} --- !u!1 &4204936758877281454 GameObject: m_ObjectHideFlags: 0 @@ -328,6 +343,17 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} +--- !u!114 &6294227615655975748 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7625753975028379600, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + m_PrefabInstance: {fileID: 4507408873941251220} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!224 &7210190615658038846 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} From e1bc7fcf25f257ad0aa2b6be42491566b3f01391 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Fri, 3 Jan 2025 14:46:25 +0100 Subject: [PATCH 04/36] fix scriptable objects --- .../Controls/GenericContextMenuConfig.cs | 32 ++++++++++++++----- .../GenericContextMenu/ControlsPoolManager.cs | 8 ++--- .../GenericContextMenuController.cs | 9 ++++-- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs index 638a5b69c8..25660a2587 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs @@ -8,33 +8,49 @@ namespace DCL.UI.GenericContextMenu.Controls [Serializable] public class GenericContextMenuConfig : ScriptableObject { - public List ContextMenuSettings { get; private set; } = new (); - public Vector2 OffsetFromTarget { get; private set; } = Vector2.zero; - public float Width { get; private set; } = 170; + [SerializeField] private List contextMenuSettings = new (); + [SerializeField] private Vector2 offsetFromTarget = Vector2.zero; + [SerializeField] private float width = 170; + + public List ContextMenuSettings => contextMenuSettings; + public Vector2 OffsetFromTarget => offsetFromTarget; + public float Width => width; } [Serializable] public class ContextMenuControlSettings : ScriptableObject { - public ContextMenuControlTypes ControlTypeType { get; private set; } + [SerializeField] private ContextMenuControlTypes controlTypeType; + + public ContextMenuControlTypes ControlTypeType => controlTypeType; } + [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ButtonContextMenuControlSettings")] [Serializable] public class ButtonContextMenuControlSettings : ContextMenuControlSettings { - public string ButtonText { get; private set; } - public Sprite ButtonIcon { get; private set; } + [SerializeField] private string buttonText; + [SerializeField] private Sprite buttonIcon; + + public string ButtonText => buttonText; + public Sprite ButtonIcon => buttonIcon; } + [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ToggleContextMenuControlSettings")] [Serializable] public class ToggleContextMenuControlSettings : ContextMenuControlSettings { - public string ToggleText { get; private set; } + [SerializeField] private string toggleText; + + public string ToggleText => toggleText; } + [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/SeparatorContextMenuControlSettings")] [Serializable] public class SeparatorContextMenuControlSettings : ContextMenuControlSettings { - public int Height { get; private set; } + [SerializeField] private int height; + + public int Height => height; } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index b80b81042d..a3ff964d5e 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -62,10 +62,8 @@ public GenericContextMenuToggleView GetToggle(ToggleContextMenuControlSettings s return toggleView; } - public void Dispose() - { - - } + public void Dispose() => + ReleaseAllCurrentControls(); public void ReleaseAllCurrentControls() { @@ -86,6 +84,8 @@ public void ReleaseAllCurrentControls() break; } } + + currentControls.Clear(); } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index b86b7cfa2a..ec89c9fe7b 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -2,10 +2,8 @@ using DCL.UI.GenericContextMenu.Controls; using MVC; using System; -using System.Collections.Generic; using System.Threading; using UnityEngine; -using UnityEngine.UI; namespace DCL.UI.GenericContextMenu { @@ -32,6 +30,13 @@ public GenericContextMenuController(ViewFactoryMethod viewFactory, this.controlsPoolManager = controlsPoolManager; } + public override void Dispose() + { + base.Dispose(); + + controlsPoolManager.Dispose(); + } + protected override void OnViewInstantiated() { viewRectTransform = viewInstance!.GetComponent(); From b52e8d2841d56373d30244e249a3439099eefd63 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Fri, 3 Jan 2025 14:59:59 +0100 Subject: [PATCH 05/36] improved SO --- .../Controls/GenericContextMenuConfig.cs | 11 ++++++++++- .../GenericContextMenuController.cs | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs index 25660a2587..51a9e2560a 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs @@ -20,7 +20,7 @@ public class GenericContextMenuConfig : ScriptableObject [Serializable] public class ContextMenuControlSettings : ScriptableObject { - [SerializeField] private ContextMenuControlTypes controlTypeType; + [SerializeField] protected ContextMenuControlTypes controlTypeType; public ContextMenuControlTypes ControlTypeType => controlTypeType; } @@ -34,6 +34,9 @@ public class ButtonContextMenuControlSettings : ContextMenuControlSettings public string ButtonText => buttonText; public Sprite ButtonIcon => buttonIcon; + + private void OnEnable() => + controlTypeType = ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON; } [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ToggleContextMenuControlSettings")] @@ -43,6 +46,9 @@ public class ToggleContextMenuControlSettings : ContextMenuControlSettings [SerializeField] private string toggleText; public string ToggleText => toggleText; + + private void OnEnable() => + controlTypeType = ContextMenuControlTypes.TOGGLE_WITH_TEXT; } [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/SeparatorContextMenuControlSettings")] @@ -52,5 +58,8 @@ public class SeparatorContextMenuControlSettings : ContextMenuControlSettings [SerializeField] private int height; public int Height => height; + + private void OnEnable() => + controlTypeType = ContextMenuControlTypes.SEPARATOR; } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index ec89c9fe7b..c3c12ffa2b 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -53,6 +53,8 @@ protected override void OnBeforeViewShow() private void ConfigureContextMenu() { + viewInstance!.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, viewInstance!.ControlsContainer.sizeDelta.y); + for (var i = 0; i < inputData.Config.ContextMenuSettings.Count; i++) { ContextMenuControlSettings config = inputData.Config.ContextMenuSettings[i]; From ac6c09d20fe8ff0c969dbe9d03cc287e906f9d3d Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Fri, 3 Jan 2025 16:15:35 +0100 Subject: [PATCH 06/36] fix and integration into reel gallery --- .../AssetGroups/Essentials.asset | 5 ++++ .../Assets/ContextMenuSO.meta | 8 +++++ .../Assets/ContextMenuSO/CopyLinkConfig.asset | 17 +++++++++++ .../ContextMenuSO/CopyLinkConfig.asset.meta | 8 +++++ .../Assets/ContextMenuSO/DeleteConfig.asset | 17 +++++++++++ .../ContextMenuSO/DeleteConfig.asset.meta | 8 +++++ .../Assets/ContextMenuSO/DownloadConfig.asset | 17 +++++++++++ .../ContextMenuSO/DownloadConfig.asset.meta | 8 +++++ .../ReelGalleryContextMenuConfig.asset | 23 +++++++++++++++ .../ReelGalleryContextMenuConfig.asset.meta | 8 +++++ .../ContextMenuSO/SeparatorConfig.asset | 16 ++++++++++ .../ContextMenuSO/SeparatorConfig.asset.meta | 8 +++++ .../ContextMenuSO/SetAsPublicConfig.asset | 16 ++++++++++ .../SetAsPublicConfig.asset.meta | 8 +++++ .../Assets/ContextMenuSO/ShareOnXConfig.asset | 17 +++++++++++ .../ContextMenuSO/ShareOnXConfig.asset.meta | 8 +++++ .../CameraReelGallery.asmdef | 3 +- .../CameraReelGalleryController.cs | 8 +++-- .../Components/OptionButtonController.cs | 29 +++++++++++++++---- Explorer/Assets/DCL/Passport/Passport.asmdef | 3 +- .../PluginSystem/Global/ExplorePanelPlugin.cs | 9 +++++- .../Global/Global Plugins Settings.asset | 5 ++++ .../GenericContextMenuSeparatorView.cs | 3 ++ .../GenericContextMenu/ControlsPoolManager.cs | 10 +++++-- .../GenericContextMenuController.cs | 11 +++---- .../Prefabs/ButtonWithTextAndIcon.prefab | 2 +- .../Prefabs/Separator.prefab | 3 +- .../Prefabs/ToggleWithText.prefab | 4 +-- 28 files changed, 259 insertions(+), 23 deletions(-) create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO.meta create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset.meta create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset.meta create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset.meta create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset.meta create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset.meta create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset.meta create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset create mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset.meta diff --git a/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset b/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset index b62009934f..11f8a0c14f 100644 --- a/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset +++ b/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset @@ -112,6 +112,11 @@ MonoBehaviour: m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 43daf6965002847a19f241e71b28fd9b + m_Address: Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 4a2a7b610414b45c1b576946ce094877 m_Address: NftCategoryIcons m_ReadOnly: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO.meta new file mode 100644 index 0000000000..dfde800094 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 89fb2efff5a894f4dbf7980aa03544e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset new file mode 100644 index 0000000000..fee9bc9713 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: CopyLinkConfig + m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings + controlTypeType: 0 + buttonText: Copy Link + buttonIcon: {fileID: 21300000, guid: 3bffb1589fb814c70b23fbce43ba6736, type: 3} diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset.meta new file mode 100644 index 0000000000..19e44b08ea --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db49cac2faca44598a924e1c56690e0c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset new file mode 100644 index 0000000000..dd4325f0b0 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: DeleteConfig + m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings + controlTypeType: 0 + buttonText: Delete + buttonIcon: {fileID: 21300000, guid: ac4ebefc5fac7475ba19ac778feacfa8, type: 3} diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset.meta new file mode 100644 index 0000000000..8c0e023838 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a1abe3dafbc2143d8949b174e3c6c235 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset new file mode 100644 index 0000000000..6c859387bb --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: DownloadConfig + m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings + controlTypeType: 0 + buttonText: Download + buttonIcon: {fileID: 21300000, guid: 7c1ba996ae79c4993b1c434f833c4084, type: 3} diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset.meta new file mode 100644 index 0000000000..0d4e076e71 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ad489cd996154c1cad21a0856ed86bc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset new file mode 100644 index 0000000000..9918995ede --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7f94b35778914b3085d26ae60acea3be, type: 3} + m_Name: ReelGalleryContextMenuConfig + m_EditorClassIdentifier: + contextMenuSettings: + - {fileID: 11400000, guid: 63b9ee24ad69145e9becb7da653bdb4a, type: 2} + - {fileID: 11400000, guid: 333b53545538440bca1cb75185892b64, type: 2} + - {fileID: 11400000, guid: 5c0c78cadc79d4af0815be75aa67b027, type: 2} + - {fileID: 11400000, guid: db49cac2faca44598a924e1c56690e0c, type: 2} + - {fileID: 11400000, guid: 3ad489cd996154c1cad21a0856ed86bc, type: 2} + - {fileID: 11400000, guid: a1abe3dafbc2143d8949b174e3c6c235, type: 2} + offsetFromTarget: {x: 14, y: 18} + width: 186 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset.meta new file mode 100644 index 0000000000..fffda78381 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 43daf6965002847a19f241e71b28fd9b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset new file mode 100644 index 0000000000..683c25ac89 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: SeparatorConfig + m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:SeparatorContextMenuControlSettings + controlTypeType: 2 + height: 8 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset.meta new file mode 100644 index 0000000000..2a204e905b --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 333b53545538440bca1cb75185892b64 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset new file mode 100644 index 0000000000..26e83a4a59 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: SetAsPublicConfig + m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ToggleContextMenuControlSettings + controlTypeType: 1 + toggleText: Set as Public diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset.meta new file mode 100644 index 0000000000..a61999c1ab --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 63b9ee24ad69145e9becb7da653bdb4a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset new file mode 100644 index 0000000000..7e6f9163e5 --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: ShareOnXConfig + m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings + controlTypeType: 0 + buttonText: Share on X + buttonIcon: {fileID: 21300000, guid: 4c97cd3c67403471d8fe75c5fc348e58, type: 3} diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset.meta new file mode 100644 index 0000000000..f0ed089c0a --- /dev/null +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5c0c78cadc79d4af0815be75aa67b027 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGallery.asmdef b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGallery.asmdef index c97da656c9..bf733b63ca 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGallery.asmdef +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGallery.asmdef @@ -21,7 +21,8 @@ "GUID:212dec3614823496d8f46a506aa5b831", "GUID:45f6fff651a0a514f8edfdaf9cce45af", "GUID:c6e727f7851314e679212856f4ce3e53", - "CameraReelToast" + "CameraReelToast", + "GenericContextMenu" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs index 90aeefe493..eb9973b2b7 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs @@ -10,7 +10,9 @@ using DCL.InWorldCamera.ReelActions; using DCL.Multiplayer.Connections.DecentralandUrls; using DCL.Optimization.Pools; +using DCL.UI.GenericContextMenu.Controls; using DG.Tweening; +using MVC; using System; using System.Collections.Generic; using System.Threading; @@ -100,7 +102,9 @@ public CameraReelGalleryController(CameraReelGalleryView view, IDecentralandUrlsSource? decentralandUrlsSource = null, IExplorePanelEscapeAction? explorePanelEscapeAction = null, ISystemClipboard? systemClipboard = null, - ReelGalleryStringMessages? reelGalleryStringMessages = null) + ReelGalleryStringMessages? reelGalleryStringMessages = null, + IMVCManager? mvcManager = null, + GenericContextMenuConfig? contextMenuConfig = null) { this.view = view; this.cameraReelStorageService = cameraReelStorageService; @@ -124,7 +128,7 @@ public CameraReelGalleryController(CameraReelGalleryView view, if (optionButtonView is not null && contextMenuView is not null) { this.contextMenuController = new ContextMenuController(contextMenuView); - this.optionButtonController = new OptionButtonController(optionButtonView, contextMenuController); + this.optionButtonController = new OptionButtonController(optionButtonView, contextMenuController, mvcManager!, contextMenuConfig!); } reelGalleryPoolManager = new ReelGalleryPoolManager(view.thumbnailViewPrefab, view.monthGridPrefab, view.unusedThumbnailViewObject, diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs index b3612c70b9..86437bc34e 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs @@ -1,5 +1,9 @@ using DCL.InWorldCamera.CameraReelStorageService.Schemas; +using DCL.UI.GenericContextMenu; +using DCL.UI.GenericContextMenu.Controls; +using MVC; using System; +using System.Collections.Generic; using UnityEngine; namespace DCL.InWorldCamera.CameraReelGallery.Components @@ -9,13 +13,27 @@ public class OptionButtonController : IDisposable private readonly OptionButtonView view; private readonly ContextMenuController contextMenuController; private readonly RectTransform buttonRectTransform; + private readonly IMVCManager mvcManager; + private readonly GenericContextMenuConfig contextMenuConfig; + private readonly Dictionary controlsActions = new () + { + { 0, new Action(toggleValue => Debug.Log($"Toggle clicked: {toggleValue}")) }, + { 2, new Action(() => Debug.Log("Share on X clicked")) }, + { 3, new Action(() => Debug.Log("Copy Link clicked")) }, + { 4, new Action(() => Debug.Log("Download clicked")) }, + { 5, new Action(() => Debug.Log("Delete clicked")) }, + }; public event Action? Hide; public OptionButtonController(OptionButtonView view, - ContextMenuController contextMenuController) + ContextMenuController contextMenuController, + IMVCManager mvcManager, + GenericContextMenuConfig contextMenuConfig) { this.view = view; + this.mvcManager = mvcManager; + this.contextMenuConfig = contextMenuConfig; this.buttonRectTransform = view.GetComponent(); this.view.optionButton.onClick.AddListener(OnOptionClicked); @@ -44,10 +62,11 @@ public void HideControl() private void OnOptionClicked() { - if (!contextMenuController.IsOpen()) - contextMenuController.Show(buttonRectTransform.position); - else - contextMenuController.Hide(); + // if (!contextMenuController.IsOpen()) + // contextMenuController.Show(buttonRectTransform.position); + // else + // contextMenuController.Hide(); + mvcManager.ShowAsync(GenericContextMenuController.IssueCommand(new GenericContextMenuParameter(contextMenuConfig, controlsActions, buttonRectTransform.position))); } public void Dispose() diff --git a/Explorer/Assets/DCL/Passport/Passport.asmdef b/Explorer/Assets/DCL/Passport/Passport.asmdef index 32b7c956a7..3330582b56 100644 --- a/Explorer/Assets/DCL/Passport/Passport.asmdef +++ b/Explorer/Assets/DCL/Passport/Passport.asmdef @@ -37,7 +37,8 @@ "GUID:b5762faee0fa644b38047f2b625378a1", "GUID:b97826ed91484ac1af953a8afc03316e", "GUID:c6e727f7851314e679212856f4ce3e53", - "GUID:fbf0e9c026d7f49dc818a0d27b9789fe" + "GUID:fbf0e9c026d7f49dc818a0d27b9789fe", + "GenericContextMenu" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs index 925d6cc9d2..2f3ce3df71 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs +++ b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs @@ -48,6 +48,7 @@ using DCL.PluginSystem.World; using DCL.SDKComponents.MediaStream.Settings; using DCL.Settings.Settings; +using DCL.UI.GenericContextMenu.Controls; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Audio; @@ -249,6 +250,8 @@ public async UniTask InitializeAsync(ExplorePanelSettings settings, Cancellation mapRendererContainer.MapRenderer, placesAPIService, webRequestController, webBrowser, dclInput, realmNavigator, realmData, mapPathEventBus, world, playerEntity, inputBlock, chatMessagesBus); + GenericContextMenuConfig contextMenuConfig = await assetsProvisioner.ProvideMainAssetValueAsync(settings.ContextMenuConfig, ct); + await navmapController.InitializeAssetsAsync(assetsProvisioner, ct); await backpackSubPlugin.InitializeAsync(settings.BackpackSettings, explorePanelView.GetComponentInChildren(), ct); @@ -261,7 +264,9 @@ public async UniTask InitializeAsync(ExplorePanelSettings settings, Cancellation new ReelGalleryConfigParams(settings.GridLayoutFixedColumnCount, settings.ThumbnailHeight, settings.ThumbnailWidth, true, true), true, cameraReelView.optionsButton, cameraReelView.contextMenu, webBrowser, decentralandUrlsSource, inputHandler, systemClipboard, - new ReelGalleryStringMessages(settings.CameraReelGalleryShareToXMessage, settings.PhotoSuccessfullyDeletedMessage, settings.PhotoSuccessfullyUpdatedMessage, settings.PhotoSuccessfullyDownloadedMessage, settings.LinkCopiedMessage)), + new ReelGalleryStringMessages(settings.CameraReelGalleryShareToXMessage, settings.PhotoSuccessfullyDeletedMessage, settings.PhotoSuccessfullyUpdatedMessage, settings.PhotoSuccessfullyDownloadedMessage, settings.LinkCopiedMessage), + mvcManager, + contextMenuConfig), cameraReelStorageService, web3IdentityCache, mvcManager, @@ -330,6 +335,8 @@ public class ExplorePanelSettings : IDCLPluginSettings [field: SerializeField] public int ThumbnailWidth { get; private set; } + [field: SerializeField] internal AssetReferenceT ContextMenuConfig { get; private set; } + public IReadOnlyCollection EmbeddedEmotesAsURN() => EmbeddedEmotes.Select(s => new URN(s)).ToArray(); } diff --git a/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset b/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset index 1a8155db8e..c9654f1d34 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset +++ b/Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset @@ -251,6 +251,11 @@ MonoBehaviour: k__BackingField: 6 k__BackingField: 230 k__BackingField: 306 + k__BackingField: + m_AssetGUID: 43daf6965002847a19f241e71b28fd9b + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 - rid: 1841402216112979969 type: {class: CharacterContainer/Settings, ns: DCL.Character.Plugin, asm: DCL.Plugins} data: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index 56e5cb874b..ccfd8ed778 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -6,11 +6,14 @@ namespace DCL.UI.GenericContextMenu.Controls public class GenericContextMenuSeparatorView : MonoBehaviour, IGenericContextMenuComponent { [field: SerializeField] public LayoutElement LayoutElementComponent { get; private set; } + [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } public void Configure(ContextMenuControlSettings settings) { SeparatorContextMenuControlSettings separatorSettings = settings as SeparatorContextMenuControlSettings; LayoutElementComponent.preferredHeight = separatorSettings!.Height; + LayoutElementComponent.minHeight = separatorSettings.Height; + RectTransformComponent.sizeDelta = new Vector2(RectTransformComponent.sizeDelta.x, separatorSettings.Height); } public void UnregisterListeners(){} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index a3ff964d5e..520a837d6f 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -38,25 +38,29 @@ public ControlsPoolManager( actionOnDestroy: toggleView => GameObject.Destroy(toggleView.gameObject)); } - public GenericContextMenuSeparatorView GetSeparator(SeparatorContextMenuControlSettings settings) + public GenericContextMenuSeparatorView GetSeparator(SeparatorContextMenuControlSettings settings, int index) { GenericContextMenuSeparatorView separatorView = separatorPool.Get(); + separatorView.transform.SetSiblingIndex(index); separatorView.Configure(settings); currentControls.Add(separatorView); return separatorView; } - public GenericContextMenuButtonWithTextView GetButton(ButtonContextMenuControlSettings settings) + public GenericContextMenuButtonWithTextView GetButton(ButtonContextMenuControlSettings settings, int index) { GenericContextMenuButtonWithTextView buttonView = buttonPool.Get(); + buttonView.transform.SetSiblingIndex(index); buttonView.Configure(settings); currentControls.Add(buttonView); return buttonView; } - public GenericContextMenuToggleView GetToggle(ToggleContextMenuControlSettings settings) + public GenericContextMenuToggleView GetToggle(ToggleContextMenuControlSettings settings, int index) { + //TODO: initial value GenericContextMenuToggleView toggleView = togglePool.Get(); + toggleView.transform.SetSiblingIndex(index); toggleView.Configure(settings); currentControls.Add(toggleView); return toggleView; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index c3c12ffa2b..d0287e6315 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -4,6 +4,7 @@ using System; using System.Threading; using UnityEngine; +using UnityEngine.Events; namespace DCL.UI.GenericContextMenu { @@ -62,16 +63,16 @@ private void ConfigureContextMenu() switch (config.ControlTypeType) { case ContextMenuControlTypes.SEPARATOR: - controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings); + controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings, i); break; case ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON: - GenericContextMenuButtonWithTextView button = controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings); - button.ButtonComponent.onClick.AddListener(inputData.ControlsActions[i] as UnityEngine.Events.UnityAction); + GenericContextMenuButtonWithTextView button = controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings, i); + button.ButtonComponent.onClick.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); button.ButtonComponent.onClick.AddListener(TriggerContextMenuClose); break; case ContextMenuControlTypes.TOGGLE_WITH_TEXT: - GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings); - toggle.ToggleComponent.onValueChanged.AddListener(inputData.ControlsActions[i] as UnityEngine.Events.UnityAction); + GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, i); + toggle.ToggleComponent.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); toggle.ToggleComponent.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); break; } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab index 1869776813..fea1d673dc 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab @@ -140,7 +140,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Share on X + m_text: Insert text here m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab index 4b7b64eaf2..cfc5e3dcfb 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab @@ -60,6 +60,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: k__BackingField: {fileID: 8471297342254466779} + k__BackingField: {fileID: 8849643100579995022} --- !u!114 &8471297342254466779 MonoBehaviour: m_ObjectHideFlags: 0 @@ -74,7 +75,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_IgnoreLayout: 0 m_MinWidth: -1 - m_MinHeight: -1 + m_MinHeight: 1 m_PreferredWidth: -1 m_PreferredHeight: 1 m_FlexibleWidth: -1 diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab index 61c391e01e..2fc6cf974f 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab @@ -157,9 +157,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 'Set as Public - -' + m_text: Insert text here m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} From 5d0e5ad01f5922c415208815099e27aa72924538 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 11:17:02 +0100 Subject: [PATCH 07/36] extension and initial values --- .../ReelGalleryContextMenuConfig.asset | 2 +- .../Components/OptionButtonController.cs | 30 ++++++++++++++----- .../GenericContextMenuController.cs | 19 ++++++++++-- .../GenericContextMenuParameter.cs | 18 ++++++++++- .../Prefabs/GenericContextMenu.prefab | 4 +-- 5 files changed, 59 insertions(+), 14 deletions(-) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset index 9918995ede..2ec0505bfa 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset @@ -19,5 +19,5 @@ MonoBehaviour: - {fileID: 11400000, guid: db49cac2faca44598a924e1c56690e0c, type: 2} - {fileID: 11400000, guid: 3ad489cd996154c1cad21a0856ed86bc, type: 2} - {fileID: 11400000, guid: a1abe3dafbc2143d8949b174e3c6c235, type: 2} - offsetFromTarget: {x: 14, y: 18} + offsetFromTarget: {x: 0, y: 0} width: 186 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs index 86437bc34e..b28e80496d 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs @@ -1,3 +1,4 @@ +using Cysharp.Threading.Tasks; using DCL.InWorldCamera.CameraReelStorageService.Schemas; using DCL.UI.GenericContextMenu; using DCL.UI.GenericContextMenu.Controls; @@ -10,6 +11,12 @@ namespace DCL.InWorldCamera.CameraReelGallery.Components { public class OptionButtonController : IDisposable { + private const int PUBLIC_CONTROL_INDEX = 0; + private const int SHARE_CONTROL_INDEX = 2; + private const int COPY_CONTROL_INDEX = 3; + private const int DOWNLOAD_CONTROL_INDEX = 4; + private const int DELETE_CONTROL_INDEX = 5; + private readonly OptionButtonView view; private readonly ContextMenuController contextMenuController; private readonly RectTransform buttonRectTransform; @@ -17,15 +24,18 @@ public class OptionButtonController : IDisposable private readonly GenericContextMenuConfig contextMenuConfig; private readonly Dictionary controlsActions = new () { - { 0, new Action(toggleValue => Debug.Log($"Toggle clicked: {toggleValue}")) }, - { 2, new Action(() => Debug.Log("Share on X clicked")) }, - { 3, new Action(() => Debug.Log("Copy Link clicked")) }, - { 4, new Action(() => Debug.Log("Download clicked")) }, - { 5, new Action(() => Debug.Log("Delete clicked")) }, + { PUBLIC_CONTROL_INDEX, new Action(toggleValue => Debug.Log($"Toggle clicked: {toggleValue}")) }, + { SHARE_CONTROL_INDEX, new Action(() => Debug.Log("Share on X clicked")) }, + { COPY_CONTROL_INDEX, new Action(() => Debug.Log("Copy Link clicked")) }, + { DOWNLOAD_CONTROL_INDEX, new Action(() => Debug.Log("Download clicked")) }, + { DELETE_CONTROL_INDEX, new Action(() => Debug.Log("Delete clicked")) }, }; + private readonly Dictionary initialValues = new (); public event Action? Hide; + private bool isContextMenuOpen; + public OptionButtonController(OptionButtonView view, ContextMenuController contextMenuController, IMVCManager mvcManager, @@ -42,7 +52,7 @@ public OptionButtonController(OptionButtonView view, this.contextMenuController.AnyControlClicked += HideControl; } - public bool IsContextMenuOpen() => contextMenuController.IsOpen(); + public bool IsContextMenuOpen() => isContextMenuOpen; public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, Vector3 offsetPosition = default) { @@ -50,6 +60,7 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, view.transform.localPosition = offsetPosition; view.gameObject.SetActive(true); contextMenuController.SetImageData(cameraReelResponse); + initialValues[PUBLIC_CONTROL_INDEX] = cameraReelResponse.isPublic; } public void HideControl() @@ -66,7 +77,12 @@ private void OnOptionClicked() // contextMenuController.Show(buttonRectTransform.position); // else // contextMenuController.Hide(); - mvcManager.ShowAsync(GenericContextMenuController.IssueCommand(new GenericContextMenuParameter(contextMenuConfig, controlsActions, buttonRectTransform.position))); + mvcManager.ShowAsync(GenericContextMenuController.IssueCommand( + new GenericContextMenuParameter(contextMenuConfig, controlsActions, buttonRectTransform.position, + actionOnShow: () => isContextMenuOpen = true, + actionOnHide: () => isContextMenuOpen = false, + closeTask: view.optionButton.OnClickAsync(), + initialValues: initialValues))); } public void Dispose() diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index d0287e6315..e7530d993c 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -5,6 +5,7 @@ using System.Threading; using UnityEngine; using UnityEngine.Events; +using UnityEngine.UI; namespace DCL.UI.GenericContextMenu { @@ -52,6 +53,12 @@ protected override void OnBeforeViewShow() ConfigureContextMenu(); } + protected override void OnViewShow() + { + base.OnViewShow(); + inputData.ActionOnShow?.Invoke(); + } + private void ConfigureContextMenu() { viewInstance!.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, viewInstance!.ControlsContainer.sizeDelta.y); @@ -72,12 +79,15 @@ private void ConfigureContextMenu() break; case ContextMenuControlTypes.TOGGLE_WITH_TEXT: GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, i); + if (inputData.InitialValues != null && inputData.InitialValues.TryGetValue(i, out object initialValue)) + toggle.ToggleComponent.isOn = (bool)initialValue; toggle.ToggleComponent.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); toggle.ToggleComponent.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); break; } } - + Canvas.ForceUpdateCanvases(); + LayoutRebuilder.ForceRebuildLayoutImmediate(viewInstance!.ControlsContainer); viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.OffsetFromTarget, inputData.OverlapRect); } @@ -156,12 +166,15 @@ private static Rect GetWorldRect(RectTransform rectTransform) return new Rect(min, size); } - protected override void OnViewClose() => + protected override void OnViewClose() + { controlsPoolManager.ReleaseAllCurrentControls(); + inputData.ActionOnHide?.Invoke(); + } private void TriggerContextMenuClose() => isClosing = true; protected override UniTask WaitForCloseIntentAsync(CancellationToken ct) => - UniTask.WhenAny(UniTask.WaitUntil(() => isClosing, cancellationToken: ct)); + inputData.CloseTask != null ? UniTask.WhenAny(UniTask.WaitUntil(() => isClosing, cancellationToken: ct), inputData.CloseTask.Value) : UniTask.WaitUntil(() => isClosing, cancellationToken: ct); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs index 513c58300c..00d55d0fc8 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs @@ -1,3 +1,4 @@ +using Cysharp.Threading.Tasks; using DCL.UI.GenericContextMenu.Controls; using System; using System.Collections.Generic; @@ -11,13 +12,28 @@ public struct GenericContextMenuParameter public readonly Dictionary ControlsActions; public readonly Vector2 AnchorPosition; public readonly Rect? OverlapRect; + public readonly Action? ActionOnShow; + public readonly Action? ActionOnHide; + public readonly UniTask? CloseTask; + public readonly Dictionary? InitialValues; - public GenericContextMenuParameter(GenericContextMenuConfig config, Dictionary controlsActions, Vector2 anchorPosition, Rect? overlapRect = null) + public GenericContextMenuParameter(GenericContextMenuConfig config, + Dictionary controlsActions, + Vector2 anchorPosition, + Rect? overlapRect = null, + Action? actionOnShow = null, + Action? actionOnHide = null, + UniTask? closeTask = null, + Dictionary? initialValues = null) { this.Config = config; this.ControlsActions = controlsActions; this.AnchorPosition = anchorPosition; this.OverlapRect = overlapRect; + this.ActionOnShow = actionOnShow; + this.ActionOnHide = actionOnHide; + this.CloseTask = closeTask; + this.InitialValues = initialValues; } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab index 35c49cb5af..47232705ef 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab @@ -156,9 +156,9 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchoredPosition: {x: 50, y: -38.49994} m_SizeDelta: {x: 100, y: 0} - m_Pivot: {x: 0, y: 1} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8909096000382750580 CanvasRenderer: m_ObjectHideFlags: 0 From 06caf8c26ef06c8d76576a9cd9f9887286989e86 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 11:35:04 +0100 Subject: [PATCH 08/36] moved all SO in own classes --- .../Assets/ContextMenuSO/CopyLinkConfig.asset | 2 +- .../Assets/ContextMenuSO/DeleteConfig.asset | 2 +- .../Assets/ContextMenuSO/DownloadConfig.asset | 2 +- .../ContextMenuSO/SeparatorConfig.asset | 2 +- .../ContextMenuSO/SetAsPublicConfig.asset | 2 +- .../Assets/ContextMenuSO/ShareOnXConfig.asset | 2 +- .../CameraReelGalleryController.cs | 1 + .../Components/OptionButtonController.cs | 1 + .../PluginSystem/Global/ExplorePanelPlugin.cs | 1 + .../GenericContextMenu/Controls/Configs.meta | 3 + .../ButtonContextMenuControlSettings.cs | 19 ++++++ .../ButtonContextMenuControlSettings.cs.meta | 3 + .../Configs/ContextMenuControlSettings.cs | 13 ++++ .../ContextMenuControlSettings.cs.meta | 3 + .../Configs/GenericContextMenuConfig.cs | 19 ++++++ .../GenericContextMenuConfig.cs.meta | 0 .../SeparatorContextMenuControlSettings.cs | 17 +++++ ...eparatorContextMenuControlSettings.cs.meta | 3 + .../ToggleContextMenuControlSettings.cs | 17 +++++ .../ToggleContextMenuControlSettings.cs.meta | 3 + .../GenericContextMenuButtonWithTextView.cs | 1 + .../Controls/GenericContextMenuConfig.cs | 65 ------------------- .../GenericContextMenuSeparatorView.cs | 1 + .../Controls/GenericContextMenuToggleView.cs | 1 + .../Controls/IGenericContextMenuComponent.cs | 2 + .../GenericContextMenu/ControlsPoolManager.cs | 1 + .../GenericContextMenuController.cs | 1 + .../GenericContextMenuParameter.cs | 1 + 28 files changed, 117 insertions(+), 71 deletions(-) create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs rename Explorer/Assets/DCL/UI/GenericContextMenu/Controls/{ => Configs}/GenericContextMenuConfig.cs.meta (100%) create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs.meta delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset index fee9bc9713..cc2c09969b 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 0} + m_Script: {fileID: 11500000, guid: 14514d4875b74c0c9569ec576fdc85c0, type: 3} m_Name: CopyLinkConfig m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings controlTypeType: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset index dd4325f0b0..6ed05c7004 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 0} + m_Script: {fileID: 11500000, guid: 14514d4875b74c0c9569ec576fdc85c0, type: 3} m_Name: DeleteConfig m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings controlTypeType: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset index 6c859387bb..5247ec1ef8 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 0} + m_Script: {fileID: 11500000, guid: 14514d4875b74c0c9569ec576fdc85c0, type: 3} m_Name: DownloadConfig m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings controlTypeType: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset index 683c25ac89..490ac36143 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 0} + m_Script: {fileID: 11500000, guid: 6cc12b279dd14422b34f1c61caa290db, type: 3} m_Name: SeparatorConfig m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:SeparatorContextMenuControlSettings controlTypeType: 2 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset index 26e83a4a59..7bc6be223b 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 0} + m_Script: {fileID: 11500000, guid: f16a3a2eede14641b93b511007b15f12, type: 3} m_Name: SetAsPublicConfig m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ToggleContextMenuControlSettings controlTypeType: 1 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset index 7e6f9163e5..84f42c3a6a 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 0} + m_Script: {fileID: 11500000, guid: 14514d4875b74c0c9569ec576fdc85c0, type: 3} m_Name: ShareOnXConfig m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings controlTypeType: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs index eb9973b2b7..5f06e90e13 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs @@ -11,6 +11,7 @@ using DCL.Multiplayer.Connections.DecentralandUrls; using DCL.Optimization.Pools; using DCL.UI.GenericContextMenu.Controls; +using DCL.UI.GenericContextMenu.Controls.Configs; using DG.Tweening; using MVC; using System; diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs index b28e80496d..c09bb4e88b 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs @@ -2,6 +2,7 @@ using DCL.InWorldCamera.CameraReelStorageService.Schemas; using DCL.UI.GenericContextMenu; using DCL.UI.GenericContextMenu.Controls; +using DCL.UI.GenericContextMenu.Controls.Configs; using MVC; using System; using System.Collections.Generic; diff --git a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs index 2f3ce3df71..f6f77773f2 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs +++ b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs @@ -49,6 +49,7 @@ using DCL.SDKComponents.MediaStream.Settings; using DCL.Settings.Settings; using DCL.UI.GenericContextMenu.Controls; +using DCL.UI.GenericContextMenu.Controls.Configs; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Audio; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs.meta new file mode 100644 index 0000000000..dcf2fc1ac3 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 359cc1b1be2442cd9bbd23fd22820acd +timeCreated: 1736159349 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs new file mode 100644 index 0000000000..380507a412 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs @@ -0,0 +1,19 @@ +using System; +using UnityEngine; + +namespace DCL.UI.GenericContextMenu.Controls.Configs +{ + [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ButtonContextMenuControlSettings")] + [Serializable] + public class ButtonContextMenuControlSettings : ContextMenuControlSettings + { + [SerializeField] private string buttonText; + [SerializeField] private Sprite buttonIcon; + + public string ButtonText => buttonText; + public Sprite ButtonIcon => buttonIcon; + + private void OnEnable() => + controlTypeType = ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON; + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs.meta new file mode 100644 index 0000000000..a5915a9d71 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 14514d4875b74c0c9569ec576fdc85c0 +timeCreated: 1736159414 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs new file mode 100644 index 0000000000..7d936c1f94 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs @@ -0,0 +1,13 @@ +using System; +using UnityEngine; + +namespace DCL.UI.GenericContextMenu.Controls.Configs +{ + [Serializable] + public class ContextMenuControlSettings : ScriptableObject + { + [SerializeField] protected ContextMenuControlTypes controlTypeType; + + public ContextMenuControlTypes ControlTypeType => controlTypeType; + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs.meta new file mode 100644 index 0000000000..cf6fc97a11 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: deda3be456e24a89ba80056e3f254b5f +timeCreated: 1736159386 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs new file mode 100644 index 0000000000..d49278ca93 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace DCL.UI.GenericContextMenu.Controls.Configs +{ + [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/GenericContextMenuSettings")] + [Serializable] + public class GenericContextMenuConfig : ScriptableObject + { + [SerializeField] private List contextMenuSettings = new (); + [SerializeField] private Vector2 offsetFromTarget = Vector2.zero; + [SerializeField] private float width = 170; + + public List ContextMenuSettings => contextMenuSettings; + public Vector2 OffsetFromTarget => offsetFromTarget; + public float Width => width; + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs.meta similarity index 100% rename from Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs.meta rename to Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs.meta diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs new file mode 100644 index 0000000000..756994f1a4 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs @@ -0,0 +1,17 @@ +using System; +using UnityEngine; + +namespace DCL.UI.GenericContextMenu.Controls.Configs +{ + [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/SeparatorContextMenuControlSettings")] + [Serializable] + public class SeparatorContextMenuControlSettings : ContextMenuControlSettings + { + [SerializeField] private int height; + + public int Height => height; + + private void OnEnable() => + controlTypeType = ContextMenuControlTypes.SEPARATOR; + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs.meta new file mode 100644 index 0000000000..e59c42a634 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6cc12b279dd14422b34f1c61caa290db +timeCreated: 1736159456 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs new file mode 100644 index 0000000000..7f11c9e1f5 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs @@ -0,0 +1,17 @@ +using System; +using UnityEngine; + +namespace DCL.UI.GenericContextMenu.Controls.Configs +{ + [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ToggleContextMenuControlSettings")] + [Serializable] + public class ToggleContextMenuControlSettings : ContextMenuControlSettings + { + [SerializeField] private string toggleText; + + public string ToggleText => toggleText; + + private void OnEnable() => + controlTypeType = ContextMenuControlTypes.TOGGLE_WITH_TEXT; + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs.meta new file mode 100644 index 0000000000..4064552014 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f16a3a2eede14641b93b511007b15f12 +timeCreated: 1736159433 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index 034c6ffa11..fcfb05289f 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -1,3 +1,4 @@ +using DCL.UI.GenericContextMenu.Controls.Configs; using TMPro; using UnityEngine; using UnityEngine.UI; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs deleted file mode 100644 index 51a9e2560a..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuConfig.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace DCL.UI.GenericContextMenu.Controls -{ - [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/GenericContextMenuSettings")] - [Serializable] - public class GenericContextMenuConfig : ScriptableObject - { - [SerializeField] private List contextMenuSettings = new (); - [SerializeField] private Vector2 offsetFromTarget = Vector2.zero; - [SerializeField] private float width = 170; - - public List ContextMenuSettings => contextMenuSettings; - public Vector2 OffsetFromTarget => offsetFromTarget; - public float Width => width; - } - - [Serializable] - public class ContextMenuControlSettings : ScriptableObject - { - [SerializeField] protected ContextMenuControlTypes controlTypeType; - - public ContextMenuControlTypes ControlTypeType => controlTypeType; - } - - [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ButtonContextMenuControlSettings")] - [Serializable] - public class ButtonContextMenuControlSettings : ContextMenuControlSettings - { - [SerializeField] private string buttonText; - [SerializeField] private Sprite buttonIcon; - - public string ButtonText => buttonText; - public Sprite ButtonIcon => buttonIcon; - - private void OnEnable() => - controlTypeType = ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON; - } - - [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ToggleContextMenuControlSettings")] - [Serializable] - public class ToggleContextMenuControlSettings : ContextMenuControlSettings - { - [SerializeField] private string toggleText; - - public string ToggleText => toggleText; - - private void OnEnable() => - controlTypeType = ContextMenuControlTypes.TOGGLE_WITH_TEXT; - } - - [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/SeparatorContextMenuControlSettings")] - [Serializable] - public class SeparatorContextMenuControlSettings : ContextMenuControlSettings - { - [SerializeField] private int height; - - public int Height => height; - - private void OnEnable() => - controlTypeType = ContextMenuControlTypes.SEPARATOR; - } -} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index ccfd8ed778..b3b5778a90 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -1,3 +1,4 @@ +using DCL.UI.GenericContextMenu.Controls.Configs; using UnityEngine; using UnityEngine.UI; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 48e281c970..8cbf2252e0 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -1,3 +1,4 @@ +using DCL.UI.GenericContextMenu.Controls.Configs; using TMPro; using UnityEngine; using UnityEngine.UI; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs index 6c4f619d84..75f317f136 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs @@ -1,3 +1,5 @@ +using DCL.UI.GenericContextMenu.Controls.Configs; + namespace DCL.UI.GenericContextMenu.Controls { public interface IGenericContextMenuComponent diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index 520a837d6f..6f6e8e0bc1 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -1,4 +1,5 @@ using DCL.UI.GenericContextMenu.Controls; +using DCL.UI.GenericContextMenu.Controls.Configs; using System; using System.Collections.Generic; using UnityEngine; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index e7530d993c..1304e31103 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -1,5 +1,6 @@ using Cysharp.Threading.Tasks; using DCL.UI.GenericContextMenu.Controls; +using DCL.UI.GenericContextMenu.Controls.Configs; using MVC; using System; using System.Threading; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs index 00d55d0fc8..73c17d7a65 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs @@ -1,5 +1,6 @@ using Cysharp.Threading.Tasks; using DCL.UI.GenericContextMenu.Controls; +using DCL.UI.GenericContextMenu.Controls.Configs; using System; using System.Collections.Generic; using UnityEngine; From abfb65fd5664e23079e4733a30427a32cbd1889d Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 11:55:14 +0100 Subject: [PATCH 09/36] fix toggle graphics --- .../Controls/GenericContextMenuToggleView.cs | 4 ++-- .../UI/GenericContextMenu/ControlsPoolManager.cs | 5 +++-- .../GenericContextMenu/GenericContextMenu.asmdef | 3 ++- .../GenericContextMenuController.cs | 11 ++++++----- .../Prefabs/ToggleWithText.prefab | 8 ++++---- Explorer/Assets/DCL/UI/ToggleView.cs | 15 +++++++++------ 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 8cbf2252e0..19b9e750cf 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -7,7 +7,7 @@ namespace DCL.UI.GenericContextMenu.Controls { public class GenericContextMenuToggleView : MonoBehaviour, IGenericContextMenuComponent { - [field: SerializeField] public Toggle ToggleComponent { get; private set; } + [field: SerializeField] public ToggleView ToggleComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } public void Configure(ContextMenuControlSettings settings) @@ -17,6 +17,6 @@ public void Configure(ContextMenuControlSettings settings) } public void UnregisterListeners() => - ToggleComponent.onValueChanged.RemoveAllListeners(); + ToggleComponent.Toggle.onValueChanged.RemoveAllListeners(); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index 6f6e8e0bc1..7369af5ff8 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -57,12 +57,13 @@ public GenericContextMenuButtonWithTextView GetButton(ButtonContextMenuControlSe return buttonView; } - public GenericContextMenuToggleView GetToggle(ToggleContextMenuControlSettings settings, int index) + public GenericContextMenuToggleView GetToggle(ToggleContextMenuControlSettings settings, bool initialValue, int index) { - //TODO: initial value GenericContextMenuToggleView toggleView = togglePool.Get(); toggleView.transform.SetSiblingIndex(index); toggleView.Configure(settings); + toggleView.ToggleComponent.Toggle.isOn = initialValue; + toggleView.ToggleComponent.SetToggleGraphics(initialValue); currentControls.Add(toggleView); return toggleView; } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef index d6d25ef85d..a097ec2d48 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef @@ -4,7 +4,8 @@ "references": [ "GUID:45f6fff651a0a514f8edfdaf9cce45af", "GUID:f51ebe6a0ceec4240a699833d6309b23", - "GUID:6055be8ebefd69e48b49212b09b47b2f" + "GUID:6055be8ebefd69e48b49212b09b47b2f", + "GUID:e169fa6683c924c7e99a85981a91d953" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 1304e31103..2ac9999f76 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -79,11 +79,12 @@ private void ConfigureContextMenu() button.ButtonComponent.onClick.AddListener(TriggerContextMenuClose); break; case ContextMenuControlTypes.TOGGLE_WITH_TEXT: - GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, i); - if (inputData.InitialValues != null && inputData.InitialValues.TryGetValue(i, out object initialValue)) - toggle.ToggleComponent.isOn = (bool)initialValue; - toggle.ToggleComponent.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); - toggle.ToggleComponent.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); + bool initialValue = false; + if (inputData.InitialValues != null && inputData.InitialValues.TryGetValue(i, out object initVal)) + initialValue = (bool)initVal; + GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, initialValue, i); + toggle.ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); + toggle.ToggleComponent.Toggle.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); break; } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab index 2fc6cf974f..9cb022477a 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab @@ -90,7 +90,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e8f35c553d944f99854691517619b0e3, type: 3} m_Name: m_EditorClassIdentifier: - k__BackingField: {fileID: 6294227615655975748} + k__BackingField: {fileID: 3675667337910807093} k__BackingField: {fileID: 7042733739484598958} --- !u!1 &4204936758877281454 GameObject: @@ -341,15 +341,15 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} ---- !u!114 &6294227615655975748 stripped +--- !u!114 &3675667337910807093 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 7625753975028379600, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + m_CorrespondingSourceObject: {fileID: 977034302134673057, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} m_PrefabInstance: {fileID: 4507408873941251220} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Script: {fileID: 11500000, guid: 822ef88491b0c4b3982153e7574be1fa, type: 3} m_Name: m_EditorClassIdentifier: --- !u!224 &7210190615658038846 stripped diff --git a/Explorer/Assets/DCL/UI/ToggleView.cs b/Explorer/Assets/DCL/UI/ToggleView.cs index 71b22530c9..882ac584ee 100644 --- a/Explorer/Assets/DCL/UI/ToggleView.cs +++ b/Explorer/Assets/DCL/UI/ToggleView.cs @@ -40,17 +40,20 @@ private void OnDisable() Toggle.onValueChanged.RemoveListener(OnToggle); } + public void SetToggleGraphics(bool toggle) + { + OnImage.SetActive(toggle); + OffImage.SetActive(!toggle); + OnBackgroundImage.gameObject.SetActive(toggle); + OffBackgroundImage.gameObject.SetActive(!toggle); + } + private void OnToggle(bool toggle) { UIAudioEventsBus.Instance.SendPlayAudioEvent(toggle ? ToggleOnAudio : ToggleOffAudio); if (autoToggleImagesOnToggle) - { - OnImage.SetActive(toggle); - OffImage.SetActive(!toggle); - OnBackgroundImage.gameObject.SetActive(toggle); - OffBackgroundImage.gameObject.SetActive(!toggle); - } + SetToggleGraphics(toggle); } } } From 278bc57a567f64f72b7504e7cae3a3bc9a2617b0 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 12:08:03 +0100 Subject: [PATCH 10/36] added readonly serialized attribute drawer --- .../Configs/ContextMenuControlSettings.cs | 3 ++- .../GenericContextMenu.asmdef | 3 ++- .../Scripts/Utility/CustomPropertyDrawers.cs | 3 +++ .../Scripts/Utility/Editor/ReadOnlyDrawer.cs | 22 +++++++++++++++++++ .../Utility/Editor/ReadOnlyDrawer.cs.meta | 3 +++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs create mode 100644 Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs.meta diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs index 7d936c1f94..265f9cc0d1 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs @@ -1,12 +1,13 @@ using System; using UnityEngine; +using Utility; namespace DCL.UI.GenericContextMenu.Controls.Configs { [Serializable] public class ContextMenuControlSettings : ScriptableObject { - [SerializeField] protected ContextMenuControlTypes controlTypeType; + [SerializeField, ReadOnly] protected ContextMenuControlTypes controlTypeType; public ContextMenuControlTypes ControlTypeType => controlTypeType; } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef index a097ec2d48..c01b99fe9a 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenu.asmdef @@ -5,7 +5,8 @@ "GUID:45f6fff651a0a514f8edfdaf9cce45af", "GUID:f51ebe6a0ceec4240a699833d6309b23", "GUID:6055be8ebefd69e48b49212b09b47b2f", - "GUID:e169fa6683c924c7e99a85981a91d953" + "GUID:e169fa6683c924c7e99a85981a91d953", + "GUID:fa7b3fdbb04d67549916da7bd2af58ab" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs b/Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs index 477c871ba4..9b6bbae7dd 100644 --- a/Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs +++ b/Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs @@ -29,4 +29,7 @@ public ShowIfConditionAttribute(string fieldName) FieldName = fieldName; } } + + [AttributeUsage(AttributeTargets.Field)] + public class ReadOnlyAttribute : PropertyAttribute { } } diff --git a/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs b/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs new file mode 100644 index 0000000000..15a466525b --- /dev/null +++ b/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs @@ -0,0 +1,22 @@ +using UnityEditor; +using UnityEngine; + +namespace Utility.Editor +{ + [CustomPropertyDrawer(typeof(ReadOnlyAttribute))] + public class ReadOnlyDrawer : PropertyDrawer + { + public override float GetPropertyHeight(SerializedProperty property, + GUIContent label) => + EditorGUI.GetPropertyHeight(property, label, true); + + public override void OnGUI(Rect position, + SerializedProperty property, + GUIContent label) + { + GUI.enabled = false; + EditorGUI.PropertyField(position, property, label, true); + GUI.enabled = true; + } + } +} diff --git a/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs.meta b/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs.meta new file mode 100644 index 0000000000..5fc0382ad4 --- /dev/null +++ b/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9d2048fa24444acdb9d3eae270615399 +timeCreated: 1736161257 \ No newline at end of file From aae1e1e88ebf2a2f8b8cd205a659e98e264811ec Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 12:44:55 +0100 Subject: [PATCH 11/36] context menu conversion test --- .../CameraReelGalleryController.cs | 19 ++++++--- .../Components/OptionButtonController.cs | 41 +++++++++---------- .../GenericContextMenuController.cs | 7 ++-- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs index 5f06e90e13..99dee29229 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs @@ -33,6 +33,15 @@ private enum ScrollDirection DOWN } + public enum ContextMenuControls + { + PUBLIC_CONTROL_INDEX = 0, + SHARE_CONTROL_INDEX = 2, + COPY_CONTROL_INDEX = 3, + DOWNLOAD_CONTROL_INDEX = 4, + DELETE_CONTROL_INDEX = 5, + } + private struct ReelToDeleteInfo { public readonly string Id; @@ -143,11 +152,11 @@ public CameraReelGalleryController(CameraReelGalleryView view, if (this.contextMenuController != null) { - this.contextMenuController.SetPublicRequested += SetReelPublic; - this.contextMenuController.ShareToXRequested += ShareToX; - this.contextMenuController.CopyPictureLinkRequested += CopyPictureLink; - this.contextMenuController.DownloadRequested += DownloadReelLocally; - this.contextMenuController.DeletePictureRequested += DeleteReel; + this.optionButtonController.SetPublicRequested += SetReelPublic; + this.optionButtonController.ShareToXRequested += ShareToX; + this.optionButtonController.CopyPictureLinkRequested += CopyPictureLink; + this.optionButtonController.DownloadRequested += DownloadReelLocally; + this.optionButtonController.DeletePictureRequested += DeleteReel; } } diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs index c09bb4e88b..0a8db019f9 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs @@ -1,7 +1,6 @@ using Cysharp.Threading.Tasks; using DCL.InWorldCamera.CameraReelStorageService.Schemas; using DCL.UI.GenericContextMenu; -using DCL.UI.GenericContextMenu.Controls; using DCL.UI.GenericContextMenu.Controls.Configs; using MVC; using System; @@ -12,30 +11,24 @@ namespace DCL.InWorldCamera.CameraReelGallery.Components { public class OptionButtonController : IDisposable { - private const int PUBLIC_CONTROL_INDEX = 0; - private const int SHARE_CONTROL_INDEX = 2; - private const int COPY_CONTROL_INDEX = 3; - private const int DOWNLOAD_CONTROL_INDEX = 4; - private const int DELETE_CONTROL_INDEX = 5; - private readonly OptionButtonView view; private readonly ContextMenuController contextMenuController; private readonly RectTransform buttonRectTransform; private readonly IMVCManager mvcManager; private readonly GenericContextMenuConfig contextMenuConfig; - private readonly Dictionary controlsActions = new () - { - { PUBLIC_CONTROL_INDEX, new Action(toggleValue => Debug.Log($"Toggle clicked: {toggleValue}")) }, - { SHARE_CONTROL_INDEX, new Action(() => Debug.Log("Share on X clicked")) }, - { COPY_CONTROL_INDEX, new Action(() => Debug.Log("Copy Link clicked")) }, - { DOWNLOAD_CONTROL_INDEX, new Action(() => Debug.Log("Download clicked")) }, - { DELETE_CONTROL_INDEX, new Action(() => Debug.Log("Delete clicked")) }, - }; + private readonly Dictionary controlsActions; private readonly Dictionary initialValues = new (); public event Action? Hide; + public event Action? SetPublicRequested; + public event Action? ShareToXRequested; + public event Action? CopyPictureLinkRequested; + public event Action? DownloadRequested; + public event Action? DeletePictureRequested; + private bool isContextMenuOpen; + private CameraReelResponseCompact currentReelData; public OptionButtonController(OptionButtonView view, ContextMenuController contextMenuController, @@ -50,7 +43,14 @@ public OptionButtonController(OptionButtonView view, this.view.optionButton.onClick.AddListener(OnOptionClicked); this.contextMenuController = contextMenuController; - this.contextMenuController.AnyControlClicked += HideControl; + controlsActions = new () + { + { (int)CameraReelGalleryController.ContextMenuControls.PUBLIC_CONTROL_INDEX, new Action(toggleValue => SetPublicRequested?.Invoke(currentReelData, toggleValue)) }, + { (int)CameraReelGalleryController.ContextMenuControls.SHARE_CONTROL_INDEX, new Action(() => ShareToXRequested?.Invoke(currentReelData)) }, + { (int)CameraReelGalleryController.ContextMenuControls.COPY_CONTROL_INDEX, new Action(() => CopyPictureLinkRequested?.Invoke(currentReelData)) }, + { (int)CameraReelGalleryController.ContextMenuControls.DOWNLOAD_CONTROL_INDEX, new Action(() => DownloadRequested?.Invoke(currentReelData)) }, + { (int)CameraReelGalleryController.ContextMenuControls.DELETE_CONTROL_INDEX, new Action(() => DeletePictureRequested?.Invoke(currentReelData)) }, + }; } public bool IsContextMenuOpen() => isContextMenuOpen; @@ -60,10 +60,11 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, view.transform.SetParent(parent); view.transform.localPosition = offsetPosition; view.gameObject.SetActive(true); - contextMenuController.SetImageData(cameraReelResponse); - initialValues[PUBLIC_CONTROL_INDEX] = cameraReelResponse.isPublic; + currentReelData = cameraReelResponse; + initialValues[(int)CameraReelGalleryController.ContextMenuControls.PUBLIC_CONTROL_INDEX] = cameraReelResponse.isPublic; } + //TODO: transform context menu close action to task and pass it to closeTask public void HideControl() { view.transform.localScale = Vector3.one; @@ -74,10 +75,6 @@ public void HideControl() private void OnOptionClicked() { - // if (!contextMenuController.IsOpen()) - // contextMenuController.Show(buttonRectTransform.position); - // else - // contextMenuController.Hide(); mvcManager.ShowAsync(GenericContextMenuController.IssueCommand( new GenericContextMenuParameter(contextMenuConfig, controlsActions, buttonRectTransform.position, actionOnShow: () => isContextMenuOpen = true, diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 2ac9999f76..084a417c2e 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -67,6 +67,8 @@ private void ConfigureContextMenu() for (var i = 0; i < inputData.Config.ContextMenuSettings.Count; i++) { ContextMenuControlSettings config = inputData.Config.ContextMenuSettings[i]; + object controlInitialValue = null; + inputData.InitialValues?.TryGetValue(i, out controlInitialValue); switch (config.ControlTypeType) { @@ -79,10 +81,7 @@ private void ConfigureContextMenu() button.ButtonComponent.onClick.AddListener(TriggerContextMenuClose); break; case ContextMenuControlTypes.TOGGLE_WITH_TEXT: - bool initialValue = false; - if (inputData.InitialValues != null && inputData.InitialValues.TryGetValue(i, out object initVal)) - initialValue = (bool)initVal; - GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, initialValue, i); + GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, controlInitialValue != null && (bool)controlInitialValue , i); toggle.ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); toggle.ToggleComponent.Toggle.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); break; From 203985857805b095d14327cf96a7ffe7d3fdce92 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 15:22:19 +0100 Subject: [PATCH 12/36] fix custom property naming --- .../Controls/Configs/ContextMenuControlSettings.cs | 2 +- Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs | 2 +- .../Utility/Editor/{ReadOnlyDrawer.cs => ShowOnlyDrawer.cs} | 4 ++-- .../Editor/{ReadOnlyDrawer.cs.meta => ShowOnlyDrawer.cs.meta} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename Explorer/Assets/Scripts/Utility/Editor/{ReadOnlyDrawer.cs => ShowOnlyDrawer.cs} (83%) rename Explorer/Assets/Scripts/Utility/Editor/{ReadOnlyDrawer.cs.meta => ShowOnlyDrawer.cs.meta} (100%) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs index 265f9cc0d1..c9a280a43e 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs @@ -7,7 +7,7 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs [Serializable] public class ContextMenuControlSettings : ScriptableObject { - [SerializeField, ReadOnly] protected ContextMenuControlTypes controlTypeType; + [SerializeField, ShowOnly] protected ContextMenuControlTypes controlTypeType; public ContextMenuControlTypes ControlTypeType => controlTypeType; } diff --git a/Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs b/Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs index 9b6bbae7dd..9a1ad1504f 100644 --- a/Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs +++ b/Explorer/Assets/Scripts/Utility/CustomPropertyDrawers.cs @@ -31,5 +31,5 @@ public ShowIfConditionAttribute(string fieldName) } [AttributeUsage(AttributeTargets.Field)] - public class ReadOnlyAttribute : PropertyAttribute { } + public class ShowOnlyAttribute : PropertyAttribute { } } diff --git a/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs b/Explorer/Assets/Scripts/Utility/Editor/ShowOnlyDrawer.cs similarity index 83% rename from Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs rename to Explorer/Assets/Scripts/Utility/Editor/ShowOnlyDrawer.cs index 15a466525b..85548af4d8 100644 --- a/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs +++ b/Explorer/Assets/Scripts/Utility/Editor/ShowOnlyDrawer.cs @@ -3,8 +3,8 @@ namespace Utility.Editor { - [CustomPropertyDrawer(typeof(ReadOnlyAttribute))] - public class ReadOnlyDrawer : PropertyDrawer + [CustomPropertyDrawer(typeof(ShowOnlyAttribute))] + public class ShowOnlyDrawer : PropertyDrawer { public override float GetPropertyHeight(SerializedProperty property, GUIContent label) => diff --git a/Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs.meta b/Explorer/Assets/Scripts/Utility/Editor/ShowOnlyDrawer.cs.meta similarity index 100% rename from Explorer/Assets/Scripts/Utility/Editor/ReadOnlyDrawer.cs.meta rename to Explorer/Assets/Scripts/Utility/Editor/ShowOnlyDrawer.cs.meta From 2fc3279a043cd7a3e61ad6895003f7620fd700b7 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 16:26:21 +0100 Subject: [PATCH 13/36] more test conversion --- .../CameraReelGalleryController.cs | 21 ++++++++----------- .../Components/OptionButtonController.cs | 11 ++++------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs index e21be800cf..035dae7aea 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs @@ -10,7 +10,6 @@ using DCL.InWorldCamera.ReelActions; using DCL.Multiplayer.Connections.DecentralandUrls; using DCL.Optimization.Pools; -using DCL.UI.GenericContextMenu.Controls; using DCL.UI.GenericContextMenu.Controls.Configs; using DG.Tweening; using MVC; @@ -79,7 +78,6 @@ public ReelToDeleteInfo(string id, string datetime) private readonly Dictionary monthViews = new (); private readonly Dictionary reelThumbnailCache = new (); private readonly OptionButtonController? optionButtonController; - private readonly ContextMenuController? contextMenuController; private readonly Rect elementMaskRect; private readonly ReelGalleryStringMessages? reelGalleryStringMessages; private readonly ReelGalleryConfigParams reelGalleryConfigParams; @@ -137,8 +135,7 @@ public CameraReelGalleryController(CameraReelGalleryView view, if (optionButtonView is not null && contextMenuView is not null) { - this.contextMenuController = new ContextMenuController(contextMenuView); - this.optionButtonController = new OptionButtonController(optionButtonView, contextMenuController, mvcManager!, contextMenuConfig!); + this.optionButtonController = new OptionButtonController(optionButtonView, mvcManager!, contextMenuConfig!); } reelGalleryPoolManager = new ReelGalleryPoolManager(view.thumbnailViewPrefab, view.monthGridPrefab, view.unusedThumbnailViewObject, @@ -150,7 +147,7 @@ public CameraReelGalleryController(CameraReelGalleryView view, view.cancelDeleteIntentBackgroundButton?.onClick.AddListener(() => OnDeletionModalCancelClick(false)); view.deleteReelButton?.onClick.AddListener(DeleteScreenshot); - if (this.contextMenuController != null) + if (this.optionButtonController != null) { this.optionButtonController.SetPublicRequested += SetReelPublic; this.optionButtonController.ShareToXRequested += ShareToX; @@ -540,7 +537,7 @@ private void OnDisable() deleteScreenshotCts.SafeCancelAndDispose(); HideDeleteModal(); - contextMenuController?.Hide(); + optionButtonController?.HideControl(); } public void Dispose() @@ -557,13 +554,13 @@ public void Dispose() optionButtonController?.Dispose(); - if (this.contextMenuController != null) + if (this.optionButtonController != null) { - this.contextMenuController.SetPublicRequested -= SetReelPublic; - this.contextMenuController.ShareToXRequested -= ShareToX; - this.contextMenuController.CopyPictureLinkRequested -= CopyPictureLink; - this.contextMenuController.DownloadRequested -= DownloadReelLocally; - this.contextMenuController.DeletePictureRequested -= DeleteReel; + this.optionButtonController.SetPublicRequested -= SetReelPublic; + this.optionButtonController.ShareToXRequested -= ShareToX; + this.optionButtonController.CopyPictureLinkRequested -= CopyPictureLink; + this.optionButtonController.DownloadRequested -= DownloadReelLocally; + this.optionButtonController.DeletePictureRequested -= DeleteReel; } } } diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs index 0a8db019f9..2c26888a2b 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs @@ -12,7 +12,6 @@ namespace DCL.InWorldCamera.CameraReelGallery.Components public class OptionButtonController : IDisposable { private readonly OptionButtonView view; - private readonly ContextMenuController contextMenuController; private readonly RectTransform buttonRectTransform; private readonly IMVCManager mvcManager; private readonly GenericContextMenuConfig contextMenuConfig; @@ -29,9 +28,9 @@ public class OptionButtonController : IDisposable private bool isContextMenuOpen; private CameraReelResponseCompact currentReelData; + private UniTaskCompletionSource closeContextMenuTask; public OptionButtonController(OptionButtonView view, - ContextMenuController contextMenuController, IMVCManager mvcManager, GenericContextMenuConfig contextMenuConfig) { @@ -41,7 +40,6 @@ public OptionButtonController(OptionButtonView view, this.buttonRectTransform = view.GetComponent(); this.view.optionButton.onClick.AddListener(OnOptionClicked); - this.contextMenuController = contextMenuController; controlsActions = new () { @@ -62,13 +60,13 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, view.gameObject.SetActive(true); currentReelData = cameraReelResponse; initialValues[(int)CameraReelGalleryController.ContextMenuControls.PUBLIC_CONTROL_INDEX] = cameraReelResponse.isPublic; + closeContextMenuTask = new UniTaskCompletionSource(); } - //TODO: transform context menu close action to task and pass it to closeTask public void HideControl() { view.transform.localScale = Vector3.one; - contextMenuController.Hide(); + closeContextMenuTask?.TrySetResult(); Hide?.Invoke(); view.gameObject.SetActive(false); } @@ -79,14 +77,13 @@ private void OnOptionClicked() new GenericContextMenuParameter(contextMenuConfig, controlsActions, buttonRectTransform.position, actionOnShow: () => isContextMenuOpen = true, actionOnHide: () => isContextMenuOpen = false, - closeTask: view.optionButton.OnClickAsync(), + closeTask: closeContextMenuTask?.Task, initialValues: initialValues))); } public void Dispose() { view.optionButton.onClick.RemoveAllListeners(); - contextMenuController.Dispose(); Hide = null; } } From 682984a54a4f16f0989764d036e32e343698db38 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 16:42:29 +0100 Subject: [PATCH 14/36] fix context menu position --- .../Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset | 2 +- .../DCL/UI/GenericContextMenu/GenericContextMenuController.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset index 2ec0505bfa..af32227505 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset @@ -19,5 +19,5 @@ MonoBehaviour: - {fileID: 11400000, guid: db49cac2faca44598a924e1c56690e0c, type: 2} - {fileID: 11400000, guid: 3ad489cd996154c1cad21a0856ed86bc, type: 2} - {fileID: 11400000, guid: a1abe3dafbc2143d8949b174e3c6c235, type: 2} - offsetFromTarget: {x: 0, y: 0} + offsetFromTarget: {x: 11, y: 18} width: 186 diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 084a417c2e..9376607ca7 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -25,6 +25,7 @@ private enum ContextMenuOpenDirection private readonly ControlsPoolManager controlsPoolManager; private RectTransform viewRectTransform; + private Rect backgroundWorldRect; private bool isClosing; public GenericContextMenuController(ViewFactoryMethod viewFactory, @@ -43,6 +44,7 @@ public override void Dispose() protected override void OnViewInstantiated() { viewRectTransform = viewInstance!.GetComponent(); + backgroundWorldRect = GetWorldRect(viewInstance!.BackgroundCloseButton.GetComponent()); viewInstance!.BackgroundCloseButtonClicked += TriggerContextMenuClose; } @@ -116,7 +118,7 @@ private Vector3 GetControlsPosition(Vector2 anchorPosition, Vector2 offsetFromTa { Vector2 offsetByDirection = GetOffsetByDirection(enumVal, offsetFromTarget); Vector3 currentPosition = position + new Vector3(offsetByDirection.x, offsetByDirection.y, 0); - float nonOverlappingArea = CalculateNonOverlappingArea(overlapRect ?? viewRectTransform.rect, GetProjectedRect(currentPosition)); + float nonOverlappingArea = CalculateNonOverlappingArea(overlapRect ?? backgroundWorldRect, GetProjectedRect(currentPosition)); if (nonOverlappingArea < minNonOverlappingArea) { newPosition = currentPosition; From 22ae88b272f90df9a0958645d6c632d756b6cd9b Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 17:38:35 +0100 Subject: [PATCH 15/36] avoid layout rebuild for height calculation --- .../GenericContextMenuButtonWithTextView.cs | 1 + .../Controls/GenericContextMenuToggleView.cs | 1 + .../GenericContextMenuController.cs | 16 ++++++++++++---- .../GenericContextMenu/GenericContextMenuView.cs | 1 + .../Prefabs/ButtonWithTextAndIcon.prefab | 1 + .../Prefabs/GenericContextMenu.prefab | 1 + .../Prefabs/ToggleWithText.prefab | 1 + 7 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index fcfb05289f..a57d0d8387 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -7,6 +7,7 @@ namespace DCL.UI.GenericContextMenu.Controls { public class GenericContextMenuButtonWithTextView : MonoBehaviour, IGenericContextMenuComponent { + [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } [field: SerializeField] public Button ButtonComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } [field: SerializeField] public Image ImageComponent { get; private set; } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 19b9e750cf..854ddfc165 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -7,6 +7,7 @@ namespace DCL.UI.GenericContextMenu.Controls { public class GenericContextMenuToggleView : MonoBehaviour, IGenericContextMenuComponent { + [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } [field: SerializeField] public ToggleView ToggleComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 9376607ca7..6d659a7710 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -64,7 +64,7 @@ protected override void OnViewShow() private void ConfigureContextMenu() { - viewInstance!.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, viewInstance!.ControlsContainer.sizeDelta.y); + float totalHeight = 0; for (var i = 0; i < inputData.Config.ContextMenuSettings.Count; i++) { @@ -75,22 +75,30 @@ private void ConfigureContextMenu() switch (config.ControlTypeType) { case ContextMenuControlTypes.SEPARATOR: - controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings, i); + GenericContextMenuSeparatorView separatorView = controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings, i); + totalHeight += separatorView.RectTransformComponent.rect.height; break; case ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON: GenericContextMenuButtonWithTextView button = controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings, i); button.ButtonComponent.onClick.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); button.ButtonComponent.onClick.AddListener(TriggerContextMenuClose); + totalHeight += button.RectTransformComponent.rect.height; break; case ContextMenuControlTypes.TOGGLE_WITH_TEXT: GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, controlInitialValue != null && (bool)controlInitialValue , i); toggle.ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); toggle.ToggleComponent.Toggle.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); + totalHeight += toggle.RectTransformComponent.rect.height; break; } } - Canvas.ForceUpdateCanvases(); - LayoutRebuilder.ForceRebuildLayoutImmediate(viewInstance!.ControlsContainer); + + viewInstance!.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, + totalHeight + + viewInstance!.ControlsLayoutGroup.padding.bottom + + viewInstance!.ControlsLayoutGroup.padding.top + + (viewInstance!.ControlsLayoutGroup.spacing * (inputData.Config.ContextMenuSettings.Count - 1))); + viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.OffsetFromTarget, inputData.OverlapRect); } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs index 767c28d277..1125b5f7ca 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs @@ -8,6 +8,7 @@ namespace DCL.UI.GenericContextMenu public class GenericContextMenuView : ViewBase, IView, IDisposable { [field: SerializeField] public RectTransform ControlsContainer { get; private set; } + [field: SerializeField] public VerticalLayoutGroup ControlsLayoutGroup { get; private set; } [field: SerializeField] public Button BackgroundCloseButton { get; private set; } public event Action BackgroundCloseButtonClicked; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab index fea1d673dc..36e509339c 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab @@ -346,6 +346,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0cb01ddb93349c98fd84395a98b77f9, type: 3} m_Name: m_EditorClassIdentifier: + k__BackingField: {fileID: 5856922699228769623} k__BackingField: {fileID: 4754064954679370281} k__BackingField: {fileID: 8655627310085805794} k__BackingField: {fileID: 6260016763612421407} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab index 47232705ef..92f00b29aa 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab @@ -119,6 +119,7 @@ MonoBehaviour: k__BackingField: {fileID: 6591100080399325240} k__BackingField: {fileID: 8522526520946479007} k__BackingField: {fileID: 2932465032679087180} + k__BackingField: {fileID: 5384044999603412779} k__BackingField: {fileID: 3243245791156245727} --- !u!1 &7170495978923432429 GameObject: diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab index 9cb022477a..91be3f80f3 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab @@ -90,6 +90,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e8f35c553d944f99854691517619b0e3, type: 3} m_Name: m_EditorClassIdentifier: + k__BackingField: {fileID: 891560713975722788} k__BackingField: {fileID: 3675667337910807093} k__BackingField: {fileID: 7042733739484598958} --- !u!1 &4204936758877281454 From 18aed20ee4dbd0ea2b4be8d30653c08b2de41363 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 6 Jan 2025 17:58:50 +0100 Subject: [PATCH 16/36] restructured components --- .../GenericContextMenuButtonWithTextView.cs | 7 ++- .../Controls/GenericContextMenuComponent.cs | 15 +++++++ .../GenericContextMenuComponent.cs.meta | 3 ++ .../GenericContextMenuSeparatorView.cs | 7 ++- .../Controls/GenericContextMenuToggleView.cs | 8 ++-- .../GenericContextMenuController.cs | 43 +++++++++++-------- 6 files changed, 51 insertions(+), 32 deletions(-) create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs.meta diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index a57d0d8387..765139895c 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -5,21 +5,20 @@ namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuButtonWithTextView : MonoBehaviour, IGenericContextMenuComponent + public class GenericContextMenuButtonWithTextView : GenericContextMenuComponent { - [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } [field: SerializeField] public Button ButtonComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } [field: SerializeField] public Image ImageComponent { get; private set; } - public void Configure(ContextMenuControlSettings settings) + public override void Configure(ContextMenuControlSettings settings) { ButtonContextMenuControlSettings buttonSettings = settings as ButtonContextMenuControlSettings; TextComponent.SetText(buttonSettings!.ButtonText); ImageComponent.sprite = buttonSettings.ButtonIcon; } - public void UnregisterListeners() => + public override void UnregisterListeners() => ButtonComponent.onClick.RemoveAllListeners(); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs new file mode 100644 index 0000000000..a58a6a641d --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs @@ -0,0 +1,15 @@ +using DCL.UI.GenericContextMenu.Controls.Configs; +using UnityEngine; + +namespace DCL.UI.GenericContextMenu.Controls +{ + [RequireComponent(typeof(RectTransform))] + public abstract class GenericContextMenuComponent : MonoBehaviour, IGenericContextMenuComponent + { + [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } + + public abstract void Configure(ContextMenuControlSettings settings); + + public abstract void UnregisterListeners(); + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs.meta new file mode 100644 index 0000000000..98d8cc1921 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a81c224e27c1441c912e481761144796 +timeCreated: 1736181634 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index b3b5778a90..a0ffa6579a 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -4,12 +4,11 @@ namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuSeparatorView : MonoBehaviour, IGenericContextMenuComponent + public class GenericContextMenuSeparatorView : GenericContextMenuComponent { [field: SerializeField] public LayoutElement LayoutElementComponent { get; private set; } - [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } - public void Configure(ContextMenuControlSettings settings) + public override void Configure(ContextMenuControlSettings settings) { SeparatorContextMenuControlSettings separatorSettings = settings as SeparatorContextMenuControlSettings; LayoutElementComponent.preferredHeight = separatorSettings!.Height; @@ -17,6 +16,6 @@ public void Configure(ContextMenuControlSettings settings) RectTransformComponent.sizeDelta = new Vector2(RectTransformComponent.sizeDelta.x, separatorSettings.Height); } - public void UnregisterListeners(){} + public override void UnregisterListeners(){} } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 854ddfc165..90d38a32f7 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -1,23 +1,21 @@ using DCL.UI.GenericContextMenu.Controls.Configs; using TMPro; using UnityEngine; -using UnityEngine.UI; namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuToggleView : MonoBehaviour, IGenericContextMenuComponent + public class GenericContextMenuToggleView : GenericContextMenuComponent { - [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } [field: SerializeField] public ToggleView ToggleComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } - public void Configure(ContextMenuControlSettings settings) + public override void Configure(ContextMenuControlSettings settings) { ToggleContextMenuControlSettings toggleSettings = settings as ToggleContextMenuControlSettings; TextComponent.SetText(toggleSettings!.ToggleText); } - public void UnregisterListeners() => + public override void UnregisterListeners() => ToggleComponent.Toggle.onValueChanged.RemoveAllListeners(); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 6d659a7710..f8937b10ee 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -72,25 +72,14 @@ private void ConfigureContextMenu() object controlInitialValue = null; inputData.InitialValues?.TryGetValue(i, out controlInitialValue); - switch (config.ControlTypeType) - { - case ContextMenuControlTypes.SEPARATOR: - GenericContextMenuSeparatorView separatorView = controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings, i); - totalHeight += separatorView.RectTransformComponent.rect.height; - break; - case ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON: - GenericContextMenuButtonWithTextView button = controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings, i); - button.ButtonComponent.onClick.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); - button.ButtonComponent.onClick.AddListener(TriggerContextMenuClose); - totalHeight += button.RectTransformComponent.rect.height; - break; - case ContextMenuControlTypes.TOGGLE_WITH_TEXT: - GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, controlInitialValue != null && (bool)controlInitialValue , i); - toggle.ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[i])); - toggle.ToggleComponent.Toggle.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); - totalHeight += toggle.RectTransformComponent.rect.height; - break; - } + GenericContextMenuComponent component = config.ControlTypeType switch { + ContextMenuControlTypes.SEPARATOR => controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings, i), + ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON => HandleButton(config as ButtonContextMenuControlSettings, i), + ContextMenuControlTypes.TOGGLE_WITH_TEXT => HandleToggle(config as ToggleContextMenuControlSettings, controlInitialValue != null && (bool)controlInitialValue, i), + _ => throw new NotImplementedException($"Control of type {config.ControlTypeType} is not implemented") + }; + + totalHeight += component!.RectTransformComponent.rect.height; } viewInstance!.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, @@ -102,6 +91,22 @@ private void ConfigureContextMenu() viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.OffsetFromTarget, inputData.OverlapRect); } + private GenericContextMenuComponent HandleButton(ButtonContextMenuControlSettings config, int index) + { + GenericContextMenuButtonWithTextView button = controlsPoolManager.GetButton(config, index); + button.ButtonComponent.onClick.AddListener(new UnityAction((Action)inputData.ControlsActions[index])); + button.ButtonComponent.onClick.AddListener(TriggerContextMenuClose); + return button; + } + + private GenericContextMenuComponent HandleToggle(ToggleContextMenuControlSettings config, bool initialValue, int index) + { + GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config, initialValue, index); + toggle.ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[index])); + toggle.ToggleComponent.Toggle.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); + return toggle; + } + private Vector2 GetOffsetByDirection(ContextMenuOpenDirection direction, Vector2 offsetFromTarget) { return direction switch From 939556f910fc5e132e8bd1a14e00662dd743c310 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Tue, 7 Jan 2025 10:42:00 +0100 Subject: [PATCH 17/36] more generic management of components --- .../GenericContextMenuButtonWithTextView.cs | 8 ++++++ .../Controls/GenericContextMenuComponent.cs | 5 ++++ .../GenericContextMenuSeparatorView.cs | 7 ++++- .../Controls/GenericContextMenuToggleView.cs | 8 ++++++ .../Controls/IGenericContextMenuComponent.cs | 3 ++ .../GenericContextMenuController.cs | 28 ++++++------------- 6 files changed, 38 insertions(+), 21 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index 765139895c..eb1ca9699e 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -1,6 +1,8 @@ using DCL.UI.GenericContextMenu.Controls.Configs; +using System; using TMPro; using UnityEngine; +using UnityEngine.Events; using UnityEngine.UI; namespace DCL.UI.GenericContextMenu.Controls @@ -20,5 +22,11 @@ public override void Configure(ContextMenuControlSettings settings) public override void UnregisterListeners() => ButtonComponent.onClick.RemoveAllListeners(); + + public override void RegisterListener(Delegate listener) => + ButtonComponent.onClick.AddListener(new UnityAction((Action)listener)); + + public override void RegisterCloseListener(Action listener) => + RegisterListener(listener); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs index a58a6a641d..800b4a27af 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs @@ -1,4 +1,5 @@ using DCL.UI.GenericContextMenu.Controls.Configs; +using System; using UnityEngine; namespace DCL.UI.GenericContextMenu.Controls @@ -11,5 +12,9 @@ public abstract class GenericContextMenuComponent : MonoBehaviour, IGenericConte public abstract void Configure(ContextMenuControlSettings settings); public abstract void UnregisterListeners(); + + public abstract void RegisterListener(Delegate listener); + + public abstract void RegisterCloseListener(Action listener); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index a0ffa6579a..7db6c7090d 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -1,4 +1,5 @@ using DCL.UI.GenericContextMenu.Controls.Configs; +using System; using UnityEngine; using UnityEngine.UI; @@ -16,6 +17,10 @@ public override void Configure(ContextMenuControlSettings settings) RectTransformComponent.sizeDelta = new Vector2(RectTransformComponent.sizeDelta.x, separatorSettings.Height); } - public override void UnregisterListeners(){} + public override void UnregisterListeners() { } + + public override void RegisterListener(Delegate listener) { } + + public override void RegisterCloseListener(Action listener) { } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 90d38a32f7..3bb528910c 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -1,6 +1,8 @@ using DCL.UI.GenericContextMenu.Controls.Configs; +using System; using TMPro; using UnityEngine; +using UnityEngine.Events; namespace DCL.UI.GenericContextMenu.Controls { @@ -17,5 +19,11 @@ public override void Configure(ContextMenuControlSettings settings) public override void UnregisterListeners() => ToggleComponent.Toggle.onValueChanged.RemoveAllListeners(); + + public override void RegisterListener(Delegate listener) => + ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction((Action)listener)); + + public override void RegisterCloseListener(Action listener) => + ToggleComponent.Toggle.onValueChanged.AddListener(_ => listener()); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs index 75f317f136..2231abc0c2 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs @@ -1,4 +1,5 @@ using DCL.UI.GenericContextMenu.Controls.Configs; +using System; namespace DCL.UI.GenericContextMenu.Controls { @@ -6,5 +7,7 @@ public interface IGenericContextMenuComponent { void Configure(ContextMenuControlSettings settings); void UnregisterListeners(); + void RegisterListener(Delegate listener); + void RegisterCloseListener(Action listener); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index f8937b10ee..7a9ed1ac87 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -5,8 +5,6 @@ using System; using System.Threading; using UnityEngine; -using UnityEngine.Events; -using UnityEngine.UI; namespace DCL.UI.GenericContextMenu { @@ -74,11 +72,17 @@ private void ConfigureContextMenu() GenericContextMenuComponent component = config.ControlTypeType switch { ContextMenuControlTypes.SEPARATOR => controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings, i), - ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON => HandleButton(config as ButtonContextMenuControlSettings, i), - ContextMenuControlTypes.TOGGLE_WITH_TEXT => HandleToggle(config as ToggleContextMenuControlSettings, controlInitialValue != null && (bool)controlInitialValue, i), + ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON => controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings, i), + ContextMenuControlTypes.TOGGLE_WITH_TEXT => controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, controlInitialValue != null && (bool)controlInitialValue, i), _ => throw new NotImplementedException($"Control of type {config.ControlTypeType} is not implemented") }; + if (inputData.ControlsActions.TryGetValue(i, out Delegate action)) + { + component.RegisterListener(action); + component.RegisterCloseListener(TriggerContextMenuClose); + } + totalHeight += component!.RectTransformComponent.rect.height; } @@ -91,22 +95,6 @@ private void ConfigureContextMenu() viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.OffsetFromTarget, inputData.OverlapRect); } - private GenericContextMenuComponent HandleButton(ButtonContextMenuControlSettings config, int index) - { - GenericContextMenuButtonWithTextView button = controlsPoolManager.GetButton(config, index); - button.ButtonComponent.onClick.AddListener(new UnityAction((Action)inputData.ControlsActions[index])); - button.ButtonComponent.onClick.AddListener(TriggerContextMenuClose); - return button; - } - - private GenericContextMenuComponent HandleToggle(ToggleContextMenuControlSettings config, bool initialValue, int index) - { - GenericContextMenuToggleView toggle = controlsPoolManager.GetToggle(config, initialValue, index); - toggle.ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction((Action)inputData.ControlsActions[index])); - toggle.ToggleComponent.Toggle.onValueChanged.AddListener(toggleValue => TriggerContextMenuClose()); - return toggle; - } - private Vector2 GetOffsetByDirection(ContextMenuOpenDirection direction, Vector2 offsetFromTarget) { return direction switch From d5484f355b8ce7e504284d63d1c95ef0ad496dff Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Tue, 7 Jan 2025 10:58:43 +0100 Subject: [PATCH 18/36] reference lambdas and values by config instead of indexes --- .../CameraReelGalleryController.cs | 9 -------- .../Components/OptionButtonController.cs | 22 ++++++++++++------- .../GenericContextMenuController.cs | 4 ++-- .../GenericContextMenuParameter.cs | 8 +++---- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs index 035dae7aea..c047d406da 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs @@ -32,15 +32,6 @@ private enum ScrollDirection DOWN } - public enum ContextMenuControls - { - PUBLIC_CONTROL_INDEX = 0, - SHARE_CONTROL_INDEX = 2, - COPY_CONTROL_INDEX = 3, - DOWNLOAD_CONTROL_INDEX = 4, - DELETE_CONTROL_INDEX = 5, - } - private struct ReelToDeleteInfo { public readonly string Id; diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs index 2c26888a2b..61be6ba89c 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs @@ -11,12 +11,18 @@ namespace DCL.InWorldCamera.CameraReelGallery.Components { public class OptionButtonController : IDisposable { + private const int PUBLIC_CONTROL_INDEX = 0; + private const int SHARE_CONTROL_INDEX = 2; + private const int COPY_CONTROL_INDEX = 3; + private const int DOWNLOAD_CONTROL_INDEX = 4; + private const int DELETE_CONTROL_INDEX = 5; + private readonly OptionButtonView view; private readonly RectTransform buttonRectTransform; private readonly IMVCManager mvcManager; private readonly GenericContextMenuConfig contextMenuConfig; - private readonly Dictionary controlsActions; - private readonly Dictionary initialValues = new (); + private readonly Dictionary controlsActions; + private readonly Dictionary initialValues = new (); public event Action? Hide; @@ -43,11 +49,11 @@ public OptionButtonController(OptionButtonView view, controlsActions = new () { - { (int)CameraReelGalleryController.ContextMenuControls.PUBLIC_CONTROL_INDEX, new Action(toggleValue => SetPublicRequested?.Invoke(currentReelData, toggleValue)) }, - { (int)CameraReelGalleryController.ContextMenuControls.SHARE_CONTROL_INDEX, new Action(() => ShareToXRequested?.Invoke(currentReelData)) }, - { (int)CameraReelGalleryController.ContextMenuControls.COPY_CONTROL_INDEX, new Action(() => CopyPictureLinkRequested?.Invoke(currentReelData)) }, - { (int)CameraReelGalleryController.ContextMenuControls.DOWNLOAD_CONTROL_INDEX, new Action(() => DownloadRequested?.Invoke(currentReelData)) }, - { (int)CameraReelGalleryController.ContextMenuControls.DELETE_CONTROL_INDEX, new Action(() => DeletePictureRequested?.Invoke(currentReelData)) }, + { contextMenuConfig.ContextMenuSettings[PUBLIC_CONTROL_INDEX], new Action(toggleValue => SetPublicRequested?.Invoke(currentReelData, toggleValue)) }, + { contextMenuConfig.ContextMenuSettings[SHARE_CONTROL_INDEX], new Action(() => ShareToXRequested?.Invoke(currentReelData)) }, + { contextMenuConfig.ContextMenuSettings[COPY_CONTROL_INDEX], new Action(() => CopyPictureLinkRequested?.Invoke(currentReelData)) }, + { contextMenuConfig.ContextMenuSettings[DOWNLOAD_CONTROL_INDEX], new Action(() => DownloadRequested?.Invoke(currentReelData)) }, + { contextMenuConfig.ContextMenuSettings[DELETE_CONTROL_INDEX], new Action(() => DeletePictureRequested?.Invoke(currentReelData)) }, }; } @@ -59,7 +65,7 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, view.transform.localPosition = offsetPosition; view.gameObject.SetActive(true); currentReelData = cameraReelResponse; - initialValues[(int)CameraReelGalleryController.ContextMenuControls.PUBLIC_CONTROL_INDEX] = cameraReelResponse.isPublic; + initialValues[contextMenuConfig.ContextMenuSettings[PUBLIC_CONTROL_INDEX]] = cameraReelResponse.isPublic; closeContextMenuTask = new UniTaskCompletionSource(); } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 7a9ed1ac87..f32680839b 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -68,7 +68,7 @@ private void ConfigureContextMenu() { ContextMenuControlSettings config = inputData.Config.ContextMenuSettings[i]; object controlInitialValue = null; - inputData.InitialValues?.TryGetValue(i, out controlInitialValue); + inputData.InitialValues?.TryGetValue(config, out controlInitialValue); GenericContextMenuComponent component = config.ControlTypeType switch { ContextMenuControlTypes.SEPARATOR => controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings, i), @@ -77,7 +77,7 @@ private void ConfigureContextMenu() _ => throw new NotImplementedException($"Control of type {config.ControlTypeType} is not implemented") }; - if (inputData.ControlsActions.TryGetValue(i, out Delegate action)) + if (inputData.ControlsActions.TryGetValue(config, out Delegate action)) { component.RegisterListener(action); component.RegisterCloseListener(TriggerContextMenuClose); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs index 73c17d7a65..5b6ee70665 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs @@ -10,22 +10,22 @@ namespace DCL.UI.GenericContextMenu public struct GenericContextMenuParameter { public readonly GenericContextMenuConfig Config; - public readonly Dictionary ControlsActions; + public readonly Dictionary ControlsActions; public readonly Vector2 AnchorPosition; public readonly Rect? OverlapRect; public readonly Action? ActionOnShow; public readonly Action? ActionOnHide; public readonly UniTask? CloseTask; - public readonly Dictionary? InitialValues; + public readonly Dictionary? InitialValues; public GenericContextMenuParameter(GenericContextMenuConfig config, - Dictionary controlsActions, + Dictionary controlsActions, Vector2 anchorPosition, Rect? overlapRect = null, Action? actionOnShow = null, Action? actionOnHide = null, UniTask? closeTask = null, - Dictionary? initialValues = null) + Dictionary? initialValues = null) { this.Config = config; this.ControlsActions = controlsActions; From e25937d2ca720364526e8549d9606fa338f87632 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Tue, 7 Jan 2025 11:23:50 +0100 Subject: [PATCH 19/36] more generic pool manager --- .../GenericContextMenuButtonWithTextView.cs | 2 +- .../Controls/GenericContextMenuComponent.cs | 2 +- .../GenericContextMenuSeparatorView.cs | 2 +- .../Controls/GenericContextMenuToggleView.cs | 3 +- .../Controls/IGenericContextMenuComponent.cs | 2 +- .../GenericContextMenu/ControlsPoolManager.cs | 37 ++++++------------- .../GenericContextMenuController.cs | 7 +--- 7 files changed, 19 insertions(+), 36 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index eb1ca9699e..8cb323b732 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -13,7 +13,7 @@ public class GenericContextMenuButtonWithTextView : GenericContextMenuComponent [field: SerializeField] public TMP_Text TextComponent { get; private set; } [field: SerializeField] public Image ImageComponent { get; private set; } - public override void Configure(ContextMenuControlSettings settings) + public override void Configure(ContextMenuControlSettings settings, object initialValue) { ButtonContextMenuControlSettings buttonSettings = settings as ButtonContextMenuControlSettings; TextComponent.SetText(buttonSettings!.ButtonText); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs index 800b4a27af..e2dbc12f84 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs @@ -9,7 +9,7 @@ public abstract class GenericContextMenuComponent : MonoBehaviour, IGenericConte { [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } - public abstract void Configure(ContextMenuControlSettings settings); + public abstract void Configure(ContextMenuControlSettings settings, object initialValue); public abstract void UnregisterListeners(); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index 7db6c7090d..0d41e7ba69 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -9,7 +9,7 @@ public class GenericContextMenuSeparatorView : GenericContextMenuComponent { [field: SerializeField] public LayoutElement LayoutElementComponent { get; private set; } - public override void Configure(ContextMenuControlSettings settings) + public override void Configure(ContextMenuControlSettings settings, object initialValue) { SeparatorContextMenuControlSettings separatorSettings = settings as SeparatorContextMenuControlSettings; LayoutElementComponent.preferredHeight = separatorSettings!.Height; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 3bb528910c..b3be75890b 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -11,10 +11,11 @@ public class GenericContextMenuToggleView : GenericContextMenuComponent [field: SerializeField] public ToggleView ToggleComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } - public override void Configure(ContextMenuControlSettings settings) + public override void Configure(ContextMenuControlSettings settings, object initialValue) { ToggleContextMenuControlSettings toggleSettings = settings as ToggleContextMenuControlSettings; TextComponent.SetText(toggleSettings!.ToggleText); + ToggleComponent.Toggle.isOn = initialValue != null && (bool)initialValue; } public override void UnregisterListeners() => diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs index 2231abc0c2..3c5950a656 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs @@ -5,7 +5,7 @@ namespace DCL.UI.GenericContextMenu.Controls { public interface IGenericContextMenuComponent { - void Configure(ContextMenuControlSettings settings); + void Configure(ContextMenuControlSettings settings, object initialValue); void UnregisterListeners(); void RegisterListener(Delegate listener); void RegisterCloseListener(Action listener); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index 7369af5ff8..b406ff0380 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -39,33 +39,20 @@ public ControlsPoolManager( actionOnDestroy: toggleView => GameObject.Destroy(toggleView.gameObject)); } - public GenericContextMenuSeparatorView GetSeparator(SeparatorContextMenuControlSettings settings, int index) + public GenericContextMenuComponent GetContextMenuComponent(T settings, object initialValue, int index) where T : ContextMenuControlSettings { - GenericContextMenuSeparatorView separatorView = separatorPool.Get(); - separatorView.transform.SetSiblingIndex(index); - separatorView.Configure(settings); - currentControls.Add(separatorView); - return separatorView; - } + GenericContextMenuComponent component = settings switch + { + SeparatorContextMenuControlSettings => separatorPool.Get(), + ButtonContextMenuControlSettings => buttonPool.Get(), + ToggleContextMenuControlSettings => togglePool.Get(), + _ => throw new ArgumentOutOfRangeException() + }; + component.transform.SetSiblingIndex(index); + component.Configure(settings, initialValue); + currentControls.Add(component); - public GenericContextMenuButtonWithTextView GetButton(ButtonContextMenuControlSettings settings, int index) - { - GenericContextMenuButtonWithTextView buttonView = buttonPool.Get(); - buttonView.transform.SetSiblingIndex(index); - buttonView.Configure(settings); - currentControls.Add(buttonView); - return buttonView; - } - - public GenericContextMenuToggleView GetToggle(ToggleContextMenuControlSettings settings, bool initialValue, int index) - { - GenericContextMenuToggleView toggleView = togglePool.Get(); - toggleView.transform.SetSiblingIndex(index); - toggleView.Configure(settings); - toggleView.ToggleComponent.Toggle.isOn = initialValue; - toggleView.ToggleComponent.SetToggleGraphics(initialValue); - currentControls.Add(toggleView); - return toggleView; + return component; } public void Dispose() => diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index f32680839b..23201e112e 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -70,12 +70,7 @@ private void ConfigureContextMenu() object controlInitialValue = null; inputData.InitialValues?.TryGetValue(config, out controlInitialValue); - GenericContextMenuComponent component = config.ControlTypeType switch { - ContextMenuControlTypes.SEPARATOR => controlsPoolManager.GetSeparator(config as SeparatorContextMenuControlSettings, i), - ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON => controlsPoolManager.GetButton(config as ButtonContextMenuControlSettings, i), - ContextMenuControlTypes.TOGGLE_WITH_TEXT => controlsPoolManager.GetToggle(config as ToggleContextMenuControlSettings, controlInitialValue != null && (bool)controlInitialValue, i), - _ => throw new NotImplementedException($"Control of type {config.ControlTypeType} is not implemented") - }; + GenericContextMenuComponent component = controlsPoolManager.GetContextMenuComponent(config, controlInitialValue, i); if (inputData.ControlsActions.TryGetValue(config, out Delegate action)) { From 41121a540ad880f373ae28fd0f9589e89a6b983d Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Tue, 7 Jan 2025 12:04:31 +0100 Subject: [PATCH 20/36] expose elements spacing in context menu config --- .../Controls/Configs/GenericContextMenuConfig.cs | 2 ++ .../DCL/UI/GenericContextMenu/GenericContextMenuController.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs index d49278ca93..3a611e6861 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs @@ -11,9 +11,11 @@ public class GenericContextMenuConfig : ScriptableObject [SerializeField] private List contextMenuSettings = new (); [SerializeField] private Vector2 offsetFromTarget = Vector2.zero; [SerializeField] private float width = 170; + [SerializeField] private int elementsSpacing = 1; public List ContextMenuSettings => contextMenuSettings; public Vector2 OffsetFromTarget => offsetFromTarget; public float Width => width; + public int ElementsSpacing => elementsSpacing; } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 23201e112e..da6c9be28b 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -81,7 +81,8 @@ private void ConfigureContextMenu() totalHeight += component!.RectTransformComponent.rect.height; } - viewInstance!.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, + viewInstance!.ControlsLayoutGroup.spacing = inputData.Config.ElementsSpacing; + viewInstance.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, totalHeight + viewInstance!.ControlsLayoutGroup.padding.bottom + viewInstance!.ControlsLayoutGroup.padding.top From c03f7d01a8e0cc58b98679436db6eefb979ed831 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Tue, 7 Jan 2025 15:27:22 +0100 Subject: [PATCH 21/36] exposed layout settings --- .../ButtonContextMenuControlSettings.cs | 6 ++ .../Configs/GenericContextMenuConfig.cs | 3 + .../SeparatorContextMenuControlSettings.cs | 4 + .../ToggleContextMenuControlSettings.cs | 6 ++ .../GenericContextMenuButtonWithTextView.cs | 3 + .../Controls/GenericContextMenuComponent.cs | 2 + .../GenericContextMenuSeparatorView.cs | 2 + .../Controls/GenericContextMenuToggleView.cs | 4 + .../GenericContextMenuController.cs | 1 + .../Prefabs/ButtonWithTextAndIcon.prefab | 65 +++++++++++++-- .../Prefabs/GenericContextMenu.prefab | 2 +- .../Prefabs/Separator.prefab | 34 +++++++- .../Prefabs/ToggleWithText.prefab | 80 ++++++++++++++++--- 13 files changed, 188 insertions(+), 24 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs index 380507a412..dc9ca53148 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs @@ -9,9 +9,15 @@ public class ButtonContextMenuControlSettings : ContextMenuControlSettings { [SerializeField] private string buttonText; [SerializeField] private Sprite buttonIcon; + [SerializeField] private RectOffset horizontalLayoutPadding; + [SerializeField] private int horizontalLayoutSpacing; + [SerializeField] private bool horizontalLayoutReverseArrangement; public string ButtonText => buttonText; public Sprite ButtonIcon => buttonIcon; + public RectOffset HorizontalLayoutPadding => horizontalLayoutPadding; + public bool HorizontalLayoutReverseArrangement => horizontalLayoutReverseArrangement; + public int HorizontalLayoutSpacing => horizontalLayoutSpacing; private void OnEnable() => controlTypeType = ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs index 3a611e6861..8df5c7dc3e 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using UnityEngine; +using UnityEngine.Serialization; namespace DCL.UI.GenericContextMenu.Controls.Configs { @@ -11,11 +12,13 @@ public class GenericContextMenuConfig : ScriptableObject [SerializeField] private List contextMenuSettings = new (); [SerializeField] private Vector2 offsetFromTarget = Vector2.zero; [SerializeField] private float width = 170; + [SerializeField] private RectOffset verticalLayoutPadding; [SerializeField] private int elementsSpacing = 1; public List ContextMenuSettings => contextMenuSettings; public Vector2 OffsetFromTarget => offsetFromTarget; public float Width => width; public int ElementsSpacing => elementsSpacing; + public RectOffset VerticalLayoutPadding => verticalLayoutPadding; } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs index 756994f1a4..6231b2a9cc 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs @@ -8,8 +8,12 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs public class SeparatorContextMenuControlSettings : ContextMenuControlSettings { [SerializeField] private int height; + [SerializeField] private int leftPadding; + [SerializeField] private int rightPadding; public int Height => height; + public int LeftPadding => leftPadding; + public int RightPadding => rightPadding; private void OnEnable() => controlTypeType = ContextMenuControlTypes.SEPARATOR; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs index 7f11c9e1f5..470aa77dcc 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs @@ -8,8 +8,14 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs public class ToggleContextMenuControlSettings : ContextMenuControlSettings { [SerializeField] private string toggleText; + [SerializeField] private RectOffset horizontalLayoutPadding; + [SerializeField] private int horizontalLayoutSpacing; + [SerializeField] private bool horizontalLayoutReverseArrangement; public string ToggleText => toggleText; + public RectOffset HorizontalLayoutPadding => horizontalLayoutPadding; + public bool HorizontalLayoutReverseArrangement => horizontalLayoutReverseArrangement; + public int HorizontalLayoutSpacing => horizontalLayoutSpacing; private void OnEnable() => controlTypeType = ContextMenuControlTypes.TOGGLE_WITH_TEXT; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index 8cb323b732..5ab806f7d8 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -18,6 +18,9 @@ public override void Configure(ContextMenuControlSettings settings, object initi ButtonContextMenuControlSettings buttonSettings = settings as ButtonContextMenuControlSettings; TextComponent.SetText(buttonSettings!.ButtonText); ImageComponent.sprite = buttonSettings.ButtonIcon; + HorizontalLayoutComponent.padding = buttonSettings.HorizontalLayoutPadding; + HorizontalLayoutComponent.spacing = buttonSettings.HorizontalLayoutSpacing; + HorizontalLayoutComponent.reverseArrangement = buttonSettings.HorizontalLayoutReverseArrangement; } public override void UnregisterListeners() => diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs index e2dbc12f84..c2061f6a35 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs @@ -1,6 +1,7 @@ using DCL.UI.GenericContextMenu.Controls.Configs; using System; using UnityEngine; +using UnityEngine.UI; namespace DCL.UI.GenericContextMenu.Controls { @@ -8,6 +9,7 @@ namespace DCL.UI.GenericContextMenu.Controls public abstract class GenericContextMenuComponent : MonoBehaviour, IGenericContextMenuComponent { [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } + [field: SerializeField] public HorizontalLayoutGroup HorizontalLayoutComponent { get; private set; } public abstract void Configure(ContextMenuControlSettings settings, object initialValue); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index 0d41e7ba69..88d43440d7 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -14,6 +14,8 @@ public override void Configure(ContextMenuControlSettings settings, object initi SeparatorContextMenuControlSettings separatorSettings = settings as SeparatorContextMenuControlSettings; LayoutElementComponent.preferredHeight = separatorSettings!.Height; LayoutElementComponent.minHeight = separatorSettings.Height; + HorizontalLayoutComponent.padding.left = separatorSettings.LeftPadding; + HorizontalLayoutComponent.padding.right = separatorSettings.RightPadding; RectTransformComponent.sizeDelta = new Vector2(RectTransformComponent.sizeDelta.x, separatorSettings.Height); } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index b3be75890b..0985c74ca6 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -15,7 +15,11 @@ public override void Configure(ContextMenuControlSettings settings, object initi { ToggleContextMenuControlSettings toggleSettings = settings as ToggleContextMenuControlSettings; TextComponent.SetText(toggleSettings!.ToggleText); + HorizontalLayoutComponent.padding = toggleSettings.HorizontalLayoutPadding; + HorizontalLayoutComponent.spacing = toggleSettings.HorizontalLayoutSpacing; + HorizontalLayoutComponent.reverseArrangement = toggleSettings.HorizontalLayoutReverseArrangement; ToggleComponent.Toggle.isOn = initialValue != null && (bool)initialValue; + ToggleComponent.SetToggleGraphics(ToggleComponent.Toggle.isOn); } public override void UnregisterListeners() => diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index da6c9be28b..66c7356fa4 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -82,6 +82,7 @@ private void ConfigureContextMenu() } viewInstance!.ControlsLayoutGroup.spacing = inputData.Config.ElementsSpacing; + viewInstance!.ControlsLayoutGroup.padding = inputData.Config.VerticalLayoutPadding; viewInstance.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, totalHeight + viewInstance!.ControlsLayoutGroup.padding.bottom diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab index 36e509339c..8955e399d1 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab @@ -11,6 +11,7 @@ GameObject: - component: {fileID: 5689583333307287039} - component: {fileID: 1478214069186395182} - component: {fileID: 6260016763612421407} + - component: {fileID: 9151502442912869247} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -32,10 +33,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 5856922699228769623} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 19.099854, y: 0} - m_SizeDelta: {x: 22, y: 22} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 22} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1478214069186395182 CanvasRenderer: @@ -75,6 +76,26 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &9151502442912869247 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3280621027375879117} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 22 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &5560931233070250528 GameObject: m_ObjectHideFlags: 0 @@ -108,9 +129,9 @@ RectTransform: m_Father: {fileID: 5856922699228769623} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -11.4, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 34} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7052121060252565769 CanvasRenderer: @@ -205,7 +226,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 49.872375, y: 0, z: 0, w: 0} + m_margin: {x: 0.0022964478, y: 0, z: 0, w: 0} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 @@ -224,6 +245,7 @@ GameObject: - component: {fileID: 4151572650133112880} - component: {fileID: 4754064954679370281} - component: {fileID: 2380315831848862698} + - component: {fileID: 7506631029325872581} m_Layer: 5 m_Name: ButtonWithTextAndIcon m_TagString: Untagged @@ -350,3 +372,30 @@ MonoBehaviour: k__BackingField: {fileID: 4754064954679370281} k__BackingField: {fileID: 8655627310085805794} k__BackingField: {fileID: 6260016763612421407} + k__BackingField: {fileID: 7506631029325872581} +--- !u!114 &7506631029325872581 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6449720775875921457} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 7 + m_Right: 7 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 3 + m_Spacing: 8 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab index 92f00b29aa..8963e3f909 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab @@ -219,7 +219,7 @@ MonoBehaviour: m_Spacing: 1 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 - m_ChildControlWidth: 0 + m_ChildControlWidth: 1 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab index cfc5e3dcfb..09faa4009f 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab @@ -12,6 +12,7 @@ GameObject: - component: {fileID: 583917151655658426} - component: {fileID: 39844814625538630} - component: {fileID: 8471297342254466779} + - component: {fileID: 4847806888979574716} m_Layer: 5 m_Name: Separator m_TagString: Untagged @@ -59,8 +60,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 83940472056b404bb53ff806ae8bb4bc, type: 3} m_Name: m_EditorClassIdentifier: - k__BackingField: {fileID: 8471297342254466779} k__BackingField: {fileID: 8849643100579995022} + k__BackingField: {fileID: 4847806888979574716} + k__BackingField: {fileID: 8471297342254466779} --- !u!114 &8471297342254466779 MonoBehaviour: m_ObjectHideFlags: 0 @@ -81,6 +83,32 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 +--- !u!114 &4847806888979574716 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 37667019366274743} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 8 + m_Right: 8 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 3 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 --- !u!1 &5532609801677578509 GameObject: m_ObjectHideFlags: 0 @@ -113,8 +141,8 @@ RectTransform: m_Children: [] m_Father: {fileID: 8849643100579995022} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 1, y: 0.5} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 1} m_Pivot: {x: 0.5, y: 0.5} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab index 91be3f80f3..7008072938 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab @@ -12,6 +12,7 @@ GameObject: - component: {fileID: 4905401340599041321} - component: {fileID: 2548270455446298190} - component: {fileID: 7162056934107790529} + - component: {fileID: 6983794906705303621} m_Layer: 5 m_Name: ToggleWithText m_TagString: Untagged @@ -93,6 +94,33 @@ MonoBehaviour: k__BackingField: {fileID: 891560713975722788} k__BackingField: {fileID: 3675667337910807093} k__BackingField: {fileID: 7042733739484598958} + k__BackingField: {fileID: 6983794906705303621} +--- !u!114 &6983794906705303621 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582679870921041373} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 7 + m_Right: 7 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 3 + m_Spacing: 8 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 --- !u!1 &4204936758877281454 GameObject: m_ObjectHideFlags: 0 @@ -126,9 +154,9 @@ RectTransform: m_Father: {fileID: 891560713975722788} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -7.8, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 34} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8033074215218235640 CanvasRenderer: @@ -223,7 +251,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 17.085876, y: 0, z: 0.9236145, w: 0.46179962} + m_margin: {x: -0.011375427, y: 0, z: 0.122177124, w: 0.46179962} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 @@ -251,23 +279,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} propertyPath: m_AnchorMax.x - value: 0.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} propertyPath: m_AnchorMax.y - value: 0.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} propertyPath: m_AnchorMin.x - value: 0.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} propertyPath: m_AnchorMin.y - value: 0.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} propertyPath: m_SizeDelta.x - value: 32 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} propertyPath: m_SizeDelta.y @@ -303,7 +331,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} propertyPath: m_AnchoredPosition.x - value: 74.4 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} propertyPath: m_AnchoredPosition.y @@ -340,19 +368,47 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 7225474628005434785, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + insertIndex: -1 + addedObject: {fileID: 4331704739465187971} m_SourcePrefab: {fileID: 100100000, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} --- !u!114 &3675667337910807093 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 977034302134673057, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} m_PrefabInstance: {fileID: 4507408873941251220} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 6542466477384704309} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 822ef88491b0c4b3982153e7574be1fa, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &6542466477384704309 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7225474628005434785, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} + m_PrefabInstance: {fileID: 4507408873941251220} + m_PrefabAsset: {fileID: 0} +--- !u!114 &4331704739465187971 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6542466477384704309} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 32 + m_PreferredHeight: 18 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!224 &7210190615658038846 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 6521834947971461802, guid: 6a387e1548b1545319b57f5a417160aa, type: 3} From d73b1cc3e8734c2a560c518481abcac2b094ea0d Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Tue, 7 Jan 2025 18:36:28 +0100 Subject: [PATCH 22/36] fix reel gallery context menu behavior --- .../CameraReelGallery/Components/OptionButtonController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs index 61be6ba89c..4f620a4d88 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs @@ -82,7 +82,11 @@ private void OnOptionClicked() mvcManager.ShowAsync(GenericContextMenuController.IssueCommand( new GenericContextMenuParameter(contextMenuConfig, controlsActions, buttonRectTransform.position, actionOnShow: () => isContextMenuOpen = true, - actionOnHide: () => isContextMenuOpen = false, + actionOnHide: () => + { + isContextMenuOpen = false; + HideControl(); + }, closeTask: closeContextMenuTask?.Task, initialValues: initialValues))); } From 2bb9953ed718cee6c8f4003ebae6c003b092cd4d Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Tue, 7 Jan 2025 18:51:50 +0100 Subject: [PATCH 23/36] removed unused import --- .../Controls/Configs/GenericContextMenuConfig.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs index 8df5c7dc3e..b45277ba2f 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using UnityEngine; -using UnityEngine.Serialization; namespace DCL.UI.GenericContextMenu.Controls.Configs { From 660b442ee31b80b57324aa0becf6a30a3e245a7e Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Wed, 8 Jan 2025 12:43:49 +0100 Subject: [PATCH 24/36] ported camera reel gallery context menu to new generic architecture --- .../ExplorePanel/Assets/ExplorePanelUI.prefab | 50 +- .../Assets/CameraReel.prefab | 252 +-- .../Assets/ContextMenu.prefab | 1791 ----------------- .../Assets/ContextMenu.prefab.meta | 7 - .../Assets/ContextMenuSO/CopyLinkConfig.asset | 7 + .../Assets/ContextMenuSO/DeleteConfig.asset | 7 + .../Assets/ContextMenuSO/DownloadConfig.asset | 7 + .../ReelGalleryContextMenuConfig.asset | 6 + .../ContextMenuSO/SetAsPublicConfig.asset | 7 + .../Assets/ContextMenuSO/ShareOnXConfig.asset | 7 + .../CameraReelGalleryController.cs | 3 +- .../CameraReelGallery/CameraReelView.cs | 1 - .../Components/ContextMenuController.cs | 171 -- .../Components/ContextMenuController.cs.meta | 3 - .../Components/ContextMenuView.cs | 21 - .../Components/ContextMenuView.cs.meta | 3 - .../PluginSystem/Global/ExplorePanelPlugin.cs | 2 +- 17 files changed, 69 insertions(+), 2276 deletions(-) delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuController.cs delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuController.cs.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuView.cs delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuView.cs.meta diff --git a/Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab b/Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab index 085cd12800..184e07f94d 100644 --- a/Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab +++ b/Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab @@ -1965,23 +1965,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 20 + value: 0 objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.x - value: 85.770004 + value: 0 objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 452888844655872247, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y @@ -2689,19 +2689,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4355553488569849823, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4355553488569849823, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4355553488569849823, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 24 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4355553488569849823, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4392543827313620798, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_PresetInfoIsWorld @@ -2949,23 +2949,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 32.11 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.x - value: 113.825005 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6206568137154906387, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y @@ -3165,23 +3165,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 10 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.x - value: 68.770004 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7879708898242044120, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y @@ -3297,23 +3297,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 35.77 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.x - value: 26 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 9086857670890158988, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.x @@ -9043,7 +9043,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8968749121595387193, guid: 56d4550f784694f7a89e739437f9ca7a, type: 3} propertyPath: m_Size - value: 1 + value: 0.99999994 objectReference: {fileID: 0} - target: {fileID: 9095025335429269016, guid: 56d4550f784694f7a89e739437f9ca7a, type: 3} propertyPath: m_AnchorMax.y diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab index ae390894b4..d37ecfef14 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab @@ -599,7 +599,6 @@ RectTransform: - {fileID: 7272444036869642788} - {fileID: 1251018259287073913} - {fileID: 213375767772556615} - - {fileID: 8183293030925317648} m_Father: {fileID: 4233407933185336058} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -1122,7 +1121,7 @@ MonoBehaviour: k__BackingField: {fileID: 6326828515697139143} k__BackingField: 0.3 k__BackingField: {fileID: 3243249746742492487} - k__BackingField: {fileID: 2907236184025088760} + k__BackingField: {fileID: 0} k__BackingField: {fileID: 3847227160490674318} k__BackingField: {fileID: 4907642448593202628} --- !u!225 &2374670453255527950 @@ -1480,255 +1479,6 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1001 &3226858321448410529 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 7600482305893780570} - m_Modifications: - - target: {fileID: 917359636009044144, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_Name - value: ContextMenu - objectReference: {fileID: 0} - - target: {fileID: 917359636009044144, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1435592614438302178, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1435592614438302178, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1435592614438302178, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 93 - objectReference: {fileID: 0} - - target: {fileID: 1435592614438302178, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: -140 - objectReference: {fileID: 0} - - target: {fileID: 3837476989312074693, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3837476989312074693, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3837476989312074693, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 178 - objectReference: {fileID: 0} - - target: {fileID: 3837476989312074693, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: -45 - objectReference: {fileID: 0} - - target: {fileID: 5024033747866302706, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5024033747866302706, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5024033747866302706, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 93 - objectReference: {fileID: 0} - - target: {fileID: 5024033747866302706, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: -175 - objectReference: {fileID: 0} - - target: {fileID: 5265644956865833266, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5265644956865833266, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5265644956865833266, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 178 - objectReference: {fileID: 0} - - target: {fileID: 5265644956865833266, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: -39 - objectReference: {fileID: 0} - - target: {fileID: 5448123382622785344, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5448123382622785344, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5448123382622785344, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 178 - objectReference: {fileID: 0} - - target: {fileID: 5448123382622785344, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: -47 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_Pivot.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_Pivot.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6953358313008442297, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6953358313008442297, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6953358313008442297, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 93 - objectReference: {fileID: 0} - - target: {fileID: 6953358313008442297, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: -21 - objectReference: {fileID: 0} - - target: {fileID: 6960825954358028589, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_SizeDelta.y - value: 204 - objectReference: {fileID: 0} - - target: {fileID: 7373416871451464613, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7373416871451464613, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7373416871451464613, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 93 - objectReference: {fileID: 0} - - target: {fileID: 7373416871451464613, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: -70 - objectReference: {fileID: 0} - - target: {fileID: 8942640797296534233, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8942640797296534233, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8942640797296534233, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.x - value: 93 - objectReference: {fileID: 0} - - target: {fileID: 8942640797296534233, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - propertyPath: m_AnchoredPosition.y - value: -105 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} ---- !u!114 &2907236184025088760 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 328913869957783385, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - m_PrefabInstance: {fileID: 3226858321448410529} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 58b1fc19b24a44a6b396c5e2bc396814, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!224 &8183293030925317648 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 6726406609788578737, guid: 2aec6b833bfbc4fa6945789c985bcbab, type: 3} - m_PrefabInstance: {fileID: 3226858321448410529} - m_PrefabAsset: {fileID: 0} --- !u!1001 &4880803577921534565 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab deleted file mode 100644 index 9459cb19d8..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab +++ /dev/null @@ -1,1791 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &153593676684821910 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 9109166007022972366} - - component: {fileID: 6804856598700196751} - - component: {fileID: 3829981538101240825} - m_Layer: 5 - m_Name: Text (TMP) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &9109166007022972366 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 153593676684821910} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1435592614438302178} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -11.4001465, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &6804856598700196751 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 153593676684821910} - m_CullTransparentMesh: 1 ---- !u!114 &3829981538101240825 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 153593676684821910} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Download - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 0 - m_ActiveFontFeatures: 6e72656b - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_EmojiFallbackSupport: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 49.872375, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &241600355069304941 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6960825954358028589} - - component: {fileID: 3777217613826233392} - - component: {fileID: 5212247865599549420} - - component: {fileID: 7107330329049305308} - - component: {fileID: 6482225385952010237} - m_Layer: 5 - m_Name: Controls - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6960825954358028589 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 241600355069304941} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 6953358313008442297} - - {fileID: 5265644956865833266} - - {fileID: 3837476989312074693} - - {fileID: 5448123382622785344} - - {fileID: 7373416871451464613} - - {fileID: 8942640797296534233} - - {fileID: 1435592614438302178} - - {fileID: 5024033747866302706} - m_Father: {fileID: 6726406609788578737} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 93, y: -101} - m_SizeDelta: {x: 186, y: 204} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &3777217613826233392 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 241600355069304941} - m_CullTransparentMesh: 1 ---- !u!114 &5212247865599549420 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 241600355069304941} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 14d01e642387749e482a6f14133c57b8, type: 3} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 2 ---- !u!114 &7107330329049305308 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 241600355069304941} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 4 - m_Bottom: 12 - m_ChildAlignment: 1 - m_Spacing: 1 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 1 - m_ChildControlWidth: 0 - m_ChildControlHeight: 0 - m_ChildScaleWidth: 0 - m_ChildScaleHeight: 0 - m_ReverseArrangement: 0 ---- !u!114 &6482225385952010237 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 241600355069304941} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalFit: 0 - m_VerticalFit: 2 ---- !u!1 &917359636009044144 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6726406609788578737} - - component: {fileID: 8846635303853992875} - - component: {fileID: 328913869957783385} - m_Layer: 5 - m_Name: ContextMenu - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &6726406609788578737 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 917359636009044144} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 1938189212626645348} - - {fileID: 6960825954358028589} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 1, y: 1} ---- !u!222 &8846635303853992875 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 917359636009044144} - m_CullTransparentMesh: 1 ---- !u!114 &328913869957783385 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 917359636009044144} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 58b1fc19b24a44a6b396c5e2bc396814, type: 3} - m_Name: - m_EditorClassIdentifier: - k__BackingField: {fileID: 6270000119972004024} - k__BackingField: {fileID: 241600355069304941} - k__BackingField: {fileID: 4285643018510730201} - k__BackingField: {fileID: 8569663302546971867} - k__BackingField: {fileID: 9172762623700419208} - k__BackingField: {fileID: 8912886943391370634} - k__BackingField: {fileID: 6705755724379186506} - k__BackingField: {x: 14, y: 18, z: 0} ---- !u!1 &1106820289145627350 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1938189212626645348} - - component: {fileID: 6270000119972004024} - - component: {fileID: 6665054181960399046} - - component: {fileID: 4788943020835295078} - m_Layer: 5 - m_Name: BackgroundButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1938189212626645348 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1106820289145627350} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 6726406609788578737} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &6270000119972004024 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1106820289145627350} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 4788943020835295078} - m_OnClick: - m_PersistentCalls: - m_Calls: [] ---- !u!222 &6665054181960399046 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1106820289145627350} - m_CullTransparentMesh: 1 ---- !u!114 &4788943020835295078 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1106820289145627350} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &1187598748905023893 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5448123382622785344} - - component: {fileID: 3832929446152871985} - - component: {fileID: 957929112920025232} - m_Layer: 5 - m_Name: EmptyDiv - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &5448123382622785344 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1187598748905023893} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 6960825954358028589} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 178, y: -47} - m_SizeDelta: {x: 170, y: 5} - m_Pivot: {x: 1, y: 1} ---- !u!222 &3832929446152871985 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1187598748905023893} - m_CullTransparentMesh: 1 ---- !u!114 &957929112920025232 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1187598748905023893} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &3005944233306849445 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1435592614438302178} - - component: {fileID: 2557053734556770132} - - component: {fileID: 7834040903522321089} - - component: {fileID: 8912886943391370634} - m_Layer: 5 - m_Name: Download - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1435592614438302178 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3005944233306849445} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 1301806229976265455} - - {fileID: 9109166007022972366} - m_Father: {fileID: 6960825954358028589} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 93, y: -140} - m_SizeDelta: {x: 170, y: 34} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2557053734556770132 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3005944233306849445} - m_CullTransparentMesh: 1 ---- !u!114 &7834040903522321089 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3005944233306849445} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 12dd1efc4e826764f9b02be515a9a033, type: 3} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 2.2 ---- !u!114 &8912886943391370634 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3005944233306849445} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_HighlightedColor: {r: 0.2627451, g: 0.2509804, b: 0.2901961, a: 1} - m_PressedColor: {r: 0, g: 0, b: 0, a: 1} - m_SelectedColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_DisabledColor: {r: 0.5176471, g: 0.5176471, b: 0.5176471, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 7834040903522321089} - m_OnClick: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &3873125813820455679 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1301806229976265455} - - component: {fileID: 324485778412375441} - - component: {fileID: 8136513671600662607} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1301806229976265455 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3873125813820455679} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1435592614438302178} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 19.099854, y: 0} - m_SizeDelta: {x: 22, y: 22} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &324485778412375441 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3873125813820455679} - m_CullTransparentMesh: 1 ---- !u!114 &8136513671600662607 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3873125813820455679} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 7c1ba996ae79c4993b1c434f833c4084, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &4165917075229900878 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7636837300239362868} - - component: {fileID: 7070978168207325360} - - component: {fileID: 6464200172032130531} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &7636837300239362868 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4165917075229900878} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 5024033747866302706} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 19.099854, y: 0} - m_SizeDelta: {x: 22, y: 22} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &7070978168207325360 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4165917075229900878} - m_CullTransparentMesh: 1 ---- !u!114 &6464200172032130531 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4165917075229900878} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: ac4ebefc5fac7475ba19ac778feacfa8, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &4847586579564556279 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5024033747866302706} - - component: {fileID: 8335063636545434758} - - component: {fileID: 2847469768833753061} - - component: {fileID: 6705755724379186506} - m_Layer: 5 - m_Name: Delete - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &5024033747866302706 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4847586579564556279} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 7636837300239362868} - - {fileID: 6944871212798502140} - m_Father: {fileID: 6960825954358028589} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 93, y: -175} - m_SizeDelta: {x: 170, y: 34} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &8335063636545434758 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4847586579564556279} - m_CullTransparentMesh: 1 ---- !u!114 &2847469768833753061 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4847586579564556279} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 12dd1efc4e826764f9b02be515a9a033, type: 3} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 2.2 ---- !u!114 &6705755724379186506 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4847586579564556279} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_HighlightedColor: {r: 0.2627451, g: 0.2509804, b: 0.2901961, a: 1} - m_PressedColor: {r: 0, g: 0, b: 0, a: 1} - m_SelectedColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_DisabledColor: {r: 0.5176471, g: 0.5176471, b: 0.5176471, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2847469768833753061} - m_OnClick: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &4872399709113216962 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8781575534993125610} - - component: {fileID: 7550723613670819039} - - component: {fileID: 5564698440495501558} - m_Layer: 5 - m_Name: Text (TMP) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &8781575534993125610 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4872399709113216962} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 8942640797296534233} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -11.4001465, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &7550723613670819039 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4872399709113216962} - m_CullTransparentMesh: 1 ---- !u!114 &5564698440495501558 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4872399709113216962} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Copy Link - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 0 - m_ActiveFontFeatures: 6e72656b - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_EmojiFallbackSupport: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 49.872375, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &6170344280183481015 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5265644956865833266} - - component: {fileID: 5528744821385994656} - - component: {fileID: 1311081189620797229} - m_Layer: 5 - m_Name: EmptyDiv - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &5265644956865833266 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6170344280183481015} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 6960825954358028589} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 178, y: -39} - m_SizeDelta: {x: 170, y: 5} - m_Pivot: {x: 1, y: 1} ---- !u!222 &5528744821385994656 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6170344280183481015} - m_CullTransparentMesh: 1 ---- !u!114 &1311081189620797229 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6170344280183481015} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &7230772624285820676 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7307299007369133304} - - component: {fileID: 2473259701612753141} - - component: {fileID: 6791961596621133630} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &7307299007369133304 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7230772624285820676} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 8942640797296534233} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.5} - m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 19.099854, y: 0} - m_SizeDelta: {x: 22, y: 22} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2473259701612753141 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7230772624285820676} - m_CullTransparentMesh: 1 ---- !u!114 &6791961596621133630 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7230772624285820676} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 3bffb1589fb814c70b23fbce43ba6736, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!1 &7562641137747796985 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6944871212798502140} - - component: {fileID: 2849153206787035192} - - component: {fileID: 2967499417837278662} - m_Layer: 5 - m_Name: Text (TMP) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6944871212798502140 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7562641137747796985} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 5024033747866302706} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -11.4001465, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2849153206787035192 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7562641137747796985} - m_CullTransparentMesh: 1 ---- !u!114 &2967499417837278662 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7562641137747796985} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Delete - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 14 - m_fontSizeBase: 14 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 0 - m_ActiveFontFeatures: 6e72656b - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_EmojiFallbackSupport: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 49.872375, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &8824995693078906424 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8942640797296534233} - - component: {fileID: 3636992482128772401} - - component: {fileID: 8940596167260727821} - - component: {fileID: 9172762623700419208} - m_Layer: 5 - m_Name: CopyLink - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &8942640797296534233 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8824995693078906424} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 7307299007369133304} - - {fileID: 8781575534993125610} - m_Father: {fileID: 6960825954358028589} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 93, y: -105} - m_SizeDelta: {x: 170, y: 34} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &3636992482128772401 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8824995693078906424} - m_CullTransparentMesh: 1 ---- !u!114 &8940596167260727821 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8824995693078906424} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 12dd1efc4e826764f9b02be515a9a033, type: 3} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 2.2 ---- !u!114 &9172762623700419208 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8824995693078906424} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_HighlightedColor: {r: 0.2627451, g: 0.2509804, b: 0.2901961, a: 1} - m_PressedColor: {r: 0, g: 0, b: 0, a: 1} - m_SelectedColor: {r: 0.08627451, g: 0.08235294, b: 0.09411765, a: 1} - m_DisabledColor: {r: 0.5176471, g: 0.5176471, b: 0.5176471, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 8940596167260727821} - m_OnClick: - m_PersistentCalls: - m_Calls: [] ---- !u!1001 &3968898043218984690 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 6960825954358028589} - m_Modifications: - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_SizeDelta.x - value: 170 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_SizeDelta.y - value: 34 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_AnchoredPosition.x - value: 93 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_AnchoredPosition.y - value: -70 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6449720775875921457, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - propertyPath: m_Name - value: ShareOnX - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} ---- !u!224 &7373416871451464613 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 5856922699228769623, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - m_PrefabInstance: {fileID: 3968898043218984690} - m_PrefabAsset: {fileID: 0} ---- !u!114 &8569663302546971867 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 4754064954679370281, guid: 3c3c8d365c6ef4acfa3665168b5737a9, type: 3} - m_PrefabInstance: {fileID: 3968898043218984690} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!1001 &5733446806677757515 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 6960825954358028589} - m_Modifications: - - target: {fileID: 37667019366274743, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_Name - value: Div - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_Pivot.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_Pivot.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_SizeDelta.x - value: 170 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_SizeDelta.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_AnchoredPosition.x - value: 178 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_AnchoredPosition.y - value: -45 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} ---- !u!224 &3837476989312074693 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 8849643100579995022, guid: 52bc5c5fe83f743cdba8dab60b247e96, type: 3} - m_PrefabInstance: {fileID: 5733446806677757515} - m_PrefabAsset: {fileID: 0} ---- !u!1001 &7791296854210631837 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 6960825954358028589} - m_Modifications: - - target: {fileID: 582679870921041373, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_Name - value: SetAsPublic - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_SizeDelta.x - value: 170 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_SizeDelta.y - value: 34 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_AnchoredPosition.x - value: 93 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_AnchoredPosition.y - value: -21 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 60ec312971597448e978368a5382c0f1, type: 3} ---- !u!114 &4285643018510730201 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 6294227615655975748, guid: 60ec312971597448e978368a5382c0f1, type: 3} - m_PrefabInstance: {fileID: 7791296854210631837} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!224 &6953358313008442297 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 891560713975722788, guid: 60ec312971597448e978368a5382c0f1, type: 3} - m_PrefabInstance: {fileID: 7791296854210631837} - m_PrefabAsset: {fileID: 0} diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab.meta deleted file mode 100644 index 2116bc4e5f..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenu.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 2aec6b833bfbc4fa6945789c985bcbab -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset index cc2c09969b..aaaae500fd 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset @@ -15,3 +15,10 @@ MonoBehaviour: controlTypeType: 0 buttonText: Copy Link buttonIcon: {fileID: 21300000, guid: 3bffb1589fb814c70b23fbce43ba6736, type: 3} + horizontalLayoutPadding: + m_Left: 8 + m_Right: 8 + m_Top: 0 + m_Bottom: 0 + horizontalLayoutSpacing: 10 + horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset index 6ed05c7004..a2f3bce740 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset @@ -15,3 +15,10 @@ MonoBehaviour: controlTypeType: 0 buttonText: Delete buttonIcon: {fileID: 21300000, guid: ac4ebefc5fac7475ba19ac778feacfa8, type: 3} + horizontalLayoutPadding: + m_Left: 8 + m_Right: 8 + m_Top: 0 + m_Bottom: 0 + horizontalLayoutSpacing: 10 + horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset index 5247ec1ef8..c7f41e7d80 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset @@ -15,3 +15,10 @@ MonoBehaviour: controlTypeType: 0 buttonText: Download buttonIcon: {fileID: 21300000, guid: 7c1ba996ae79c4993b1c434f833c4084, type: 3} + horizontalLayoutPadding: + m_Left: 8 + m_Right: 8 + m_Top: 0 + m_Bottom: 0 + horizontalLayoutSpacing: 10 + horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset index af32227505..c2d18acdc3 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset @@ -21,3 +21,9 @@ MonoBehaviour: - {fileID: 11400000, guid: a1abe3dafbc2143d8949b174e3c6c235, type: 2} offsetFromTarget: {x: 11, y: 18} width: 186 + verticalLayoutPadding: + m_Left: 8 + m_Right: 8 + m_Top: 4 + m_Bottom: 12 + elementsSpacing: 1 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset index 7bc6be223b..658bb101b4 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset @@ -14,3 +14,10 @@ MonoBehaviour: m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ToggleContextMenuControlSettings controlTypeType: 1 toggleText: Set as Public + horizontalLayoutPadding: + m_Left: 8 + m_Right: 8 + m_Top: 0 + m_Bottom: 0 + horizontalLayoutSpacing: 30 + horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset index 84f42c3a6a..c0d635537a 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset @@ -15,3 +15,10 @@ MonoBehaviour: controlTypeType: 0 buttonText: Share on X buttonIcon: {fileID: 21300000, guid: 4c97cd3c67403471d8fe75c5fc348e58, type: 3} + horizontalLayoutPadding: + m_Left: 8 + m_Right: 8 + m_Top: 0 + m_Bottom: 0 + horizontalLayoutSpacing: 10 + horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs index c047d406da..de529c9b0b 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs @@ -96,7 +96,6 @@ public CameraReelGalleryController(CameraReelGalleryView view, ReelGalleryConfigParams reelGalleryConfigParams, bool useSignedRequest, OptionButtonView? optionButtonView = null, - ContextMenuView? contextMenuView = null, IWebBrowser? webBrowser = null, IDecentralandUrlsSource? decentralandUrlsSource = null, IExplorePanelEscapeAction? explorePanelEscapeAction = null, @@ -124,7 +123,7 @@ public CameraReelGalleryController(CameraReelGalleryView view, if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer) this.view.scrollRect.scrollSensitivity *= MACOS_SCROLL_SENSITIVITY_SCALE_FACTOR; - if (optionButtonView is not null && contextMenuView is not null) + if (optionButtonView is not null) { this.optionButtonController = new OptionButtonController(optionButtonView, mvcManager!, contextMenuConfig!); } diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs index 606225a851..698474124c 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs @@ -24,7 +24,6 @@ public class CameraReelView : MonoBehaviour [field: Header("Context menu")] [field: SerializeField] public OptionButtonView optionsButton { get; private set; } - [field: SerializeField] public ContextMenuView contextMenu { get; private set; } [field: Header("Animators")] [field: SerializeField] internal Animator panelAnimator { get; private set; } diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuController.cs deleted file mode 100644 index be0538538f..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuController.cs +++ /dev/null @@ -1,171 +0,0 @@ -using DCL.InWorldCamera.CameraReelStorageService.Schemas; -using System; -using UnityEngine; - -namespace DCL.InWorldCamera.CameraReelGallery.Components -{ - public class ContextMenuController : IDisposable - { - private enum ContextMenuOpenDirection - { - BOTTOM_RIGHT, - BOTTOM_LEFT, - TOP_LEFT, - TOP_RIGHT - } - - private readonly ContextMenuView view; - private readonly RectTransform controlsRectTransform; - private readonly RectTransform controlsParentRectTransform; - private readonly Rect backgroundButtonRect; - - public event Action? SetPublicRequested; - public event Action? ShareToXRequested; - public event Action? CopyPictureLinkRequested; - public event Action? DownloadRequested; - public event Action? DeletePictureRequested; - - public event Action? AnyControlClicked; - - private CameraReelResponseCompact imageData; - - public ContextMenuController(ContextMenuView view) - { - this.view = view; - - this.view.backgroundCloseButton.onClick.AddListener(Hide); - this.view.backgroundCloseButton.onClick.AddListener(() => AnyControlClicked?.Invoke()); - - this.controlsRectTransform = this.view.controlsParent.GetComponent(); - this.controlsParentRectTransform = this.view.controlsParent.transform.parent.GetComponent(); - this.backgroundButtonRect = this.view.backgroundCloseButton.GetComponent().GetWorldRect(); - - view.shareOnX.onClick.AddListener(() => - { - ShareToXRequested?.Invoke(imageData); - AnyControlClicked?.Invoke(); - }); - - view.copyLink.onClick.AddListener(() => - { - CopyPictureLinkRequested?.Invoke(imageData); - AnyControlClicked?.Invoke(); - }); - - view.download.onClick.AddListener(() => - { - DownloadRequested?.Invoke(imageData); - AnyControlClicked?.Invoke(); - }); - - view.delete.onClick.AddListener(() => - { - DeletePictureRequested?.Invoke(imageData); - AnyControlClicked?.Invoke(); - }); - } - - private void SetAsPublicInvoke(bool toggle) => - SetPublicRequested?.Invoke(imageData, toggle); - - public void Show(Vector3 anchorPosition) - { - view.gameObject.SetActive(true); - - //Align the "public" toggle status according to the imageData without triggering an "invoke" - view.setAsPublic.onValueChanged.RemoveListener(SetAsPublicInvoke); - view.setAsPublic.isOn = imageData.isPublic; - view.setAsPublic.onValueChanged.AddListener(SetAsPublicInvoke); - - controlsRectTransform.localPosition = GetControlsPosition(anchorPosition); - } - - private Vector3 GetOffsetByDirection(ContextMenuOpenDirection direction) - { - return direction switch - { - ContextMenuOpenDirection.BOTTOM_RIGHT => view.offsetFromTarget, - ContextMenuOpenDirection.BOTTOM_LEFT => new Vector3(-view.offsetFromTarget.x - controlsRectTransform.rect.width, view.offsetFromTarget.y, view.offsetFromTarget.z), - ContextMenuOpenDirection.TOP_RIGHT => new Vector3(view.offsetFromTarget.x, -view.offsetFromTarget.y + controlsRectTransform.rect.height, view.offsetFromTarget.z), - ContextMenuOpenDirection.TOP_LEFT => new Vector3(-view.offsetFromTarget.x - controlsRectTransform.rect.width, -view.offsetFromTarget.y + controlsRectTransform.rect.height, view.offsetFromTarget.z), - _ => Vector3.zero - }; - } - - private Vector3 GetControlsPosition(Vector3 anchorPosition) - { - Vector3 position = controlsParentRectTransform.InverseTransformPoint(anchorPosition); - position.x += controlsRectTransform.rect.width / 2; - position.y -= controlsRectTransform.rect.height / 2; - - Vector3 newPosition = Vector3.zero; - float minNonOverlappingArea = float.MaxValue; - foreach (ContextMenuOpenDirection enumVal in Enum.GetValues(typeof(ContextMenuOpenDirection))) - { - Vector3 currentPosition = position + GetOffsetByDirection(enumVal); - float nonOverlappingArea = CalculateNonOverlappingArea(backgroundButtonRect, GetProjectedRect(currentPosition)); - if (nonOverlappingArea < minNonOverlappingArea) - { - newPosition = currentPosition; - minNonOverlappingArea = nonOverlappingArea; - } - } - - return newPosition; - } - - private float CalculateNonOverlappingArea(Rect rect1, Rect rect2) - { - float area1 = rect1.width * rect1.height; - float area2 = rect2.width * rect2.height; - - Rect intersection = Rect.MinMaxRect( - Mathf.Max(rect1.xMin, rect2.xMin), - Mathf.Max(rect1.yMin, rect2.yMin), - Mathf.Min(rect1.xMax, rect2.xMax), - Mathf.Min(rect1.yMax, rect2.yMax) - ); - - float intersectionArea = 0; - - if (intersection is { width: > 0, height: > 0 }) - intersectionArea = intersection.width * intersection.height; - - return area1 + area2 - intersectionArea; - } - - private Rect GetProjectedRect(Vector3 newPosition) - { - Vector3 originalPosition = controlsRectTransform.localPosition; - controlsRectTransform.localPosition = newPosition; - Rect rect = controlsRectTransform.GetWorldRect(); - controlsRectTransform.localPosition = originalPosition; - - return rect; - } - - public void Hide() => - view.gameObject.SetActive(false); - - public bool IsOpen() => - view.gameObject.activeSelf; - - public void SetImageData(CameraReelResponseCompact cameraReelResponse) => - imageData = cameraReelResponse; - - public void Dispose() - { - view.backgroundCloseButton.onClick.RemoveAllListeners(); - view.setAsPublic.onValueChanged.RemoveAllListeners(); - view.shareOnX.onClick.RemoveAllListeners(); - view.copyLink.onClick.RemoveAllListeners(); - view.download.onClick.RemoveAllListeners(); - view.delete.onClick.RemoveAllListeners(); - SetPublicRequested = null; - ShareToXRequested = null; - CopyPictureLinkRequested = null; - DownloadRequested = null; - DeletePictureRequested = null; - } - } -} diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuController.cs.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuController.cs.meta deleted file mode 100644 index 1bc4778ac9..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuController.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: d166449cfd11469d89c4fbc256cd60d7 -timeCreated: 1731572453 \ No newline at end of file diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuView.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuView.cs deleted file mode 100644 index 9c3d868a39..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuView.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; - -namespace DCL.InWorldCamera.CameraReelGallery.Components -{ - public class ContextMenuView : MonoBehaviour - { - [field: SerializeField] internal Button backgroundCloseButton { get; private set; } - [field: SerializeField] internal GameObject controlsParent { get; private set; } - - [field: Header("Controls")] - [field: SerializeField] internal Toggle setAsPublic { get; private set; } - [field: SerializeField] internal Button shareOnX { get; private set; } - [field: SerializeField] internal Button copyLink { get; private set; } - [field: SerializeField] internal Button download { get; private set; } - [field: SerializeField] internal Button delete { get; private set; } - - [field: Header("Configuration")] - [field: SerializeField] internal Vector3 offsetFromTarget { get; private set; } = Vector3.zero; - } -} diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuView.cs.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuView.cs.meta deleted file mode 100644 index 8ab8944e8d..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ContextMenuView.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 58b1fc19b24a44a6b396c5e2bc396814 -timeCreated: 1731514195 \ No newline at end of file diff --git a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs index f6f77773f2..a12113887f 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs +++ b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs @@ -263,7 +263,7 @@ public async UniTask InitializeAsync(ExplorePanelSettings settings, Cancellation new CameraReelGalleryController(cameraReelView.CameraReelGalleryView, this.cameraReelStorageService, cameraReelScreenshotsStorage, new ReelGalleryConfigParams(settings.GridLayoutFixedColumnCount, settings.ThumbnailHeight, settings.ThumbnailWidth, true, true), true, - cameraReelView.optionsButton, cameraReelView.contextMenu, + cameraReelView.optionsButton, webBrowser, decentralandUrlsSource, inputHandler, systemClipboard, new ReelGalleryStringMessages(settings.CameraReelGalleryShareToXMessage, settings.PhotoSuccessfullyDeletedMessage, settings.PhotoSuccessfullyUpdatedMessage, settings.PhotoSuccessfullyDownloadedMessage, settings.LinkCopiedMessage), mvcManager, From f694ec96b51d7bdc194ea1f8ad2a48fe521eb540 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Wed, 8 Jan 2025 13:09:17 +0100 Subject: [PATCH 25/36] fix asmdef pointers --- Explorer/Assets/DCL/Passport/Passport.asmdef | 2 +- Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Explorer/Assets/DCL/Passport/Passport.asmdef b/Explorer/Assets/DCL/Passport/Passport.asmdef index 3330582b56..ad64a7a040 100644 --- a/Explorer/Assets/DCL/Passport/Passport.asmdef +++ b/Explorer/Assets/DCL/Passport/Passport.asmdef @@ -38,7 +38,7 @@ "GUID:b97826ed91484ac1af953a8afc03316e", "GUID:c6e727f7851314e679212856f4ce3e53", "GUID:fbf0e9c026d7f49dc818a0d27b9789fe", - "GenericContextMenu" + "GUID:5462d37de7d4344df8aade58a45b403e" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef b/Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef index f00240cd14..60149dc845 100644 --- a/Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef +++ b/Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef @@ -148,7 +148,7 @@ "GUID:0f5ab34acaa8744d8a22d7dc4c45a487", "GUID:134508e23dba8457db8766637d1d33ec", "GUID:fdc035e0abb695e408d8ccf2c3bd63a5", - "GenericContextMenu" + "GUID:5462d37de7d4344df8aade58a45b403e" ], "includePlatforms": [], "excludePlatforms": [], From cf7e07257903785d5e46451bc55bb7d255c84a49 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Wed, 8 Jan 2025 13:36:29 +0100 Subject: [PATCH 26/36] add required component --- .../GenericContextMenu/Controls/GenericContextMenuComponent.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs index c2061f6a35..c0f79dfb45 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs @@ -6,6 +6,7 @@ namespace DCL.UI.GenericContextMenu.Controls { [RequireComponent(typeof(RectTransform))] + [RequireComponent(typeof(HorizontalLayoutGroup))] public abstract class GenericContextMenuComponent : MonoBehaviour, IGenericContextMenuComponent { [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } From 7b56cb9497d746144eec9f758b874532a7280241 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Thu, 9 Jan 2025 09:42:47 +0100 Subject: [PATCH 27/36] changed class names --- .../CameraReelGallery/Assets/CameraReel.prefab | 3 +-- .../CameraReelGallery/CameraReelGalleryController.cs | 6 +++--- .../DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs | 2 +- ...tonController.cs => CameraReelOptionButtonController.cs} | 6 +++--- ...ler.cs.meta => CameraReelOptionButtonController.cs.meta} | 0 .../{OptionButtonView.cs => CameraReelOptionButtonView.cs} | 2 +- ...uttonView.cs.meta => CameraReelOptionButtonView.cs.meta} | 0 .../CameraReelGallery/Components/MonthGridController.cs | 2 +- .../CameraReelGallery/Components/ReelThumbnailController.cs | 4 ++-- .../Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs | 2 +- 10 files changed, 13 insertions(+), 14 deletions(-) rename Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/{OptionButtonController.cs => CameraReelOptionButtonController.cs} (95%) rename Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/{OptionButtonController.cs.meta => CameraReelOptionButtonController.cs.meta} (100%) rename Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/{OptionButtonView.cs => CameraReelOptionButtonView.cs} (76%) rename Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/{OptionButtonView.cs.meta => CameraReelOptionButtonView.cs.meta} (100%) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab index d37ecfef14..591e9d7806 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab @@ -1120,8 +1120,7 @@ MonoBehaviour: k__BackingField: {fileID: 3007147660590048626} k__BackingField: {fileID: 6326828515697139143} k__BackingField: 0.3 - k__BackingField: {fileID: 3243249746742492487} - k__BackingField: {fileID: 0} + k__BackingField: {fileID: 3243249746742492487} k__BackingField: {fileID: 3847227160490674318} k__BackingField: {fileID: 4907642448593202628} --- !u!225 &2374670453255527950 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs index 4fc9102f3a..ac4d6ae18e 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs @@ -68,7 +68,7 @@ public ReelToDeleteInfo(string id, string datetime) private readonly ReelGalleryPoolManager reelGalleryPoolManager; private readonly Dictionary monthViews = new (); private readonly Dictionary reelThumbnailCache = new (); - private readonly OptionButtonController? optionButtonController; + private readonly CameraReelOptionButtonController? optionButtonController; private readonly Rect elementMaskRect; private readonly ReelGalleryStringMessages? reelGalleryStringMessages; private readonly ReelGalleryConfigParams reelGalleryConfigParams; @@ -95,7 +95,7 @@ public CameraReelGalleryController(CameraReelGalleryView view, ICameraReelScreenshotsStorage cameraReelScreenshotsStorage, ReelGalleryConfigParams reelGalleryConfigParams, bool useSignedRequest, - OptionButtonView? optionButtonView = null, + CameraReelOptionButtonView? optionButtonView = null, IWebBrowser? webBrowser = null, IDecentralandUrlsSource? decentralandUrlsSource = null, IExplorePanelEscapeAction? explorePanelEscapeAction = null, @@ -125,7 +125,7 @@ public CameraReelGalleryController(CameraReelGalleryView view, if (optionButtonView is not null) { - this.optionButtonController = new OptionButtonController(optionButtonView, mvcManager!, contextMenuConfig!); + this.optionButtonController = new CameraReelOptionButtonController(optionButtonView, mvcManager!, contextMenuConfig!); } reelGalleryPoolManager = new ReelGalleryPoolManager(view.thumbnailViewPrefab, view.monthGridPrefab, view.unusedThumbnailViewObject, diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs index 698474124c..5144bd3d74 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelView.cs @@ -23,7 +23,7 @@ public class CameraReelView : MonoBehaviour [field: SerializeField] internal float storageFullToastFadeTime { get; private set; } = 0.3f; [field: Header("Context menu")] - [field: SerializeField] public OptionButtonView optionsButton { get; private set; } + [field: SerializeField] public CameraReelOptionButtonView CameraReelOptionsButton { get; private set; } [field: Header("Animators")] [field: SerializeField] internal Animator panelAnimator { get; private set; } diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs similarity index 95% rename from Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs rename to Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs index 4f620a4d88..4080ead87f 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs @@ -9,7 +9,7 @@ namespace DCL.InWorldCamera.CameraReelGallery.Components { - public class OptionButtonController : IDisposable + public class CameraReelOptionButtonController : IDisposable { private const int PUBLIC_CONTROL_INDEX = 0; private const int SHARE_CONTROL_INDEX = 2; @@ -17,7 +17,7 @@ public class OptionButtonController : IDisposable private const int DOWNLOAD_CONTROL_INDEX = 4; private const int DELETE_CONTROL_INDEX = 5; - private readonly OptionButtonView view; + private readonly CameraReelOptionButtonView view; private readonly RectTransform buttonRectTransform; private readonly IMVCManager mvcManager; private readonly GenericContextMenuConfig contextMenuConfig; @@ -36,7 +36,7 @@ public class OptionButtonController : IDisposable private CameraReelResponseCompact currentReelData; private UniTaskCompletionSource closeContextMenuTask; - public OptionButtonController(OptionButtonView view, + public CameraReelOptionButtonController(CameraReelOptionButtonView view, IMVCManager mvcManager, GenericContextMenuConfig contextMenuConfig) { diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs.meta similarity index 100% rename from Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs.meta rename to Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs.meta diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonView.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs similarity index 76% rename from Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonView.cs rename to Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs index 4e9d112665..0f231e0fd5 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonView.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs @@ -3,7 +3,7 @@ namespace DCL.InWorldCamera.CameraReelGallery.Components { - public class OptionButtonView : MonoBehaviour + public class CameraReelOptionButtonView : MonoBehaviour { [field: SerializeField] internal Button optionButton { get; private set; } } diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonView.cs.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs.meta similarity index 100% rename from Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonView.cs.meta rename to Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs.meta diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/MonthGridController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/MonthGridController.cs index 16fd78c389..24e9872c66 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/MonthGridController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/MonthGridController.cs @@ -24,7 +24,7 @@ public MonthGridController(MonthGridView view, public IReadOnlyList Setup(DateTime bucket, List images, - OptionButtonController? optionsButton, + CameraReelOptionButtonController? optionsButton, Action onThumbnailLoaded, Action onThumbnailClicked) { diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ReelThumbnailController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ReelThumbnailController.cs index d8c903e09c..69fe6e088d 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ReelThumbnailController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/ReelThumbnailController.cs @@ -15,7 +15,7 @@ public class ReelThumbnailController : IDisposable private readonly ICameraReelScreenshotsStorage cameraReelScreenshotsStorage; private readonly RectTransform rectTransform; - private OptionButtonController? optionButton; + private CameraReelOptionButtonController? optionButton; private CancellationTokenSource loadImageCts; private bool imageLoaded; @@ -34,7 +34,7 @@ public ReelThumbnailController(ReelThumbnailView view, this.view.PointerExit += PointerExit; } - public void Setup(CameraReelResponseCompact cameraReelData, OptionButtonController? optionsButton) + public void Setup(CameraReelResponseCompact cameraReelData, CameraReelOptionButtonController? optionsButton) { this.CameraReelResponse = cameraReelData; this.optionButton = optionsButton; diff --git a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs index a12113887f..fc4a4e7d8c 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs +++ b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs @@ -263,7 +263,7 @@ public async UniTask InitializeAsync(ExplorePanelSettings settings, Cancellation new CameraReelGalleryController(cameraReelView.CameraReelGalleryView, this.cameraReelStorageService, cameraReelScreenshotsStorage, new ReelGalleryConfigParams(settings.GridLayoutFixedColumnCount, settings.ThumbnailHeight, settings.ThumbnailWidth, true, true), true, - cameraReelView.optionsButton, + cameraReelView.CameraReelOptionsButton, webBrowser, decentralandUrlsSource, inputHandler, systemClipboard, new ReelGalleryStringMessages(settings.CameraReelGalleryShareToXMessage, settings.PhotoSuccessfullyDeletedMessage, settings.PhotoSuccessfullyUpdatedMessage, settings.PhotoSuccessfullyDownloadedMessage, settings.LinkCopiedMessage), mvcManager, From 18c2b995ae08ff7e8e217fe4cd7cc6bd1a42d261 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Thu, 9 Jan 2025 15:01:00 +0100 Subject: [PATCH 28/36] use asset references instead of indexes --- .../ExplorePanel/Assets/ExplorePanelUI.prefab | 48 +- .../Assets/CameraReel.prefab | 524 +++++++----------- .../CameraReelOptionButtonController.cs | 18 +- .../Components/CameraReelOptionButtonView.cs | 8 + 4 files changed, 228 insertions(+), 370 deletions(-) diff --git a/Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab b/Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab index 7c650c5d09..af6f094027 100644 --- a/Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab +++ b/Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab @@ -1965,23 +1965,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 20 + value: 0 objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.x - value: 85.770004 + value: 0 objectReference: {fileID: 0} - target: {fileID: 267759340061970864, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 452888844655872247, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y @@ -2689,19 +2689,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4355553488569849823, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4355553488569849823, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4355553488569849823, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 24 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4355553488569849823, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4392543827313620798, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_PresetInfoIsWorld @@ -2949,23 +2949,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 32.11 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.x - value: 113.825005 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6131980454684310232, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6206568137154906387, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y @@ -3165,23 +3165,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 10 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.x - value: 68.770004 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7820116009902200831, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7879708898242044120, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y @@ -3297,23 +3297,23 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_SizeDelta.x - value: 35.77 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.x - value: 26 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8963147552032789253, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchoredPosition.y - value: -15 + value: 0 objectReference: {fileID: 0} - target: {fileID: 9086857670890158988, guid: ad0eada9babef44e5bb3f06b080eef83, type: 3} propertyPath: m_AnchorMax.x diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab index 83d157239b..720ec9f214 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab @@ -269,8 +269,7 @@ MonoBehaviour: m_text: Gallery m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, - type: 2} + m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -701,7 +700,8 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 3988546233187951147} - m_TargetAssemblyTypeName: DCL.InWorldCamera.CameraReel.CameraReelView, CameraReel + m_TargetAssemblyTypeName: DCL.InWorldCamera.CameraReel.CameraReelView, + CameraReel m_MethodName: OnPointerEnter m_Mode: 1 m_Arguments: @@ -717,7 +717,8 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 3988546233187951147} - m_TargetAssemblyTypeName: DCL.InWorldCamera.CameraReel.CameraReelView, CameraReel + m_TargetAssemblyTypeName: DCL.InWorldCamera.CameraReel.CameraReelView, + CameraReel m_MethodName: OnPointerExit m_Mode: 1 m_Arguments: @@ -916,8 +917,7 @@ MonoBehaviour: m_text: There are no photos yet m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, - type: 2} + m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -1225,8 +1225,7 @@ MonoBehaviour: to save incredible memories with your friends! m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 35aa85d68d15435418848a03a2db81ec, type: 2} - m_sharedMaterial: {fileID: 1701868249614554837, guid: 35aa85d68d15435418848a03a2db81ec, - type: 2} + m_sharedMaterial: {fileID: 1701868249614554837, guid: 35aa85d68d15435418848a03a2db81ec, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -1411,8 +1410,7 @@ MonoBehaviour: Camera access.' m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} - m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, - type: 2} + m_sharedMaterial: {fileID: 735423033564544980, guid: 96ae0a2159a39234f858ea23bdcc74ad, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -1488,116 +1486,114 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 7600482305893780570} m_Modifications: - - target: {fileID: 4051113445585127458, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4051113445585127458, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_Name value: OptionButton objectReference: {fileID: 0} - - target: {fileID: 4051113445585127458, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4051113445585127458, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_IsActive value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_Pivot.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_Pivot.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_AnchorMax.x value: 1 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_AnchorMax.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_AnchorMin.x value: 1 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_AnchorMin.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_SizeDelta.x value: 16 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_SizeDelta.y value: 41 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_AnchoredPosition.x value: -15.839966 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_AnchoredPosition.y value: -25.799988 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} + propertyPath: k__BackingField + value: + objectReference: {fileID: 11400000, guid: db49cac2faca44598a924e1c56690e0c, type: 2} + - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} + propertyPath: k__BackingField + value: + objectReference: {fileID: 11400000, guid: 5c0c78cadc79d4af0815be75aa67b027, type: 2} + - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} + propertyPath: k__BackingField + value: + objectReference: {fileID: 11400000, guid: a1abe3dafbc2143d8949b174e3c6c235, type: 2} + - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} + propertyPath: k__BackingField + value: + objectReference: {fileID: 11400000, guid: 63b9ee24ad69145e9becb7da653bdb4a, type: 2} + - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} + propertyPath: k__BackingField + value: + objectReference: {fileID: 11400000, guid: 3ad489cd996154c1cad21a0856ed86bc, type: 2} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -1605,14 +1601,12 @@ PrefabInstance: m_SourcePrefab: {fileID: 100100000, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} --- !u!224 &213375767772556615 stripped RectTransform: - m_CorrespondingSourceObject: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + m_CorrespondingSourceObject: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} m_PrefabInstance: {fileID: 4880803577921534565} m_PrefabAsset: {fileID: 0} --- !u!114 &3243249746742492487 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, - type: 3} + m_CorrespondingSourceObject: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} m_PrefabInstance: {fileID: 4880803577921534565} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} @@ -1629,314 +1623,251 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 7600482305893780570} m_Modifications: - - target: {fileID: 82416765707789990, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 82416765707789990, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 82416765707789990, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 82416765707789990, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 82416765707789990, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 82416765707789990, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 82416765707789990, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 82416765707789990, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_SizeDelta.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Pivot.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Pivot.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.x value: 1 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMin.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_SizeDelta.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 1222848717167653732, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 1222848717167653732, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1222848717167653732, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 1222848717167653732, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_SizeDelta.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1348563079485151301, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 1348563079485151301, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Size value: 1 objectReference: {fileID: 0} - - target: {fileID: 2017588044618821606, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 2017588044618821606, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 2017588044618821606, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 2017588044618821606, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 2207382435968079271, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 2207382435968079271, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_SizeDelta.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2732301325727209105, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 2732301325727209105, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Sprite value: - objectReference: {fileID: 21300000, guid: 3511e442bc30148ee990f816a8fbf595, - type: 3} - - target: {fileID: 2732301325727209105, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + objectReference: {fileID: 21300000, guid: 3511e442bc30148ee990f816a8fbf595, type: 3} + - target: {fileID: 2732301325727209105, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_PixelsPerUnitMultiplier value: 2 objectReference: {fileID: 0} - - target: {fileID: 2977760952838749573, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 2977760952838749573, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 3189630940838969984, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3189630940838969984, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 3189630940838969984, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3189630940838969984, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_NormalColor.a value: 1 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_NormalColor.b value: 1 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_NormalColor.g value: 1 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_NormalColor.r value: 1 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_SelectedColor.b value: 1 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_SelectedColor.g value: 1 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_SelectedColor.r value: 1 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_HighlightedColor.b value: 0.9882353 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_HighlightedColor.g value: 0.9882353 objectReference: {fileID: 0} - - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 3636608111683699458, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Colors.m_HighlightedColor.r value: 0.9882353 objectReference: {fileID: 0} - - target: {fileID: 4034794011650801746, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4034794011650801746, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_SizeDelta.y value: -8 objectReference: {fileID: 0} - - target: {fileID: 4034794011650801746, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4034794011650801746, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: emptyState value: objectReference: {fileID: 8905698767790674638} - - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: elementMask value: objectReference: {fileID: 2288520811973442059} - - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: errorNotificationView value: objectReference: {fileID: 3334231101523510230} - - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: cameraReelToastMessage value: objectReference: {fileID: 3784594265100022905} - - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: successNotificationView value: objectReference: {fileID: 2752032496125254721} - - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: k__BackingField value: objectReference: {fileID: 8905698767790674638} - - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: k__BackingField value: objectReference: {fileID: 2288520811973442059} - - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: k__BackingField value: objectReference: {fileID: 3784594265100022905} - - target: {fileID: 5218057066178112453, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 5218057066178112453, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5218057066178112453, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 5218057066178112453, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6526360350117164228, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 6526360350117164228, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Name value: CameraReelGallery objectReference: {fileID: 0} - - target: {fileID: 6526360350117164228, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 6526360350117164228, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 9111658648430937670, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 9111658648430937670, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Padding.m_Top value: 30 objectReference: {fileID: 0} - - target: {fileID: 9111658648430937670, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 9111658648430937670, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Padding.m_Left value: 30 objectReference: {fileID: 0} - - target: {fileID: 9111658648430937670, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + - target: {fileID: 9111658648430937670, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} propertyPath: m_Padding.m_Bottom value: 30 objectReference: {fileID: 0} @@ -1947,8 +1878,7 @@ PrefabInstance: m_SourcePrefab: {fileID: 100100000, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} --- !u!114 &6326828515697139143 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + m_CorrespondingSourceObject: {fileID: 4110944459725859003, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} m_PrefabInstance: {fileID: 7980496423896577404} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} @@ -1959,8 +1889,7 @@ MonoBehaviour: m_EditorClassIdentifier: --- !u!224 &7272444036869642788 stripped RectTransform: - m_CorrespondingSourceObject: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, - type: 3} + m_CorrespondingSourceObject: {fileID: 733104209777700696, guid: ade6e83ad45fc4c7e81daa5a6e0f7bab, type: 3} m_PrefabInstance: {fileID: 7980496423896577404} m_PrefabAsset: {fileID: 0} --- !u!1001 &8018665343577164319 @@ -1971,213 +1900,171 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 7089919813109021726} m_Modifications: - - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 3818669314171149728, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4298821328858515220, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 4298821328858515220, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_Pivot.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_Pivot.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMax.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMax.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMin.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMin.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_SizeDelta.x value: 100 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_SizeDelta.y value: 100 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7128017764798322014, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7205955764813336134, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7205955764813336134, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_Name value: CameraReelToastMessage objectReference: {fileID: 0} - - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7251593552360608895, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + - target: {fileID: 7452968672632771285, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} @@ -2188,8 +2075,7 @@ PrefabInstance: m_SourcePrefab: {fileID: 100100000, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} --- !u!114 &2752032496125254721 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 5294310512652686942, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + m_CorrespondingSourceObject: {fileID: 5294310512652686942, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} m_PrefabInstance: {fileID: 8018665343577164319} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} @@ -2200,8 +2086,7 @@ MonoBehaviour: m_EditorClassIdentifier: --- !u!114 &3334231101523510230 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 4687565653496383945, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + m_CorrespondingSourceObject: {fileID: 4687565653496383945, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} m_PrefabInstance: {fileID: 8018665343577164319} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} @@ -2212,14 +2097,12 @@ MonoBehaviour: m_EditorClassIdentifier: --- !u!224 &3602592284197316570 stripped RectTransform: - m_CorrespondingSourceObject: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + m_CorrespondingSourceObject: {fileID: 6824922924571684293, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} m_PrefabInstance: {fileID: 8018665343577164319} m_PrefabAsset: {fileID: 0} --- !u!114 &3784594265100022905 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 6615103731004571238, guid: d3c7651cfc8ca4aa5a94d5502e133d78, - type: 3} + m_CorrespondingSourceObject: {fileID: 6615103731004571238, guid: d3c7651cfc8ca4aa5a94d5502e133d78, type: 3} m_PrefabInstance: {fileID: 8018665343577164319} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} @@ -2236,128 +2119,103 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 7089919813109021726} m_Modifications: - - target: {fileID: 1598000652067421378, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 1598000652067421378, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_text value: Storage -/- photos taken objectReference: {fileID: 0} - - target: {fileID: 3924920385296817262, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 3924920385296817262, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: value value: 38.7 objectReference: {fileID: 0} - - target: {fileID: 3924920385296817262, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 3924920385296817262, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: valuePercentage value: 10.2 objectReference: {fileID: 0} - - target: {fileID: 4461350349728300166, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 4461350349728300166, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_SizeDelta.x value: 24.48 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_Pivot.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_Pivot.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_AnchorMax.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_AnchorMax.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_AnchorMin.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_AnchorMin.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_SizeDelta.x value: 240 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_SizeDelta.y value: 34 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_AnchoredPosition.x value: 285 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_AnchoredPosition.y value: -33 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 9206749887786283819, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + - target: {fileID: 9206749887786283819, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} propertyPath: m_Name value: StorageProgressBar objectReference: {fileID: 0} @@ -2368,14 +2226,12 @@ PrefabInstance: m_SourcePrefab: {fileID: 100100000, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} --- !u!224 &4470011579181005172 stripped RectTransform: - m_CorrespondingSourceObject: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + m_CorrespondingSourceObject: {fileID: 5877137106279555878, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} m_PrefabInstance: {fileID: 8036500732720454226} m_PrefabAsset: {fileID: 0} --- !u!114 &6485039005606233660 stripped MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 3924920385296817262, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, - type: 3} + m_CorrespondingSourceObject: {fileID: 3924920385296817262, guid: 68b03dc4c47f84e90acebbf0ff5eea2f, type: 3} m_PrefabInstance: {fileID: 8036500732720454226} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs index 4080ead87f..f7a3cb21d3 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs @@ -11,12 +11,6 @@ namespace DCL.InWorldCamera.CameraReelGallery.Components { public class CameraReelOptionButtonController : IDisposable { - private const int PUBLIC_CONTROL_INDEX = 0; - private const int SHARE_CONTROL_INDEX = 2; - private const int COPY_CONTROL_INDEX = 3; - private const int DOWNLOAD_CONTROL_INDEX = 4; - private const int DELETE_CONTROL_INDEX = 5; - private readonly CameraReelOptionButtonView view; private readonly RectTransform buttonRectTransform; private readonly IMVCManager mvcManager; @@ -49,11 +43,11 @@ public CameraReelOptionButtonController(CameraReelOptionButtonView view, controlsActions = new () { - { contextMenuConfig.ContextMenuSettings[PUBLIC_CONTROL_INDEX], new Action(toggleValue => SetPublicRequested?.Invoke(currentReelData, toggleValue)) }, - { contextMenuConfig.ContextMenuSettings[SHARE_CONTROL_INDEX], new Action(() => ShareToXRequested?.Invoke(currentReelData)) }, - { contextMenuConfig.ContextMenuSettings[COPY_CONTROL_INDEX], new Action(() => CopyPictureLinkRequested?.Invoke(currentReelData)) }, - { contextMenuConfig.ContextMenuSettings[DOWNLOAD_CONTROL_INDEX], new Action(() => DownloadRequested?.Invoke(currentReelData)) }, - { contextMenuConfig.ContextMenuSettings[DELETE_CONTROL_INDEX], new Action(() => DeletePictureRequested?.Invoke(currentReelData)) }, + { this.view.publicControl, new Action(toggleValue => SetPublicRequested?.Invoke(currentReelData, toggleValue)) }, + { this.view.shareControl, new Action(() => ShareToXRequested?.Invoke(currentReelData)) }, + { this.view.copyControl, new Action(() => CopyPictureLinkRequested?.Invoke(currentReelData)) }, + { this.view.downloadControl, new Action(() => DownloadRequested?.Invoke(currentReelData)) }, + { this.view.deleteControl, new Action(() => DeletePictureRequested?.Invoke(currentReelData)) }, }; } @@ -65,7 +59,7 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, view.transform.localPosition = offsetPosition; view.gameObject.SetActive(true); currentReelData = cameraReelResponse; - initialValues[contextMenuConfig.ContextMenuSettings[PUBLIC_CONTROL_INDEX]] = cameraReelResponse.isPublic; + initialValues[view.publicControl] = cameraReelResponse.isPublic; closeContextMenuTask = new UniTaskCompletionSource(); } diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs index 0f231e0fd5..8da0c5671c 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs @@ -1,3 +1,4 @@ +using DCL.UI.GenericContextMenu.Controls.Configs; using UnityEngine; using UnityEngine.UI; @@ -6,5 +7,12 @@ namespace DCL.InWorldCamera.CameraReelGallery.Components public class CameraReelOptionButtonView : MonoBehaviour { [field: SerializeField] internal Button optionButton { get; private set; } + + [field: Header("Context menu settings")] + [field: SerializeField] internal ContextMenuControlSettings publicControl { get; private set; } + [field: SerializeField] internal ContextMenuControlSettings shareControl { get; private set; } + [field: SerializeField] internal ContextMenuControlSettings copyControl { get; private set; } + [field: SerializeField] internal ContextMenuControlSettings downloadControl { get; private set; } + [field: SerializeField] internal ContextMenuControlSettings deleteControl { get; private set; } } } From 8b49855faf579a054539f3a592fc275c8de374b2 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Fri, 10 Jan 2025 15:00:45 +0100 Subject: [PATCH 29/36] added generic types for component configure method --- .../GenericContextMenuButtonWithTextView.cs | 15 +++--- .../Controls/GenericContextMenuComponent.cs | 18 +------ .../GenericContextMenuComponentBase.cs | 20 ++++++++ .../GenericContextMenuComponentBase.cs.meta | 3 ++ .../GenericContextMenuSeparatorView.cs | 15 +++--- .../Controls/GenericContextMenuToggleView.cs | 13 +++-- .../Controls/IGenericContextMenuComponent.cs | 13 ----- .../IGenericContextMenuComponent.cs.meta | 3 -- .../GenericContextMenu/ControlsPoolManager.cs | 47 ++++++++++++++----- .../GenericContextMenuController.cs | 2 +- 10 files changed, 81 insertions(+), 68 deletions(-) create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs.meta delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs.meta diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index 5ab806f7d8..2751d7ae40 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -7,20 +7,19 @@ namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuButtonWithTextView : GenericContextMenuComponent + public class GenericContextMenuButtonWithTextView : GenericContextMenuComponent { [field: SerializeField] public Button ButtonComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } [field: SerializeField] public Image ImageComponent { get; private set; } - public override void Configure(ContextMenuControlSettings settings, object initialValue) + public override void Configure(ButtonContextMenuControlSettings settings, object initialValue) { - ButtonContextMenuControlSettings buttonSettings = settings as ButtonContextMenuControlSettings; - TextComponent.SetText(buttonSettings!.ButtonText); - ImageComponent.sprite = buttonSettings.ButtonIcon; - HorizontalLayoutComponent.padding = buttonSettings.HorizontalLayoutPadding; - HorizontalLayoutComponent.spacing = buttonSettings.HorizontalLayoutSpacing; - HorizontalLayoutComponent.reverseArrangement = buttonSettings.HorizontalLayoutReverseArrangement; + TextComponent.SetText(settings!.ButtonText); + ImageComponent.sprite = settings.ButtonIcon; + HorizontalLayoutComponent.padding = settings.HorizontalLayoutPadding; + HorizontalLayoutComponent.spacing = settings.HorizontalLayoutSpacing; + HorizontalLayoutComponent.reverseArrangement = settings.HorizontalLayoutReverseArrangement; } public override void UnregisterListeners() => diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs index c0f79dfb45..4ffa03c0f2 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs @@ -1,23 +1,9 @@ using DCL.UI.GenericContextMenu.Controls.Configs; -using System; -using UnityEngine; -using UnityEngine.UI; namespace DCL.UI.GenericContextMenu.Controls { - [RequireComponent(typeof(RectTransform))] - [RequireComponent(typeof(HorizontalLayoutGroup))] - public abstract class GenericContextMenuComponent : MonoBehaviour, IGenericContextMenuComponent + public abstract class GenericContextMenuComponent : GenericContextMenuComponentBase where T : ContextMenuControlSettings { - [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } - [field: SerializeField] public HorizontalLayoutGroup HorizontalLayoutComponent { get; private set; } - - public abstract void Configure(ContextMenuControlSettings settings, object initialValue); - - public abstract void UnregisterListeners(); - - public abstract void RegisterListener(Delegate listener); - - public abstract void RegisterCloseListener(Action listener); + public abstract void Configure(T settings, object initialValue); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs new file mode 100644 index 0000000000..9531c83106 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs @@ -0,0 +1,20 @@ +using System; +using UnityEngine; +using UnityEngine.UI; + +namespace DCL.UI.GenericContextMenu.Controls +{ + [RequireComponent(typeof(RectTransform))] + [RequireComponent(typeof(HorizontalLayoutGroup))] + public abstract class GenericContextMenuComponentBase : MonoBehaviour + { + [field: SerializeField] public RectTransform RectTransformComponent { get; private set; } + [field: SerializeField] public HorizontalLayoutGroup HorizontalLayoutComponent { get; private set; } + + public abstract void UnregisterListeners(); + + public abstract void RegisterListener(Delegate listener); + + public abstract void RegisterCloseListener(Action listener); + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs.meta new file mode 100644 index 0000000000..14701e18a0 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7650d9eec6394461b72756f05a0edbba +timeCreated: 1736511764 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index 88d43440d7..6bf2de21ca 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -5,18 +5,17 @@ namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuSeparatorView : GenericContextMenuComponent + public class GenericContextMenuSeparatorView : GenericContextMenuComponent { [field: SerializeField] public LayoutElement LayoutElementComponent { get; private set; } - public override void Configure(ContextMenuControlSettings settings, object initialValue) + public override void Configure(SeparatorContextMenuControlSettings settings, object initialValue) { - SeparatorContextMenuControlSettings separatorSettings = settings as SeparatorContextMenuControlSettings; - LayoutElementComponent.preferredHeight = separatorSettings!.Height; - LayoutElementComponent.minHeight = separatorSettings.Height; - HorizontalLayoutComponent.padding.left = separatorSettings.LeftPadding; - HorizontalLayoutComponent.padding.right = separatorSettings.RightPadding; - RectTransformComponent.sizeDelta = new Vector2(RectTransformComponent.sizeDelta.x, separatorSettings.Height); + LayoutElementComponent.preferredHeight = settings!.Height; + LayoutElementComponent.minHeight = settings.Height; + HorizontalLayoutComponent.padding.left = settings.LeftPadding; + HorizontalLayoutComponent.padding.right = settings.RightPadding; + RectTransformComponent.sizeDelta = new Vector2(RectTransformComponent.sizeDelta.x, settings.Height); } public override void UnregisterListeners() { } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 0985c74ca6..d58034a1a8 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -6,18 +6,17 @@ namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuToggleView : GenericContextMenuComponent + public class GenericContextMenuToggleView : GenericContextMenuComponent { [field: SerializeField] public ToggleView ToggleComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } - public override void Configure(ContextMenuControlSettings settings, object initialValue) + public override void Configure(ToggleContextMenuControlSettings settings, object initialValue) { - ToggleContextMenuControlSettings toggleSettings = settings as ToggleContextMenuControlSettings; - TextComponent.SetText(toggleSettings!.ToggleText); - HorizontalLayoutComponent.padding = toggleSettings.HorizontalLayoutPadding; - HorizontalLayoutComponent.spacing = toggleSettings.HorizontalLayoutSpacing; - HorizontalLayoutComponent.reverseArrangement = toggleSettings.HorizontalLayoutReverseArrangement; + TextComponent.SetText(settings!.ToggleText); + HorizontalLayoutComponent.padding = settings.HorizontalLayoutPadding; + HorizontalLayoutComponent.spacing = settings.HorizontalLayoutSpacing; + HorizontalLayoutComponent.reverseArrangement = settings.HorizontalLayoutReverseArrangement; ToggleComponent.Toggle.isOn = initialValue != null && (bool)initialValue; ToggleComponent.SetToggleGraphics(ToggleComponent.Toggle.isOn); } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs deleted file mode 100644 index 3c5950a656..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs +++ /dev/null @@ -1,13 +0,0 @@ -using DCL.UI.GenericContextMenu.Controls.Configs; -using System; - -namespace DCL.UI.GenericContextMenu.Controls -{ - public interface IGenericContextMenuComponent - { - void Configure(ContextMenuControlSettings settings, object initialValue); - void UnregisterListeners(); - void RegisterListener(Delegate listener); - void RegisterCloseListener(Action listener); - } -} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs.meta deleted file mode 100644 index fedce32038..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/IGenericContextMenuComponent.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9910d7a5b2134ee6b2e395f007a3eeda -timeCreated: 1735901392 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index b406ff0380..cab45d1083 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -12,7 +12,7 @@ public class ControlsPoolManager : IDisposable private readonly IObjectPool separatorPool; private readonly IObjectPool buttonPool; private readonly IObjectPool togglePool; - private readonly List currentControls = new (); + private readonly List currentControls = new (); public ControlsPoolManager( Transform controlsParent, @@ -39,28 +39,51 @@ public ControlsPoolManager( actionOnDestroy: toggleView => GameObject.Destroy(toggleView.gameObject)); } - public GenericContextMenuComponent GetContextMenuComponent(T settings, object initialValue, int index) where T : ContextMenuControlSettings + public GenericContextMenuComponentBase GetContextMenuComponent(T settings, object initialValue, int index) where T : ContextMenuControlSettings { - GenericContextMenuComponent component = settings switch - { - SeparatorContextMenuControlSettings => separatorPool.Get(), - ButtonContextMenuControlSettings => buttonPool.Get(), - ToggleContextMenuControlSettings => togglePool.Get(), - _ => throw new ArgumentOutOfRangeException() - }; - component.transform.SetSiblingIndex(index); - component.Configure(settings, initialValue); + GenericContextMenuComponentBase component = settings switch + { + SeparatorContextMenuControlSettings separatorSettings => GetSeparator(separatorSettings, initialValue), + ButtonContextMenuControlSettings buttonSettings => GetButton(buttonSettings, initialValue), + ToggleContextMenuControlSettings toggleSettings => GetToggle(toggleSettings, initialValue), + _ => throw new ArgumentOutOfRangeException() + }; + component!.transform.SetSiblingIndex(index); currentControls.Add(component); return component; } + private GenericContextMenuComponentBase GetSeparator(SeparatorContextMenuControlSettings settings, object initialValue) + { + GenericContextMenuSeparatorView separatorView = separatorPool.Get(); + separatorView.Configure(settings, initialValue); + + return separatorView; + } + + private GenericContextMenuComponentBase GetButton(ButtonContextMenuControlSettings settings, object initialValue) + { + GenericContextMenuButtonWithTextView separatorView = buttonPool.Get(); + separatorView.Configure(settings, initialValue); + + return separatorView; + } + + private GenericContextMenuComponentBase GetToggle(ToggleContextMenuControlSettings settings, object initialValue) + { + GenericContextMenuToggleView separatorView = togglePool.Get(); + separatorView.Configure(settings, initialValue); + + return separatorView; + } + public void Dispose() => ReleaseAllCurrentControls(); public void ReleaseAllCurrentControls() { - foreach (IGenericContextMenuComponent control in currentControls) + foreach (GenericContextMenuComponentBase control in currentControls) { control.UnregisterListeners(); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 66c7356fa4..e275800129 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -70,7 +70,7 @@ private void ConfigureContextMenu() object controlInitialValue = null; inputData.InitialValues?.TryGetValue(config, out controlInitialValue); - GenericContextMenuComponent component = controlsPoolManager.GetContextMenuComponent(config, controlInitialValue, i); + GenericContextMenuComponentBase component = controlsPoolManager.GetContextMenuComponent(config, controlInitialValue, i); if (inputData.ControlsActions.TryGetValue(config, out Delegate action)) { From dfae86e213d62a4cc8f288b2e554d5af13a19612 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Tue, 14 Jan 2025 10:31:26 +0100 Subject: [PATCH 30/36] moved scriptable object logic to code builder --- .../Assets/CameraReel.prefab | 24 ------------- .../Assets/ContextMenuSO.meta | 8 ----- .../Assets/ContextMenuSO/CopyLinkConfig.asset | 24 ------------- .../ContextMenuSO/CopyLinkConfig.asset.meta | 8 ----- .../Assets/ContextMenuSO/DeleteConfig.asset | 24 ------------- .../ContextMenuSO/DeleteConfig.asset.meta | 8 ----- .../Assets/ContextMenuSO/DownloadConfig.asset | 24 ------------- .../ContextMenuSO/DownloadConfig.asset.meta | 8 ----- .../ReelGalleryContextMenuConfig.asset | 29 --------------- .../ReelGalleryContextMenuConfig.asset.meta | 8 ----- .../ContextMenuSO/SeparatorConfig.asset | 16 --------- .../ContextMenuSO/SeparatorConfig.asset.meta | 8 ----- .../ContextMenuSO/SetAsPublicConfig.asset | 23 ------------ .../SetAsPublicConfig.asset.meta | 8 ----- .../Assets/ContextMenuSO/ShareOnXConfig.asset | 24 ------------- .../ContextMenuSO/ShareOnXConfig.asset.meta | 8 ----- .../Assets/OptionButton.prefab | 9 +++++ .../CameraReelGalleryController.cs | 5 ++- .../CameraReelOptionButtonController.cs | 27 +++++++------- .../Components/CameraReelOptionButtonView.cs | 18 +++++++--- .../PluginSystem/Global/ExplorePanelPlugin.cs | 7 +--- .../ButtonContextMenuControlSettings.cs | 33 +++++++++-------- .../Configs/ContextMenuControlSettings.cs | 9 ++--- .../Controls/Configs/GenericContextMenu.cs | 36 +++++++++++++++++++ ...fig.cs.meta => GenericContextMenu.cs.meta} | 0 .../Configs/GenericContextMenuConfig.cs | 23 ------------ .../SeparatorContextMenuControlSettings.cs | 22 +++++------- .../ToggleContextMenuControlSettings.cs | 29 ++++++++------- .../Controls/ContextMenuControlTypes.cs | 9 ----- .../Controls/ContextMenuControlTypes.cs.meta | 3 -- .../GenericContextMenuButtonWithTextView.cs | 11 +++--- .../GenericContextMenuSeparatorView.cs | 10 +++--- .../Controls/GenericContextMenuToggleView.cs | 9 ++--- .../GenericContextMenuController.cs | 20 +++++------ .../GenericContextMenuParameter.cs | 8 ++--- 35 files changed, 144 insertions(+), 396 deletions(-) delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset.meta delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset delete mode 100644 Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset.meta create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs rename Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/{GenericContextMenuConfig.cs.meta => GenericContextMenu.cs.meta} (100%) delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs.meta diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab index 720ec9f214..89e7da2a19 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab @@ -1490,10 +1490,6 @@ PrefabInstance: propertyPath: m_Name value: OptionButton objectReference: {fileID: 0} - - target: {fileID: 4051113445585127458, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - target: {fileID: 4704582517862536994, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} propertyPath: m_Pivot.x value: 0.5 @@ -1574,26 +1570,6 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} - propertyPath: k__BackingField - value: - objectReference: {fileID: 11400000, guid: db49cac2faca44598a924e1c56690e0c, type: 2} - - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} - propertyPath: k__BackingField - value: - objectReference: {fileID: 11400000, guid: 5c0c78cadc79d4af0815be75aa67b027, type: 2} - - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} - propertyPath: k__BackingField - value: - objectReference: {fileID: 11400000, guid: a1abe3dafbc2143d8949b174e3c6c235, type: 2} - - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} - propertyPath: k__BackingField - value: - objectReference: {fileID: 11400000, guid: 63b9ee24ad69145e9becb7da653bdb4a, type: 2} - - target: {fileID: 7979901938051434274, guid: 4995a4307ab5b445c8a0c9123af8e343, type: 3} - propertyPath: k__BackingField - value: - objectReference: {fileID: 11400000, guid: 3ad489cd996154c1cad21a0856ed86bc, type: 2} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO.meta deleted file mode 100644 index dfde800094..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 89fb2efff5a894f4dbf7980aa03544e0 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset deleted file mode 100644 index aaaae500fd..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset +++ /dev/null @@ -1,24 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 14514d4875b74c0c9569ec576fdc85c0, type: 3} - m_Name: CopyLinkConfig - m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings - controlTypeType: 0 - buttonText: Copy Link - buttonIcon: {fileID: 21300000, guid: 3bffb1589fb814c70b23fbce43ba6736, type: 3} - horizontalLayoutPadding: - m_Left: 8 - m_Right: 8 - m_Top: 0 - m_Bottom: 0 - horizontalLayoutSpacing: 10 - horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset.meta deleted file mode 100644 index 19e44b08ea..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/CopyLinkConfig.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: db49cac2faca44598a924e1c56690e0c -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset deleted file mode 100644 index a2f3bce740..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset +++ /dev/null @@ -1,24 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 14514d4875b74c0c9569ec576fdc85c0, type: 3} - m_Name: DeleteConfig - m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings - controlTypeType: 0 - buttonText: Delete - buttonIcon: {fileID: 21300000, guid: ac4ebefc5fac7475ba19ac778feacfa8, type: 3} - horizontalLayoutPadding: - m_Left: 8 - m_Right: 8 - m_Top: 0 - m_Bottom: 0 - horizontalLayoutSpacing: 10 - horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset.meta deleted file mode 100644 index 8c0e023838..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DeleteConfig.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a1abe3dafbc2143d8949b174e3c6c235 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset deleted file mode 100644 index c7f41e7d80..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset +++ /dev/null @@ -1,24 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 14514d4875b74c0c9569ec576fdc85c0, type: 3} - m_Name: DownloadConfig - m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings - controlTypeType: 0 - buttonText: Download - buttonIcon: {fileID: 21300000, guid: 7c1ba996ae79c4993b1c434f833c4084, type: 3} - horizontalLayoutPadding: - m_Left: 8 - m_Right: 8 - m_Top: 0 - m_Bottom: 0 - horizontalLayoutSpacing: 10 - horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset.meta deleted file mode 100644 index 0d4e076e71..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/DownloadConfig.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3ad489cd996154c1cad21a0856ed86bc -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset deleted file mode 100644 index c2d18acdc3..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset +++ /dev/null @@ -1,29 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7f94b35778914b3085d26ae60acea3be, type: 3} - m_Name: ReelGalleryContextMenuConfig - m_EditorClassIdentifier: - contextMenuSettings: - - {fileID: 11400000, guid: 63b9ee24ad69145e9becb7da653bdb4a, type: 2} - - {fileID: 11400000, guid: 333b53545538440bca1cb75185892b64, type: 2} - - {fileID: 11400000, guid: 5c0c78cadc79d4af0815be75aa67b027, type: 2} - - {fileID: 11400000, guid: db49cac2faca44598a924e1c56690e0c, type: 2} - - {fileID: 11400000, guid: 3ad489cd996154c1cad21a0856ed86bc, type: 2} - - {fileID: 11400000, guid: a1abe3dafbc2143d8949b174e3c6c235, type: 2} - offsetFromTarget: {x: 11, y: 18} - width: 186 - verticalLayoutPadding: - m_Left: 8 - m_Right: 8 - m_Top: 4 - m_Bottom: 12 - elementsSpacing: 1 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset.meta deleted file mode 100644 index fffda78381..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ReelGalleryContextMenuConfig.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 43daf6965002847a19f241e71b28fd9b -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset deleted file mode 100644 index 490ac36143..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset +++ /dev/null @@ -1,16 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6cc12b279dd14422b34f1c61caa290db, type: 3} - m_Name: SeparatorConfig - m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:SeparatorContextMenuControlSettings - controlTypeType: 2 - height: 8 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset.meta deleted file mode 100644 index 2a204e905b..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SeparatorConfig.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 333b53545538440bca1cb75185892b64 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset deleted file mode 100644 index 658bb101b4..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset +++ /dev/null @@ -1,23 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f16a3a2eede14641b93b511007b15f12, type: 3} - m_Name: SetAsPublicConfig - m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ToggleContextMenuControlSettings - controlTypeType: 1 - toggleText: Set as Public - horizontalLayoutPadding: - m_Left: 8 - m_Right: 8 - m_Top: 0 - m_Bottom: 0 - horizontalLayoutSpacing: 30 - horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset.meta deleted file mode 100644 index a61999c1ab..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/SetAsPublicConfig.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 63b9ee24ad69145e9becb7da653bdb4a -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset deleted file mode 100644 index c0d635537a..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset +++ /dev/null @@ -1,24 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 14514d4875b74c0c9569ec576fdc85c0, type: 3} - m_Name: ShareOnXConfig - m_EditorClassIdentifier: GenericContextMenu:DCL.UI.GenericContextMenu.Controls:ButtonContextMenuControlSettings - controlTypeType: 0 - buttonText: Share on X - buttonIcon: {fileID: 21300000, guid: 4c97cd3c67403471d8fe75c5fc348e58, type: 3} - horizontalLayoutPadding: - m_Left: 8 - m_Right: 8 - m_Top: 0 - m_Bottom: 0 - horizontalLayoutSpacing: 10 - horizontalLayoutReverseArrangement: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset.meta b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset.meta deleted file mode 100644 index f0ed089c0a..0000000000 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/ContextMenuSO/ShareOnXConfig.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5c0c78cadc79d4af0815be75aa67b027 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/OptionButton.prefab b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/OptionButton.prefab index bf6b86c0d9..8c9a20712e 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/OptionButton.prefab +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/OptionButton.prefab @@ -135,6 +135,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: k__BackingField: {fileID: 6943278575139157012} + k__BackingField: Set as Public + k__BackingField: Share on X + k__BackingField: {fileID: 21300000, guid: 4c97cd3c67403471d8fe75c5fc348e58, type: 3} + k__BackingField: Copy Link + k__BackingField: {fileID: 21300000, guid: 3bffb1589fb814c70b23fbce43ba6736, type: 3} + k__BackingField: Download + k__BackingField: {fileID: 21300000, guid: 7c1ba996ae79c4993b1c434f833c4084, type: 3} + k__BackingField: Delete + k__BackingField: {fileID: 21300000, guid: ac4ebefc5fac7475ba19ac778feacfa8, type: 3} --- !u!1 &4238458680548828747 GameObject: m_ObjectHideFlags: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs index ac4d6ae18e..97d6065ff5 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGalleryController.cs @@ -101,8 +101,7 @@ public CameraReelGalleryController(CameraReelGalleryView view, IExplorePanelEscapeAction? explorePanelEscapeAction = null, ISystemClipboard? systemClipboard = null, ReelGalleryStringMessages? reelGalleryStringMessages = null, - IMVCManager? mvcManager = null, - GenericContextMenuConfig? contextMenuConfig = null) + IMVCManager? mvcManager = null) { this.view = view; this.cameraReelStorageService = cameraReelStorageService; @@ -125,7 +124,7 @@ public CameraReelGalleryController(CameraReelGalleryView view, if (optionButtonView is not null) { - this.optionButtonController = new CameraReelOptionButtonController(optionButtonView, mvcManager!, contextMenuConfig!); + this.optionButtonController = new CameraReelOptionButtonController(optionButtonView, mvcManager!); } reelGalleryPoolManager = new ReelGalleryPoolManager(view.thumbnailViewPrefab, view.monthGridPrefab, view.unusedThumbnailViewObject, diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs index f7a3cb21d3..cf6c866603 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs @@ -14,9 +14,9 @@ public class CameraReelOptionButtonController : IDisposable private readonly CameraReelOptionButtonView view; private readonly RectTransform buttonRectTransform; private readonly IMVCManager mvcManager; - private readonly GenericContextMenuConfig contextMenuConfig; - private readonly Dictionary controlsActions; + private readonly GenericContextMenu contextMenu; private readonly Dictionary initialValues = new (); + private readonly ToggleContextMenuControlSettings publicToggleSettings; public event Action? Hide; @@ -31,24 +31,21 @@ public class CameraReelOptionButtonController : IDisposable private UniTaskCompletionSource closeContextMenuTask; public CameraReelOptionButtonController(CameraReelOptionButtonView view, - IMVCManager mvcManager, - GenericContextMenuConfig contextMenuConfig) + IMVCManager mvcManager) { this.view = view; this.mvcManager = mvcManager; - this.contextMenuConfig = contextMenuConfig; this.buttonRectTransform = view.GetComponent(); this.view.optionButton.onClick.AddListener(OnOptionClicked); - controlsActions = new () - { - { this.view.publicControl, new Action(toggleValue => SetPublicRequested?.Invoke(currentReelData, toggleValue)) }, - { this.view.shareControl, new Action(() => ShareToXRequested?.Invoke(currentReelData)) }, - { this.view.copyControl, new Action(() => CopyPictureLinkRequested?.Invoke(currentReelData)) }, - { this.view.downloadControl, new Action(() => DownloadRequested?.Invoke(currentReelData)) }, - { this.view.deleteControl, new Action(() => DeletePictureRequested?.Invoke(currentReelData)) }, - }; + contextMenu = new GenericContextMenu() + .AddControl(publicToggleSettings = new ToggleContextMenuControlSettings(view.publicToggleText, toggleValue => SetPublicRequested?.Invoke(currentReelData, toggleValue))) + .AddControl(new SeparatorContextMenuControlSettings()) + .AddControl(new ButtonContextMenuControlSettings(view.shareButtonText, view.shareButtonSprite, () => ShareToXRequested?.Invoke(currentReelData))) + .AddControl(new ButtonContextMenuControlSettings(view.copyButtonText, view.copyButtonSprite, () => CopyPictureLinkRequested?.Invoke(currentReelData))) + .AddControl(new ButtonContextMenuControlSettings(view.downloadButtonText, view.downloadButtonSprite, () => DownloadRequested?.Invoke(currentReelData))) + .AddControl(new ButtonContextMenuControlSettings(view.deleteButtonText, view.deleteButtonSprite, () => DeletePictureRequested?.Invoke(currentReelData))); } public bool IsContextMenuOpen() => isContextMenuOpen; @@ -59,7 +56,7 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, view.transform.localPosition = offsetPosition; view.gameObject.SetActive(true); currentReelData = cameraReelResponse; - initialValues[view.publicControl] = cameraReelResponse.isPublic; + initialValues[publicToggleSettings] = cameraReelResponse.isPublic; closeContextMenuTask = new UniTaskCompletionSource(); } @@ -74,7 +71,7 @@ public void HideControl() private void OnOptionClicked() { mvcManager.ShowAsync(GenericContextMenuController.IssueCommand( - new GenericContextMenuParameter(contextMenuConfig, controlsActions, buttonRectTransform.position, + new GenericContextMenuParameter(contextMenu, buttonRectTransform.position, actionOnShow: () => isContextMenuOpen = true, actionOnHide: () => { diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs index 8da0c5671c..c543087cf8 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonView.cs @@ -9,10 +9,18 @@ public class CameraReelOptionButtonView : MonoBehaviour [field: SerializeField] internal Button optionButton { get; private set; } [field: Header("Context menu settings")] - [field: SerializeField] internal ContextMenuControlSettings publicControl { get; private set; } - [field: SerializeField] internal ContextMenuControlSettings shareControl { get; private set; } - [field: SerializeField] internal ContextMenuControlSettings copyControl { get; private set; } - [field: SerializeField] internal ContextMenuControlSettings downloadControl { get; private set; } - [field: SerializeField] internal ContextMenuControlSettings deleteControl { get; private set; } + [field: SerializeField] internal string publicToggleText { get; private set; } + [field: Space(10)] + [field: SerializeField] internal string shareButtonText { get; private set; } + [field: SerializeField] internal Sprite shareButtonSprite { get; private set; } + [field: Space(10)] + [field: SerializeField] internal string copyButtonText { get; private set; } + [field: SerializeField] internal Sprite copyButtonSprite { get; private set; } + [field: Space(10)] + [field: SerializeField] internal string downloadButtonText { get; private set; } + [field: SerializeField] internal Sprite downloadButtonSprite { get; private set; } + [field: Space(10)] + [field: SerializeField] internal string deleteButtonText { get; private set; } + [field: SerializeField] internal Sprite deleteButtonSprite { get; private set; } } } diff --git a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs index fc4a4e7d8c..4c859cb810 100644 --- a/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs +++ b/Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs @@ -251,8 +251,6 @@ public async UniTask InitializeAsync(ExplorePanelSettings settings, Cancellation mapRendererContainer.MapRenderer, placesAPIService, webRequestController, webBrowser, dclInput, realmNavigator, realmData, mapPathEventBus, world, playerEntity, inputBlock, chatMessagesBus); - GenericContextMenuConfig contextMenuConfig = await assetsProvisioner.ProvideMainAssetValueAsync(settings.ContextMenuConfig, ct); - await navmapController.InitializeAssetsAsync(assetsProvisioner, ct); await backpackSubPlugin.InitializeAsync(settings.BackpackSettings, explorePanelView.GetComponentInChildren(), ct); @@ -266,8 +264,7 @@ public async UniTask InitializeAsync(ExplorePanelSettings settings, Cancellation cameraReelView.CameraReelOptionsButton, webBrowser, decentralandUrlsSource, inputHandler, systemClipboard, new ReelGalleryStringMessages(settings.CameraReelGalleryShareToXMessage, settings.PhotoSuccessfullyDeletedMessage, settings.PhotoSuccessfullyUpdatedMessage, settings.PhotoSuccessfullyDownloadedMessage, settings.LinkCopiedMessage), - mvcManager, - contextMenuConfig), + mvcManager), cameraReelStorageService, web3IdentityCache, mvcManager, @@ -336,8 +333,6 @@ public class ExplorePanelSettings : IDCLPluginSettings [field: SerializeField] public int ThumbnailWidth { get; private set; } - [field: SerializeField] internal AssetReferenceT ContextMenuConfig { get; private set; } - public IReadOnlyCollection EmbeddedEmotesAsURN() => EmbeddedEmotes.Select(s => new URN(s)).ToArray(); } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs index dc9ca53148..15497a0823 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs @@ -3,23 +3,26 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs { - [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ButtonContextMenuControlSettings")] - [Serializable] public class ButtonContextMenuControlSettings : ContextMenuControlSettings { - [SerializeField] private string buttonText; - [SerializeField] private Sprite buttonIcon; - [SerializeField] private RectOffset horizontalLayoutPadding; - [SerializeField] private int horizontalLayoutSpacing; - [SerializeField] private bool horizontalLayoutReverseArrangement; + internal readonly string buttonText; + internal readonly Sprite buttonIcon; + internal readonly RectOffset horizontalLayoutPadding; + internal readonly int horizontalLayoutSpacing; + internal readonly bool horizontalLayoutReverseArrangement; - public string ButtonText => buttonText; - public Sprite ButtonIcon => buttonIcon; - public RectOffset HorizontalLayoutPadding => horizontalLayoutPadding; - public bool HorizontalLayoutReverseArrangement => horizontalLayoutReverseArrangement; - public int HorizontalLayoutSpacing => horizontalLayoutSpacing; - - private void OnEnable() => - controlTypeType = ContextMenuControlTypes.BUTTON_WITH_TEXT_AND_ICON; + /// + /// Button component settings for the context menu. + /// horizontalLayoutPadding has the default value of (8, 8, 0, 0). + /// + public ButtonContextMenuControlSettings(string buttonText, Sprite buttonIcon, Action clickAction, RectOffset horizontalLayoutPadding = null, int horizontalLayoutSpacing = 10, bool horizontalLayoutReverseArrangement = false) + { + this.buttonText = buttonText; + this.buttonIcon = buttonIcon; + this.horizontalLayoutPadding = horizontalLayoutPadding ?? new RectOffset(8, 8, 0, 0); + this.horizontalLayoutSpacing = horizontalLayoutSpacing; + this.horizontalLayoutReverseArrangement = horizontalLayoutReverseArrangement; + this.callback = clickAction; + } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs index c9a280a43e..13fb947dc8 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs @@ -1,14 +1,9 @@ using System; -using UnityEngine; -using Utility; namespace DCL.UI.GenericContextMenu.Controls.Configs { - [Serializable] - public class ContextMenuControlSettings : ScriptableObject + public class ContextMenuControlSettings { - [SerializeField, ShowOnly] protected ContextMenuControlTypes controlTypeType; - - public ContextMenuControlTypes ControlTypeType => controlTypeType; + internal Delegate callback; } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs new file mode 100644 index 0000000000..cabd0e9356 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace DCL.UI.GenericContextMenu.Controls.Configs +{ + /// + /// Main generic context menu class, used to invoke the MVC manager + /// + public class GenericContextMenu + { + internal readonly List contextMenuSettings = new (); + internal readonly Vector2 offsetFromTarget; + internal readonly float width; + internal readonly RectOffset verticalLayoutPadding; + internal readonly int elementsSpacing; + + /// + /// Main context menu class. + /// offsetFromTarget has the default value of (11, 18). + /// horizontalLayoutPadding has the default value of (8, 8, 4, 12). + /// + public GenericContextMenu(float width = 186, Vector2? offsetFromTarget = null, RectOffset verticalLayoutPadding = null, int elementsSpacing = 1) + { + this.width = width; + this.offsetFromTarget = offsetFromTarget ?? new Vector2(11, 18); + this.verticalLayoutPadding = verticalLayoutPadding ?? new RectOffset(8, 8, 4, 12); + this.elementsSpacing = elementsSpacing; + } + + public GenericContextMenu AddControl(ContextMenuControlSettings settings) + { + contextMenuSettings.Add(settings); + return this; + } + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs.meta similarity index 100% rename from Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs.meta rename to Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs.meta diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs deleted file mode 100644 index b45277ba2f..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenuConfig.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace DCL.UI.GenericContextMenu.Controls.Configs -{ - [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/GenericContextMenuSettings")] - [Serializable] - public class GenericContextMenuConfig : ScriptableObject - { - [SerializeField] private List contextMenuSettings = new (); - [SerializeField] private Vector2 offsetFromTarget = Vector2.zero; - [SerializeField] private float width = 170; - [SerializeField] private RectOffset verticalLayoutPadding; - [SerializeField] private int elementsSpacing = 1; - - public List ContextMenuSettings => contextMenuSettings; - public Vector2 OffsetFromTarget => offsetFromTarget; - public float Width => width; - public int ElementsSpacing => elementsSpacing; - public RectOffset VerticalLayoutPadding => verticalLayoutPadding; - } -} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs index 6231b2a9cc..65bb716fbf 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs @@ -1,21 +1,17 @@ -using System; -using UnityEngine; namespace DCL.UI.GenericContextMenu.Controls.Configs { - [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/SeparatorContextMenuControlSettings")] - [Serializable] public class SeparatorContextMenuControlSettings : ContextMenuControlSettings { - [SerializeField] private int height; - [SerializeField] private int leftPadding; - [SerializeField] private int rightPadding; + internal readonly int height; + internal readonly int leftPadding; + internal readonly int rightPadding; - public int Height => height; - public int LeftPadding => leftPadding; - public int RightPadding => rightPadding; - - private void OnEnable() => - controlTypeType = ContextMenuControlTypes.SEPARATOR; + public SeparatorContextMenuControlSettings(int height = 8, int leftPadding = 0, int rightPadding = 0) + { + this.height = height; + this.leftPadding = leftPadding; + this.rightPadding = rightPadding; + } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs index 470aa77dcc..be5d10f9c7 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs @@ -3,21 +3,24 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs { - [CreateAssetMenu(fileName = "GenericContextMenuSettings", menuName = "SO/ContextMenu/Components/ToggleContextMenuControlSettings")] - [Serializable] public class ToggleContextMenuControlSettings : ContextMenuControlSettings { - [SerializeField] private string toggleText; - [SerializeField] private RectOffset horizontalLayoutPadding; - [SerializeField] private int horizontalLayoutSpacing; - [SerializeField] private bool horizontalLayoutReverseArrangement; + internal readonly string toggleText; + internal readonly RectOffset horizontalLayoutPadding; + internal readonly int horizontalLayoutSpacing; + internal readonly bool horizontalLayoutReverseArrangement; - public string ToggleText => toggleText; - public RectOffset HorizontalLayoutPadding => horizontalLayoutPadding; - public bool HorizontalLayoutReverseArrangement => horizontalLayoutReverseArrangement; - public int HorizontalLayoutSpacing => horizontalLayoutSpacing; - - private void OnEnable() => - controlTypeType = ContextMenuControlTypes.TOGGLE_WITH_TEXT; + /// + /// Toggle component settings for the context menu. + /// horizontalLayoutPadding has the default value of (8, 8, 0, 0). + /// + public ToggleContextMenuControlSettings(string toggleText, Action toggleAction, RectOffset horizontalLayoutPadding = null, int horizontalLayoutSpacing = 30, bool horizontalLayoutReverseArrangement = false) + { + this.toggleText = toggleText; + this.horizontalLayoutPadding = horizontalLayoutPadding ?? new RectOffset(8, 8, 0, 0); + this.horizontalLayoutSpacing = horizontalLayoutSpacing; + this.horizontalLayoutReverseArrangement = horizontalLayoutReverseArrangement; + this.callback = toggleAction; + } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs deleted file mode 100644 index 92d1b48647..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace DCL.UI.GenericContextMenu.Controls -{ - public enum ContextMenuControlTypes - { - BUTTON_WITH_TEXT_AND_ICON, - TOGGLE_WITH_TEXT, - SEPARATOR, - } -} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs.meta deleted file mode 100644 index 473b75d175..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/ContextMenuControlTypes.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9fd3b581133547cba80f4bb3ca569cab -timeCreated: 1735833944 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index 2751d7ae40..98a1f50b85 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -15,11 +15,12 @@ public class GenericContextMenuButtonWithTextView : GenericContextMenuComponent< public override void Configure(ButtonContextMenuControlSettings settings, object initialValue) { - TextComponent.SetText(settings!.ButtonText); - ImageComponent.sprite = settings.ButtonIcon; - HorizontalLayoutComponent.padding = settings.HorizontalLayoutPadding; - HorizontalLayoutComponent.spacing = settings.HorizontalLayoutSpacing; - HorizontalLayoutComponent.reverseArrangement = settings.HorizontalLayoutReverseArrangement; + TextComponent.SetText(settings!.buttonText); + ImageComponent.sprite = settings.buttonIcon; + HorizontalLayoutComponent.padding = settings.horizontalLayoutPadding; + HorizontalLayoutComponent.spacing = settings.horizontalLayoutSpacing; + HorizontalLayoutComponent.reverseArrangement = settings.horizontalLayoutReverseArrangement; + RegisterListener(settings.callback); } public override void UnregisterListeners() => diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index 6bf2de21ca..f0eaaa1b45 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -11,11 +11,11 @@ public class GenericContextMenuSeparatorView : GenericContextMenuComponent diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index e275800129..456e2c53df 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -64,32 +64,28 @@ private void ConfigureContextMenu() { float totalHeight = 0; - for (var i = 0; i < inputData.Config.ContextMenuSettings.Count; i++) + for (var i = 0; i < inputData.Config.contextMenuSettings.Count; i++) { - ContextMenuControlSettings config = inputData.Config.ContextMenuSettings[i]; + ContextMenuControlSettings config = inputData.Config.contextMenuSettings[i]; object controlInitialValue = null; inputData.InitialValues?.TryGetValue(config, out controlInitialValue); GenericContextMenuComponentBase component = controlsPoolManager.GetContextMenuComponent(config, controlInitialValue, i); - if (inputData.ControlsActions.TryGetValue(config, out Delegate action)) - { - component.RegisterListener(action); - component.RegisterCloseListener(TriggerContextMenuClose); - } + component.RegisterCloseListener(TriggerContextMenuClose); totalHeight += component!.RectTransformComponent.rect.height; } - viewInstance!.ControlsLayoutGroup.spacing = inputData.Config.ElementsSpacing; - viewInstance!.ControlsLayoutGroup.padding = inputData.Config.VerticalLayoutPadding; - viewInstance.ControlsContainer.sizeDelta = new Vector2(inputData.Config.Width, + viewInstance!.ControlsLayoutGroup.spacing = inputData.Config.elementsSpacing; + viewInstance!.ControlsLayoutGroup.padding = inputData.Config.verticalLayoutPadding; + viewInstance.ControlsContainer.sizeDelta = new Vector2(inputData.Config.width, totalHeight + viewInstance!.ControlsLayoutGroup.padding.bottom + viewInstance!.ControlsLayoutGroup.padding.top - + (viewInstance!.ControlsLayoutGroup.spacing * (inputData.Config.ContextMenuSettings.Count - 1))); + + (viewInstance!.ControlsLayoutGroup.spacing * (inputData.Config.contextMenuSettings.Count - 1))); - viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.OffsetFromTarget, inputData.OverlapRect); + viewInstance!.ControlsContainer.localPosition = GetControlsPosition(inputData.AnchorPosition, inputData.Config.offsetFromTarget, inputData.OverlapRect); } private Vector2 GetOffsetByDirection(ContextMenuOpenDirection direction, Vector2 offsetFromTarget) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs index 5b6ee70665..0adc9ed95f 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs @@ -1,5 +1,4 @@ using Cysharp.Threading.Tasks; -using DCL.UI.GenericContextMenu.Controls; using DCL.UI.GenericContextMenu.Controls.Configs; using System; using System.Collections.Generic; @@ -9,8 +8,7 @@ namespace DCL.UI.GenericContextMenu { public struct GenericContextMenuParameter { - public readonly GenericContextMenuConfig Config; - public readonly Dictionary ControlsActions; + public readonly Controls.Configs.GenericContextMenu Config; public readonly Vector2 AnchorPosition; public readonly Rect? OverlapRect; public readonly Action? ActionOnShow; @@ -18,8 +16,7 @@ public struct GenericContextMenuParameter public readonly UniTask? CloseTask; public readonly Dictionary? InitialValues; - public GenericContextMenuParameter(GenericContextMenuConfig config, - Dictionary controlsActions, + public GenericContextMenuParameter(Controls.Configs.GenericContextMenu config, Vector2 anchorPosition, Rect? overlapRect = null, Action? actionOnShow = null, @@ -28,7 +25,6 @@ public GenericContextMenuParameter(GenericContextMenuConfig config, Dictionary? initialValues = null) { this.Config = config; - this.ControlsActions = controlsActions; this.AnchorPosition = anchorPosition; this.OverlapRect = overlapRect; this.ActionOnShow = actionOnShow; From b3e145a83ac652b801eb61586c37f7dcdeb32457 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Thu, 16 Jan 2025 10:18:34 +0100 Subject: [PATCH 31/36] suggested modifications --- .../AddressableAssetSettings.asset | 2 +- .../AssetGroups/Essentials.asset | 14 +++++++------- .../Components/CameraReelOptionButtonController.cs | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Explorer/Assets/AddressableAssetsData/AddressableAssetSettings.asset b/Explorer/Assets/AddressableAssetsData/AddressableAssetSettings.asset index 2c04c4a45d..4f2d5b3d4e 100644 --- a/Explorer/Assets/AddressableAssetsData/AddressableAssetSettings.asset +++ b/Explorer/Assets/AddressableAssetsData/AddressableAssetSettings.asset @@ -15,7 +15,7 @@ MonoBehaviour: m_DefaultGroup: 47f803e1e9c5079449bd106df98a0b7d m_currentHash: serializedVersion: 2 - Hash: 45a8a0823ee038a925d952879c82ab60 + Hash: 929bc0a851082190651830d8f45eaaca m_OptimizeCatalogSize: 0 m_BuildRemoteCatalog: 0 m_BundleLocalCatalog: 0 diff --git a/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset b/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset index 13823a7e45..6c2b2a5f8b 100644 --- a/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset +++ b/Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset @@ -112,13 +112,13 @@ MonoBehaviour: m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 - - m_GUID: 3d761805ce62940dbafaa7bb64be222c - m_Address: ClusterMarkerObjectForSearchResults + - m_GUID: 3c3c8d365c6ef4acfa3665168b5737a9 + m_Address: ButtonWithTextAndIcon m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 - - m_GUID: 3c3c8d365c6ef4acfa3665168b5737a9 - m_Address: Assets/DCL/UI/GenericContextMenu/Prefabs/ButtonWithTextAndIcon.prefab + - m_GUID: 3d761805ce62940dbafaa7bb64be222c + m_Address: ClusterMarkerObjectForSearchResults m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 @@ -148,7 +148,7 @@ MonoBehaviour: m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 52bc5c5fe83f743cdba8dab60b247e96 - m_Address: Assets/DCL/UI/GenericContextMenu/Prefabs/Separator.prefab + m_Address: Separator m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 @@ -193,7 +193,7 @@ MonoBehaviour: m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 5ef9c85ff80df42e88f2946a299f1102 - m_Address: Assets/DCL/UI/GenericContextMenu/Prefabs/GenericContextMenu.prefab + m_Address: GenericContextMenu m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 @@ -208,7 +208,7 @@ MonoBehaviour: m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 60ec312971597448e978368a5382c0f1 - m_Address: Assets/DCL/UI/GenericContextMenu/Prefabs/ToggleWithText.prefab + m_Address: ToggleWithText m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs index cf6c866603..e915cf8e37 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs @@ -63,7 +63,7 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, public void HideControl() { view.transform.localScale = Vector3.one; - closeContextMenuTask?.TrySetResult(); + closeContextMenuTask.TrySetResult(); Hide?.Invoke(); view.gameObject.SetActive(false); } @@ -78,7 +78,7 @@ private void OnOptionClicked() isContextMenuOpen = false; HideControl(); }, - closeTask: closeContextMenuTask?.Task, + closeTask: closeContextMenuTask.Task, initialValues: initialValues))); } From 98829f0db87dbaf5bd94ea7889c8c6e6ef63c9b0 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Thu, 16 Jan 2025 10:59:49 +0100 Subject: [PATCH 32/36] removed unnecessary abstraction layer in components --- .../CameraReelOptionButtonController.cs | 6 +++--- .../GenericContextMenuButtonWithTextView.cs | 4 ++-- .../Controls/GenericContextMenuComponent.cs | 9 --------- .../Controls/GenericContextMenuComponent.cs.meta | 3 --- .../Controls/GenericContextMenuSeparatorView.cs | 4 ++-- .../Controls/GenericContextMenuToggleView.cs | 6 +++--- .../UI/GenericContextMenu/ControlsPoolManager.cs | 16 ++++++++-------- 7 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs.meta diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs index e915cf8e37..ed4696b805 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs @@ -28,7 +28,7 @@ public class CameraReelOptionButtonController : IDisposable private bool isContextMenuOpen; private CameraReelResponseCompact currentReelData; - private UniTaskCompletionSource closeContextMenuTask; + private UniTaskCompletionSource? closeContextMenuTask; public CameraReelOptionButtonController(CameraReelOptionButtonView view, IMVCManager mvcManager) @@ -63,7 +63,7 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, public void HideControl() { view.transform.localScale = Vector3.one; - closeContextMenuTask.TrySetResult(); + closeContextMenuTask?.TrySetResult(); Hide?.Invoke(); view.gameObject.SetActive(false); } @@ -78,7 +78,7 @@ private void OnOptionClicked() isContextMenuOpen = false; HideControl(); }, - closeTask: closeContextMenuTask.Task, + closeTask: closeContextMenuTask?.Task, initialValues: initialValues))); } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index 98a1f50b85..0f91ffcfb4 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -7,13 +7,13 @@ namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuButtonWithTextView : GenericContextMenuComponent + public class GenericContextMenuButtonWithTextView : GenericContextMenuComponentBase { [field: SerializeField] public Button ButtonComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } [field: SerializeField] public Image ImageComponent { get; private set; } - public override void Configure(ButtonContextMenuControlSettings settings, object initialValue) + public void Configure(ButtonContextMenuControlSettings settings) { TextComponent.SetText(settings!.buttonText); ImageComponent.sprite = settings.buttonIcon; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs deleted file mode 100644 index 4ffa03c0f2..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs +++ /dev/null @@ -1,9 +0,0 @@ -using DCL.UI.GenericContextMenu.Controls.Configs; - -namespace DCL.UI.GenericContextMenu.Controls -{ - public abstract class GenericContextMenuComponent : GenericContextMenuComponentBase where T : ContextMenuControlSettings - { - public abstract void Configure(T settings, object initialValue); - } -} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs.meta deleted file mode 100644 index 98d8cc1921..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponent.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: a81c224e27c1441c912e481761144796 -timeCreated: 1736181634 \ No newline at end of file diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index f0eaaa1b45..5b0925e8b2 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -5,11 +5,11 @@ namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuSeparatorView : GenericContextMenuComponent + public class GenericContextMenuSeparatorView : GenericContextMenuComponentBase { [field: SerializeField] public LayoutElement LayoutElementComponent { get; private set; } - public override void Configure(SeparatorContextMenuControlSettings settings, object initialValue) + public void Configure(SeparatorContextMenuControlSettings settings) { LayoutElementComponent.preferredHeight = settings!.height; LayoutElementComponent.minHeight = settings.height; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 639f1bae91..0c3fa73109 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -6,18 +6,18 @@ namespace DCL.UI.GenericContextMenu.Controls { - public class GenericContextMenuToggleView : GenericContextMenuComponent + public class GenericContextMenuToggleView : GenericContextMenuComponentBase { [field: SerializeField] public ToggleView ToggleComponent { get; private set; } [field: SerializeField] public TMP_Text TextComponent { get; private set; } - public override void Configure(ToggleContextMenuControlSettings settings, object initialValue) + public void Configure(ToggleContextMenuControlSettings settings, bool initialValue) { TextComponent.SetText(settings!.toggleText); HorizontalLayoutComponent.padding = settings.horizontalLayoutPadding; HorizontalLayoutComponent.spacing = settings.horizontalLayoutSpacing; HorizontalLayoutComponent.reverseArrangement = settings.horizontalLayoutReverseArrangement; - ToggleComponent.Toggle.isOn = initialValue != null && (bool)initialValue; + ToggleComponent.Toggle.isOn = initialValue; ToggleComponent.SetToggleGraphics(ToggleComponent.Toggle.isOn); RegisterListener(settings.callback); } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index cab45d1083..cae9e18b54 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -43,9 +43,9 @@ public GenericContextMenuComponentBase GetContextMenuComponent(T settings, ob { GenericContextMenuComponentBase component = settings switch { - SeparatorContextMenuControlSettings separatorSettings => GetSeparator(separatorSettings, initialValue), - ButtonContextMenuControlSettings buttonSettings => GetButton(buttonSettings, initialValue), - ToggleContextMenuControlSettings toggleSettings => GetToggle(toggleSettings, initialValue), + SeparatorContextMenuControlSettings separatorSettings => GetSeparator(separatorSettings), + ButtonContextMenuControlSettings buttonSettings => GetButton(buttonSettings), + ToggleContextMenuControlSettings toggleSettings => GetToggle(toggleSettings, (bool)initialValue), _ => throw new ArgumentOutOfRangeException() }; component!.transform.SetSiblingIndex(index); @@ -54,23 +54,23 @@ public GenericContextMenuComponentBase GetContextMenuComponent(T settings, ob return component; } - private GenericContextMenuComponentBase GetSeparator(SeparatorContextMenuControlSettings settings, object initialValue) + private GenericContextMenuComponentBase GetSeparator(SeparatorContextMenuControlSettings settings) { GenericContextMenuSeparatorView separatorView = separatorPool.Get(); - separatorView.Configure(settings, initialValue); + separatorView.Configure(settings); return separatorView; } - private GenericContextMenuComponentBase GetButton(ButtonContextMenuControlSettings settings, object initialValue) + private GenericContextMenuComponentBase GetButton(ButtonContextMenuControlSettings settings) { GenericContextMenuButtonWithTextView separatorView = buttonPool.Get(); - separatorView.Configure(settings, initialValue); + separatorView.Configure(settings); return separatorView; } - private GenericContextMenuComponentBase GetToggle(ToggleContextMenuControlSettings settings, object initialValue) + private GenericContextMenuComponentBase GetToggle(ToggleContextMenuControlSettings settings, bool initialValue) { GenericContextMenuToggleView separatorView = togglePool.Get(); separatorView.Configure(settings, initialValue); From f5ad9752efa1fd0e1fc6317fc71947f7fd081187 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Thu, 16 Jan 2025 11:54:07 +0100 Subject: [PATCH 33/36] refactored context menu closing task --- .../GenericContextMenuController.cs | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 456e2c53df..98141f82af 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -2,9 +2,9 @@ using DCL.UI.GenericContextMenu.Controls; using DCL.UI.GenericContextMenu.Controls.Configs; using MVC; -using System; using System.Threading; using UnityEngine; +using Utility; namespace DCL.UI.GenericContextMenu { @@ -21,10 +21,12 @@ private enum ContextMenuOpenDirection public override CanvasOrdering.SortingLayer Layer => CanvasOrdering.SortingLayer.Popup; private readonly ControlsPoolManager controlsPoolManager; + private readonly Vector3[] worldRectCorners = new Vector3[4]; + private readonly ContextMenuOpenDirection[] openDirections = EnumUtils.Values(); private RectTransform viewRectTransform; private Rect backgroundWorldRect; - private bool isClosing; + private UniTaskCompletionSource internalCloseTask; public GenericContextMenuController(ViewFactoryMethod viewFactory, ControlsPoolManager controlsPoolManager) : base(viewFactory) @@ -49,7 +51,7 @@ protected override void OnViewInstantiated() protected override void OnBeforeViewShow() { - isClosing = false; + internalCloseTask = new UniTaskCompletionSource(); ConfigureContextMenu(); } @@ -108,9 +110,9 @@ private Vector3 GetControlsPosition(Vector2 anchorPosition, Vector2 offsetFromTa Vector3 newPosition = Vector3.zero; float minNonOverlappingArea = float.MaxValue; - foreach (ContextMenuOpenDirection enumVal in Enum.GetValues(typeof(ContextMenuOpenDirection))) + foreach (ContextMenuOpenDirection openDirection in openDirections) { - Vector2 offsetByDirection = GetOffsetByDirection(enumVal, offsetFromTarget); + Vector2 offsetByDirection = GetOffsetByDirection(openDirection, offsetFromTarget); Vector3 currentPosition = position + new Vector3(offsetByDirection.x, offsetByDirection.y, 0); float nonOverlappingArea = CalculateNonOverlappingArea(overlapRect ?? backgroundWorldRect, GetProjectedRect(currentPosition)); if (nonOverlappingArea < minNonOverlappingArea) @@ -153,12 +155,11 @@ private Rect GetProjectedRect(Vector3 newPosition) return rect; } - private static Rect GetWorldRect(RectTransform rectTransform) + private Rect GetWorldRect(RectTransform rectTransform) { - var corners = new Vector3[4]; - rectTransform.GetWorldCorners(corners); - Vector2 min = corners[0]; - Vector2 max = corners[2]; + rectTransform.GetWorldCorners(worldRectCorners); + Vector2 min = worldRectCorners[0]; + Vector2 max = worldRectCorners[2]; Vector2 size = max - min; return new Rect(min, size); } @@ -169,9 +170,12 @@ protected override void OnViewClose() inputData.ActionOnHide?.Invoke(); } - private void TriggerContextMenuClose() => isClosing = true; + private void TriggerContextMenuClose() => internalCloseTask.TrySetResult(); - protected override UniTask WaitForCloseIntentAsync(CancellationToken ct) => - inputData.CloseTask != null ? UniTask.WhenAny(UniTask.WaitUntil(() => isClosing, cancellationToken: ct), inputData.CloseTask.Value) : UniTask.WaitUntil(() => isClosing, cancellationToken: ct); + protected override UniTask WaitForCloseIntentAsync(CancellationToken ct) + { + UniTask inputCloseTask = inputData.CloseTask ?? UniTask.Never(ct); + return UniTask.WhenAny(internalCloseTask.Task, inputCloseTask); + } } } From 2e59aee1f9516273078c96753f85cfa2bb0450b4 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Thu, 16 Jan 2025 11:59:41 +0100 Subject: [PATCH 34/36] removed background button click event and used onClickAsync directly in close task --- .../GenericContextMenuController.cs | 4 +--- .../UI/GenericContextMenu/GenericContextMenuView.cs | 11 +---------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 98141f82af..25178abcd9 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -45,8 +45,6 @@ protected override void OnViewInstantiated() { viewRectTransform = viewInstance!.GetComponent(); backgroundWorldRect = GetWorldRect(viewInstance!.BackgroundCloseButton.GetComponent()); - - viewInstance!.BackgroundCloseButtonClicked += TriggerContextMenuClose; } protected override void OnBeforeViewShow() @@ -175,7 +173,7 @@ protected override void OnViewClose() protected override UniTask WaitForCloseIntentAsync(CancellationToken ct) { UniTask inputCloseTask = inputData.CloseTask ?? UniTask.Never(ct); - return UniTask.WhenAny(internalCloseTask.Task, inputCloseTask); + return UniTask.WhenAny(internalCloseTask.Task, inputCloseTask, viewInstance!.BackgroundCloseButton.OnClickAsync(ct)); } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs index 1125b5f7ca..b06148d029 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuView.cs @@ -11,16 +11,7 @@ public class GenericContextMenuView : ViewBase, IView, IDisposable [field: SerializeField] public VerticalLayoutGroup ControlsLayoutGroup { get; private set; } [field: SerializeField] public Button BackgroundCloseButton { get; private set; } - public event Action BackgroundCloseButtonClicked; - - private void Awake() - { - BackgroundCloseButton?.onClick.AddListener(() => BackgroundCloseButtonClicked?.Invoke()); - } - - public void Dispose() - { + public void Dispose() => BackgroundCloseButton?.onClick.RemoveAllListeners(); - } } } From a60cde033a1a9fff6a289d9c665b04ac6b686e23 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Thu, 16 Jan 2025 14:47:38 +0100 Subject: [PATCH 35/36] prevent double Hide invocation --- .../Components/CameraReelOptionButtonController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs index ed4696b805..ace456da70 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs @@ -76,7 +76,8 @@ private void OnOptionClicked() actionOnHide: () => { isContextMenuOpen = false; - HideControl(); + if (view.gameObject.activeSelf) + HideControl(); }, closeTask: closeContextMenuTask?.Task, initialValues: initialValues))); From c71845d41d55a9810b199cc655be0d4f15742df8 Mon Sep 17 00:00:00 2001 From: lorenzo-ranciaffi Date: Mon, 20 Jan 2025 15:53:46 +0100 Subject: [PATCH 36/36] removed generic Delegate and initial value. Moved everything as typed to specific control settings --- .../Components/CameraReelOptionButtonController.cs | 6 ++---- .../Controls/Configs/ButtonContextMenuControlSettings.cs | 3 ++- .../Controls/Configs/ContextMenuControlSettings.cs | 9 --------- .../Controls/Configs/GenericContextMenu.cs | 4 ++-- .../Controls/Configs/IContextMenuControlSettings.cs | 7 +++++++ ...tings.cs.meta => IContextMenuControlSettings.cs.meta} | 0 .../Configs/SeparatorContextMenuControlSettings.cs | 2 +- .../Controls/Configs/ToggleContextMenuControlSettings.cs | 7 ++++++- .../Controls/GenericContextMenuButtonWithTextView.cs | 4 ++-- .../Controls/GenericContextMenuComponentBase.cs | 2 -- .../Controls/GenericContextMenuSeparatorView.cs | 2 -- .../Controls/GenericContextMenuToggleView.cs | 4 ++-- .../DCL/UI/GenericContextMenu/ControlsPoolManager.cs | 4 ++-- .../GenericContextMenu/GenericContextMenuController.cs | 6 ++---- .../UI/GenericContextMenu/GenericContextMenuParameter.cs | 5 +---- 15 files changed, 29 insertions(+), 36 deletions(-) delete mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs create mode 100644 Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/IContextMenuControlSettings.cs rename Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/{ContextMenuControlSettings.cs.meta => IContextMenuControlSettings.cs.meta} (100%) diff --git a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs index ace456da70..9a37fc3e5e 100644 --- a/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs +++ b/Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs @@ -15,7 +15,6 @@ public class CameraReelOptionButtonController : IDisposable private readonly RectTransform buttonRectTransform; private readonly IMVCManager mvcManager; private readonly GenericContextMenu contextMenu; - private readonly Dictionary initialValues = new (); private readonly ToggleContextMenuControlSettings publicToggleSettings; public event Action? Hide; @@ -56,7 +55,7 @@ public void Show(CameraReelResponseCompact cameraReelResponse, Transform parent, view.transform.localPosition = offsetPosition; view.gameObject.SetActive(true); currentReelData = cameraReelResponse; - initialValues[publicToggleSettings] = cameraReelResponse.isPublic; + publicToggleSettings.SetInitialValue(cameraReelResponse.isPublic); closeContextMenuTask = new UniTaskCompletionSource(); } @@ -79,8 +78,7 @@ private void OnOptionClicked() if (view.gameObject.activeSelf) HideControl(); }, - closeTask: closeContextMenuTask?.Task, - initialValues: initialValues))); + closeTask: closeContextMenuTask?.Task))); } public void Dispose() diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs index 15497a0823..8fae5ffc1e 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ButtonContextMenuControlSettings.cs @@ -3,13 +3,14 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs { - public class ButtonContextMenuControlSettings : ContextMenuControlSettings + public class ButtonContextMenuControlSettings : IContextMenuControlSettings { internal readonly string buttonText; internal readonly Sprite buttonIcon; internal readonly RectOffset horizontalLayoutPadding; internal readonly int horizontalLayoutSpacing; internal readonly bool horizontalLayoutReverseArrangement; + internal readonly Action callback; /// /// Button component settings for the context menu. diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs deleted file mode 100644 index 13fb947dc8..0000000000 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace DCL.UI.GenericContextMenu.Controls.Configs -{ - public class ContextMenuControlSettings - { - internal Delegate callback; - } -} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs index cabd0e9356..32487662af 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/GenericContextMenu.cs @@ -8,7 +8,7 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs /// public class GenericContextMenu { - internal readonly List contextMenuSettings = new (); + internal readonly List contextMenuSettings = new (); internal readonly Vector2 offsetFromTarget; internal readonly float width; internal readonly RectOffset verticalLayoutPadding; @@ -27,7 +27,7 @@ public GenericContextMenu(float width = 186, Vector2? offsetFromTarget = null, R this.elementsSpacing = elementsSpacing; } - public GenericContextMenu AddControl(ContextMenuControlSettings settings) + public GenericContextMenu AddControl(IContextMenuControlSettings settings) { contextMenuSettings.Add(settings); return this; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/IContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/IContextMenuControlSettings.cs new file mode 100644 index 0000000000..6049b74832 --- /dev/null +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/IContextMenuControlSettings.cs @@ -0,0 +1,7 @@ + +namespace DCL.UI.GenericContextMenu.Controls.Configs +{ + public interface IContextMenuControlSettings + { + } +} diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs.meta b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/IContextMenuControlSettings.cs.meta similarity index 100% rename from Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs.meta rename to Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/IContextMenuControlSettings.cs.meta diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs index 65bb716fbf..7c07111fa4 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/SeparatorContextMenuControlSettings.cs @@ -1,7 +1,7 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs { - public class SeparatorContextMenuControlSettings : ContextMenuControlSettings + public class SeparatorContextMenuControlSettings : IContextMenuControlSettings { internal readonly int height; internal readonly int leftPadding; diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs index be5d10f9c7..42f06180a0 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ToggleContextMenuControlSettings.cs @@ -3,12 +3,14 @@ namespace DCL.UI.GenericContextMenu.Controls.Configs { - public class ToggleContextMenuControlSettings : ContextMenuControlSettings + public class ToggleContextMenuControlSettings : IContextMenuControlSettings { internal readonly string toggleText; internal readonly RectOffset horizontalLayoutPadding; internal readonly int horizontalLayoutSpacing; internal readonly bool horizontalLayoutReverseArrangement; + internal readonly Action callback; + internal bool initialValue; /// /// Toggle component settings for the context menu. @@ -22,5 +24,8 @@ public ToggleContextMenuControlSettings(string toggleText, Action toggleAc this.horizontalLayoutReverseArrangement = horizontalLayoutReverseArrangement; this.callback = toggleAction; } + + public void SetInitialValue(bool value) => + initialValue = value; } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs index 0f91ffcfb4..92ec3c8ebc 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs @@ -26,8 +26,8 @@ public void Configure(ButtonContextMenuControlSettings settings) public override void UnregisterListeners() => ButtonComponent.onClick.RemoveAllListeners(); - public override void RegisterListener(Delegate listener) => - ButtonComponent.onClick.AddListener(new UnityAction((Action)listener)); + private void RegisterListener(Action listener) => + ButtonComponent.onClick.AddListener(new UnityAction(listener)); public override void RegisterCloseListener(Action listener) => RegisterListener(listener); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs index 9531c83106..ff41b1f6d8 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuComponentBase.cs @@ -13,8 +13,6 @@ public abstract class GenericContextMenuComponentBase : MonoBehaviour public abstract void UnregisterListeners(); - public abstract void RegisterListener(Delegate listener); - public abstract void RegisterCloseListener(Action listener); } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs index 5b0925e8b2..06cc0b67ce 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuSeparatorView.cs @@ -20,8 +20,6 @@ public void Configure(SeparatorContextMenuControlSettings settings) public override void UnregisterListeners() { } - public override void RegisterListener(Delegate listener) { } - public override void RegisterCloseListener(Action listener) { } } } diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs index 0c3fa73109..8610c0f98f 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuToggleView.cs @@ -25,8 +25,8 @@ public void Configure(ToggleContextMenuControlSettings settings, bool initialVal public override void UnregisterListeners() => ToggleComponent.Toggle.onValueChanged.RemoveAllListeners(); - public override void RegisterListener(Delegate listener) => - ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction((Action)listener)); + private void RegisterListener(Action listener) => + ToggleComponent.Toggle.onValueChanged.AddListener(new UnityAction(listener)); public override void RegisterCloseListener(Action listener) => ToggleComponent.Toggle.onValueChanged.AddListener(_ => listener()); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs index cae9e18b54..74a7e372a2 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/ControlsPoolManager.cs @@ -39,13 +39,13 @@ public ControlsPoolManager( actionOnDestroy: toggleView => GameObject.Destroy(toggleView.gameObject)); } - public GenericContextMenuComponentBase GetContextMenuComponent(T settings, object initialValue, int index) where T : ContextMenuControlSettings + public GenericContextMenuComponentBase GetContextMenuComponent(T settings, int index) where T : IContextMenuControlSettings { GenericContextMenuComponentBase component = settings switch { SeparatorContextMenuControlSettings separatorSettings => GetSeparator(separatorSettings), ButtonContextMenuControlSettings buttonSettings => GetButton(buttonSettings), - ToggleContextMenuControlSettings toggleSettings => GetToggle(toggleSettings, (bool)initialValue), + ToggleContextMenuControlSettings toggleSettings => GetToggle(toggleSettings, toggleSettings.initialValue), _ => throw new ArgumentOutOfRangeException() }; component!.transform.SetSiblingIndex(index); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs index 25178abcd9..7fcb2d68fc 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs @@ -66,11 +66,9 @@ private void ConfigureContextMenu() for (var i = 0; i < inputData.Config.contextMenuSettings.Count; i++) { - ContextMenuControlSettings config = inputData.Config.contextMenuSettings[i]; - object controlInitialValue = null; - inputData.InitialValues?.TryGetValue(config, out controlInitialValue); + IContextMenuControlSettings config = inputData.Config.contextMenuSettings[i]; - GenericContextMenuComponentBase component = controlsPoolManager.GetContextMenuComponent(config, controlInitialValue, i); + GenericContextMenuComponentBase component = controlsPoolManager.GetContextMenuComponent(config, i); component.RegisterCloseListener(TriggerContextMenuClose); diff --git a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs index 0adc9ed95f..c83d7d2bbb 100644 --- a/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs +++ b/Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuParameter.cs @@ -14,15 +14,13 @@ public struct GenericContextMenuParameter public readonly Action? ActionOnShow; public readonly Action? ActionOnHide; public readonly UniTask? CloseTask; - public readonly Dictionary? InitialValues; public GenericContextMenuParameter(Controls.Configs.GenericContextMenu config, Vector2 anchorPosition, Rect? overlapRect = null, Action? actionOnShow = null, Action? actionOnHide = null, - UniTask? closeTask = null, - Dictionary? initialValues = null) + UniTask? closeTask = null) { this.Config = config; this.AnchorPosition = anchorPosition; @@ -30,7 +28,6 @@ public GenericContextMenuParameter(Controls.Configs.GenericContextMenu config, this.ActionOnShow = actionOnShow; this.ActionOnHide = actionOnHide; this.CloseTask = closeTask; - this.InitialValues = initialValues; } } }