| | 1 | | using Cysharp.Threading.Tasks; |
| | 2 | | using DCL; |
| | 3 | | using DCL.Browser; |
| | 4 | | using DCL.Controllers.HUD; |
| | 5 | | using DCL.MyAccount; |
| | 6 | | using DCL.SettingsCommon; |
| | 7 | | using DCLServices.CopyPaste.Analytics; |
| | 8 | | using DCLServices.PlacesAPIService; |
| | 9 | | using MainScripts.DCL.Controllers.HUD.Profile; |
| | 10 | | using MainScripts.DCL.Controllers.HUD.SettingsPanelHUDDesktop.Scripts; |
| | 11 | | using SocialFeaturesAnalytics; |
| | 12 | | using System.Threading; |
| | 13 | | using UnityEngine; |
| | 14 | |
|
| | 15 | | public class HUDDesktopFactory : HUDFactory |
| | 16 | | { |
| | 17 | | private const string VIEW_NAME = "_ProfileHUD"; |
| | 18 | |
|
| | 19 | | public override async UniTask<IHUD> CreateHUD(HUDElementID hudElementId, CancellationToken cancellationToken = defau |
| | 20 | | { |
| 0 | 21 | | IHUD hudElement = null; |
| | 22 | |
|
| | 23 | | switch (hudElementId) |
| | 24 | | { |
| | 25 | | case HUDElementID.NONE: |
| | 26 | | break; |
| | 27 | | case HUDElementID.SETTINGS_PANEL: |
| 0 | 28 | | hudElement = new SettingsPanelHUDControllerDesktop(); |
| 0 | 29 | | break; |
| | 30 | | case HUDElementID.PROFILE_HUD: |
| 0 | 31 | | ProfileHUDViewDesktop_V2 view = Object.Instantiate(Resources.Load<ProfileHUDViewDesktop_V2>("ProfileHUDD |
| 0 | 32 | | view.name = VIEW_NAME; |
| | 33 | |
|
| 0 | 34 | | var userProfileWebInterfaceBridge = new UserProfileWebInterfaceBridge(); |
| 0 | 35 | | var webInterfaceBrowserBridge = new WebInterfaceBrowserBridge(); |
| | 36 | |
|
| 0 | 37 | | hudElement = new ProfileHUDControllerDesktop( |
| | 38 | | view, |
| | 39 | | userProfileWebInterfaceBridge, |
| | 40 | | new SocialAnalytics( |
| | 41 | | Environment.i.platform.serviceProviders.analytics, |
| | 42 | | userProfileWebInterfaceBridge), |
| | 43 | | DataStore.i, |
| | 44 | | new MyAccountCardController( |
| | 45 | | view.MyAccountCardView, |
| | 46 | | DataStore.i, |
| | 47 | | userProfileWebInterfaceBridge, |
| | 48 | | Settings.i, |
| | 49 | | webInterfaceBrowserBridge), |
| | 50 | | webInterfaceBrowserBridge); |
| 0 | 51 | | break; |
| | 52 | | case HUDElementID.MINIMAP: |
| 0 | 53 | | hudElement = new MinimapHUDControllerDesktop( |
| | 54 | | MinimapMetadataController.i, |
| | 55 | | new WebInterfaceHomeLocationController(), |
| | 56 | | Environment.i, |
| | 57 | | Environment.i.serviceLocator.Get<IPlacesAPIService>(), |
| | 58 | | new PlacesAnalytics(), |
| | 59 | | Clipboard.Create(), |
| | 60 | | Environment.i.serviceLocator.Get<ICopyPasteAnalyticsService>(), |
| | 61 | | DataStore.i.contentModeration, |
| | 62 | | Environment.i.world.state); |
| 0 | 63 | | break; |
| | 64 | |
|
| | 65 | | default: |
| 0 | 66 | | hudElement = await base.CreateHUD(hudElementId, cancellationToken); |
| | 67 | | break; |
| | 68 | | } |
| | 69 | |
|
| 0 | 70 | | return hudElement; |
| 0 | 71 | | } |
| | 72 | | } |